@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
@@ -1,4 +1,5 @@
1
1
  export { default as Author } from './author';
2
2
  export { default as Center } from './center';
3
3
  export { default as Grid } from './grid';
4
+ export { default as Link } from './link';
4
5
  export { default as LinkButton } from './link-button';
@@ -0,0 +1,2 @@
1
+ declare const Link: import('react').ForwardRefExoticComponent<Omit<import('gatsby-link').GatsbyLinkProps<unknown>, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
2
+ export default Link;
@@ -0,0 +1 @@
1
+ export declare function getLocalizedPath(path: string, currentLocaleCode: string, defaultLocaleCode: string): string;
@@ -1,2 +1,2 @@
1
- import { Currency, GameCharacteristic } from '../../types';
2
- export declare function getGameInfoItemValue(key: GameCharacteristic, value: unknown, currency: Currency | Currency[]): string;
1
+ import { Currency, ILocale, GameCharacteristic } from '../../types';
2
+ export declare function getGameInfoItemValue(key: GameCharacteristic, value: unknown, locale: ILocale['code'], currency: Currency | Currency[]): string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-N8nXj4-i.js");
3
+ const index = require("../index-D0yXUsJz.js");
4
+ const index$1 = require("../index-B9GEoC68.js");
4
5
  exports.Author = index.Author;
5
6
  exports.AuthorCard = index.AuthorCard;
6
7
  exports.BonusCard = index.BonusCard;
@@ -26,3 +27,4 @@ exports.StrapiContentRenderer = index.StrapiContentRenderer;
26
27
  exports.Table = index.Table;
27
28
  exports.Tabs = index.Tabs;
28
29
  exports.Tip = index.Tip;
30
+ exports.Link = index$1.Link;
@@ -1,4 +1,5 @@
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";
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 } from "../index-tJcccH0B.mjs";
2
3
  export {
3
4
  k as Author,
4
5
  A as AuthorCard,
@@ -16,6 +17,7 @@ export {
16
17
  m as Grid,
17
18
  H as HowTo,
18
19
  L as Layout,
20
+ L2 as Link,
19
21
  n as LinkButton,
20
22
  g as List,
21
23
  N as NotFound,
@@ -0,0 +1,2 @@
1
+ import { IconComponent } from '../../../../../../types';
2
+ export declare const EarthIcon: IconComponent;
@@ -0,0 +1,2 @@
1
+ import { IconComponent } from '../../../../../../types';
2
+ export declare const FranceIcon: IconComponent;
@@ -0,0 +1,2 @@
1
+ import { IconComponent } from '../../../../../../types';
2
+ export declare const GermanyIcon: IconComponent;
@@ -0,0 +1,2 @@
1
+ import { IconComponent } from '../../../../../../types';
2
+ export declare const GlobeIcon: IconComponent;
@@ -0,0 +1,6 @@
1
+ export { EarthIcon } from './earth';
2
+ export { FranceIcon } from './france';
3
+ export { GermanyIcon } from './germany';
4
+ export { GlobeIcon } from './globe';
5
+ export { ItalyIcon } from './italy';
6
+ export { RussiaIcon } from './russia';
@@ -0,0 +1,2 @@
1
+ import { IconComponent } from '../../../../../../types';
2
+ export declare const ItalyIcon: IconComponent;
@@ -0,0 +1,2 @@
1
+ import { IconComponent } from '../../../../../../types';
2
+ export declare const RussiaIcon: IconComponent;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { ILocale } from '../../../../types';
3
+ type LocaleSwitcherProps = {
4
+ currentLocale: ILocale;
5
+ locales: ILocale[];
6
+ };
7
+ declare const LocaleSwitcher: FC<LocaleSwitcherProps>;
8
+ export default LocaleSwitcher;
@@ -0,0 +1,2 @@
1
+ import { IconComponent, ILocale } from '../../../../types';
2
+ export declare function getMappedIcon(code: ILocale['code']): IconComponent;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { NavigationProps } from '../types';
2
+ import { NavigationProps } from '../../../../../types';
3
3
  declare const DesktopNavigation: FC<NavigationProps>;
4
4
  export default DesktopNavigation;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { NavigationProps } from './types';
2
+ import { NavigationProps } from '../../../../types';
3
3
  declare const Navigation: FC<NavigationProps>;
4
4
  export default Navigation;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { NavigationProps } from '../types';
2
+ import { NavigationProps } from '../../../../../types';
3
3
  declare const MobileNavigation: FC<NavigationProps>;
4
4
  export default MobileNavigation;
@@ -1,11 +1,10 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- import { ISeo, ISiteMetadata, LanguageCode } from '../../types';
2
+ import { ILocale, ISeo } from '../../types';
3
3
  import { SeoItemGetter } from './types';
4
4
  type SeoProps = PropsWithChildren<{
5
- siteMetadata: ISiteMetadata;
6
5
  title?: ISeo['title'] | SeoItemGetter;
7
6
  description?: ISeo['description'] | SeoItemGetter;
8
- lang?: LanguageCode;
7
+ lang?: ILocale['code'];
9
8
  }>;
10
9
  declare const Seo: FC<SeoProps>;
11
10
  export default Seo;
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-BV0hDmYP.js");
4
- exports.usePrimaryColors = index.usePrimaryColors;
3
+ const index = require("../index-WFgDSB1A.js");
4
+ const index$1 = require("../index-BnmGE5_x.js");
5
+ exports.useLocalization = index.useLocalization;
6
+ exports.usePrimaryColors = index$1.usePrimaryColors;
@@ -1 +1,2 @@
1
+ export { default as useLocalization } from './use-localization';
1
2
  export { default as usePrimaryColors } from './use-primary-colors';
@@ -1,4 +1,6 @@
1
- import { u } from "../index-CkTgVjZS.mjs";
1
+ import { u } from "../index-BzbpMLDD.mjs";
2
+ import { u as u2 } from "../index-QazOxABc.mjs";
2
3
  export {
3
- u as usePrimaryColors
4
+ u as useLocalization,
5
+ u2 as usePrimaryColors
4
6
  };
@@ -0,0 +1,9 @@
1
+ import { ILocale, ISiteLocalization } from '../../types';
2
+ interface IUseLocalizationParams extends ISiteLocalization {
3
+ location: Location;
4
+ }
5
+ interface IUseLocalizationReturn {
6
+ currentLocale: ILocale;
7
+ }
8
+ declare function useLocalization({ location, defaultLocale, locales }: IUseLocalizationParams): IUseLocalizationReturn;
9
+ export default useLocalization;
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("react-i18next");
4
- const i18n = require("i18next");
5
- const i18n$1 = require("../index-BPLxhZG_.js");
6
- exports.i18n = i18n;
7
- exports.resources = i18n$1.resources;
3
+ const index = require("../index-BHfpWNqh.js");
4
+ const resources = {
5
+ en: index.dictionary$4,
6
+ it: index.dictionary$3,
7
+ de: index.dictionary$2,
8
+ ru: index.dictionary$1,
9
+ fr: index.dictionary
10
+ };
11
+ const DEFAULT_LANGUAGE = "en";
12
+ exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
13
+ exports.resources = resources;
@@ -1,9 +1,10 @@
1
+ import { LanguageCode } from '../types';
1
2
  import { DefaultResourceType, default as resources } from './resources';
2
- import { default as i18n } from 'i18next';
3
3
  declare module 'i18next' {
4
4
  interface CustomTypeOptions {
5
5
  defaultNS: Extract<DefaultResourceType, 'common'>;
6
6
  resources: DefaultResourceType;
7
7
  }
8
8
  }
9
- export { i18n, resources };
9
+ declare const DEFAULT_LANGUAGE: LanguageCode;
10
+ export { resources, DEFAULT_LANGUAGE };
@@ -1,7 +1,13 @@
1
- import "react-i18next";
2
- import { default as default2 } from "i18next";
3
- import { r } from "../index-BE9gNdXx.mjs";
1
+ import { d as dictionary, b as dictionary$1, c as dictionary$2, e as dictionary$3, f as dictionary$4 } from "../index-CACDltm3.mjs";
2
+ const resources = {
3
+ en: dictionary$4,
4
+ it: dictionary$3,
5
+ de: dictionary$2,
6
+ ru: dictionary$1,
7
+ fr: dictionary
8
+ };
9
+ const DEFAULT_LANGUAGE = "en";
4
10
  export {
5
- default2 as i18n,
6
- r as resources
11
+ DEFAULT_LANGUAGE,
12
+ resources
7
13
  };
@@ -0,0 +1,112 @@
1
+ declare const dictionary: {
2
+ readonly pageNotFound: {
3
+ seo: {
4
+ title: string;
5
+ };
6
+ title: string;
7
+ description: string;
8
+ action: string;
9
+ };
10
+ readonly footer: {
11
+ copyright: string;
12
+ disclaimer: {
13
+ title: string;
14
+ description: string;
15
+ };
16
+ };
17
+ readonly gameDemo: {
18
+ warning: string;
19
+ action: {
20
+ playForReal: string;
21
+ playForFree: string;
22
+ activateFullscreen: string;
23
+ deactivateFullscreen: string;
24
+ exit: string;
25
+ };
26
+ };
27
+ readonly gameInfo: {
28
+ title: string;
29
+ group: {
30
+ general: string;
31
+ features: string;
32
+ };
33
+ feature: {
34
+ BONUS_FEATURES: string;
35
+ COMPATIBILITY: string;
36
+ FUNCTIONS: string;
37
+ DEVELOPER: string;
38
+ HAS_AUTOPLAY: string;
39
+ HAS_BONUS_PURCHASE: string;
40
+ HAS_COLLECTION_SYMBOLS: string;
41
+ HAS_DEMO: string;
42
+ HAS_FAST_SPIN: string;
43
+ HAS_FREE_SPINS: string;
44
+ HAS_PROGRESSIVE_JACKPOT: string;
45
+ LANGUAGES: string;
46
+ MAX_WIN: string;
47
+ MAX_BET: string;
48
+ MIN_BET: string;
49
+ NAME: string;
50
+ PAY_LINES: string;
51
+ REELS_NUMBER: string;
52
+ RELEASE_DATE: string;
53
+ ROWS_WITH_PINS: string;
54
+ RTP: string;
55
+ THEME: string;
56
+ TYPE: string;
57
+ VOLATILITY: string;
58
+ };
59
+ value: {
60
+ boolean: {
61
+ true: string;
62
+ false: string;
63
+ };
64
+ volatility: {
65
+ HIGH: string;
66
+ MEDIUM: string;
67
+ LOW: string;
68
+ };
69
+ };
70
+ };
71
+ readonly prosCons: {
72
+ advantages: string;
73
+ disadvantages: string;
74
+ };
75
+ readonly author: {
76
+ title: string;
77
+ action: {
78
+ expand: string;
79
+ collapse: string;
80
+ };
81
+ };
82
+ readonly contactForm: {
83
+ field: {
84
+ name: {
85
+ label: string;
86
+ placeholder: string;
87
+ };
88
+ email: {
89
+ label: string;
90
+ placeholder: string;
91
+ };
92
+ message: {
93
+ label: string;
94
+ placeholder: string;
95
+ };
96
+ };
97
+ notification: {
98
+ title: string;
99
+ description: string;
100
+ };
101
+ action: {
102
+ send: string;
103
+ };
104
+ };
105
+ readonly bonusCard: {
106
+ action: {
107
+ expand: string;
108
+ collapse: string;
109
+ };
110
+ };
111
+ };
112
+ export default dictionary;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ function buildPath(slug, parentSlug) {
3
+ return parentSlug === "" ? slug : `${parentSlug}/${slug}`;
4
+ }
5
+ function isRelativePath(path = "") {
6
+ return path.startsWith("/");
7
+ }
8
+ exports.buildPath = buildPath;
9
+ exports.isRelativePath = isRelativePath;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const react = require("react");
4
+ const gatsby = require("gatsby");
5
+ require("@chakra-ui/react");
6
+ require("@mdx-js/react");
7
+ require("react-i18next");
8
+ require("./index-C6MG_f24.js");
9
+ require("./index-BHfpWNqh.js");
10
+ const index = require("./index-WFgDSB1A.js");
11
+ const index$1 = require("./index-At00w6EN.js");
12
+ const SiteContext = react.createContext(null);
13
+ const SiteProvider = ({ children, ...context }) => {
14
+ const value = react.useMemo(() => context, []);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(SiteContext.Provider, { value, children });
16
+ };
17
+ function useSiteContext() {
18
+ const context = react.useContext(SiteContext);
19
+ if (!context) {
20
+ throw new Error("useSiteContext must be used within SiteProvider");
21
+ }
22
+ return context;
23
+ }
24
+ const PageContext = react.createContext(null);
25
+ const PageProvider = ({ children, location }) => {
26
+ const { localization } = useSiteContext();
27
+ const { currentLocale } = index.useLocalization({ location, ...localization });
28
+ const value = react.useMemo(() => ({ currentLocale }), [currentLocale]);
29
+ return /* @__PURE__ */ jsxRuntime.jsx(PageContext.Provider, { value, children });
30
+ };
31
+ function usePageContext() {
32
+ const context = react.useContext(PageContext);
33
+ if (!context) {
34
+ throw new Error("usePageContext must be used within PageProvider");
35
+ }
36
+ return context;
37
+ }
38
+ function normalizePath(path = "") {
39
+ return path.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/");
40
+ }
41
+ function getLocalizedPath(path, currentLocaleCode, defaultLocaleCode) {
42
+ const localePrefix = currentLocaleCode === defaultLocaleCode ? "/" : `/${currentLocaleCode}/`;
43
+ if (path === "/") {
44
+ return localePrefix;
45
+ }
46
+ if (index$1.isRelativePath(path)) {
47
+ const maybeLocaleCode = path.split("/")[1];
48
+ return maybeLocaleCode === defaultLocaleCode ? "/" : path;
49
+ }
50
+ return `${localePrefix}${normalizePath(path)}`;
51
+ }
52
+ const Link = react.forwardRef(({ to, ...props }, ref) => {
53
+ const { localization } = useSiteContext();
54
+ const { currentLocale } = usePageContext();
55
+ const defaultLocale = localization.defaultLocale;
56
+ const path = getLocalizedPath(to, currentLocale.code, defaultLocale.code);
57
+ return /* @__PURE__ */ jsxRuntime.jsx(gatsby.Link, { ref, to: path, ...props });
58
+ });
59
+ exports.Link = Link;
60
+ exports.PageProvider = PageProvider;
61
+ exports.SiteProvider = SiteProvider;
62
+ exports.usePageContext = usePageContext;
63
+ exports.useSiteContext = useSiteContext;