@anywayseo/tools 4.2.2 → 5.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.
Files changed (76) hide show
  1. package/dist/components/base/index.d.ts +1 -0
  2. package/dist/components/base/link/index.d.ts +2 -0
  3. package/dist/components/base/link/utils.d.ts +1 -0
  4. package/dist/components/game-info/utils.d.ts +2 -2
  5. package/dist/components/index.cjs +3 -1
  6. package/dist/components/index.mjs +3 -1
  7. package/dist/components/layout/header/locale-switcher/icons/earth/index.d.ts +2 -0
  8. package/dist/components/layout/header/locale-switcher/icons/france/index.d.ts +2 -0
  9. package/dist/components/layout/header/locale-switcher/icons/germany/index.d.ts +2 -0
  10. package/dist/components/layout/header/locale-switcher/icons/globe/index.d.ts +2 -0
  11. package/dist/components/layout/header/locale-switcher/icons/index.d.ts +6 -0
  12. package/dist/components/layout/header/locale-switcher/icons/italy/index.d.ts +2 -0
  13. package/dist/components/layout/header/locale-switcher/icons/russia/index.d.ts +2 -0
  14. package/dist/components/layout/header/locale-switcher/index.d.ts +8 -0
  15. package/dist/components/layout/header/locale-switcher/utils.d.ts +2 -0
  16. package/dist/components/layout/header/navigation/desktop/index.d.ts +1 -1
  17. package/dist/components/layout/header/navigation/index.d.ts +1 -1
  18. package/dist/components/layout/header/navigation/mobile/index.d.ts +1 -1
  19. package/dist/components/seo/index.d.ts +2 -3
  20. package/dist/hooks/index.cjs +4 -2
  21. package/dist/hooks/index.d.ts +1 -0
  22. package/dist/hooks/index.mjs +4 -2
  23. package/dist/hooks/use-localization/index.d.ts +9 -0
  24. package/dist/i18n/index.cjs +11 -5
  25. package/dist/i18n/index.d.ts +3 -2
  26. package/dist/i18n/index.mjs +11 -5
  27. package/dist/i18n/resources/fr/index.d.ts +112 -0
  28. package/dist/index-At00w6EN.js +9 -0
  29. package/dist/index-B9GEoC68.js +63 -0
  30. package/dist/{index-DAbZBo7_.mjs → index-BCuXOiT9.mjs} +201 -67
  31. package/dist/{index-BPLxhZG_.js → index-BHfpWNqh.js} +183 -73
  32. package/dist/{index-DF_u_tzx.js → index-BIdYBT1G.js} +7 -3
  33. package/dist/{index-MpNfBHkQ.mjs → index-BJRvnR8Q.mjs} +1 -5
  34. package/dist/index-BRVKhbs6.mjs +6 -0
  35. package/dist/index-BmaWfWLV.mjs +10 -0
  36. package/dist/{index-BV0hDmYP.js → index-BnmGE5_x.js} +3 -2
  37. package/dist/{index-DPO0aIC3.mjs → index-Bu4S7kG8.mjs} +7 -10
  38. package/dist/index-BzbpMLDD.mjs +23 -0
  39. package/dist/{index-DVcQxWMZ.js → index-C6MG_f24.js} +0 -4
  40. package/dist/{index-BE9gNdXx.mjs → index-CACDltm3.mjs} +183 -73
  41. package/dist/index-CYr1ct1t.js +93 -0
  42. package/dist/index-CbuiYkSg.js +5 -0
  43. package/dist/{index-CcsbqDXL.mjs → index-CrmmG8yy.mjs} +7 -3
  44. package/dist/{index-N8nXj4-i.js → index-D0yXUsJz.js} +220 -86
  45. package/dist/{index-DuQjQMNN.js → index-D34TfBTR.js} +7 -10
  46. package/dist/{index-CkTgVjZS.mjs → index-QazOxABc.mjs} +3 -2
  47. package/dist/index-WFgDSB1A.js +22 -0
  48. package/dist/index-cQqALZIW.mjs +94 -0
  49. package/dist/index-tJcccH0B.mjs +64 -0
  50. package/dist/index.cjs +43 -31
  51. package/dist/index.mjs +33 -21
  52. package/dist/providers/index.cjs +4 -2
  53. package/dist/providers/index.d.ts +1 -0
  54. package/dist/providers/index.mjs +5 -3
  55. package/dist/providers/page-provider/index.d.ts +11 -0
  56. package/dist/providers/site-provider/index.d.ts +5 -4
  57. package/dist/types/api/index.d.ts +2 -2
  58. package/dist/types/components/icon/index.d.ts +2 -0
  59. package/dist/types/components/index.d.ts +2 -0
  60. package/dist/types/components/locale-switcher/index.d.ts +5 -0
  61. package/dist/types/components/navigation/index.d.ts +9 -10
  62. package/dist/types/i18n/index.d.ts +7 -1
  63. package/dist/types/site/index.d.ts +15 -13
  64. package/dist/utils/api/index.d.ts +5 -0
  65. package/dist/utils/date/index.d.ts +4 -3
  66. package/dist/utils/index.cjs +23 -16
  67. package/dist/utils/index.d.ts +1 -0
  68. package/dist/utils/index.mjs +16 -9
  69. package/dist/utils/navigation/index.d.ts +2 -2
  70. package/dist/utils/numbers/index.d.ts +3 -3
  71. package/package.json +1 -1
  72. package/dist/components/layout/header/navigation/types.d.ts +0 -4
  73. package/dist/index-BClxYYix.js +0 -40
  74. package/dist/index-BNb-P8a6.mjs +0 -17
  75. package/dist/index-BhsXlbd8.js +0 -16
  76. package/dist/index-Ca_M-II5.mjs +0 -41
@@ -0,0 +1,94 @@
1
+ const DUMMY_PAGE_TYPE = "DUMMY";
2
+ const NavigationSlug = {
3
+ HEADER: "header-navigation",
4
+ FOOTER: "footer-navigation"
5
+ };
6
+ function isValidPath(value) {
7
+ return typeof value === "string" && (value === "" || value.startsWith("/"));
8
+ }
9
+ function isValidType(value) {
10
+ return typeof value === "string" && value !== DUMMY_PAGE_TYPE;
11
+ }
12
+ function transformNavItems(items) {
13
+ if (!items || !items.length) {
14
+ return [];
15
+ }
16
+ const transformed = [];
17
+ items.forEach((item) => {
18
+ var _a;
19
+ if (item && item.title && isValidType(item.type) && isValidPath(item.path)) {
20
+ const isNavGroup = (_a = item.items) == null ? void 0 : _a.length;
21
+ transformed.push({
22
+ label: item.title,
23
+ slug: isNavGroup ? "" : item.path.slice(1),
24
+ ...isNavGroup && { children: transformNavItems(item.items) }
25
+ });
26
+ }
27
+ });
28
+ return transformed;
29
+ }
30
+ function transformSiteNavigation(strapiNavigation) {
31
+ const siteNavigation = {
32
+ header: {},
33
+ footer: {}
34
+ };
35
+ if (!strapiNavigation) {
36
+ return siteNavigation;
37
+ }
38
+ const groups = strapiNavigation.items;
39
+ for (const group of groups ?? []) {
40
+ const { slug, locale, items } = group ?? {};
41
+ if (locale && slug === NavigationSlug.HEADER) {
42
+ siteNavigation.header[locale] = transformNavItems(items ?? []);
43
+ }
44
+ if (locale && slug === NavigationSlug.FOOTER) {
45
+ siteNavigation.footer[locale] = transformNavItems(items ?? []);
46
+ }
47
+ }
48
+ return siteNavigation;
49
+ }
50
+ function getNavigation(fallback, strapiNavigation) {
51
+ const siteNavigation = {
52
+ header: fallback.header,
53
+ footer: fallback.footer
54
+ };
55
+ if (!strapiNavigation) {
56
+ return siteNavigation;
57
+ }
58
+ const navigation = transformSiteNavigation(strapiNavigation);
59
+ siteNavigation.header = { ...siteNavigation.header, ...navigation.header };
60
+ siteNavigation.footer = { ...siteNavigation.footer, ...navigation.footer };
61
+ return siteNavigation;
62
+ }
63
+ function getSiteName(url) {
64
+ if (!url) {
65
+ return "";
66
+ }
67
+ return url.replace(/^https?:\/\//, "");
68
+ }
69
+ function getLocale(defaultLocaleCode, locales) {
70
+ let locale = { code: "en", name: "Default" };
71
+ if (defaultLocaleCode && (locales == null ? void 0 : locales.length)) {
72
+ const foundLocale = locales.find(({ code }) => code === defaultLocaleCode);
73
+ if (foundLocale) {
74
+ locale = foundLocale;
75
+ }
76
+ }
77
+ return locale;
78
+ }
79
+ function getLocales(defaultLocaleCode, locales) {
80
+ if (!locales) {
81
+ return [];
82
+ }
83
+ return [...locales].sort((a, b) => {
84
+ if (a.code === defaultLocaleCode) return -1;
85
+ if (b.code === defaultLocaleCode) return 1;
86
+ return 0;
87
+ });
88
+ }
89
+ export {
90
+ getSiteName as a,
91
+ getLocale as b,
92
+ getLocales as c,
93
+ getNavigation as g
94
+ };
@@ -0,0 +1,64 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo, forwardRef } from "react";
3
+ import { Link as Link$1 } from "gatsby";
4
+ import "@chakra-ui/react";
5
+ import "@mdx-js/react";
6
+ import "react-i18next";
7
+ import "./index-BJRvnR8Q.mjs";
8
+ import "./index-CACDltm3.mjs";
9
+ import { u as useLocalization } from "./index-BzbpMLDD.mjs";
10
+ import { i as isRelativePath } from "./index-BmaWfWLV.mjs";
11
+ const SiteContext = createContext(null);
12
+ const SiteProvider = ({ children, ...context }) => {
13
+ const value = useMemo(() => context, []);
14
+ return /* @__PURE__ */ jsx(SiteContext.Provider, { value, children });
15
+ };
16
+ function useSiteContext() {
17
+ const context = useContext(SiteContext);
18
+ if (!context) {
19
+ throw new Error("useSiteContext must be used within SiteProvider");
20
+ }
21
+ return context;
22
+ }
23
+ const PageContext = createContext(null);
24
+ const PageProvider = ({ children, location }) => {
25
+ const { localization } = useSiteContext();
26
+ const { currentLocale } = useLocalization({ location, ...localization });
27
+ const value = useMemo(() => ({ currentLocale }), [currentLocale]);
28
+ return /* @__PURE__ */ jsx(PageContext.Provider, { value, children });
29
+ };
30
+ function usePageContext() {
31
+ const context = useContext(PageContext);
32
+ if (!context) {
33
+ throw new Error("usePageContext must be used within PageProvider");
34
+ }
35
+ return context;
36
+ }
37
+ function normalizePath(path = "") {
38
+ return path.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/");
39
+ }
40
+ function getLocalizedPath(path, currentLocaleCode, defaultLocaleCode) {
41
+ const localePrefix = currentLocaleCode === defaultLocaleCode ? "/" : `/${currentLocaleCode}/`;
42
+ if (path === "/") {
43
+ return localePrefix;
44
+ }
45
+ if (isRelativePath(path)) {
46
+ const maybeLocaleCode = path.split("/")[1];
47
+ return maybeLocaleCode === defaultLocaleCode ? "/" : path;
48
+ }
49
+ return `${localePrefix}${normalizePath(path)}`;
50
+ }
51
+ const Link = forwardRef(({ to, ...props }, ref) => {
52
+ const { localization } = useSiteContext();
53
+ const { currentLocale } = usePageContext();
54
+ const defaultLocale = localization.defaultLocale;
55
+ const path = getLocalizedPath(to, currentLocale.code, defaultLocale.code);
56
+ return /* @__PURE__ */ jsx(Link$1, { ref, to: path, ...props });
57
+ });
58
+ export {
59
+ Link as L,
60
+ PageProvider as P,
61
+ SiteProvider as S,
62
+ useSiteContext as a,
63
+ usePageContext as u
64
+ };
package/dist/index.cjs CHANGED
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-N8nXj4-i.js");
4
- const index$1 = require("./index-BV0hDmYP.js");
5
- const i18n$1 = require("./index-BPLxhZG_.js");
6
- const index$2 = require("./index-DF_u_tzx.js");
7
- const index$3 = require("./index-BhsXlbd8.js");
8
- const index$4 = require("./index-DVcQxWMZ.js");
9
- const index$5 = require("./index-DuQjQMNN.js");
10
- const index$6 = require("./index-BClxYYix.js");
11
- const i18n = require("i18next");
3
+ const index = require("./index-D0yXUsJz.js");
4
+ const index$1 = require("./index-B9GEoC68.js");
5
+ const index$2 = require("./index-WFgDSB1A.js");
6
+ const index$3 = require("./index-BnmGE5_x.js");
7
+ const i18n = require("./i18n/index.cjs");
8
+ const index$4 = require("./index-BIdYBT1G.js");
9
+ const index$5 = require("./index-BHfpWNqh.js");
10
+ const index$6 = require("./index-C6MG_f24.js");
11
+ const index$7 = require("./index-CYr1ct1t.js");
12
+ const index$8 = require("./index-D34TfBTR.js");
13
+ const index$9 = require("./index-At00w6EN.js");
14
+ const index$a = require("./index-CbuiYkSg.js");
12
15
  exports.Author = index.Author;
13
16
  exports.AuthorCard = index.AuthorCard;
14
17
  exports.BonusCard = index.BonusCard;
@@ -34,25 +37,34 @@ exports.StrapiContentRenderer = index.StrapiContentRenderer;
34
37
  exports.Table = index.Table;
35
38
  exports.Tabs = index.Tabs;
36
39
  exports.Tip = index.Tip;
37
- exports.usePrimaryColors = index$1.usePrimaryColors;
38
- exports.GameCharacteristic = i18n$1.GameCharacteristic;
39
- exports.GameVolatility = i18n$1.GameVolatility;
40
- exports.resources = i18n$1.resources;
41
- exports.MdxProvider = index$2.MdxProvider;
42
- exports.SiteProvider = index$3.SiteProvider;
43
- exports.useSiteContext = index$3.useSiteContext;
44
- exports.Animation = index$4.Animation;
45
- exports.DARK_THEME_COLOR = index$4.DARK_THEME_COLOR;
46
- exports.LIGHT_THEME_COLOR = index$4.LIGHT_THEME_COLOR;
47
- exports.formatDate = index$5.formatDate;
48
- exports.formatNumber = index$5.formatNumber;
49
- exports.getCurrencySymbol = index$5.getCurrencySymbol;
50
- exports.getCurrentMonth = index$5.getCurrentMonth;
51
- exports.getCurrentYear = index$5.getCurrentYear;
52
- exports.getSeededRandomComparator = index$5.getSeededRandomComparator;
53
- exports.parseNumber = index$5.parseNumber;
54
- exports.randomComparator = index$5.randomComparator;
55
- exports.round = index$5.round;
56
- exports.toFixedTwo = index$5.toFixedTwo;
57
- exports.transformSiteNavigation = index$6.transformSiteNavigation;
58
- exports.i18n = i18n;
40
+ exports.Link = index$1.Link;
41
+ exports.PageProvider = index$1.PageProvider;
42
+ exports.SiteProvider = index$1.SiteProvider;
43
+ exports.usePageContext = index$1.usePageContext;
44
+ exports.useSiteContext = index$1.useSiteContext;
45
+ exports.useLocalization = index$2.useLocalization;
46
+ exports.usePrimaryColors = index$3.usePrimaryColors;
47
+ exports.DEFAULT_LANGUAGE = i18n.DEFAULT_LANGUAGE;
48
+ exports.resources = i18n.resources;
49
+ exports.MdxProvider = index$4.MdxProvider;
50
+ exports.GameCharacteristic = index$5.GameCharacteristic;
51
+ exports.GameVolatility = index$5.GameVolatility;
52
+ exports.Animation = index$6.Animation;
53
+ exports.getLocale = index$7.getLocale;
54
+ exports.getLocales = index$7.getLocales;
55
+ exports.getNavigation = index$7.getNavigation;
56
+ exports.getSiteName = index$7.getSiteName;
57
+ exports.formatDate = index$8.formatDate;
58
+ exports.formatNumber = index$8.formatNumber;
59
+ exports.getCurrencySymbol = index$8.getCurrencySymbol;
60
+ exports.getCurrentMonth = index$8.getCurrentMonth;
61
+ exports.getCurrentYear = index$8.getCurrentYear;
62
+ exports.getSeededRandomComparator = index$8.getSeededRandomComparator;
63
+ exports.parseNumber = index$8.parseNumber;
64
+ exports.randomComparator = index$8.randomComparator;
65
+ exports.round = index$8.round;
66
+ exports.toFixedTwo = index$8.toFixedTwo;
67
+ exports.buildPath = index$9.buildPath;
68
+ exports.isRelativePath = index$9.isRelativePath;
69
+ exports.DARK_THEME_COLOR = index$a.DARK_THEME_COLOR;
70
+ exports.LIGHT_THEME_COLOR = index$a.LIGHT_THEME_COLOR;
package/dist/index.mjs CHANGED
@@ -1,12 +1,15 @@
1
- import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "./index-DAbZBo7_.mjs";
2
- import { u } from "./index-CkTgVjZS.mjs";
3
- import { a as a2, G as G2, r } from "./index-BE9gNdXx.mjs";
4
- import { M } from "./index-CcsbqDXL.mjs";
5
- import { S as S2, u as u2 } from "./index-BNb-P8a6.mjs";
6
- import { A as A2, D, L as L2 } from "./index-MpNfBHkQ.mjs";
7
- import { f as f2, b as b2, c as c2, a as a3, g as g2, e as e2, p, d as d2, r as r2, t } from "./index-DPO0aIC3.mjs";
8
- import { t as t2 } from "./index-Ca_M-II5.mjs";
9
- import { default as default2 } from "i18next";
1
+ import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "./index-BCuXOiT9.mjs";
2
+ import { L as L2, P as P2, S as S2, u, a as a2 } from "./index-tJcccH0B.mjs";
3
+ import { u as u2 } from "./index-BzbpMLDD.mjs";
4
+ import { u as u3 } from "./index-QazOxABc.mjs";
5
+ import { DEFAULT_LANGUAGE, resources } from "./i18n/index.mjs";
6
+ import { M } from "./index-CrmmG8yy.mjs";
7
+ import { a as a3, G as G2 } from "./index-CACDltm3.mjs";
8
+ import { A as A2 } from "./index-BJRvnR8Q.mjs";
9
+ import { b as b2, c as c2, g as g2, a as a4 } from "./index-cQqALZIW.mjs";
10
+ import { f as f2, b as b3, c as c3, a as a5, g as g3, e as e2, p, d as d2, r, t } from "./index-Bu4S7kG8.mjs";
11
+ import { b as b4, i as i2 } from "./index-BmaWfWLV.mjs";
12
+ import { D, L as L3 } from "./index-BRVKhbs6.mjs";
10
13
  export {
11
14
  A2 as Animation,
12
15
  k as Author,
@@ -16,23 +19,26 @@ export {
16
19
  l as Center,
17
20
  C as ContactForm,
18
21
  D as DARK_THEME_COLOR,
22
+ DEFAULT_LANGUAGE,
19
23
  F as Faq,
20
24
  b as FeatureCard,
21
25
  c as FeatureCardGrid,
22
26
  G as GameCard,
23
27
  d as GameCardGrid,
24
- a2 as GameCharacteristic,
28
+ a3 as GameCharacteristic,
25
29
  e as GameDemo,
26
30
  f as GameInfo,
27
31
  G2 as GameVolatility,
28
32
  m as Grid,
29
33
  H as HowTo,
30
- L2 as LIGHT_THEME_COLOR,
34
+ L3 as LIGHT_THEME_COLOR,
31
35
  L as Layout,
36
+ L2 as Link,
32
37
  n as LinkButton,
33
38
  g as List,
34
39
  M as MdxProvider,
35
40
  N as NotFound,
41
+ P2 as PageProvider,
36
42
  P as ProsCons,
37
43
  S as Seo,
38
44
  S2 as SiteProvider,
@@ -40,19 +46,25 @@ export {
40
46
  T as Table,
41
47
  i as Tabs,
42
48
  j as Tip,
49
+ b4 as buildPath,
43
50
  f2 as formatDate,
44
- b2 as formatNumber,
45
- c2 as getCurrencySymbol,
46
- a3 as getCurrentMonth,
47
- g2 as getCurrentYear,
51
+ b3 as formatNumber,
52
+ c3 as getCurrencySymbol,
53
+ a5 as getCurrentMonth,
54
+ g3 as getCurrentYear,
55
+ b2 as getLocale,
56
+ c2 as getLocales,
57
+ g2 as getNavigation,
48
58
  e2 as getSeededRandomComparator,
49
- default2 as i18n,
59
+ a4 as getSiteName,
60
+ i2 as isRelativePath,
50
61
  p as parseNumber,
51
62
  d2 as randomComparator,
52
- r as resources,
53
- r2 as round,
63
+ resources,
64
+ r as round,
54
65
  t as toFixedTwo,
55
- t2 as transformSiteNavigation,
56
- u as usePrimaryColors,
57
- u2 as useSiteContext
66
+ u2 as useLocalization,
67
+ u as usePageContext,
68
+ u3 as usePrimaryColors,
69
+ a2 as useSiteContext
58
70
  };
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-DF_u_tzx.js");
4
- const index$1 = require("../index-BhsXlbd8.js");
3
+ const index = require("../index-BIdYBT1G.js");
4
+ const index$1 = require("../index-B9GEoC68.js");
5
5
  exports.MdxProvider = index.MdxProvider;
6
+ exports.PageProvider = index$1.PageProvider;
6
7
  exports.SiteProvider = index$1.SiteProvider;
8
+ exports.usePageContext = index$1.usePageContext;
7
9
  exports.useSiteContext = index$1.useSiteContext;
@@ -1,2 +1,3 @@
1
1
  export { default as MdxProvider } from './mdx-provider';
2
+ export { default as PageProvider, usePageContext } from './page-provider';
2
3
  export { default as SiteProvider, useSiteContext } from './site-provider';
@@ -1,7 +1,9 @@
1
- import { M } from "../index-CcsbqDXL.mjs";
2
- import { S, u } from "../index-BNb-P8a6.mjs";
1
+ import { M } from "../index-CrmmG8yy.mjs";
2
+ import { P, S, u, a } from "../index-tJcccH0B.mjs";
3
3
  export {
4
4
  M as MdxProvider,
5
+ P as PageProvider,
5
6
  S as SiteProvider,
6
- u as useSiteContext
7
+ u as usePageContext,
8
+ a as useSiteContext
7
9
  };
@@ -0,0 +1,11 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ILocale } from '../../types';
3
+ interface IPageContextInput {
4
+ location: Location;
5
+ }
6
+ interface IPageContext {
7
+ currentLocale: ILocale;
8
+ }
9
+ declare const PageProvider: FC<PropsWithChildren<IPageContextInput>>;
10
+ export default PageProvider;
11
+ export declare function usePageContext(): IPageContext;
@@ -1,10 +1,11 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- import { ISiteConfigs, ISiteMetadata } from '../../types';
2
+ import { ISiteConfig, ISiteLocalization, ISiteMetadata, ISiteNavigation } from '../../types';
3
3
  interface ISiteContext {
4
4
  metadata: ISiteMetadata;
5
- configs?: ISiteConfigs;
5
+ navigation: ISiteNavigation;
6
+ localization: ISiteLocalization;
7
+ config: ISiteConfig;
6
8
  }
7
- type SiteMetadataProviderProps = ISiteContext;
8
- declare const SiteProvider: FC<PropsWithChildren<SiteMetadataProviderProps>>;
9
+ declare const SiteProvider: FC<PropsWithChildren<ISiteContext>>;
9
10
  export default SiteProvider;
10
11
  export declare function useSiteContext(): ISiteContext;
@@ -2,7 +2,7 @@ export interface IStrapiNavigation {
2
2
  readonly items: ReadonlyArray<IStrapiNavigationGroup | null> | null;
3
3
  }
4
4
  export interface IStrapiNavigationGroup {
5
- readonly name: string | null;
5
+ readonly locale: string | null;
6
6
  readonly slug: string | null;
7
7
  readonly items: ReadonlyArray<IStrapiNavigationItem | null> | null;
8
8
  }
@@ -11,6 +11,6 @@ export interface IStrapiNavigationItem {
11
11
  readonly title: string | null;
12
12
  readonly slug: string | null;
13
13
  readonly path: string | null;
14
- readonly menuAttached: boolean | null;
15
14
  readonly items: ReadonlyArray<IStrapiNavigationItem | null> | null;
15
+ readonly menuAttached?: boolean | null;
16
16
  }
@@ -0,0 +1,2 @@
1
+ import { FC, SVGProps } from 'react';
2
+ export type IconComponent = FC<SVGProps<SVGSVGElement>>;
@@ -7,8 +7,10 @@ export * from './game-card';
7
7
  export * from './game-info';
8
8
  export * from './grid';
9
9
  export * from './how-to';
10
+ export * from './icon';
10
11
  export * from './image';
11
12
  export * from './link';
13
+ export * from './locale-switcher';
12
14
  export * from './navigation';
13
15
  export * from './pros-cons';
14
16
  export * from './strapi-component';
@@ -0,0 +1,5 @@
1
+ import { ILocale } from '../../i18n';
2
+ import { IconComponent } from '../icon';
3
+ export interface ILocaleMenuItem extends ILocale {
4
+ icon: IconComponent;
5
+ }
@@ -1,13 +1,12 @@
1
- type Path = `/${string}`;
2
- type EmptyPath = '';
3
- type IndexPath = '/';
4
- export interface INavItem<P extends Path = Path> {
5
- path: P | EmptyPath;
1
+ import { ILocale } from '../../i18n';
2
+ export interface INavItem {
3
+ slug: string;
6
4
  label: string;
7
- children?: ISubNavItem[];
5
+ children?: Omit<INavItem, 'children'>[];
8
6
  }
9
- export interface ISubNavItem<P extends Path = Path> {
10
- path: P | IndexPath;
11
- label: string;
7
+ export interface INavigation {
8
+ [locale: ILocale['code']]: INavItem[] | undefined;
12
9
  }
13
- export {};
10
+ export type NavigationProps = {
11
+ menu: INavItem[];
12
+ };
@@ -1,2 +1,8 @@
1
- export type LanguageCode = 'en' | 'it' | 'de' | 'ru';
1
+ export type LanguageCode = 'en' | 'it' | 'de' | 'fr' | 'ru';
2
2
  export type Currency = 'USD' | 'EUR' | 'GBP' | 'RUB';
3
+ type LocaleCode = string;
4
+ export interface ILocale {
5
+ code: LocaleCode;
6
+ name: string;
7
+ }
8
+ export {};
@@ -1,35 +1,37 @@
1
1
  import { ReactNode } from 'react';
2
- import { Image, INavItem } from '../components';
2
+ import { Image, INavigation } from '../components';
3
3
  import { ISeo } from '../content';
4
- import { Currency, LanguageCode } from '../i18n';
4
+ import { Currency, ILocale } from '../i18n';
5
5
  interface ISiteHeaderConfig {
6
- navigation?: INavItem[];
7
6
  toolbar?: ReactNode;
8
7
  }
9
8
  interface ISiteFooterConfig {
10
- navigation?: INavItem[];
11
9
  extra?: ReactNode;
12
10
  showDisclaimer?: boolean;
13
11
  }
14
12
  interface ISiteThemeConfig {
15
13
  isInvertedColor?: boolean;
16
14
  }
17
- export interface ISiteConfigs {
15
+ export interface ISiteConfig {
16
+ theme?: ISiteThemeConfig;
18
17
  header?: ISiteHeaderConfig;
19
18
  footer?: ISiteFooterConfig;
20
- theme?: ISiteThemeConfig;
19
+ }
20
+ export interface ISiteNavigation {
21
+ header: INavigation;
22
+ footer: INavigation;
23
+ }
24
+ export interface ISiteLocalization {
25
+ currency: Currency | Currency[];
26
+ defaultLocale: ILocale;
27
+ locales: ILocale[];
21
28
  }
22
29
  export interface ISiteMetadata {
23
30
  name: string;
24
- logo: Image;
25
- lang: LanguageCode;
26
- currency: Currency | Currency[];
31
+ lang: ILocale['code'];
27
32
  seo: ISeo;
33
+ logo: Image;
28
34
  /** Planned */
29
35
  favicon?: Image;
30
36
  }
31
- export interface ISiteNavigation {
32
- header: INavItem[];
33
- footer: INavItem[];
34
- }
35
37
  export {};
@@ -0,0 +1,5 @@
1
+ import { ILocale, ISiteNavigation, IStrapiNavigation } from '../../types';
2
+ export declare function getNavigation(fallback: ISiteNavigation, strapiNavigation?: IStrapiNavigation | null): ISiteNavigation;
3
+ export declare function getSiteName(url?: string | null): string;
4
+ export declare function getLocale(defaultLocaleCode: ILocale['code'], locales?: ILocale[] | null): ILocale;
5
+ export declare function getLocales(defaultLocaleCode: ILocale['code'], locales?: ILocale[] | null): ILocale[];
@@ -1,8 +1,9 @@
1
- export declare function getCurrentYear(): string;
2
- export declare function getCurrentMonth(): string;
1
+ import { ILocale } from '../../types';
2
+ export declare function getCurrentYear(locale?: ILocale['code']): string;
3
+ export declare function getCurrentMonth(locale?: ILocale['code']): string;
3
4
  interface IFormatDateOptions {
4
5
  value: string | number | Date;
5
- locale?: string;
6
+ locale?: ILocale['code'];
6
7
  options?: Intl.DateTimeFormatOptions;
7
8
  }
8
9
  export declare function formatDate({ value, locale, options }: IFormatDateOptions): string;
@@ -1,19 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-DVcQxWMZ.js");
4
- const index$1 = require("../index-DuQjQMNN.js");
5
- const index$2 = require("../index-BClxYYix.js");
3
+ const index = require("../index-C6MG_f24.js");
4
+ const index$1 = require("../index-CYr1ct1t.js");
5
+ const index$2 = require("../index-D34TfBTR.js");
6
+ const index$3 = require("../index-At00w6EN.js");
7
+ const index$4 = require("../index-CbuiYkSg.js");
6
8
  exports.Animation = index.Animation;
7
- exports.DARK_THEME_COLOR = index.DARK_THEME_COLOR;
8
- exports.LIGHT_THEME_COLOR = index.LIGHT_THEME_COLOR;
9
- exports.formatDate = index$1.formatDate;
10
- exports.formatNumber = index$1.formatNumber;
11
- exports.getCurrencySymbol = index$1.getCurrencySymbol;
12
- exports.getCurrentMonth = index$1.getCurrentMonth;
13
- exports.getCurrentYear = index$1.getCurrentYear;
14
- exports.getSeededRandomComparator = index$1.getSeededRandomComparator;
15
- exports.parseNumber = index$1.parseNumber;
16
- exports.randomComparator = index$1.randomComparator;
17
- exports.round = index$1.round;
18
- exports.toFixedTwo = index$1.toFixedTwo;
19
- exports.transformSiteNavigation = index$2.transformSiteNavigation;
9
+ exports.getLocale = index$1.getLocale;
10
+ exports.getLocales = index$1.getLocales;
11
+ exports.getNavigation = index$1.getNavigation;
12
+ exports.getSiteName = index$1.getSiteName;
13
+ exports.formatDate = index$2.formatDate;
14
+ exports.formatNumber = index$2.formatNumber;
15
+ exports.getCurrencySymbol = index$2.getCurrencySymbol;
16
+ exports.getCurrentMonth = index$2.getCurrentMonth;
17
+ exports.getCurrentYear = index$2.getCurrentYear;
18
+ exports.getSeededRandomComparator = index$2.getSeededRandomComparator;
19
+ exports.parseNumber = index$2.parseNumber;
20
+ exports.randomComparator = index$2.randomComparator;
21
+ exports.round = index$2.round;
22
+ exports.toFixedTwo = index$2.toFixedTwo;
23
+ exports.buildPath = index$3.buildPath;
24
+ exports.isRelativePath = index$3.isRelativePath;
25
+ exports.DARK_THEME_COLOR = index$4.DARK_THEME_COLOR;
26
+ exports.LIGHT_THEME_COLOR = index$4.LIGHT_THEME_COLOR;
@@ -1,4 +1,5 @@
1
1
  export * from './animation';
2
+ export * from './api';
2
3
  export * from './date';
3
4
  export * from './navigation';
4
5
  export * from './numbers';
@@ -1,19 +1,26 @@
1
- import { A, D, L } from "../index-MpNfBHkQ.mjs";
2
- import { f, b, c, a, g, e, p, d, r, t } from "../index-DPO0aIC3.mjs";
3
- import { t as t2 } from "../index-Ca_M-II5.mjs";
1
+ import { A } from "../index-BJRvnR8Q.mjs";
2
+ import { b, c, g, a } from "../index-cQqALZIW.mjs";
3
+ import { f, b as b2, c as c2, a as a2, g as g2, e, p, d, r, t } from "../index-Bu4S7kG8.mjs";
4
+ import { b as b3, i } from "../index-BmaWfWLV.mjs";
5
+ import { D, L } from "../index-BRVKhbs6.mjs";
4
6
  export {
5
7
  A as Animation,
6
8
  D as DARK_THEME_COLOR,
7
9
  L as LIGHT_THEME_COLOR,
10
+ b3 as buildPath,
8
11
  f as formatDate,
9
- b as formatNumber,
10
- c as getCurrencySymbol,
11
- a as getCurrentMonth,
12
- g as getCurrentYear,
12
+ b2 as formatNumber,
13
+ c2 as getCurrencySymbol,
14
+ a2 as getCurrentMonth,
15
+ g2 as getCurrentYear,
16
+ b as getLocale,
17
+ c as getLocales,
18
+ g as getNavigation,
13
19
  e as getSeededRandomComparator,
20
+ a as getSiteName,
21
+ i as isRelativePath,
14
22
  p as parseNumber,
15
23
  d as randomComparator,
16
24
  r as round,
17
- t as toFixedTwo,
18
- t2 as transformSiteNavigation
25
+ t as toFixedTwo
19
26
  };
@@ -1,2 +1,2 @@
1
- import { ISiteNavigation, IStrapiNavigation } from '../../types';
2
- export declare function transformSiteNavigation(strapiNavigation: IStrapiNavigation): ISiteNavigation | null;
1
+ export declare function buildPath(slug: string, parentSlug: string): string;
2
+ export declare function isRelativePath(path?: string): boolean;