gatsby-core-theme 5.1.4 → 6.1.0
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/.storybook/main.js +13 -14
- package/CHANGELOG.md +59 -0
- package/jest.config.js +5 -1
- package/package.json +31 -32
- package/package.old.json +98 -0
- package/src/components/atoms/menu/items/item/index.js +1 -1
- package/src/components/atoms/menu/items/item/item.module.scss +28 -19
- package/src/components/atoms/menu/items/items.module.scss +1 -1
- package/src/components/molecules/counter/counter-item/count-number/count-number.test.js +2 -2
- package/src/components/molecules/header/{header.stories.js → header.storiesssss.js} +9 -8
- package/src/components/organisms/cards/index.js +1 -2
- package/src/constants/settings.js +5 -0
- package/src/helpers/getters.js +22 -0
- package/src/helpers/processor/index.js +3 -5
- package/src/helpers/processor/modules.js +16 -6
- package/src/helpers/processor/modules.test.js +19 -0
- package/src/hooks/lazy-image/index.js +11 -4
- package/src/styles/utils/_icons.scss +2 -2
- package/tests/custom-jest-environment.js +22 -0
- package/tests/factories/modules/card.factory.js +3 -3
- package/{loadershim.js → tests/loadershim.js} +1 -1
package/.storybook/main.js
CHANGED
|
@@ -5,10 +5,13 @@ module.exports = {
|
|
|
5
5
|
'../../**/**/src/**/*.stories.@(js|jsx|ts|tsx)',
|
|
6
6
|
],
|
|
7
7
|
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
|
8
|
+
core: {
|
|
9
|
+
builder: 'webpack5',
|
|
10
|
+
},
|
|
8
11
|
webpackFinal: async (config) => {
|
|
9
12
|
config.module.rules.push({
|
|
10
13
|
test: /\.scss$/,
|
|
11
|
-
|
|
14
|
+
use: [
|
|
12
15
|
require.resolve('style-loader'),
|
|
13
16
|
{
|
|
14
17
|
loader: require.resolve('css-loader'),
|
|
@@ -27,15 +30,10 @@ module.exports = {
|
|
|
27
30
|
],
|
|
28
31
|
});
|
|
29
32
|
config.module.rules[0].exclude = [/node_modules\/(?!(gatsby)\/)/];
|
|
30
|
-
|
|
31
|
-
config.module.rules[0].use[0].options.
|
|
32
|
-
require.resolve('
|
|
33
|
-
|
|
34
|
-
];
|
|
35
|
-
config.module.rules[0].use[0].options.plugins = [
|
|
36
|
-
require.resolve('@babel/plugin-proposal-class-properties'),
|
|
37
|
-
require.resolve('babel-plugin-remove-graphql-queries'),
|
|
38
|
-
];
|
|
33
|
+
// Use babel-plugin-remove-graphql-queries to remove static queries from components when rendering in storybook
|
|
34
|
+
config.module.rules[0].use[0].options.plugins.push(
|
|
35
|
+
require.resolve('babel-plugin-remove-graphql-queries')
|
|
36
|
+
);
|
|
39
37
|
config.resolve.alias = {
|
|
40
38
|
'~atoms': path.resolve(__dirname, '../src/components/atoms/'),
|
|
41
39
|
'~molecules': path.resolve(__dirname, '../src/components/molecules'),
|
|
@@ -46,13 +44,14 @@ module.exports = {
|
|
|
46
44
|
'~tests': path.resolve(__dirname, '../tests'),
|
|
47
45
|
'~context': path.resolve(__dirname, '../src/context'),
|
|
48
46
|
'~constants': path.resolve(__dirname, '../src/constants'),
|
|
47
|
+
'gatsby-page-utils': path.resolve(__dirname, '../../node_modules/gatsby-page-utils/dist'),
|
|
49
48
|
};
|
|
50
49
|
|
|
51
|
-
config.resolve.alias['$virtual/lazy-client-sync-requires'] = path.resolve(
|
|
52
|
-
|
|
53
|
-
);
|
|
50
|
+
// config.resolve.alias['$virtual/lazy-client-sync-requires'] = path.resolve(
|
|
51
|
+
// `./__mocks__/virtual-lazy-client-sync-requires.js`
|
|
52
|
+
// );
|
|
54
53
|
|
|
55
|
-
config.resolve.mainFields = ['browser', 'module', 'main'];
|
|
54
|
+
// config.resolve.mainFields = ['browser', 'module', 'main'];
|
|
56
55
|
return config;
|
|
57
56
|
},
|
|
58
57
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
+
# [6.1.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.0.1...v6.1.0) (2022-04-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* make style ([3f83da5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3f83da5fd9160bd5e476d58a7bb378b9fcb42b98))
|
|
7
|
+
* make style for submenus ([e4a8b91](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e4a8b919ceff29d866d2ea23d673d633d6373e82))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Code Refactoring
|
|
11
|
+
|
|
12
|
+
* remove unnecessary id from generateArrayRandom ([8cf09e2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8cf09e2b0d9cd9c6b638c1ec8c53886f95121e6e))
|
|
13
|
+
* update cards random sorting filter ([382222e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/382222eb67070b8e9dee33ef37d75eef198a881c))
|
|
14
|
+
* update update cards random sorting filter with lodash ([a6b2093](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a6b209301b9a3493adce986edad6c8c6a10ccc6b))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
* Merge branch 'tm-2806-webp-images' into 'master' ([41269ae](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/41269aea2b48f5cf5d8b1bac2fa1b3d5b5f498f6))
|
|
18
|
+
* Merge branch 'tm-2805-cards-random-filter' into 'master' ([9c14230](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9c1423082cf453b4af943181c567429631d08f37))
|
|
19
|
+
* Merge branch 'tm-2840-menu-issue' into 'master' ([efb78f3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/efb78f3b00cf3a5b327c8d9d2c0005a1ad73ccac))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* added webp logic in lazy image component ([6cb2453](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6cb2453b60ad8355b1c39519e3c3fce732678a90))
|
|
25
|
+
* added webp logic in lazy image component ([c70a893](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c70a893976aef767aaa7de2e7f3eb7907be48ce5))
|
|
26
|
+
* added webp logic in lazy image component ([4fa73b5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4fa73b5ad5c65697f408bca4bb87bf8aae7a15d2))
|
|
27
|
+
* added webp logic in lazy image component ([2cb84aa](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2cb84aa43f008a769292539a41102df8bb69174c))
|
|
28
|
+
* added webp logic in lazy image component ([6c4bec0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6c4bec0e6421ff982bf4bdf94fc6249dd5d11d02))
|
|
29
|
+
* added webp logic in lazy image component ([afa63c8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/afa63c8122cbbe62f90486c5fffd65255d6ad03f))
|
|
30
|
+
* added webp logic in lazy image component ([d58e62d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d58e62d0912788d32ece115fe954e000bf172d6b))
|
|
31
|
+
|
|
32
|
+
## [6.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.0.0...v6.0.1) (2022-04-04)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* upgraded storybook ([30e851c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/30e851c2ec0d8fd53ea0625cbc676a91a7fb891e))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
* Merge branch 'tm-2812-storybook-update' into 'master' ([a923a6f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a923a6fb50e518021c6ac8caa870382f71b0d6e7))
|
|
41
|
+
|
|
42
|
+
# [6.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v5.1.4...v6.0.0) (2022-03-31)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Breaking
|
|
46
|
+
|
|
47
|
+
* fixes tests ([5076ad0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5076ad01fbb21e779b23679091d4cec4c4152364))
|
|
48
|
+
* fixes tests ([13124fe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/13124fe533af79d1bfa27bcafbe42430692fdf39))
|
|
49
|
+
* upgraded gatsby css and react packages ([764a722](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/764a722590cb3aea20064986caeffa231c74249e))
|
|
50
|
+
* upgraded to gatsby v4 ([97ba299](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/97ba299c1b596547aa1be3c74b508ebe74bfb0a2))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* removed unused packages ([924b2d5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/924b2d5eba46322ccf2d573e72cc83bc02f1ec49))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
* Merge branch 'tm-2812-gatsby-v4' into 'master' ([b0daf0c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b0daf0cc9ddea499d81f03e734057c42474c1c54))
|
|
59
|
+
|
|
1
60
|
## [5.1.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v5.1.3...v5.1.4) (2022-03-23)
|
|
2
61
|
|
|
3
62
|
|
package/jest.config.js
CHANGED
|
@@ -18,6 +18,9 @@ module.exports = {
|
|
|
18
18
|
'^~constants(.*)$': '<rootDir>/src/constants$1',
|
|
19
19
|
// JSON Data
|
|
20
20
|
'data.json': '<rootDir>/__mocks__/search-data.json',
|
|
21
|
+
'^gatsby-plugin-utils/(.*)$': [`gatsby-plugin-utils/dist/$1`, `gatsby-plugin-utils/$1`],
|
|
22
|
+
'^gatsby-page-utils/(.*)$': `gatsby-page-utils/dist/$1`,
|
|
23
|
+
'^gatsby-core-utils/(.*)$': `gatsby-core-utils/dist/$1`,
|
|
21
24
|
},
|
|
22
25
|
// testPathIgnorePatterns: [`node_modules`, `\\.cache`, `<rootDir>.*/public`],
|
|
23
26
|
coveragePathIgnorePatterns: [
|
|
@@ -32,7 +35,8 @@ module.exports = {
|
|
|
32
35
|
__PATH_PREFIX__: ``,
|
|
33
36
|
},
|
|
34
37
|
testURL: `http://localhost`,
|
|
35
|
-
|
|
38
|
+
testEnvironment: '<rootDir>/tests/custom-jest-environment.js',
|
|
39
|
+
setupFiles: [`<rootDir>/tests/loadershim.js`, '<rootDir>/tests/envVars.js'],
|
|
36
40
|
collectCoverage: true,
|
|
37
41
|
coverageThreshold: {
|
|
38
42
|
global: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-core-theme",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Gatsby Theme NPM Package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
|
|
@@ -16,9 +16,6 @@
|
|
|
16
16
|
"storybook": "cross-env STORYBOOK_IMAGE_CDN_URL=https://cdn.irishluck.ie STORYBOOK_GATSBY_SITE_NAME=norskespilleautomater.com STORYBOOK_TRACKER_LINK_FORMAT_NON_MAIN=[no],[visit],short_name STORYBOOK_TRACKER_LINK_FORMAT_MAIN=[no],[visit],short_name start-storybook -s ../storybook-images -p 6006",
|
|
17
17
|
"build-storybook": "cross-env STORYBOOK_IMAGE_CDN_URL=https://cdn.irishluck.ie STORYBOOK_GATSBY_SITE_NAME=norskespilleautomater.com STORYBOOK_TRACKER_LINK_FORMAT_NON_MAIN=[no],[visit],short_name STORYBOOK_TRACKER_LINK_FORMAT_MAIN=[no],[visit],short_name build-storybook"
|
|
18
18
|
},
|
|
19
|
-
"peerDependencies": {
|
|
20
|
-
"gatsby": "^3.3.1"
|
|
21
|
-
},
|
|
22
19
|
"dependencies": {
|
|
23
20
|
"@loadable/babel-plugin": "^5.13.2",
|
|
24
21
|
"@loadable/component": "^5.15.0",
|
|
@@ -31,37 +28,36 @@
|
|
|
31
28
|
"dotenv": "^8.2.0",
|
|
32
29
|
"eslint": "^7.20.0",
|
|
33
30
|
"esm": "^3.2.25",
|
|
34
|
-
"gatsby": "^
|
|
35
|
-
"gatsby-image": "^3.
|
|
36
|
-
"gatsby-plugin-image": "^
|
|
37
|
-
"gatsby-plugin-loadable-components-ssr": "^
|
|
38
|
-
"gatsby-plugin-manifest": "^
|
|
39
|
-
"gatsby-plugin-postcss": "^
|
|
40
|
-
"gatsby-plugin-preact": "^
|
|
41
|
-
"gatsby-plugin-react-helmet": "^
|
|
42
|
-
"gatsby-plugin-sass": "^
|
|
43
|
-
"gatsby-plugin-sharp": "^
|
|
44
|
-
"gatsby-plugin-sitemap": "^
|
|
45
|
-
"gatsby-plugin-webfonts": "^2.1
|
|
46
|
-
"gatsby-source-filesystem": "^
|
|
47
|
-
"gatsby-transformer-sharp": "^
|
|
31
|
+
"gatsby": "^4.10.3",
|
|
32
|
+
"gatsby-image": "^3.11.0",
|
|
33
|
+
"gatsby-plugin-image": "^2.10.1",
|
|
34
|
+
"gatsby-plugin-loadable-components-ssr": "^4.2.0",
|
|
35
|
+
"gatsby-plugin-manifest": "^4.10.2",
|
|
36
|
+
"gatsby-plugin-postcss": "^5.11.0",
|
|
37
|
+
"gatsby-plugin-preact": "^6.10.1",
|
|
38
|
+
"gatsby-plugin-react-helmet": "^5.10.0",
|
|
39
|
+
"gatsby-plugin-sass": "^5.11.0",
|
|
40
|
+
"gatsby-plugin-sharp": "^4.10.2",
|
|
41
|
+
"gatsby-plugin-sitemap": "^5.10.2",
|
|
42
|
+
"gatsby-plugin-webfonts": "^2.2.1",
|
|
43
|
+
"gatsby-source-filesystem": "^4.10.1",
|
|
44
|
+
"gatsby-transformer-sharp": "^4.10.0",
|
|
48
45
|
"html-react-parser": "^1.3.0",
|
|
49
46
|
"js-search": "^2.0.0",
|
|
50
47
|
"lodash": "^4.17.15",
|
|
51
|
-
"node-sass": "5.0.0",
|
|
52
48
|
"normalize.css": "^8.0.1",
|
|
53
49
|
"postcss": "^8.2.10",
|
|
54
|
-
"preact": "^10.
|
|
55
|
-
"preact-render-to-string": "^5.1.
|
|
50
|
+
"preact": "^10.7.0",
|
|
51
|
+
"preact-render-to-string": "^5.1.20",
|
|
56
52
|
"prop-types": "15.7.2",
|
|
57
53
|
"react": "^17.0.2",
|
|
58
|
-
"react-cookies": "^0.1.1",
|
|
59
54
|
"react-dom": "^17.0.2",
|
|
60
55
|
"react-google-recaptcha": "^2.1.0",
|
|
61
56
|
"react-helmet": "^6.0.0",
|
|
62
|
-
"react-icons": "^4.
|
|
63
|
-
"react-lazyload": "^2.
|
|
64
|
-
"react-masonry-css": "^1.0.16"
|
|
57
|
+
"react-icons": "^4.3.1",
|
|
58
|
+
"react-lazyload": "^3.2.0",
|
|
59
|
+
"react-masonry-css": "^1.0.16",
|
|
60
|
+
"sass": "^1.49.9"
|
|
65
61
|
},
|
|
66
62
|
"devDependencies": {
|
|
67
63
|
"@babel/core": "^7.13.1",
|
|
@@ -73,12 +69,14 @@
|
|
|
73
69
|
"@semantic-release/gitlab-config": "^8.0.0",
|
|
74
70
|
"@semantic-release/npm": "^7.1.3",
|
|
75
71
|
"@semantic-release/release-notes-generator": "^9.0.3",
|
|
76
|
-
"@storybook/addon-actions": "^6.
|
|
77
|
-
"@storybook/addon-essentials": "^6.
|
|
78
|
-
"@storybook/addon-links": "^6.
|
|
79
|
-
"@storybook/
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
72
|
+
"@storybook/addon-actions": "^6.4.20",
|
|
73
|
+
"@storybook/addon-essentials": "^6.4.20",
|
|
74
|
+
"@storybook/addon-links": "^6.4.20",
|
|
75
|
+
"@storybook/builder-webpack5": "^6.4.20",
|
|
76
|
+
"@storybook/manager-webpack5": "^6.4.20",
|
|
77
|
+
"@storybook/react": "^6.4.20",
|
|
78
|
+
"@testing-library/jest-dom": "^5.16.3",
|
|
79
|
+
"@testing-library/react": "^12.1.4",
|
|
82
80
|
"babel-jest": "^26.6.3",
|
|
83
81
|
"babel-loader": "^8.2.2",
|
|
84
82
|
"babel-plugin-remove-graphql-queries": "^3.0.0",
|
|
@@ -88,7 +86,8 @@
|
|
|
88
86
|
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.26",
|
|
89
87
|
"identity-obj-proxy": "^3.0.0",
|
|
90
88
|
"jest": "^26.6.3",
|
|
91
|
-
"
|
|
89
|
+
"jest-environment-jsdom": "^27.5.1",
|
|
90
|
+
"react-test-renderer": "^18.0.0",
|
|
92
91
|
"sass-resources-loader": "^2.1.0"
|
|
93
92
|
},
|
|
94
93
|
"author": "",
|
package/package.old.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gatsby-core-theme",
|
|
3
|
+
"version": "5.1.4",
|
|
4
|
+
"description": "Gatsby Theme NPM Package",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
|
|
7
|
+
"directories": {
|
|
8
|
+
"test": "tests"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://git.ilcd.rocks/team-floyd/themes/gatsby-themes"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "jest --coverage",
|
|
16
|
+
"storybook": "cross-env STORYBOOK_IMAGE_CDN_URL=https://cdn.irishluck.ie STORYBOOK_GATSBY_SITE_NAME=norskespilleautomater.com STORYBOOK_TRACKER_LINK_FORMAT_NON_MAIN=[no],[visit],short_name STORYBOOK_TRACKER_LINK_FORMAT_MAIN=[no],[visit],short_name start-storybook -s ../storybook-images -p 6006",
|
|
17
|
+
"build-storybook": "cross-env STORYBOOK_IMAGE_CDN_URL=https://cdn.irishluck.ie STORYBOOK_GATSBY_SITE_NAME=norskespilleautomater.com STORYBOOK_TRACKER_LINK_FORMAT_NON_MAIN=[no],[visit],short_name STORYBOOK_TRACKER_LINK_FORMAT_MAIN=[no],[visit],short_name build-storybook"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"gatsby": "^3.3.1"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@loadable/babel-plugin": "^5.13.2",
|
|
24
|
+
"@loadable/component": "^5.15.0",
|
|
25
|
+
"@loadable/server": "^5.14.2",
|
|
26
|
+
"@loadable/webpack-plugin": "^5.14.2",
|
|
27
|
+
"@reach/router": "^1.3.3",
|
|
28
|
+
"axios": "^0.21.1",
|
|
29
|
+
"chalk": "^4.1.0",
|
|
30
|
+
"cross-env": "^7.0.3",
|
|
31
|
+
"dotenv": "^8.2.0",
|
|
32
|
+
"eslint": "^7.20.0",
|
|
33
|
+
"esm": "^3.2.25",
|
|
34
|
+
"gatsby": "^3.3.1",
|
|
35
|
+
"gatsby-image": "^3.3.0",
|
|
36
|
+
"gatsby-plugin-image": "^1.3.1",
|
|
37
|
+
"gatsby-plugin-loadable-components-ssr": "^3.3.0",
|
|
38
|
+
"gatsby-plugin-manifest": "^3.3.0",
|
|
39
|
+
"gatsby-plugin-postcss": "^4.3.0",
|
|
40
|
+
"gatsby-plugin-preact": "^5.13.0",
|
|
41
|
+
"gatsby-plugin-react-helmet": "^4.3.0",
|
|
42
|
+
"gatsby-plugin-sass": "^4.3.0",
|
|
43
|
+
"gatsby-plugin-sharp": "^3.3.0",
|
|
44
|
+
"gatsby-plugin-sitemap": "^3.3.0",
|
|
45
|
+
"gatsby-plugin-webfonts": "^2.1.0",
|
|
46
|
+
"gatsby-source-filesystem": "^3.3.0",
|
|
47
|
+
"gatsby-transformer-sharp": "^3.3.0",
|
|
48
|
+
"html-react-parser": "^1.3.0",
|
|
49
|
+
"js-search": "^2.0.0",
|
|
50
|
+
"lodash": "^4.17.15",
|
|
51
|
+
"node-sass": "5.0.0",
|
|
52
|
+
"normalize.css": "^8.0.1",
|
|
53
|
+
"postcss": "^8.2.10",
|
|
54
|
+
"preact": "^10.5.14",
|
|
55
|
+
"preact-render-to-string": "^5.1.19",
|
|
56
|
+
"prop-types": "15.7.2",
|
|
57
|
+
"react": "^17.0.2",
|
|
58
|
+
"react-cookies": "^0.1.1",
|
|
59
|
+
"react-dom": "^17.0.2",
|
|
60
|
+
"react-google-recaptcha": "^2.1.0",
|
|
61
|
+
"react-helmet": "^6.0.0",
|
|
62
|
+
"react-icons": "^4.2.0",
|
|
63
|
+
"react-lazyload": "^2.6.5",
|
|
64
|
+
"react-masonry-css": "^1.0.16"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@babel/core": "^7.13.1",
|
|
68
|
+
"@babel/preset-env": "^7.13.5",
|
|
69
|
+
"@semantic-release/changelog": "^5.0.1",
|
|
70
|
+
"@semantic-release/commit-analyzer": "^8.0.1",
|
|
71
|
+
"@semantic-release/git": "^9.0.0",
|
|
72
|
+
"@semantic-release/gitlab": "^6.2.1",
|
|
73
|
+
"@semantic-release/gitlab-config": "^8.0.0",
|
|
74
|
+
"@semantic-release/npm": "^7.1.3",
|
|
75
|
+
"@semantic-release/release-notes-generator": "^9.0.3",
|
|
76
|
+
"@storybook/addon-actions": "^6.0.21",
|
|
77
|
+
"@storybook/addon-essentials": "^6.0.21",
|
|
78
|
+
"@storybook/addon-links": "^6.0.21",
|
|
79
|
+
"@storybook/react": "^6.0.21",
|
|
80
|
+
"@testing-library/jest-dom": "^5.11.9",
|
|
81
|
+
"@testing-library/react": "^11.2.5",
|
|
82
|
+
"babel-jest": "^26.6.3",
|
|
83
|
+
"babel-loader": "^8.2.2",
|
|
84
|
+
"babel-plugin-remove-graphql-queries": "^3.0.0",
|
|
85
|
+
"babel-preset-gatsby": "^1.3.0",
|
|
86
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
87
|
+
"eslint-plugin-react": "^7.22.0",
|
|
88
|
+
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.26",
|
|
89
|
+
"identity-obj-proxy": "^3.0.0",
|
|
90
|
+
"jest": "^26.6.3",
|
|
91
|
+
"react-test-renderer": "^17.0.1",
|
|
92
|
+
"sass-resources-loader": "^2.1.0"
|
|
93
|
+
},
|
|
94
|
+
"author": "",
|
|
95
|
+
"license": "ISC",
|
|
96
|
+
"browserslist": "> 0.25%, not dead"
|
|
97
|
+
}
|
|
98
|
+
|
|
@@ -101,7 +101,7 @@ export default function Item({
|
|
|
101
101
|
) : (
|
|
102
102
|
<div className={styles.item}>{item.title}</div>
|
|
103
103
|
)}
|
|
104
|
-
{options.mobile.subMenuDropDownButton &&
|
|
104
|
+
{options.mobile.subMenuDropDownButton && hasChildren && (
|
|
105
105
|
<button
|
|
106
106
|
aria-label={`${item?.title} Dropdown`}
|
|
107
107
|
type="button"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.itemWrapper
|
|
1
|
+
.itemWrapper {
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
|
|
5
5
|
.item {
|
|
6
|
-
width:
|
|
6
|
+
width: 100%;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -33,23 +33,32 @@
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
.itemWrapper {
|
|
37
|
+
@include max(laptop) {
|
|
38
|
+
button {
|
|
39
|
+
width: 20%;
|
|
40
|
+
max-width: 75px;
|
|
41
|
+
position: relative;
|
|
42
|
+
background-color: var(--primary-hover-color);
|
|
43
|
+
|
|
44
|
+
&.active {
|
|
45
|
+
@include arrow-rotate(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:after {
|
|
49
|
+
transition: 0.2s;
|
|
50
|
+
@include arrow(var(--nav-icon-color), 1rem, down, false);
|
|
51
|
+
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: calc(50% - 0.4rem);
|
|
54
|
+
left: calc(50% - 1.2rem);
|
|
55
|
+
margin-left: 1rem;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
44
58
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: calc(50% - 0.4rem);
|
|
52
|
-
left: calc(50% - 1.2rem);
|
|
53
|
-
margin-left: 1rem;
|
|
59
|
+
@include min(desktop) {
|
|
60
|
+
button {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
54
63
|
}
|
|
55
64
|
}
|
|
@@ -11,7 +11,7 @@ describe('Count Number Component', () => {
|
|
|
11
11
|
expect(getByText('0')).toBeTruthy();
|
|
12
12
|
|
|
13
13
|
await waitFor(() => {
|
|
14
|
-
expect(getByText('
|
|
14
|
+
expect(getByText('1')).toBeTruthy();
|
|
15
15
|
}, 4000);
|
|
16
16
|
});
|
|
17
17
|
test('render count down', async () => {
|
|
@@ -20,7 +20,7 @@ describe('Count Number Component', () => {
|
|
|
20
20
|
expect(getByText('10')).toBeTruthy();
|
|
21
21
|
|
|
22
22
|
await waitFor(() => {
|
|
23
|
-
expect(getByText('
|
|
23
|
+
expect(getByText('9')).toBeTruthy();
|
|
24
24
|
}, 4000);
|
|
25
25
|
});
|
|
26
26
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import {
|
|
3
4
|
Title,
|
|
@@ -38,15 +39,15 @@ export default {
|
|
|
38
39
|
},
|
|
39
40
|
},
|
|
40
41
|
backgroundImage: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
42
|
+
name: 'backgroundImage',
|
|
43
|
+
type: { name: 'boolean', required: false },
|
|
44
|
+
defaultValue: true,
|
|
45
|
+
description: 'Show or hide the background image.',
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: 'boolean' },
|
|
48
|
+
defaultValue: { summary: true },
|
|
49
49
|
},
|
|
50
|
+
},
|
|
50
51
|
},
|
|
51
52
|
parameters: {
|
|
52
53
|
docs: {
|
|
@@ -39,8 +39,7 @@ CardsGridStyles.propTypes = {
|
|
|
39
39
|
tablet_num_of_columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
40
40
|
desktop_num_of_columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
41
41
|
}).isRequired,
|
|
42
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.any])
|
|
43
|
-
.isRequired,
|
|
42
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.any]),
|
|
44
43
|
mobileColumns: PropTypes.number,
|
|
45
44
|
tabletColumns: PropTypes.number,
|
|
46
45
|
desktopColumns: PropTypes.number,
|
|
@@ -9,6 +9,11 @@ export default {
|
|
|
9
9
|
'norskespilleautomater.com': ['cards', 'cards_v2'],
|
|
10
10
|
'playcasino.co.za': ['cards', 'cards_v2'],
|
|
11
11
|
},
|
|
12
|
+
filter_cards_modules: {
|
|
13
|
+
'irishluck.ie': ['inactive', 'blacklisted'],
|
|
14
|
+
'norskespilleautomater.com': ['inactive', 'blacklisted'],
|
|
15
|
+
'playcasino.co.za': ['inactive', 'blacklisted'],
|
|
16
|
+
},
|
|
12
17
|
keep_page_extra_fields: {
|
|
13
18
|
operator: {
|
|
14
19
|
'norskespilleautomater.com': true, // needed for inoperative / placeholder fields
|
package/src/helpers/getters.js
CHANGED
|
@@ -103,6 +103,28 @@ export function getImageExtension(filename) {
|
|
|
103
103
|
return filename && filename.split('.').pop();
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
export function isBrowserWebpCompatable(feature, callback) {
|
|
107
|
+
const kTestImages = {
|
|
108
|
+
lossy: 'UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA',
|
|
109
|
+
lossless: 'UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==',
|
|
110
|
+
alpha:
|
|
111
|
+
'UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==',
|
|
112
|
+
animation:
|
|
113
|
+
'UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA',
|
|
114
|
+
};
|
|
115
|
+
const img = new Image();
|
|
116
|
+
// eslint-disable-next-line func-names
|
|
117
|
+
img.onload = function () {
|
|
118
|
+
const result = img.width > 0 && img.height > 0;
|
|
119
|
+
callback(feature, result);
|
|
120
|
+
};
|
|
121
|
+
// eslint-disable-next-line func-names
|
|
122
|
+
img.onerror = function () {
|
|
123
|
+
callback(feature, false);
|
|
124
|
+
};
|
|
125
|
+
img.src = `data:image/webp;base64,${kTestImages[feature]}`;
|
|
126
|
+
}
|
|
127
|
+
|
|
106
128
|
export function imagePrettyUrl(filename = 'image.png', width = null, height = null) {
|
|
107
129
|
const cdnURL =
|
|
108
130
|
(getImageExtension(filename) === 'gif'
|
|
@@ -77,6 +77,7 @@ export function transform(response) {
|
|
|
77
77
|
|
|
78
78
|
const savedModules = {};
|
|
79
79
|
export function processSections(sections, skipPost = false, page) {
|
|
80
|
+
const siteName = page && page.siteInfo && page.siteInfo.site_name;
|
|
80
81
|
let minutes = 0;
|
|
81
82
|
let seconds = 0;
|
|
82
83
|
|
|
@@ -89,10 +90,7 @@ export function processSections(sections, skipPost = false, page) {
|
|
|
89
90
|
}
|
|
90
91
|
if (sections[sectionKey] && sections[sectionKey].modules) {
|
|
91
92
|
sections[sectionKey].modules.forEach((module, key) => {
|
|
92
|
-
if (
|
|
93
|
-
shouldSavePrefilled(module, page && page.siteInfo && page.siteInfo.site_name) &&
|
|
94
|
-
savedModules[module.module_value_id]
|
|
95
|
-
) {
|
|
93
|
+
if (shouldSavePrefilled(module, siteName) && savedModules[module.module_value_id]) {
|
|
96
94
|
module = savedModules[module.module_value_id];
|
|
97
95
|
} else {
|
|
98
96
|
sections[sectionKey].modules[module[key]] = processModule(
|
|
@@ -105,7 +103,7 @@ export function processSections(sections, skipPost = false, page) {
|
|
|
105
103
|
previewMode
|
|
106
104
|
);
|
|
107
105
|
|
|
108
|
-
if (shouldSavePrefilled(module,
|
|
106
|
+
if (shouldSavePrefilled(module, siteName)) {
|
|
109
107
|
savedModules[module.module_value_id] = module;
|
|
110
108
|
}
|
|
111
109
|
}
|
|
@@ -16,9 +16,12 @@ export function processCardsModule(module, pages, pagesCloned, pagesMappedById)
|
|
|
16
16
|
|
|
17
17
|
if (displayInput === 'automatic' && pages[modelType]) {
|
|
18
18
|
const numOfItems =
|
|
19
|
-
Math.sign(module.num_of_items) === 0 ? pages[modelType].length : module.num_of_items;
|
|
19
|
+
Math.sign(module.num_of_items) === 0 ? pages[modelType].length : Number(module.num_of_items);
|
|
20
20
|
if (sortBy === 'random') {
|
|
21
|
-
|
|
21
|
+
const samplePages = pagesCloned[modelType].filter(
|
|
22
|
+
(page) => !settings.filter_cards_modules[process.env.GATSBY_SITE_NAME].includes(page.status)
|
|
23
|
+
);
|
|
24
|
+
module.items = sampleSize(samplePages, numOfItems);
|
|
22
25
|
} else {
|
|
23
26
|
module.items = pagesCloned[modelType].slice(0, numOfItems);
|
|
24
27
|
}
|
|
@@ -177,7 +180,11 @@ export function processCardsV2(module, pagesCloned, pagesMappedById) {
|
|
|
177
180
|
|
|
178
181
|
// Applying sorting
|
|
179
182
|
if (sortType === 'random') {
|
|
180
|
-
|
|
183
|
+
const samplePages = uniquePages.filter(
|
|
184
|
+
(page) =>
|
|
185
|
+
!settings.filter_cards_modules[process.env.GATSBY_SITE_NAME].includes(page.status)
|
|
186
|
+
);
|
|
187
|
+
module.items = sampleSize(samplePages, itemLimit);
|
|
181
188
|
} else if (sortType === 'latest') {
|
|
182
189
|
if (uniquePages.length > 0) {
|
|
183
190
|
uniquePages.sort((a, b) => (a.created_at > b.created_at ? -1 : 1));
|
|
@@ -216,9 +223,12 @@ export function processTopListModule(module, relations) {
|
|
|
216
223
|
}
|
|
217
224
|
|
|
218
225
|
export function shouldSavePrefilled(module = {}, siteName) {
|
|
219
|
-
return
|
|
220
|
-
|
|
221
|
-
|
|
226
|
+
return (
|
|
227
|
+
module.value_type === ModuleValue.VALUE_TYPE_PREFILLED_MODULE_MARKET &&
|
|
228
|
+
((settings.dynamic_prefilled_modules[siteName] &&
|
|
229
|
+
!settings.dynamic_prefilled_modules[siteName].includes(module.name)) ||
|
|
230
|
+
module.sort_by !== 'random')
|
|
231
|
+
);
|
|
222
232
|
}
|
|
223
233
|
|
|
224
234
|
export function processModule(
|
|
@@ -39,6 +39,25 @@ describe('Modules Helper', () => {
|
|
|
39
39
|
expect(moduleData.items).toHaveLength(4);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
+
test('Cards V2 FIltered inactive', () => {
|
|
43
|
+
process.env.GATSBY_SITE_NAME = 'irishluck.ie';
|
|
44
|
+
const pagesNum = 10;
|
|
45
|
+
const moduleData = getSampleCardsV2Filtered(false, 'Game');
|
|
46
|
+
moduleData.cards_selector_filters_sort_by = 'random';
|
|
47
|
+
moduleData.cards_selector_filters_limit = '3';
|
|
48
|
+
const pageList = getPageDataList(pagesNum).map((page, i) =>
|
|
49
|
+
i % 2
|
|
50
|
+
? { ...page, type: 'game', status: 'inactive' }
|
|
51
|
+
: { ...page, type: 'game', status: 'active' }
|
|
52
|
+
);
|
|
53
|
+
processCardsV2(moduleData, groupBy(pageList, 'type'));
|
|
54
|
+
|
|
55
|
+
expect(moduleData.items).toHaveLength(3);
|
|
56
|
+
moduleData.items.forEach((item) => {
|
|
57
|
+
expect(item.id % 2).toEqual(0);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
42
61
|
test('filterPages function', () => {
|
|
43
62
|
const pages = getPageDataList(3);
|
|
44
63
|
pages[0].author_id = 1;
|
|
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import LazyLoad from 'react-lazyload';
|
|
5
5
|
import { isNativeImageLazyLoadingSupported } from '~helpers/device-detect';
|
|
6
|
+
import { isBrowserWebpCompatable } from '~helpers/getters';
|
|
6
7
|
|
|
7
8
|
export default function LazyImage({
|
|
8
9
|
height,
|
|
@@ -16,10 +17,16 @@ export default function LazyImage({
|
|
|
16
17
|
}) {
|
|
17
18
|
const [errorImage, setErrorImage] = useState(false);
|
|
18
19
|
const [nonNativeLazyLoaded, setNonNativeLazyLoaded] = useState(false);
|
|
20
|
+
const [imageSrc, setImageSrc] = useState(src);
|
|
19
21
|
|
|
20
22
|
useEffect(() => {
|
|
21
23
|
setNonNativeLazyLoaded(!isNativeImageLazyLoadingSupported());
|
|
22
|
-
|
|
24
|
+
isBrowserWebpCompatable('lossy', (_feature, isSupported) => {
|
|
25
|
+
if (!isSupported && src) {
|
|
26
|
+
setImageSrc(src.replace('filters:format(webp)/', ''));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}, [src]);
|
|
23
30
|
|
|
24
31
|
if ((defaultImg && !src) || errorImage === true) {
|
|
25
32
|
return defaultImg;
|
|
@@ -27,7 +34,7 @@ export default function LazyImage({
|
|
|
27
34
|
|
|
28
35
|
return !nonNativeLazyLoaded ? (
|
|
29
36
|
<img
|
|
30
|
-
src={
|
|
37
|
+
src={imageSrc}
|
|
31
38
|
loading={loading}
|
|
32
39
|
className={className}
|
|
33
40
|
height={height}
|
|
@@ -45,7 +52,7 @@ export default function LazyImage({
|
|
|
45
52
|
debounce={0}
|
|
46
53
|
>
|
|
47
54
|
<img
|
|
48
|
-
src={
|
|
55
|
+
src={imageSrc}
|
|
49
56
|
className={className}
|
|
50
57
|
height={height}
|
|
51
58
|
width={width}
|
|
@@ -55,7 +62,7 @@ export default function LazyImage({
|
|
|
55
62
|
</LazyLoad>
|
|
56
63
|
<noscript>
|
|
57
64
|
<img
|
|
58
|
-
src={
|
|
65
|
+
src={imageSrc}
|
|
59
66
|
className={className}
|
|
60
67
|
height={height}
|
|
61
68
|
width={width}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
border-right: $size solid transparent;
|
|
12
12
|
border-bottom: $size solid $color;
|
|
13
13
|
} @else {
|
|
14
|
-
$size:
|
|
14
|
+
$size: calc($size/3);
|
|
15
15
|
border: solid $color;
|
|
16
16
|
border-width: 0 $size $size 0;
|
|
17
17
|
padding: $size;
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
&:before {
|
|
103
103
|
transform: rotate(45deg);
|
|
104
104
|
transform-origin: 0 0;
|
|
105
|
-
margin:
|
|
105
|
+
margin: - calc($thickness / 4) 0 0 calc($thickness / 2);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
&:after {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable class-methods-use-this */
|
|
2
|
+
/* eslint-disable no-empty-function */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Correct Jest bug that prevents the Firestore tests from running. More info here:
|
|
6
|
+
* https://github.com/firebase/firebase-js-sdk/issues/3096#issuecomment-637584185
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
|
+
const BrowserEnvironment = require('jest-environment-jsdom');
|
|
11
|
+
|
|
12
|
+
class MyEnvironment extends BrowserEnvironment {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super({ ...config, globals: { ...config.globals, Uint32Array, Uint8Array, ArrayBuffer } });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async setup() {}
|
|
18
|
+
|
|
19
|
+
async teardown() {}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = MyEnvironment;
|
|
@@ -326,12 +326,12 @@ export function getSampleCardsV2ModuleManual() {
|
|
|
326
326
|
return sampleOperatorCards;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
export function getSampleCardsV2Filtered(empty = false) {
|
|
329
|
+
export function getSampleCardsV2Filtered(empty = false, type = 'Operator') {
|
|
330
330
|
const sampleOperatorCards = {
|
|
331
|
-
cards_page_type:
|
|
331
|
+
cards_page_type: type.toLocaleLowerCase(),
|
|
332
332
|
cards_page_type_id: 5,
|
|
333
333
|
cards_selector: 'use_filters',
|
|
334
|
-
module_title:
|
|
334
|
+
module_title: `${type} Cards`,
|
|
335
335
|
link_label: 'View more',
|
|
336
336
|
link_value: '/sample',
|
|
337
337
|
cards_selector_filters_limit: '4',
|