@okam/next-component 2.0.0 → 2.0.2
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 +22 -0
- package/hooks/useLink/index.js +2 -1
- package/hooks/useLink/index.mjs +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## 2.0.2 (2026-02-27)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated stack-ui to 2.0.1
|
|
6
|
+
|
|
7
|
+
## 2.0.1 (2026-02-20)
|
|
8
|
+
|
|
9
|
+
### 🚀 Features
|
|
10
|
+
|
|
11
|
+
- **workspace:** migrate from npm to pnpm ([#399](https://github.com/OKAMca/stack/pull/399))
|
|
12
|
+
|
|
13
|
+
### 🩹 Fixes
|
|
14
|
+
|
|
15
|
+
- **next-component:** link doesnt localize anchor href anymore ([f960c993](https://github.com/OKAMca/stack/commit/f960c993))
|
|
16
|
+
|
|
17
|
+
### ❤️ Thank You
|
|
18
|
+
|
|
19
|
+
- Claude Opus 4.5
|
|
20
|
+
- Marie-Maxime Tanguay @marie-maxime
|
|
21
|
+
- poclerson
|
|
22
|
+
|
|
1
23
|
# 2.0.0 (2026-02-05)
|
|
2
24
|
|
|
3
25
|
### 🚀 Features
|
package/hooks/useLink/index.js
CHANGED
|
@@ -23,8 +23,9 @@ function useLinkLocale(props) {
|
|
|
23
23
|
}
|
|
24
24
|
function localizeHref(href, locale) {
|
|
25
25
|
const hrefString = href.toString();
|
|
26
|
+
const isAnchor = hrefString.startsWith("#");
|
|
26
27
|
const isExternal = /^[a-z]+:\/\//i.test(hrefString) || hrefString.startsWith("//");
|
|
27
|
-
if (isExternal)
|
|
28
|
+
if (isExternal || isAnchor)
|
|
28
29
|
return hrefString;
|
|
29
30
|
if (locale != null && locale !== false) {
|
|
30
31
|
return `/${locale}${hrefString}`;
|
package/hooks/useLink/index.mjs
CHANGED
|
@@ -21,8 +21,9 @@ function useLinkLocale(props) {
|
|
|
21
21
|
}
|
|
22
22
|
function localizeHref(href, locale) {
|
|
23
23
|
const hrefString = href.toString();
|
|
24
|
+
const isAnchor = hrefString.startsWith("#");
|
|
24
25
|
const isExternal = /^[a-z]+:\/\//i.test(hrefString) || hrefString.startsWith("//");
|
|
25
|
-
if (isExternal)
|
|
26
|
+
if (isExternal || isAnchor)
|
|
26
27
|
return hrefString;
|
|
27
28
|
if (locale != null && locale !== false) {
|
|
28
29
|
return `/${locale}${hrefString}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okam/next-component",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/OKAMca/stack.git"
|
|
6
6
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@okam/react-utils": "0.0.1",
|
|
47
|
-
"@okam/stack-ui": "2.0.
|
|
47
|
+
"@okam/stack-ui": "2.0.1",
|
|
48
48
|
"next": "^15.1.0 || ^16.0.0",
|
|
49
49
|
"nuqs": "^2.4.3",
|
|
50
50
|
"radashi": "^12.3.0",
|