@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.
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/base/link/index.d.ts +2 -0
- package/dist/components/base/link/utils.d.ts +1 -0
- package/dist/components/game-info/utils.d.ts +2 -2
- package/dist/components/index.cjs +3 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/layout/header/locale-switcher/icons/earth/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/france/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/germany/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/globe/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/index.d.ts +6 -0
- package/dist/components/layout/header/locale-switcher/icons/italy/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/russia/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/index.d.ts +8 -0
- package/dist/components/layout/header/locale-switcher/utils.d.ts +2 -0
- package/dist/components/layout/header/navigation/desktop/index.d.ts +1 -1
- package/dist/components/layout/header/navigation/index.d.ts +1 -1
- package/dist/components/layout/header/navigation/mobile/index.d.ts +1 -1
- package/dist/components/seo/index.d.ts +2 -3
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.mjs +4 -2
- package/dist/hooks/use-localization/index.d.ts +9 -0
- package/dist/i18n/index.cjs +11 -5
- package/dist/i18n/index.d.ts +3 -2
- package/dist/i18n/index.mjs +11 -5
- package/dist/i18n/resources/fr/index.d.ts +112 -0
- package/dist/index-At00w6EN.js +9 -0
- package/dist/index-B9GEoC68.js +63 -0
- package/dist/{index-DAbZBo7_.mjs → index-BCuXOiT9.mjs} +201 -67
- package/dist/{index-BPLxhZG_.js → index-BHfpWNqh.js} +183 -73
- package/dist/{index-DF_u_tzx.js → index-BIdYBT1G.js} +7 -3
- package/dist/{index-MpNfBHkQ.mjs → index-BJRvnR8Q.mjs} +1 -5
- package/dist/index-BRVKhbs6.mjs +6 -0
- package/dist/index-BmaWfWLV.mjs +10 -0
- package/dist/{index-BV0hDmYP.js → index-BnmGE5_x.js} +3 -2
- package/dist/{index-DPO0aIC3.mjs → index-Bu4S7kG8.mjs} +7 -10
- package/dist/index-BzbpMLDD.mjs +23 -0
- package/dist/{index-DVcQxWMZ.js → index-C6MG_f24.js} +0 -4
- package/dist/{index-BE9gNdXx.mjs → index-CACDltm3.mjs} +183 -73
- package/dist/index-CYr1ct1t.js +93 -0
- package/dist/index-CbuiYkSg.js +5 -0
- package/dist/{index-CcsbqDXL.mjs → index-CrmmG8yy.mjs} +7 -3
- package/dist/{index-N8nXj4-i.js → index-D0yXUsJz.js} +220 -86
- package/dist/{index-DuQjQMNN.js → index-D34TfBTR.js} +7 -10
- package/dist/{index-CkTgVjZS.mjs → index-QazOxABc.mjs} +3 -2
- package/dist/index-WFgDSB1A.js +22 -0
- package/dist/index-cQqALZIW.mjs +94 -0
- package/dist/index-tJcccH0B.mjs +64 -0
- package/dist/index.cjs +43 -31
- package/dist/index.mjs +33 -21
- package/dist/providers/index.cjs +4 -2
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.mjs +5 -3
- package/dist/providers/page-provider/index.d.ts +11 -0
- package/dist/providers/site-provider/index.d.ts +5 -4
- package/dist/types/api/index.d.ts +2 -2
- package/dist/types/components/icon/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/locale-switcher/index.d.ts +5 -0
- package/dist/types/components/navigation/index.d.ts +9 -10
- package/dist/types/i18n/index.d.ts +7 -1
- package/dist/types/site/index.d.ts +15 -13
- package/dist/utils/api/index.d.ts +5 -0
- package/dist/utils/date/index.d.ts +4 -3
- package/dist/utils/index.cjs +23 -16
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.mjs +16 -9
- package/dist/utils/navigation/index.d.ts +2 -2
- package/dist/utils/numbers/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/layout/header/navigation/types.d.ts +0 -4
- package/dist/index-BClxYYix.js +0 -40
- package/dist/index-BNb-P8a6.mjs +0 -17
- package/dist/index-BhsXlbd8.js +0 -16
- 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-
|
|
4
|
-
const index$1 = require("./index-
|
|
5
|
-
const
|
|
6
|
-
const index$
|
|
7
|
-
const
|
|
8
|
-
const index$4 = require("./index-
|
|
9
|
-
const index$5 = require("./index-
|
|
10
|
-
const index$6 = require("./index-
|
|
11
|
-
const
|
|
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.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
50
|
-
exports.
|
|
51
|
-
exports.
|
|
52
|
-
exports.
|
|
53
|
-
exports.
|
|
54
|
-
exports.
|
|
55
|
-
exports.
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
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-
|
|
2
|
-
import { u } from "./index-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
59
|
+
a4 as getSiteName,
|
|
60
|
+
i2 as isRelativePath,
|
|
50
61
|
p as parseNumber,
|
|
51
62
|
d2 as randomComparator,
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
resources,
|
|
64
|
+
r as round,
|
|
54
65
|
t as toFixedTwo,
|
|
55
|
-
|
|
56
|
-
u as
|
|
57
|
-
|
|
66
|
+
u2 as useLocalization,
|
|
67
|
+
u as usePageContext,
|
|
68
|
+
u3 as usePrimaryColors,
|
|
69
|
+
a2 as useSiteContext
|
|
58
70
|
};
|
package/dist/providers/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../index-
|
|
4
|
-
const index$1 = require("../index-
|
|
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;
|
package/dist/providers/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { M } from "../index-
|
|
2
|
-
import { S, u } from "../index-
|
|
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
|
|
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 {
|
|
2
|
+
import { ISiteConfig, ISiteLocalization, ISiteMetadata, ISiteNavigation } from '../../types';
|
|
3
3
|
interface ISiteContext {
|
|
4
4
|
metadata: ISiteMetadata;
|
|
5
|
-
|
|
5
|
+
navigation: ISiteNavigation;
|
|
6
|
+
localization: ISiteLocalization;
|
|
7
|
+
config: ISiteConfig;
|
|
6
8
|
}
|
|
7
|
-
|
|
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
|
|
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
|
}
|
|
@@ -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';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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?:
|
|
5
|
+
children?: Omit<INavItem, 'children'>[];
|
|
8
6
|
}
|
|
9
|
-
export interface
|
|
10
|
-
|
|
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,
|
|
2
|
+
import { Image, INavigation } from '../components';
|
|
3
3
|
import { ISeo } from '../content';
|
|
4
|
-
import { Currency,
|
|
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
|
|
15
|
+
export interface ISiteConfig {
|
|
16
|
+
theme?: ISiteThemeConfig;
|
|
18
17
|
header?: ISiteHeaderConfig;
|
|
19
18
|
footer?: ISiteFooterConfig;
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
export declare function
|
|
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?:
|
|
6
|
+
locale?: ILocale['code'];
|
|
6
7
|
options?: Intl.DateTimeFormatOptions;
|
|
7
8
|
}
|
|
8
9
|
export declare function formatDate({ value, locale, options }: IFormatDateOptions): string;
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../index-
|
|
4
|
-
const index$1 = require("../index-
|
|
5
|
-
const index$2 = require("../index-
|
|
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.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
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;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.mjs
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import { A
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
export declare function buildPath(slug: string, parentSlug: string): string;
|
|
2
|
+
export declare function isRelativePath(path?: string): boolean;
|