@ichaingo/link 1.3.97 → 1.3.99

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 (2) hide show
  1. package/dist/index.js +12 -12
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import { jsx as k } from "react/jsx-runtime";
3
- import W from "next/link";
4
- import { usePathname as _ } from "@ichaingo/i18n/navigation";
2
+ import { jsx as L } from "react/jsx-runtime";
3
+ import _ from "next/link";
4
+ import { usePathname as W } from "@ichaingo/i18n/navigation";
5
5
  import { useLocale as v } from "next-intl";
6
6
  import { useRouter as y, useSearchParams as B } from "next/navigation";
7
7
  import { useTransition as H, useMemo as S } from "react";
@@ -12,17 +12,17 @@ const z = ({
12
12
  withLocale: m = !0,
13
13
  baseUrl: o = "",
14
14
  children: p,
15
- target: a = "_self",
16
- onClick: i,
15
+ target: i = "_self",
16
+ onClick: a,
17
17
  prefetch: l = !1,
18
18
  ...f
19
19
  }) => {
20
- const d = y(), g = _(), P = B(), [, $] = H(), { start: w } = T(), e = v(), n = (t) => o.includes(".ichaingo.com") || t.includes(".ichaingo.com") || o === "" && !/^(https?:\/\/|\/\/)/.test(t) ? !1 : /^(https?:\/\/|\/\/)/.test(t), x = (t) => t.replace(`/${e}`, "") === g.replace(`/${e}`, "") + P.toString(), L = (t, s) => {
21
- if (i == null || i(t), t.stopPropagation(), t.preventDefault(), x(s)) {
20
+ const d = y(), P = W(), $ = B(), [, g] = H(), { start: k } = T(), e = v(), n = (t) => o.includes(".ichaingo.com") || t.includes(".ichaingo.com") || o === "" && !/^(https?:\/\/|\/\/)/.test(t) ? !1 : /^(https?:\/\/|\/\/)/.test(t), w = (t) => t.replace(`/${e}`, "") === P.replace(`/${e}`, "") + $.toString(), x = (t, s) => {
21
+ if (a == null || a(t), t.stopPropagation(), t.preventDefault(), w(s)) {
22
22
  window.location.reload();
23
23
  return;
24
24
  }
25
- c || n(s) ? window.open(s, n(s) ? "_blank" : a) : (w(), $(() => {
25
+ c || n(s) ? window.open(s, i === "_blank" || n(s) ? "_blank" : i) : (k(), g(() => {
26
26
  d.push(s);
27
27
  }));
28
28
  }, u = S(() => {
@@ -30,14 +30,14 @@ const z = ({
30
30
  const t = `/${e}`;
31
31
  return r === t || r.startsWith(`${t}/`) || !m ? o + r : r.startsWith("/") ? `${o}${t}${r}` : r;
32
32
  }, [r, e, o]);
33
- return /* @__PURE__ */ k(
34
- W,
33
+ return /* @__PURE__ */ L(
34
+ _,
35
35
  {
36
36
  suppressHydrationWarning: !0,
37
37
  prefetch: l,
38
38
  href: u,
39
- target: n(r) ? "_blank" : a,
40
- onClick: (t) => L(t, u),
39
+ target: n(r) ? "_blank" : i,
40
+ onClick: (t) => x(t, u),
41
41
  rel: n(r) ? "noopener noreferrer" : void 0,
42
42
  ...f,
43
43
  children: p
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/link",
3
- "version": "1.3.97",
3
+ "version": "1.3.99",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "next": "^15.4.5",
21
21
  "next-intl": "^4.3.4",
22
22
  "react": "^19.1.0",
23
- "@ichaingo/providers": "1.3.97",
24
- "@ichaingo/i18n": "1.3.97"
23
+ "@ichaingo/providers": "1.3.99",
24
+ "@ichaingo/i18n": "1.3.99"
25
25
  },
26
26
  "devDependencies": {
27
27
  "rollup-plugin-preserve-use-client": "^3.0.1"