gatsby-core-theme 44.7.1 → 44.8.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,31 @@
1
+ ## [44.8.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.8.0...v44.8.1) (2025-11-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * relationKeys ([c51b03b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c51b03b3def0caecb83dd934d5974316801f7352))
7
+ * typo ([3b2d4fa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3b2d4fa0f39eb1320e5c0ceead74aa933d5b8d24))
8
+
9
+
10
+ * Merge branch 'en-142/themeoptions-relation-keys' into 'master' ([3291dd9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3291dd9ac6e1c7f1b1672dc5002d2ee83e340100))
11
+
12
+ # [44.8.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.7.1...v44.8.0) (2025-11-19)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * add gtm classes ([e367b13](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e367b13dbc658cde87b4eed2226084ee6056d168))
18
+ * update operator cta gtm class default ([3068134](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3068134a7693fae5fc49181ba635e6bf58b45ca3))
19
+
20
+
21
+ * Merge branch 'operator-cta-update' into 'master' ([30e0f23](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/30e0f235510ae5596a58378578d92061b9643d7a))
22
+ * Merge branch 'en-142/themeoptions-relation-keys' into 'master' ([0a35c2c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0a35c2c8303fc72b9d0bd9de2fedfbb3550c2ff3))
23
+
24
+
25
+ ### Features
26
+
27
+ * additional relation keys from themeoptions ([f198bcb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f198bcb806f2da11925dec9e26cefc2670ae4c70))
28
+
1
29
  ## [44.7.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.7.0...v44.7.1) (2025-11-13)
2
30
 
3
31
 
package/gatsby-node.mjs CHANGED
@@ -15,20 +15,18 @@ import keygen from "./src/helpers/keygen.mjs";
15
15
  import { getTranslations } from "./src/services/api.mjs";
16
16
  import { fetchSiteSettings } from "./src/services/fetch.mjs";
17
17
  import { generateTrackerLink } from "./src/helpers/generators.mjs";
18
- import processor, {
19
- processSitemapPages,
20
- } from "./src/resolver/index.mjs";
18
+ import processor, { processSitemapPages } from "./src/resolver/index.mjs";
21
19
  import settings from "./src/constants/settings.mjs";
20
+ import { clean, removeUnwantedSections } from "./src/resolver/common.mjs";
22
21
  import {
23
- clean,
24
- removeUnwantedSections,
25
- } from "./src/resolver/common.mjs";
26
- import { generateRedirects, generatePrettyLinkRedirects } from "./src/resolver/redirect.mjs";
22
+ generateRedirects,
23
+ generatePrettyLinkRedirects,
24
+ } from "./src/resolver/redirect.mjs";
27
25
  import { translate, is404Page } from "./src/helpers/getters.mjs";
28
26
  import { getArchivePages, hasArchiveModule } from "./src/resolver/archive.mjs";
29
27
 
30
28
  const __dirname = dirname(fileURLToPath(import.meta.url));
31
- const { cloneDeep, chunk, pick } = loadash;
29
+ const { cloneDeep } = loadash;
32
30
 
33
31
  let preconnectLinks = null;
34
32
  let pages = null;
@@ -67,11 +65,10 @@ let templatesData = null;
67
65
  let defaultLanguage = null;
68
66
  const pagesToCreate = [];
69
67
  let commentsData = null;
70
- const relations = {};
71
68
 
72
69
  // eslint-disable-next-line import/prefer-default-export
73
70
  export const createPages = async (
74
- { actions: { createPage, createRedirect } },
71
+ { actions: { createPage } },
75
72
  themeOptions
76
73
  ) => {
77
74
  process.env.GATSBY_SITE_NAME = String(themeOptions.siteName);
@@ -282,9 +279,9 @@ export const createPages = async (
282
279
  }
283
280
  });
284
281
 
285
- if(process.env.DISABLE_SPLASH_SCREEN === 'true'){
286
- generatePrettyLinkRedirects( trackingPages )
287
- }else{
282
+ if (process.env.DISABLE_SPLASH_SCREEN === "true") {
283
+ generatePrettyLinkRedirects(trackingPages);
284
+ } else {
288
285
  trackingPages.forEach(({ path, page, operator }) => {
289
286
  createPage({
290
287
  path,
@@ -301,7 +298,7 @@ export const createPages = async (
301
298
  isLiveStreamProvider: false,
302
299
  },
303
300
  });
304
- })
301
+ });
305
302
  }
306
303
  };
307
304
 
@@ -362,7 +359,7 @@ export const onCreatePage = async ({ page, actions }) => {
362
359
  }
363
360
  };
364
361
 
365
- export const onPreBootstrap = async () => {
362
+ export const onPreBootstrap = async (options, themeOptions) => {
366
363
  // Get Data from Hercules
367
364
  ({
368
365
  siteSettingsData,
@@ -388,7 +385,11 @@ export const onPreBootstrap = async () => {
388
385
  commentsData,
389
386
  licensesData,
390
387
  cryptoWalletsData,
391
- } = await fetchSiteSettings(process.env.GATSBY_SITE_NAME));
388
+ } = await fetchSiteSettings(
389
+ process.env.GATSBY_SITE_NAME,
390
+ null,
391
+ themeOptions
392
+ ));
392
393
  };
393
394
 
394
395
  export const sourceNodes = async ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.7.1",
3
+ "version": "44.8.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -40,7 +40,7 @@ export default function Bonus({
40
40
  moduleName={moduleName}
41
41
  tracker={module?.tracking_link_name || "main"}
42
42
  clickedElement="operator_logo"
43
- className={`${styles.logo || ""} operator-banner-gtm logo-cta`}
43
+ className={`${styles.logo || ""} operator-banner-gtm logo-cta-gtm`}
44
44
  modulePosition={modulePosition}
45
45
  >
46
46
  <LazyImage
@@ -81,6 +81,7 @@ export default function Bonus({
81
81
  moduleName={moduleName}
82
82
  icon={ctaIcon}
83
83
  modulePosition={modulePosition}
84
+ gtmClass="bonus-operator-cta-gtm"
84
85
  />
85
86
  </div>
86
87
  {tncFixed && <Tnc isFixed={tncFixed} operator={operator} />}
@@ -31,7 +31,7 @@ export default function BonusBox({
31
31
  tracker={tracker}
32
32
  titleSuffix={titleSuffix}
33
33
  clickedElement={clickedElement}
34
- className={`${styles.detailsBox} ${'bonus-box-gtm'}`}
34
+ className={`${styles.detailsBox} ${"bonus-box-gtm"}`}
35
35
  modulePosition={modulePosition}
36
36
  itemPosition={itemPosition}
37
37
  >
@@ -50,6 +50,7 @@ export default function BonusBox({
50
50
  clickedElement={`${clickedElement}_cta`}
51
51
  modulePosition={modulePosition}
52
52
  itemPosition={itemPosition}
53
+ gtmClass="bonus-box-operator-cta-gtm"
53
54
  />
54
55
  </div>
55
56
  );
@@ -6,7 +6,7 @@ import { getProviderData } from "./providers.mjs";
6
6
 
7
7
  const { cloneDeep, pick } = loadash;
8
8
 
9
- export function sanitizegameData(game, pages = null) {
9
+ export function sanitizegameData(game, pages = null, relationKeys) {
10
10
  const gameClone = cloneDeep(game);
11
11
 
12
12
  const providerPage = pages
@@ -19,7 +19,7 @@ export function sanitizegameData(game, pages = null) {
19
19
  gameClone.game_provider.path = providerPage[0].path;
20
20
  }
21
21
 
22
- return pick(gameClone, pickRelationKeys.game);
22
+ return pick(gameClone, [...pickRelationKeys.game, ...(relationKeys || [])]);
23
23
  }
24
24
 
25
25
  export function transformGames(jsonData, relationsData) {
@@ -65,11 +65,15 @@ export function transformGames(jsonData, relationsData) {
65
65
  )
66
66
  : null;
67
67
 
68
-
69
68
  // Jackpot Data
70
- newGamesData.jackpot_data = relationsData.jackpot_data[newGamesData.game_id] || null;
69
+ newGamesData.jackpot_data =
70
+ relationsData.jackpot_data[newGamesData.game_id] || null;
71
71
 
72
- games[sitesMarketData.id] = sanitizegameData(newGamesData);
72
+ games[sitesMarketData.id] = sanitizegameData(
73
+ newGamesData,
74
+ null,
75
+ relationsData?.relationKeys
76
+ );
73
77
  });
74
78
  });
75
79
 
@@ -78,23 +82,27 @@ export function transformGames(jsonData, relationsData) {
78
82
 
79
83
  export function transformGamesJackpot(data) {
80
84
  const transformedData = {};
81
-
85
+
82
86
  Object.keys(data).forEach((operatorId) => {
83
87
  // Get the first key that is NOT "game_short_name"
84
- const gameSiteId = Object.keys(data[operatorId.toString()]).find(key => key !== 'game_short_name');
85
-
88
+ const gameSiteId = Object.keys(data[operatorId.toString()]).find(
89
+ (key) => key !== "game_short_name"
90
+ );
91
+
86
92
  let gameId = null;
87
93
  let jackpotData = {};
88
94
 
89
95
  Object.keys(data[operatorId.toString()][gameSiteId]).forEach((key) => {
90
- if(key !== 'operator_short_name') {
96
+ if (key !== "operator_short_name") {
91
97
  gameId = data[operatorId.toString()][gameSiteId][key].game_id;
92
- jackpotData = Object.assign(jackpotData, { [key]: data[operatorId.toString()][gameSiteId][key] });
98
+ jackpotData = Object.assign(jackpotData, {
99
+ [key]: data[operatorId.toString()][gameSiteId][key],
100
+ });
93
101
  }
94
- })
95
-
102
+ });
103
+
96
104
  transformedData[gameId] = jackpotData;
97
105
  });
98
-
106
+
99
107
  return transformedData;
100
108
  }
@@ -272,9 +272,8 @@ export function getReadingTime(sections, content) {
272
272
  minutes += mins;
273
273
  seconds = decimalSeconds;
274
274
  }
275
- minutes > 10 ? minutes = 10 : minutes;
275
+ minutes = minutes > 10 ? 10 : minutes;
276
276
  return (
277
-
278
277
  getRoundMinutes(`${zeroPadding(minutes, 2)}:${zeroPadding(seconds, 2)}`) ||
279
278
  null
280
279
  );
@@ -428,7 +427,8 @@ export default {
428
427
  market,
429
428
  data,
430
429
  index,
431
- pageType === "preview"
430
+ pageType === "preview",
431
+ themeOptions
432
432
  );
433
433
 
434
434
  if (["rage_seo", "rage_ppc", "sports"].includes(generalData.type)) {
@@ -16,38 +16,43 @@ export const processRelations = (
16
16
  market,
17
17
  data,
18
18
  index,
19
- isPreview
19
+ isPreview,
20
+ themeOptions
20
21
  ) => {
21
22
  if (page.relation_type !== "page" && page.relation_id) {
22
23
  const hasRelation =
23
24
  data.relations[page.relation_type] &&
24
25
  data.relations[page.relation_type].hasOwnProperty(page.relation_id);
25
-
26
- transformedPages[market][page.relation_type][
27
- index
28
- ].relation = hasRelation
26
+
27
+ transformedPages[market][page.relation_type][index].relation = hasRelation
29
28
  ? cloneDeep(data.relations[page.relation_type][page.relation_id])
30
29
  : null;
31
30
 
31
+ // Add path for software and license
32
+ if (
33
+ page.relation_type === "operator" &&
34
+ process.env.ENABLE_PATH_SOFTWARE_AND_LICENSE === "true"
35
+ ) {
36
+ // Software
37
+ transformedPages[market][page.relation_type][
38
+ index
39
+ ]?.relation?.software?.forEach((software) => {
40
+ const mappedSoftware = transformedPages[
41
+ market
42
+ ]?.software_provider?.filter((pr) => pr.relation_id === software.id)[0];
43
+ mappedSoftware && (software.path = mappedSoftware.path);
44
+ });
32
45
 
33
- // Add path for software and license
34
- if(page.relation_type === "operator" && (process.env.ENABLE_PATH_SOFTWARE_AND_LICENSE === 'true')) {
35
- // Software
36
- transformedPages[market][page.relation_type][
37
- index
38
- ]?.relation?.software?.forEach(software => {
39
- const mappedSoftware = transformedPages[market]?.software_provider?.filter(pr => pr.relation_id === software.id)[0];
40
- mappedSoftware && (software.path = mappedSoftware.path);
41
- });
42
-
43
- // License
44
- transformedPages[market][page.relation_type][
45
- index
46
- ]?.relation?.license_objects?.forEach(license => {
47
- const mappedLicense = transformedPages[market]?.operators_license?.filter(l => l.relation_id === license.id)[0];
48
- mappedLicense && (license.path = mappedLicense.path);
49
- });
50
- }
46
+ // License
47
+ transformedPages[market][page.relation_type][
48
+ index
49
+ ]?.relation?.license_objects?.forEach((license) => {
50
+ const mappedLicense = transformedPages[
51
+ market
52
+ ]?.operators_license?.filter((l) => l.relation_id === license.id)[0];
53
+ mappedLicense && (license.path = mappedLicense.path);
54
+ });
55
+ }
51
56
 
52
57
  switch (page.relation_type) {
53
58
  // // Add path for game page from game provider
@@ -55,7 +60,8 @@ export const processRelations = (
55
60
  if (hasRelation && transformedPages[market][pageType][index].relation) {
56
61
  page.relation = sanitizegameData(
57
62
  page.relation,
58
- transformedPages[market].software_provider
63
+ transformedPages[market].software_provider,
64
+ themeOptions?.pickRelationKeys?.game
59
65
  );
60
66
  }
61
67
  break;
@@ -79,7 +85,7 @@ export const processRelations = (
79
85
  if (!hasRelation) {
80
86
  transformedPages[market][pageType][index].relation =
81
87
  data.relations.crypto_exchanges[page.relation_id];
82
- }
88
+ }
83
89
  break;
84
90
  case "crypto_brokers":
85
91
  if (!hasRelation) {
@@ -87,8 +93,8 @@ export const processRelations = (
87
93
  data.relations.crypto_brokers[page.relation_id];
88
94
  }
89
95
  break;
90
- case "crypto_wallets":
91
- if (!hasRelation) {
96
+ case "crypto_wallets":
97
+ if (!hasRelation) {
92
98
  transformedPages[market][pageType][index].relation =
93
99
  data.relations.crypto_wallets[page.relation_id];
94
100
  }
@@ -104,10 +110,11 @@ export const processLogo = (logo, standardisedLogo) =>
104
110
  ? { ...logo, filename: `${logo.filename}${logo.extension}` }
105
111
  : {
106
112
  ...standardisedLogo,
107
- filename: standardisedLogo ? `${standardisedLogo.filename}${standardisedLogo.extension}` : '',
113
+ filename: standardisedLogo
114
+ ? `${standardisedLogo.filename}${standardisedLogo.extension}`
115
+ : "",
108
116
  };
109
117
 
110
-
111
118
  export const processPaymentMethods = (ids, market, payments) =>
112
119
  ids
113
120
  ? ids.map((id) =>
@@ -121,7 +128,10 @@ export const processCurrencies = (ids, currencies) =>
121
128
  pick(
122
129
  {
123
130
  ...currencies[id],
124
- logo: processLogo(currencies[id]?.logo, currencies[id]?.standardised_logo)
131
+ logo: processLogo(
132
+ currencies[id]?.logo,
133
+ currencies[id]?.standardised_logo
134
+ ),
125
135
  },
126
136
  pickRelationKeys.currency
127
137
  )
@@ -31,7 +31,11 @@ import { transformPayments } from "../resolver/payment.mjs";
31
31
  import { transformProvider } from "../resolver/providers.mjs";
32
32
  import { transformComments } from "../resolver/comments.mjs";
33
33
 
34
- export const fetchSiteSettings = async (siteName, previewPath = null) => {
34
+ export const fetchSiteSettings = async (
35
+ siteName,
36
+ previewPath = null,
37
+ themeOptions = {}
38
+ ) => {
35
39
  const siteSettingsPromise = getSiteSettings(siteName);
36
40
  const ribbonsPromise = getRibbons(`site=${process.env.GATSBY_SITE_NAME}`);
37
41
 
@@ -70,7 +74,11 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
70
74
  const pagesPromise = getPages(process.env.GATSBY_SITE_NAME, previewPath);
71
75
 
72
76
  let sportsPromise = Promise.resolve({});
73
- if (["rage_seo", "rage_ppc", "sports"].includes(siteSettingsData.general[siteId].type)) {
77
+ if (
78
+ ["rage_seo", "rage_ppc", "sports"].includes(
79
+ siteSettingsData.general[siteId].type
80
+ )
81
+ ) {
74
82
  sportsPromise = getSports(process.env.GATSBY_SITE_NAME);
75
83
  }
76
84
 
@@ -93,7 +101,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
93
101
  cryptoExchanges,
94
102
  cryptoWallets,
95
103
  userComments,
96
- licensesData
104
+ licensesData,
97
105
  ] = await Promise.all([
98
106
  ribbonsPromise,
99
107
  responsableGamingPromise,
@@ -113,7 +121,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
113
121
  cryptoExchangesPromise,
114
122
  cryptoWalletsPromise,
115
123
  userCommentsPromise,
116
- licensesPromise
124
+ licensesPromise,
117
125
  ]);
118
126
 
119
127
  const allMarketPrefixes = Object.keys(allMarketsData)
@@ -128,11 +136,12 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
128
136
 
129
137
  const paymentData = transformPayments(payments);
130
138
 
131
- const commentsData = transformComments( userComments );
132
-
139
+ const commentsData = transformComments(userComments);
140
+
133
141
  const gamesData = transformGames(games, {
134
142
  providers: providersData,
135
- jackpot_data: transformGamesJackpot(gamesJackpotData)
143
+ jackpot_data: transformGamesJackpot(gamesJackpotData),
144
+ relationKeys: themeOptions?.pickRelationKeys?.game,
136
145
  });
137
146
 
138
147
  const operatorData = transformOperators(
@@ -153,26 +162,31 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
153
162
  countries: countriesData,
154
163
  currencies: currenciesData,
155
164
  payments: paymentData,
156
- })
165
+ });
157
166
 
158
167
  const cryptoBrokersData = transformCryptosData(cryptoBrokers, {
159
168
  countries: countriesData,
160
169
  currencies: currenciesData,
161
170
  payments: paymentData,
162
- })
171
+ });
163
172
 
164
173
  const cryptoWalletsData = transformCryptosData(cryptoWallets, {
165
174
  countries: countriesData,
166
175
  currencies: currenciesData,
167
176
  payments: paymentData,
168
- })
169
-
177
+ });
170
178
 
171
- if (["rage_seo", "rage_ppc", "sports"].includes(siteSettingsData.general[siteId].type)) {
172
- const teamIds = Object.values(sportsData.teams).map((team) => String(team.livegoals_v2_id));
179
+ if (
180
+ ["rage_seo", "rage_ppc", "sports"].includes(
181
+ siteSettingsData.general[siteId].type
182
+ )
183
+ ) {
184
+ const teamIds = Object.values(sportsData.teams).map((team) =>
185
+ String(team.livegoals_v2_id)
186
+ );
173
187
  const teamKits = await getTeamJerseys(teamIds);
174
188
 
175
- sportsData.team_kits = groupBy(teamKits, 'participant_id');
189
+ sportsData.team_kits = groupBy(teamKits, "participant_id");
176
190
  }
177
191
 
178
192
  return {
@@ -200,6 +214,6 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
200
214
  cryptoBrokersData,
201
215
  cryptoWalletsData,
202
216
  commentsData,
203
- licensesData
217
+ licensesData,
204
218
  };
205
219
  };