@anywayseo/tools 5.5.0 → 5.6.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 (114) hide show
  1. package/dist/components/base/h1/index.d.ts +4 -0
  2. package/dist/components/base/h2/index.d.ts +4 -0
  3. package/dist/components/base/h3/index.d.ts +4 -0
  4. package/dist/components/base/index.d.ts +8 -0
  5. package/dist/components/base/link/index.d.ts +5 -1
  6. package/dist/components/base/link/utils.d.ts +1 -0
  7. package/dist/components/base/ol/index.d.ts +4 -0
  8. package/dist/components/base/p/index.d.ts +4 -0
  9. package/dist/components/base/ul/index.d.ts +4 -0
  10. package/dist/components/index.cjs +21 -9
  11. package/dist/components/index.d.ts +1 -3
  12. package/dist/components/index.mjs +27 -15
  13. package/dist/components/{contact-form → pages/contacts/contact-form}/index.d.ts +1 -1
  14. package/dist/components/pages/contacts/index.d.ts +3 -0
  15. package/dist/components/pages/cookie-policy/index.d.ts +3 -0
  16. package/dist/components/pages/index.d.ts +5 -0
  17. package/dist/components/pages/privacy-policy/index.d.ts +6 -0
  18. package/dist/components/pages/terms-and-conditions/index.d.ts +6 -0
  19. package/dist/hooks/index.cjs +1 -1
  20. package/dist/hooks/index.mjs +1 -1
  21. package/dist/i18n/index.cjs +10 -5
  22. package/dist/i18n/index.mjs +10 -5
  23. package/dist/i18n/resources/bg/index.d.ts +280 -0
  24. package/dist/i18n/resources/da/index.d.ts +280 -0
  25. package/dist/i18n/resources/de/index.d.ts +168 -0
  26. package/dist/i18n/resources/en/index.d.ts +168 -0
  27. package/dist/i18n/resources/fi/index.d.ts +280 -0
  28. package/dist/i18n/resources/fr/index.d.ts +168 -0
  29. package/dist/i18n/resources/it/index.d.ts +168 -0
  30. package/dist/i18n/resources/ka/index.d.ts +280 -0
  31. package/dist/i18n/resources/pt/index.d.ts +280 -0
  32. package/dist/i18n/resources/ru/index.d.ts +168 -0
  33. package/dist/{index-CAfBnNV6.js → index-5J1CqqcW.js} +1 -1
  34. package/dist/index-B1PwYYQt.mjs +24 -0
  35. package/dist/index-B6wz_B9_.js +145 -0
  36. package/dist/index-BEjKnOZA.mjs +28 -0
  37. package/dist/{index-BmaWfWLV.mjs → index-Bph7a3PR.mjs} +4 -0
  38. package/dist/index-C-ri0Fgy.js +23 -0
  39. package/dist/index-C2T70CMa.mjs +44 -0
  40. package/dist/index-COv56GyV.mjs +146 -0
  41. package/dist/{index-DZBLiQFh.js → index-CR5rM7at.js} +21 -6
  42. package/dist/index-CWMHJGbL.mjs +2957 -0
  43. package/dist/{index-BICcOaT7.js → index-CkRY_NXp.js} +0 -21
  44. package/dist/index-CyuHme_p.js +1059 -0
  45. package/dist/{index-BcFDxh8P.js → index-D4zJ5RBA.js} +13 -26
  46. package/dist/index-DDg_PkD2.js +27 -0
  47. package/dist/index-DMR4Ptkt.js +2956 -0
  48. package/dist/{index-tj12BA6U.mjs → index-DYS7zQW4.mjs} +1 -1
  49. package/dist/{index-At00w6EN.js → index-DgrIJs-a.js} +4 -0
  50. package/dist/{index-BCK4kr6V.mjs → index-Drz_7u2p.mjs} +3 -24
  51. package/dist/{index-8_-KtKsW.mjs → index-HLGPI9-S.mjs} +23 -8
  52. package/dist/{index-cEaX-HbN.mjs → index-JUwyHkmj.mjs} +222 -691
  53. package/dist/index.cjs +61 -45
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.mjs +52 -36
  56. package/dist/{components/layout → layout}/footer/navigation/index.d.ts +1 -1
  57. package/dist/layout/header/locale-switcher/icons/brazil/index.d.ts +2 -0
  58. package/dist/layout/header/locale-switcher/icons/bulgaria/index.d.ts +2 -0
  59. package/dist/layout/header/locale-switcher/icons/denmark/index.d.ts +2 -0
  60. package/dist/layout/header/locale-switcher/icons/finland/index.d.ts +2 -0
  61. package/dist/layout/header/locale-switcher/icons/france/index.d.ts +2 -0
  62. package/dist/layout/header/locale-switcher/icons/georgia/index.d.ts +2 -0
  63. package/dist/layout/header/locale-switcher/icons/germany/index.d.ts +2 -0
  64. package/dist/layout/header/locale-switcher/icons/globe/index.d.ts +2 -0
  65. package/dist/layout/header/locale-switcher/icons/index.d.ts +10 -0
  66. package/dist/layout/header/locale-switcher/icons/italy/index.d.ts +2 -0
  67. package/dist/layout/header/locale-switcher/icons/russia/index.d.ts +2 -0
  68. package/dist/{components/layout → layout}/header/locale-switcher/index.d.ts +1 -1
  69. package/dist/{components/layout → layout}/header/locale-switcher/utils.d.ts +1 -1
  70. package/dist/{components/layout → layout}/header/navigation/desktop/index.d.ts +1 -1
  71. package/dist/{components/layout → layout}/header/navigation/desktop/nav-list/index.d.ts +1 -1
  72. package/dist/{components/layout → layout}/header/navigation/index.d.ts +1 -1
  73. package/dist/{components/layout → layout}/header/navigation/mobile/index.d.ts +1 -1
  74. package/dist/{components/layout → layout}/header/navigation/mobile/nav-list/index.d.ts +1 -1
  75. package/dist/{components/layout → layout}/header/navigation/nav-link/index.d.ts +1 -1
  76. package/dist/{components/layout → layout}/hero/index.d.ts +1 -1
  77. package/dist/layout/index.cjs +596 -0
  78. package/dist/layout/index.mjs +597 -0
  79. package/dist/providers/index.cjs +2 -2
  80. package/dist/providers/index.mjs +2 -2
  81. package/dist/providers/mdx-provider/types.d.ts +3 -1
  82. package/dist/providers/mdx-provider/utils.d.ts +1 -2
  83. package/dist/types/components/strapi-component/index.d.ts +1 -1
  84. package/dist/types/i18n/index.d.ts +1 -1
  85. package/dist/utils/index.cjs +12 -10
  86. package/dist/utils/index.mjs +10 -8
  87. package/dist/utils/navigation/index.d.ts +1 -0
  88. package/package.json +7 -1
  89. package/dist/components/layout/header/locale-switcher/icons/earth/index.d.ts +0 -2
  90. package/dist/components/layout/header/locale-switcher/icons/france/index.d.ts +0 -2
  91. package/dist/components/layout/header/locale-switcher/icons/germany/index.d.ts +0 -2
  92. package/dist/components/layout/header/locale-switcher/icons/globe/index.d.ts +0 -2
  93. package/dist/components/layout/header/locale-switcher/icons/index.d.ts +0 -6
  94. package/dist/components/layout/header/locale-switcher/icons/italy/index.d.ts +0 -2
  95. package/dist/components/layout/header/locale-switcher/icons/russia/index.d.ts +0 -2
  96. package/dist/index-Bts2DBYS.mjs +0 -637
  97. package/dist/index-CJVr79Z2.js +0 -636
  98. package/dist/index-C_FekfFC.mjs +0 -57
  99. package/dist/index-D86anUPd.js +0 -1528
  100. /package/dist/components/{layout → base}/container/index.d.ts +0 -0
  101. /package/dist/components/{layout → base}/logo/index.d.ts +0 -0
  102. /package/dist/components/{not-found → pages/not-found}/index.d.ts +0 -0
  103. /package/dist/{components/layout → layout}/content/index.d.ts +0 -0
  104. /package/dist/{components/layout → layout}/footer/brand/index.d.ts +0 -0
  105. /package/dist/{components/layout → layout}/footer/copyright/index.d.ts +0 -0
  106. /package/dist/{components/layout → layout}/footer/disclaimer/index.d.ts +0 -0
  107. /package/dist/{components/layout → layout}/footer/extra/index.d.ts +0 -0
  108. /package/dist/{components/layout → layout}/footer/index.d.ts +0 -0
  109. /package/dist/{components/layout → layout}/header/brand/index.d.ts +0 -0
  110. /package/dist/{components/layout → layout}/header/index.d.ts +0 -0
  111. /package/dist/{components/layout → layout}/header/theme-toggler/index.d.ts +0 -0
  112. /package/dist/{components/layout → layout}/index.d.ts +0 -0
  113. /package/dist/{components/layout → layout}/main/index.d.ts +0 -0
  114. /package/dist/{components/layout → layout}/scroll-to-top/index.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { useColorModeValue } from "@chakra-ui/react";
2
2
  import "./index-BJRvnR8Q.mjs";
3
- import "./index-Bts2DBYS.mjs";
3
+ import "./index-CWMHJGbL.mjs";
4
4
  import { L as LIGHT_THEME_COLOR, D as DARK_THEME_COLOR } from "./index-BRVKhbs6.mjs";
5
5
  function usePrimaryColors() {
6
6
  const color = useColorModeValue(LIGHT_THEME_COLOR, DARK_THEME_COLOR);
@@ -5,5 +5,9 @@ function buildPath(slug, parentSlug) {
5
5
  function isRelativePath(path = "") {
6
6
  return path.startsWith("/");
7
7
  }
8
+ function isAbsolutePath(path = "") {
9
+ return /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(path);
10
+ }
8
11
  exports.buildPath = buildPath;
12
+ exports.isAbsolutePath = isAbsolutePath;
9
13
  exports.isRelativePath = isRelativePath;
@@ -8,24 +8,6 @@ function getCurrencySymbol(currencyCode, locale = DEFAULT_LANGUAGE) {
8
8
  }).replace(/\d/g, "").trim();
9
9
  return symbol;
10
10
  }
11
- function getCurrentYear(locale = DEFAULT_LANGUAGE) {
12
- const currentDate = /* @__PURE__ */ new Date();
13
- const currentYear = new Intl.DateTimeFormat(locale, { year: "numeric" }).format(currentDate);
14
- return currentYear;
15
- }
16
- function getCurrentMonth(locale = DEFAULT_LANGUAGE) {
17
- const currentDate = /* @__PURE__ */ new Date();
18
- const currentMonth = new Intl.DateTimeFormat(locale, { month: "long" }).format(currentDate);
19
- return currentMonth;
20
- }
21
- function formatDate({ value, locale = DEFAULT_LANGUAGE, options }) {
22
- const date = typeof value === "string" || typeof value === "number" ? new Date(value) : value;
23
- if (isNaN(date.getTime())) {
24
- throw new Error("Invalid date provided");
25
- }
26
- const formatter = new Intl.DateTimeFormat(locale, options);
27
- return formatter.format(date);
28
- }
29
11
  const DEFAULT_PRECISION = 2;
30
12
  function round(number, precision) {
31
13
  const numberString = String(number);
@@ -75,12 +57,9 @@ function getSeededRandomComparator(seed) {
75
57
  return () => seededRandom(safeSeed + index++) - 0.5;
76
58
  }
77
59
  export {
78
- getCurrentYear as a,
79
- getCurrentMonth as b,
80
- formatNumber as c,
81
- randomComparator as d,
82
- getSeededRandomComparator as e,
83
- formatDate as f,
60
+ randomComparator as a,
61
+ getSeededRandomComparator as b,
62
+ formatNumber as f,
84
63
  getCurrencySymbol as g,
85
64
  round as r,
86
65
  toFixedTwo as t
@@ -1,14 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { Image as Image$1, Box } from "@chakra-ui/react";
2
+ import { Image as Image$1, Box, Link as Link$1 } from "@chakra-ui/react";
3
3
  import Zoom from "react-medium-image-zoom";
4
4
  import { createContext, useContext, useMemo, forwardRef } from "react";
5
- import { Link as Link$1 } from "gatsby";
5
+ import { Link as Link$2 } from "gatsby";
6
6
  import "@mdx-js/react";
7
7
  import "react-i18next";
8
8
  import "./index-BJRvnR8Q.mjs";
9
- import "./index-Bts2DBYS.mjs";
9
+ import "./index-CWMHJGbL.mjs";
10
10
  import { u as useLocalization } from "./index-BzbpMLDD.mjs";
11
- import { i as isRelativePath } from "./index-BmaWfWLV.mjs";
11
+ import { a as isAbsolutePath, i as isRelativePath } from "./index-Bph7a3PR.mjs";
12
12
  function isImageUrl(image) {
13
13
  return Boolean(typeof image === "string" && image.trim() !== "");
14
14
  }
@@ -65,6 +65,9 @@ function usePageContext() {
65
65
  }
66
66
  return context;
67
67
  }
68
+ function isExternalLink(path) {
69
+ return isAbsolutePath(path);
70
+ }
68
71
  function normalizePath(path = "") {
69
72
  return path.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/");
70
73
  }
@@ -79,12 +82,24 @@ function getLocalizedPath(path, currentLocaleCode, defaultLocaleCode) {
79
82
  }
80
83
  return `${localePrefix}${normalizePath(path)}`;
81
84
  }
82
- const Link = forwardRef(({ to, ...props }, ref) => {
85
+ const Link = forwardRef(({ to = "", isRedirectLink, ...props }, ref) => {
83
86
  const { localization } = useSiteContext();
84
87
  const { currentLocale } = usePageContext();
85
- const defaultLocale = localization.defaultLocale;
86
- const path = getLocalizedPath(to, currentLocale.code, defaultLocale.code);
87
- return /* @__PURE__ */ jsx(Link$1, { ref, to: path, ...props });
88
+ if (isExternalLink(to)) {
89
+ return /* @__PURE__ */ jsx(
90
+ Link$1,
91
+ {
92
+ ref,
93
+ href: isRedirectLink ? `/follow?to=${to}` : to,
94
+ target: "_blank",
95
+ rel: "noopener noreferrer nofollow",
96
+ referrerPolicy: "no-referrer",
97
+ ...props
98
+ }
99
+ );
100
+ }
101
+ const path = getLocalizedPath(to, currentLocale.code, localization.defaultLocale.code);
102
+ return /* @__PURE__ */ jsx(Link$1, { ref, as: Link$2, to: path, ...props });
88
103
  });
89
104
  export {
90
105
  Image as I,