gatsby-core-theme 44.10.1 → 44.10.12-beta.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.
Files changed (50) hide show
  1. package/.ci.yml +1 -0
  2. package/CHANGELOG.md +101 -0
  3. package/gatsby-browser.js +3 -145
  4. package/gatsby-config.js +3 -3
  5. package/gatsby-node.mjs +7 -1
  6. package/gatsby-ssr.js +142 -0
  7. package/package.json +2 -1
  8. package/src/components/app-ssr.js +16 -18
  9. package/src/components/atoms/admin/bar/index.js +6 -2
  10. package/src/components/atoms/admin/button/index.js +4 -3
  11. package/src/components/atoms/contact-form/index.js +2 -2
  12. package/src/components/atoms/market-dropdown/index.js +7 -9
  13. package/src/components/atoms/notifications/index.js +2 -3
  14. package/src/components/atoms/ratings/index.js +7 -6
  15. package/src/components/atoms/review-link/index.js +16 -11
  16. package/src/components/atoms/search/autocomplete/article/index.js +13 -9
  17. package/src/components/atoms/search/autocomplete/default/index.js +13 -9
  18. package/src/components/atoms/search/autocomplete/game/index.js +22 -12
  19. package/src/components/atoms/search/autocomplete/operator/index.js +26 -18
  20. package/src/components/molecules/bonus/template-one/index.js +15 -2
  21. package/src/components/molecules/bonus/template-two/index.js +7 -1
  22. package/src/components/molecules/cookie-modal/index.js +1 -1
  23. package/src/components/molecules/floating-area/index.js +6 -12
  24. package/src/components/molecules/footer/index.js +35 -27
  25. package/src/components/molecules/footer/variants/template-one/template-one.stories.js +70 -67
  26. package/src/components/molecules/footer/variants/template-one/template-one.test.js +92 -69
  27. package/src/components/molecules/footer/variants/template-three/template-three.stories.js +4 -4
  28. package/src/components/molecules/footer/variants/template-three/template-three.test.js +98 -73
  29. package/src/components/molecules/footer/variants/template-two/template-two.stories.js +3 -3
  30. package/src/components/molecules/footer/variants/template-two/template-two.test.js +96 -73
  31. package/src/components/molecules/header/variants/default/template-one/index.js +15 -13
  32. package/src/components/molecules/header/variants/default/template-one/template-one.test.js +37 -29
  33. package/src/components/molecules/header/variants/slot/template-one/templateone.test.js +32 -29
  34. package/src/components/molecules/leave-comment-form/index.js +90 -79
  35. package/src/components/molecules/main/index.js +5 -7
  36. package/src/components/molecules/menu/index.js +28 -30
  37. package/src/components/molecules/newsletter/form/index.js +2 -2
  38. package/src/components/molecules/newsletter/index.js +23 -19
  39. package/src/components/molecules/tnc/index.js +4 -2
  40. package/src/components/organisms/anchor/template-two/index.js +33 -18
  41. package/src/components/organisms/footer-navigation/index.js +10 -9
  42. package/src/components/organisms/navigation/navigationContext.js +28 -4
  43. package/src/components/organisms/search/index.js +17 -4
  44. package/src/constants/ratings-constant.js +7 -9
  45. package/src/helpers/getters.mjs +3 -3
  46. package/src/helpers/processImageNode.js +38 -30
  47. package/src/helpers/processImageNode.test.js +33 -24
  48. package/src/helpers/replaceMedia.js +2 -2
  49. package/src/resolver/games.mjs +1 -1
  50. package/src/resolver/operators.mjs +23 -13
package/.ci.yml CHANGED
@@ -52,6 +52,7 @@ Theme Beta Publish:
52
52
  before_script:
53
53
  - echo "@gigmedia:registry=https://npm.gigmedia.tech/" >> ~/.npmrc
54
54
  - echo "//npm.gigmedia.tech/:_authToken=${NPM_PRIVATE_TOKEN}" >> ~/.npmrc
55
+ - echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> ~/.npmrc
55
56
  - git config --global http.sslverify false
56
57
  - git config --global user.email "floyd@gig.com"
57
58
  - git config --global user.name "floyd"
package/CHANGELOG.md CHANGED
@@ -1,3 +1,104 @@
1
+ ## [44.10.12-beta.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.11...v44.10.12-beta.1) (2025-12-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix error ([2339ad7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2339ad741f0c581fd71ed63e8d894d7b1340f18d))
7
+ * inp optimization ([df31d2c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/df31d2c071c5496c57a7b7db6a2da69e74ebda8b))
8
+ * test partytown ([c7cd7c9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c7cd7c9a910c8b2d05fbd3b566add043bb824651))
9
+
10
+
11
+ * Merge remote-tracking branch 'origin/EN-279-INP-optimization' into beta ([b477a63](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b477a635e85b47f4c43043d366da4c8bd613e251))
12
+ * Merge remote-tracking branch 'origin/master' into beta ([924dd7b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/924dd7b43084d71fe89f549a6d47caf17ad5fec8))
13
+ * Merge branch 'partytown-test' into 'beta' ([c2f1784](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c2f1784e77b298c77a8dfe6f4c6e029c2aa09f4f))
14
+
15
+ ## [44.10.11](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.10...v44.10.11) (2025-12-24)
16
+
17
+
18
+ ### Config
19
+
20
+ * package json publish registry ([e390998](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e390998d469a1a8537b756689e88f179edaf204f))
21
+
22
+ ## [44.10.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.9...v44.10.10) (2025-12-24)
23
+
24
+
25
+ ### Config
26
+
27
+ * revert npm registry ([e8c1fce](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e8c1fce05345d27c727cab10216707bb11afc94a))
28
+ * storybook cicd ([fbbf7b9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/fbbf7b9c690a45abd0559d43742e8b67c57bd635))
29
+
30
+ ## [44.10.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.8...v44.10.9) (2025-12-22)
31
+
32
+
33
+ ### Config
34
+
35
+ * cicd ([19ee96a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/19ee96a0ddfaee70ed36e8184e51bc4a5bb8778d))
36
+ * cicd ([d66f47f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d66f47f68ad42ee93511162434e68a533b1e88dd))
37
+
38
+ ## [44.10.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.7...v44.10.8) (2025-12-22)
39
+
40
+
41
+ ### Config
42
+
43
+ * cicd ([f89f0fe](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f89f0feb8d871c02a367dcdb51deaa27293e0985))
44
+ * cicd ([8a32764](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8a32764afc5aaf855833ffe99a58916aab9ea753))
45
+ * cicd ([6845813](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/684581377eed9fc043bc37446404b480854f43b2))
46
+ * update theme ([edf742f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/edf742fa89b03631ec011e3c44578851093185f5))
47
+
48
+ ## [44.10.7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.6...v44.10.7) (2025-12-19)
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * ci triggerer ([7efb556](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7efb5567eb349a087c0ffa735cc53d37f399aeb6))
54
+
55
+ ## [44.10.6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.5...v44.10.6) (2025-12-19)
56
+
57
+
58
+ ### Bug Fixes
59
+
60
+ * ci triggerer ([1fb50e1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1fb50e12ba7f141fb4b9776a08c5e21aa71c4018))
61
+
62
+ ## [44.10.5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.4...v44.10.5) (2025-12-19)
63
+
64
+
65
+ ### Bug Fixes
66
+
67
+ * ci triggerer ([4455abf](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4455abfd227bf0b7471d0a38b22d62063a0e4405))
68
+
69
+ ## [44.10.4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.3...v44.10.4) (2025-12-19)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * ci triggerer ([01071f3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/01071f37b73e948d3fa7eb7f0796ef6d0ef35c9c))
75
+
76
+ ## [44.10.3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.2...v44.10.3) (2025-12-19)
77
+
78
+
79
+ ### Bug Fixes
80
+
81
+ * core package in storybook build ([b3eeacc](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b3eeacc2f3f8f3db8026a65a1dc04b1d4898083b))
82
+ * import to new core package name ([fa2205f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/fa2205fafa4fb38bf65ccc27aee0f1a1dec51f26))
83
+
84
+
85
+ ### Config
86
+
87
+ * use private registry ([12efa45](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/12efa45601cab9c374e742aaccbf923b62644ee1))
88
+
89
+ ## [44.10.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.1...v44.10.2) (2025-12-18)
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ * disable sourcamp on prod ([8e84dfa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8e84dfa00123b1dcfd40d3cf5bc1c62832a1336b))
95
+ * test ([ea2ff94](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ea2ff94c4629cf649ba644beb9a77fe4fca0c48e))
96
+ * update tnc function to make it more dynamic ([39d2946](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/39d2946e85496f25175d070aeb8ed31a1b5ddf74))
97
+
98
+
99
+ * Merge branch 'en-293-update-t-and-c-function' into 'master' ([9ebdd6b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9ebdd6bdebc4fdf0eec147f51d6d1077f698a976))
100
+ * Merge branch 'fix/disable-sourcemap' into 'master' ([9254449](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9254449257d33e686308dca5f68dea67efc62a6d))
101
+
1
102
  ## [44.10.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.10.0...v44.10.1) (2025-12-08)
2
103
 
3
104
 
package/gatsby-browser.js CHANGED
@@ -16,148 +16,6 @@ require('./src/styles/base/_reset.scss');
16
16
  require('./src/styles/base/_spacing.scss');
17
17
  require('./src/styles/layouts/_grid.scss');
18
18
 
19
- function initGTM() {
20
- if (window.loadGTM === false || window.gtmDidInit || process.env.DISABLE_GTM === 'true') {
21
- return false;
22
- }
23
-
24
- window.gtmDidInit = true; // flag to ensure script does not get added to DOM more than once.
25
- const trackingLink = `https://www.googletagmanager.com/gtm.js?id=${process.env.GA_TRACKING_ID}`;
26
-
27
- const script = document.createElement('script');
28
- script.type = 'text/javascript';
29
- script.async = true;
30
- script.src = trackingLink;
31
-
32
- script.onload = () => {
33
- // eslint-disable-next-line no-undef
34
- dataLayer.push({
35
- // ensure PageViews are always tracked
36
- event: 'gtm.js',
37
- 'gtm.start': new Date().getTime(),
38
- 'gtm.uniqueEventId': 0,
39
- });
40
- };
41
- document.head.appendChild(script);
42
-
43
- const noscript = document.createElement('noscript');
44
- const iframe = document.createElement('iframe');
45
- iframe.src = trackingLink;
46
- iframe.style.display = 'none';
47
- iframe.style.visibility = 'hidden';
48
- iframe.height = 0;
49
- iframe.width = 0;
50
- noscript.innerHTML += iframe.outerHTML;
51
- document.body.appendChild(noscript);
52
- }
53
-
54
- function optinMonster() {
55
- const script = document.createElement('script');
56
- script.id = 'optin-monstr';
57
- script.setAttribute('data-user', process.env.OPTINMONSTR_USER);
58
- script.setAttribute('data-account', process.env.OPTINMONSTR_ACC);
59
- script.src = 'https://a.omappapi.com/app/js/api.min.js';
60
- script.async = true;
61
- document.head.appendChild(script);
62
- }
63
-
64
-
65
- const loadFacebookPixel = () => {
66
- !(function (f, b, e, v, n, t, s) {
67
- // eslint-disable-next-line no-multi-assign
68
- if (f.fbq) return;
69
- n = f.fbq = function () {
70
- n.callMethod
71
- ? // eslint-disable-next-line prefer-spread, prefer-rest-params
72
- n.callMethod.apply(n, arguments)
73
- : n.queue.push(arguments);
74
- };
75
- if (!f._fbq) f._fbq = n;
76
- n.push = n;
77
- n.loaded = !0;
78
- n.version = '2.0';
79
- n.queue = [];
80
- t = b.createElement(e);
81
- t.async = !0;
82
- t.id = 'pixel-code';
83
- t.src = v;
84
- s = b.getElementsByTagName(e)[0];
85
- s.parentNode.insertBefore(t, s);
86
- })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
87
- };
88
-
89
- const microsoftAdvertising = () => {
90
- (function (w, d, t, r, u) {
91
- var f, n, i;
92
- (w[u] = w[u] || []),
93
- (f = function () {
94
- var o = { ti: '187106455', enableAutoSpaTracking: true };
95
- (o.q = w[u]), (w[u] = new UET(o)), w[u].push('pageLoad');
96
- }),
97
- (n = d.createElement(t)),
98
- (n.src = r),
99
- (n.async = 1),
100
- (n.id = 'microsoft-code'),
101
- (n.onload = n.onreadystatechange =
102
- function () {
103
- var s = this.readyState;
104
- (s && s !== 'loaded' && s !== 'complete') ||
105
- (f(), (n.onload = n.onreadystatechange = null));
106
- }),
107
- (i = d.getElementsByTagName(t)[0]),
108
- i.parentNode.insertBefore(n, i);
109
- })(window, document, 'script', '//bat.bing.com/bat.js', 'uetq');
110
- };
111
-
112
- const piguard = () =>{
113
- if (window.loadGTM === false) {
114
- return false;
115
- }
116
-
117
- const script = document.createElement('script');
118
- script.id = 'piguard';
119
- script.src = `https://pg.${process.env.GATSBY_SITE_NAME}/analytics.js?tid=PP-${process.env.PIGUARD_ID}`;
120
- script.async = true;
121
- document.head.appendChild(script);
122
- }
123
-
124
- function scrollEvent(event) {
125
- initGTM();
126
-
127
- if (!document.getElementById('piguard') && process.env.ENABLE_PIGUARD === 'true') {
128
- piguard();
129
- }
130
-
131
- if (process.env.ENABLE_MICROSOFT === 'true' && !document.getElementById('microsoft-code'))
132
- microsoftAdvertising();
133
-
134
- if (process.env.ENABLE_OPTINMONSTR === 'true' && !document.getElementById('optin-monstr'))
135
- optinMonster();
136
- if (process.env.ENABLE_PIXEL === 'true' && !document.getElementById('pixel-code')) {
137
- if (
138
- typeof window !== 'undefined' &&
139
- window.location.pathname !== process.env.PAGE_EXCLUDE_PIXEL
140
- ) {
141
- loadFacebookPixel();
142
-
143
- fbq('init', process.env.PIXEL_ID);
144
-
145
- // Initialize and track the PageView event
146
- fbq('track', 'PageView');
147
- }
148
- }
149
-
150
- if (event) {
151
- event.currentTarget.removeEventListener(event.type, scrollEvent); // remove the event listener that got triggered
152
- }
153
- }
154
-
155
- exports.onClientEntry = () => {
156
- if (process.env.PPC === 'true') {
157
- scrollEvent(null);
158
- } else {
159
- document.addEventListener('scroll', scrollEvent, { passive: true });
160
- document.addEventListener('mousemove', scrollEvent, { passive: true });
161
- document.addEventListener('touchstart', scrollEvent, { passive: true });
162
- }
163
- };
19
+ // Note: GTM, Facebook Pixel, Microsoft Advertising, OptinMonster, and Piguard
20
+ // are now loaded via Partytown in gatsby-ssr.js for better performance.
21
+ // They run in a web worker instead of the main thread.
package/gatsby-config.js CHANGED
@@ -4,20 +4,20 @@ module.exports = {
4
4
  },
5
5
  plugins: [
6
6
  {
7
- resolve: 'gatsby-plugin-sass',
7
+ resolve: "gatsby-plugin-sass",
8
8
  options: {
9
9
  cssLoaderOptions: {
10
10
  esModule: false,
11
11
  modules: {
12
12
  namedExport: false,
13
- localIdentName: '[name]__[local]__[hash:base64:5]', // customize the class name structure here
13
+ localIdentName: "[name]__[local]__[hash:base64:5]", // customize the class name structure here
14
14
  },
15
15
  },
16
16
  additionalData: '@import "gatsby-core-theme/src/styles/globals.scss";',
17
17
  },
18
18
  },
19
19
  {
20
- resolve: 'gatsby-plugin-webpack-bundle-analyser-v2',
20
+ resolve: "gatsby-plugin-webpack-bundle-analyser-v2",
21
21
  options: {
22
22
  devMode: true,
23
23
  disable: true,
package/gatsby-node.mjs CHANGED
@@ -9,8 +9,9 @@
9
9
  import loadash from "lodash/index.js";
10
10
  import chalk from "chalk";
11
11
  import fs from "fs";
12
- import { dirname } from "path";
12
+ import nodePath, { dirname } from "path";
13
13
  import { fileURLToPath } from "url";
14
+ import { copyLibFiles } from "@qwik.dev/partytown/utils";
14
15
  import keygen from "./src/helpers/keygen.mjs";
15
16
  import { getTranslations } from "./src/services/api.mjs";
16
17
  import { fetchSiteSettings } from "./src/services/fetch.mjs";
@@ -357,6 +358,10 @@ export const onCreatePage = async ({ page, actions }) => {
357
358
  };
358
359
 
359
360
  export const onPreBootstrap = async (options, themeOptions) => {
361
+ // Copy Partytown library files to static directory
362
+ console.log(chalk.magenta("info") + chalk.whiteBright(" copying Partytown library files"));
363
+ await copyLibFiles(nodePath.join(__dirname, "static", "~partytown"));
364
+
360
365
  // Get Data from Hercules
361
366
  ({
362
367
  siteSettingsData,
@@ -503,6 +508,7 @@ export const onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
503
508
  }
504
509
 
505
510
  actions.setWebpackConfig({
511
+ devtool: stage === "build-javascrip" ? false : "eval-source-map",
506
512
  resolve: {
507
513
  alias: {
508
514
  "~atoms": `${__dirname}/src/components/atoms`,
package/gatsby-ssr.js ADDED
@@ -0,0 +1,142 @@
1
+ /* eslint-disable import/prefer-default-export */
2
+ /* eslint-disable react/jsx-filename-extension */
3
+ import React from "react";
4
+ // eslint-disable-next-line import/no-extraneous-dependencies
5
+ import { Partytown } from "@qwik.dev/partytown/react";
6
+
7
+ export const onRenderBody = ({ setHeadComponents, setPreBodyComponents }) => {
8
+ const gaTrackingId = process.env.GA_TRACKING_ID;
9
+ const enableGTM = process.env.DISABLE_GTM !== "true";
10
+ const enablePixel = process.env.ENABLE_PIXEL === "true";
11
+ const pixelId = process.env.PIXEL_ID;
12
+ const enableMicrosoft = process.env.ENABLE_MICROSOFT === "true";
13
+ const enableOptinMonster = process.env.ENABLE_OPTINMONSTR === "true";
14
+ const optinMonsterUser = process.env.OPTINMONSTR_USER;
15
+ const optinMonsterAcc = process.env.OPTINMONSTR_ACC;
16
+ const enablePiguard = process.env.ENABLE_PIGUARD === "true";
17
+ const piguardId = process.env.PIGUARD_ID;
18
+ const siteName = process.env.GATSBY_SITE_NAME;
19
+
20
+ // Configure Partytown with forwarding for all analytics
21
+ const forwardConfig = ["dataLayer.push"];
22
+
23
+ if (enablePixel) {
24
+ forwardConfig.push("fbq");
25
+ }
26
+
27
+ if (enableMicrosoft) {
28
+ forwardConfig.push("uetq.push");
29
+ }
30
+
31
+ const headComponents = [
32
+ <Partytown
33
+ key="partytown"
34
+ debug={process.env.NODE_ENV === "development"}
35
+ forward={forwardConfig}
36
+ />,
37
+ ];
38
+
39
+ // Add Google Tag Manager script with Partytown
40
+ if (enableGTM && gaTrackingId) {
41
+ headComponents.push(
42
+ <script
43
+ key="gtm-init"
44
+ type="text/partytown"
45
+ dangerouslySetInnerHTML={{
46
+ __html: `
47
+ window.dataLayer = window.dataLayer || [];
48
+ window.dataLayer.push({
49
+ 'gtm.start': new Date().getTime(),
50
+ event: 'gtm.js'
51
+ });
52
+ `,
53
+ }}
54
+ />,
55
+ <script
56
+ key="gtm"
57
+ type="text/partytown"
58
+ src={`https://www.googletagmanager.com/gtm.js?id=${gaTrackingId}`}
59
+ />
60
+ );
61
+ }
62
+
63
+ // Add Facebook Pixel script with Partytown
64
+ if (enablePixel && pixelId) {
65
+ headComponents.push(
66
+ <script
67
+ key="fb-pixel"
68
+ type="text/partytown"
69
+ dangerouslySetInnerHTML={{
70
+ __html: `
71
+ !function(f,b,e,v,n,t,s)
72
+ {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
73
+ n.callMethod.apply(n,arguments):n.queue.push(arguments)};
74
+ if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
75
+ n.queue=[];t=b.createElement(e);t.async=!0;
76
+ t.src=v;s=b.getElementsByTagName(e)[0];
77
+ s.parentNode.insertBefore(t,s)}(window, document,'script',
78
+ 'https://connect.facebook.net/en_US/fbevents.js');
79
+ fbq('init', '${pixelId}');
80
+ fbq('track', 'PageView');
81
+ `,
82
+ }}
83
+ />
84
+ );
85
+ }
86
+
87
+ // Add Microsoft Advertising (UET) script with Partytown
88
+ if (enableMicrosoft) {
89
+ headComponents.push(
90
+ <script
91
+ key="microsoft-uet"
92
+ type="text/partytown"
93
+ dangerouslySetInnerHTML={{
94
+ __html: `
95
+ (function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"187106455",enableAutoSpaTracking:true};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");
96
+ `,
97
+ }}
98
+ />
99
+ );
100
+ }
101
+
102
+ // Add OptinMonster script with Partytown
103
+ if (enableOptinMonster && optinMonsterUser && optinMonsterAcc) {
104
+ headComponents.push(
105
+ <script
106
+ key="optinmonster"
107
+ type="text/partytown"
108
+ data-user={optinMonsterUser}
109
+ data-account={optinMonsterAcc}
110
+ src="https://a.omappapi.com/app/js/api.min.js"
111
+ />
112
+ );
113
+ }
114
+
115
+ // Add Piguard script with Partytown
116
+ if (enablePiguard && piguardId && siteName) {
117
+ headComponents.push(
118
+ <script
119
+ key="piguard"
120
+ type="text/partytown"
121
+ src={`https://pg.${siteName}/analytics.js?tid=PP-${piguardId}`}
122
+ />
123
+ );
124
+ }
125
+
126
+ setHeadComponents(headComponents);
127
+
128
+ // Add GTM noscript fallback to body
129
+ if (enableGTM && gaTrackingId) {
130
+ setPreBodyComponents([
131
+ <noscript
132
+ key="gtm-noscript"
133
+ dangerouslySetInnerHTML={{
134
+ __html: `
135
+ <iframe src="https://www.googletagmanager.com/ns.html?id=${gaTrackingId}" height="0" width="0"
136
+ style="display:none;visibility:hidden"></iframe>
137
+ `,
138
+ }}
139
+ />,
140
+ ]);
141
+ }
142
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.10.1",
3
+ "version": "44.10.12-beta.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -18,6 +18,7 @@
18
18
  "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"
19
19
  },
20
20
  "dependencies": {
21
+ "@qwik.dev/partytown": "^0.11.2",
21
22
  "@reach/router": "^1.3.3",
22
23
  "@gigmedia/enigma-utils": "^1.20.0",
23
24
  "@react-icons/all-files": "^4.1.0",
@@ -1,16 +1,15 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  /* eslint-disable react/forbid-prop-types */
3
- import React, { useEffect, useState } from 'react';
4
- import PropTypes from 'prop-types';
5
- import { graphql, useStaticQuery } from 'gatsby';
6
- import MainProvider from '~context/MainProvider';
3
+ import React, { useEffect, useState } from "react";
4
+ import PropTypes from "prop-types";
5
+ import { graphql, useStaticQuery } from "gatsby";
6
+ import MainProvider from "~context/MainProvider";
7
7
  import { getCookie } from "~helpers/cookies";
8
- import Body from '~pages/body';
9
- import HeadData from '~organisms/head';
10
- import { getAPIData } from '~helpers/server-data';
8
+ import Body from "~pages/body";
9
+ import HeadData from "~organisms/head";
10
+ import { getAPIData } from "~helpers/server-data";
11
11
 
12
12
  const AppSSR = ({ pageContext, serverData }) => {
13
-
14
13
  const data = useStaticQuery(graphql`
15
14
  query {
16
15
  translations: allTranslation(filter: {}) {
@@ -27,23 +26,22 @@ const AppSSR = ({ pageContext, serverData }) => {
27
26
 
28
27
  const [isAdmin, setIsAdmin] = useState(false);
29
28
 
30
-
31
29
  useEffect(() => {
32
-
33
- if (
34
- typeof window !== `undefined` &&
35
- getCookie("showAdminBar") === "true"
36
- ) {
30
+ if (typeof window !== `undefined` && getCookie("showAdminBar") === "true") {
37
31
  setIsAdmin(true);
38
32
  }
39
33
  // eslint-disable-next-line react-hooks/exhaustive-deps
40
34
  }, []);
41
35
 
42
-
43
-
44
36
  return (
45
37
  <>
46
- <MainProvider value={{ admin: isAdmin, translations: data.translations, language: pageContext.page.language }} >
38
+ <MainProvider
39
+ value={{
40
+ admin: isAdmin,
41
+ translations: data.translations,
42
+ language: pageContext.page.language,
43
+ }}
44
+ >
47
45
  <Body pageContext={pageContext} serverData={serverData} />
48
46
  </MainProvider>
49
47
  </>
@@ -81,7 +79,7 @@ export default AppSSR;
81
79
  export async function getServerData(props) {
82
80
  // eslint-disable-next-line no-shadow
83
81
  const { pageContext, url, headers } = props;
84
- let res = '';
82
+ let res = "";
85
83
  res = await getAPIData(pageContext.page, url, headers);
86
84
  return res;
87
85
  }
@@ -20,7 +20,7 @@ const AdminBar = ({ page, marketSections, menu, activeMarket }) => {
20
20
  ? getMenuObj(navSection.modules, menu)
21
21
  : null;
22
22
 
23
- const menus = menusConfig(menuObj, footerSection, page, types);
23
+ const menus = menusConfig(menuObj, footerSection, page, types);
24
24
 
25
25
  return (
26
26
  <div className={styles.container}>
@@ -43,7 +43,11 @@ const AdminBar = ({ page, marketSections, menu, activeMarket }) => {
43
43
  </label>
44
44
  </li>
45
45
  <LayoutSection menus={menus} />
46
- <PreviewLink activeMarket={activeMarket} page={page} preview={preview} />
46
+ <PreviewLink
47
+ activeMarket={activeMarket}
48
+ page={page}
49
+ preview={preview}
50
+ />
47
51
  </ul>
48
52
  </div>
49
53
  </div>
@@ -5,17 +5,18 @@ import { FaGripHorizontal } from "@react-icons/all-files/fa/FaGripHorizontal";
5
5
  import styles from "./button.module.scss";
6
6
 
7
7
  const getDMSLink = (module) => {
8
-
9
8
  let hercLink = `${process.env.HERCULES_BACKEND_URL}`;
10
9
  let linkText = ``;
11
10
 
12
11
  switch (module.name) {
13
12
  case "top_list":
14
- hercLink += `toplists/operators/${module.items ? module.items[0].id : ""}`;
13
+ hercLink += `toplists/operators/${
14
+ module.items ? module.items[0].id : ""
15
+ }`;
15
16
  linkText = "Edit Toplist";
16
17
  break;
17
18
  case "bonus":
18
- hercLink += `operators/${module.value?.operator_id}/sites-data/edit/${module.value?.id}`;
19
+ hercLink += `operators/${module.value?.operator_id}/sites-data/edit/${module.value?.id}`;
19
20
  linkText = "Edit Operator";
20
21
  break;
21
22
  default:
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
- import Form from "gatsby-core-theme/src/components/organisms/form";
4
3
  import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight";
4
+ import Form from "~organisms/form";
5
5
  import useTranslate from "~hooks/useTranslate/useTranslate";
6
6
  import { contactUsForm } from "../../../constants/forms";
7
7
  import styles from "./contact-form.module.scss";
@@ -47,7 +47,7 @@ const ContactForm = ({
47
47
  validationMessage={validationMessage}
48
48
  path={page?.path}
49
49
  buttonIcon={buttonIcon}
50
- customClass={styles.contactUsForm || ''}
50
+ customClass={styles.contactUsForm || ""}
51
51
  />
52
52
  </div>
53
53
  </div>
@@ -2,8 +2,8 @@
2
2
  import React, { useState, useRef, useEffect } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { IoMdClose } from "@react-icons/all-files/io/IoMdClose";
5
- import Link from "gatsby-core-theme/src/hooks/link";
6
- import LazyImage from "gatsby-core-theme/src/hooks/lazy-image";
5
+ import Link from "~hooks/link";
6
+ import LazyImage from "~hooks/lazy-image";
7
7
  import useTranslate from "~hooks/useTranslate/useTranslate";
8
8
  import styles from "./market-dropdown.module.scss";
9
9
 
@@ -59,7 +59,7 @@ const MarketDropdown = ({
59
59
  <div
60
60
  className={`${styles.dropdownContainer} ${
61
61
  isActive && styles.RemoveBorder
62
- } ${customCss ? customCss || '' : ''}`}
62
+ } ${customCss ? customCss || "" : ""}`}
63
63
  ref={containerRef}
64
64
  >
65
65
  <div
@@ -85,7 +85,8 @@ const MarketDropdown = ({
85
85
  />
86
86
  {showMarket && (
87
87
  <span className={styles.marketTitle}>
88
- {(activeMarket.path_prefix !== null && activeMarket.path_prefix !== undefined)
88
+ {activeMarket.path_prefix !== null &&
89
+ activeMarket.path_prefix !== undefined
89
90
  ? activeMarket.path_prefix
90
91
  : defaultMarketText}
91
92
  </span>
@@ -119,8 +120,7 @@ const MarketDropdown = ({
119
120
  const prefix = item[1].path_prefix;
120
121
  /* eslint-disable react-hooks/rules-of-hooks */
121
122
  const marketText =
122
- prefix &&
123
- useTranslate(prefix, marketValues[prefix] || prefix);
123
+ prefix && useTranslate(prefix, marketValues[prefix] || prefix);
124
124
  const path =
125
125
  langPage.length > 0 ? langPage[0].path : prefix || "/";
126
126
 
@@ -139,9 +139,7 @@ const MarketDropdown = ({
139
139
  loading="eager"
140
140
  alt={prefix}
141
141
  />
142
- <span>
143
- {prefix ? marketText : defaultMarketText}
144
- </span>
142
+ <span>{prefix ? marketText : defaultMarketText}</span>
145
143
  </Link>
146
144
  );
147
145
  }