gatsby-matrix-theme 52.0.18 → 52.0.20

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,17 @@
1
+ ## [52.0.20](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v52.0.19...v52.0.20) (2024-10-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * preview and update version ([ef42724](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/ef42724ca0e2441c1d76e44b6ced83348bb7baa3))
7
+
8
+ ## [52.0.19](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v52.0.18...v52.0.19) (2024-10-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * sitemap ([ebd6a88](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/ebd6a88d2210d6e777a2f721d167ed6b6e22a9c8))
14
+
1
15
  ## [52.0.18](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v52.0.17...v52.0.18) (2024-10-11)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "52.0.18",
3
+ "version": "52.0.20",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -25,9 +25,10 @@
25
25
  "dependencies": {
26
26
  "@react-icons/all-files": "^4.1.0",
27
27
  "gatsby": "^5.11.0",
28
- "gatsby-core-theme": "40.0.2",
28
+ "gatsby-core-theme": "40.0.4",
29
29
  "gatsby-plugin-sharp": "^5.11.0",
30
30
  "gatsby-transformer-sharp": "^5.11.0",
31
+ "gatsby-plugin-sitemap": "^6.13.1",
31
32
  "prop-types": "15.7.2",
32
33
  "react": "^18.2.0",
33
34
  "react-dom": "^18.2.0"
@@ -7,8 +7,56 @@ import { getResultsById, getLatestResults, getAvailableDrawDays, getLottoUKdata,
7
7
  import loadSource from '~helpers/search-source';
8
8
  import { deparam } from '~helpers/strings';
9
9
  import { groupBy } from '~helpers/getters';
10
+ import {getData} from '~helpers/api'
11
+ import { fetchSiteSettings } from '~helpers/fetch-site-settings';
12
+ import processor from '~helpers/processor';
13
+
14
+
15
+ export async function getAPIData(page, url, header, preview) {
16
+
17
+ if (preview) {
18
+ try {
19
+ const siteName = process.env.GATSBY_SITE_NAME;
20
+ const params = deparam(url.split('?')[1]);
21
+ // eslint-disable-next-line camelcase
22
+ const response = await getData(siteName, params?.path, params?.market_id, true);
23
+ const {siteSettingsData, siteGeneralData, responsableGamingData, toplistData, contentData} = await fetchSiteSettings(siteName, true);
24
+
25
+ const pagePreview = response.pages.preview;
26
+
27
+ const processed = processor.run({
28
+ ...response,
29
+ siteSettingsData,
30
+ general: siteGeneralData,
31
+ prefilled_market_modules:siteSettingsData.prefilled_modules,
32
+ responsible_gamings: responsableGamingData,
33
+ toplist: toplistData,
34
+ content: contentData
35
+ },{}, null, true);
36
+
37
+ const { path } = processed.pages[pagePreview.market].preview[0];
38
+
39
+ const pagePreviewProcessed = processed.pages[pagePreview.market][
40
+ pagePreview.relation_type
41
+ // eslint-disable-next-line no-shadow
42
+ ].find((page) => page.path === path);
43
+
44
+ return {
45
+ props: {
46
+ marketSections: processed.market_sections[pagePreview.market],
47
+ prefilledModules: processed.prefilled_market_modules[pagePreview.market],
48
+ page: pagePreviewProcessed,
49
+ allMarkets: processed.site_markets,
50
+ siteInfo: processed.general
51
+ }
52
+ };
53
+ } catch (error) {
54
+ // eslint-disable-next-line no-console
55
+ console.log("Error fetching preview data:", error);
56
+ }
57
+ }
58
+
10
59
 
11
- export async function getAPIData(page, url) {
12
60
  if (page.path.endsWith('/s') || page.path === 's') {
13
61
  const results = await loadSource(page.market);
14
62
  if (page.path.endsWith('/s') || page.path === 's') {