@ichaingo/header 1.5.25 → 1.5.26
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/lib/Setting/SettingBody.js +32 -28
- package/package.json +14 -14
|
@@ -1,53 +1,57 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useLocale as h, useTranslations as
|
|
2
|
+
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useLocale as h, useTranslations as f } from "next-intl";
|
|
4
4
|
import { useSearchParams as p, usePathname as x } from "next/navigation";
|
|
5
|
-
import { Accordion as b, AccordionItem as w, AccordionTrigger as y, AccordionContent as
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import { useCallback as
|
|
5
|
+
import { Accordion as b, AccordionItem as w, AccordionTrigger as y, AccordionContent as v } from "@ichaingo/ui/accordion";
|
|
6
|
+
import { twMerge as N } from "tailwind-merge";
|
|
7
|
+
import { useCallback as j } from "react";
|
|
8
8
|
import k from "@ichaingo/link";
|
|
9
9
|
import $ from "@ichaingo/theme-toggle";
|
|
10
|
-
function U({ onClick:
|
|
10
|
+
function U({ onClick: d = () => {
|
|
11
11
|
} }) {
|
|
12
|
-
var
|
|
13
|
-
const a = h(),
|
|
12
|
+
var g;
|
|
13
|
+
const a = h(), o = p(), t = f("lang"), c = f("setting"), i = [
|
|
14
14
|
{ name: t("en"), lang: "en" },
|
|
15
15
|
{ name: t("ja"), lang: "ja" },
|
|
16
16
|
{ name: t("ko"), lang: "ko" },
|
|
17
17
|
{ name: t("zh-hant"), lang: "zh-hant" },
|
|
18
18
|
{ name: t("zh-hans"), lang: "zh-hans" }
|
|
19
|
-
],
|
|
20
|
-
(
|
|
21
|
-
const
|
|
22
|
-
return
|
|
19
|
+
], m = x(), u = j(
|
|
20
|
+
(e) => {
|
|
21
|
+
const s = m.replace(new RegExp(`/${a}(/|$)`), `/${e}$1`), l = o.toString();
|
|
22
|
+
return l ? `${s}?${l}` : s;
|
|
23
23
|
},
|
|
24
|
-
[
|
|
24
|
+
[m, a, o]
|
|
25
25
|
);
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
return /* @__PURE__ */ r("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
|
|
27
|
+
/* @__PURE__ */ n("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ n(b, { type: "single", className: "flex-1", collapsible: !0, onValueChange: (e) => {
|
|
28
|
+
document.querySelectorAll("iframe").forEach((l) => {
|
|
29
|
+
l.style.pointerEvents = e ? "auto" : "none";
|
|
30
|
+
});
|
|
31
|
+
}, children: /* @__PURE__ */ r(w, { value: a, className: "border-0", children: [
|
|
32
|
+
/* @__PURE__ */ n(y, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ r("div", { className: "flex w-full justify-between items-center", children: [
|
|
33
|
+
/* @__PURE__ */ n("span", { className: "text-title", children: c("language") }),
|
|
34
|
+
/* @__PURE__ */ n("span", { className: "text-title", children: (g = i.find((e) => e.lang === a)) == null ? void 0 : g.name })
|
|
31
35
|
] }) }),
|
|
32
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ n(v, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: i.map((e) => /* @__PURE__ */ n(
|
|
33
37
|
k,
|
|
34
38
|
{
|
|
35
39
|
prefetch: !1,
|
|
36
40
|
withLocale: !1,
|
|
37
|
-
className:
|
|
41
|
+
className: N(
|
|
38
42
|
"p-2 rounded-lg flex w-full justify-between items-center",
|
|
39
|
-
a ===
|
|
43
|
+
a === e.lang ? "text-primary" : ""
|
|
40
44
|
),
|
|
41
|
-
href: u(
|
|
42
|
-
onClick:
|
|
43
|
-
children:
|
|
45
|
+
href: u(e.lang),
|
|
46
|
+
onClick: d,
|
|
47
|
+
children: e.name
|
|
44
48
|
},
|
|
45
|
-
|
|
49
|
+
e.lang
|
|
46
50
|
)) })
|
|
47
51
|
] }) }) }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ r("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
|
|
53
|
+
/* @__PURE__ */ n("div", { children: c("theme") }),
|
|
54
|
+
/* @__PURE__ */ n($, {})
|
|
51
55
|
] })
|
|
52
56
|
] });
|
|
53
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"tailwind-merge": "3.3.1",
|
|
33
33
|
"next": "15.5.6",
|
|
34
34
|
"antd": "6.1.1",
|
|
35
|
-
"@ichaingo/auth": "1.5.
|
|
36
|
-
"@ichaingo/
|
|
37
|
-
"@ichaingo/image": "1.5.
|
|
38
|
-
"@ichaingo/
|
|
39
|
-
"@ichaingo/
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
42
|
-
"@ichaingo/
|
|
43
|
-
"@ichaingo/iconfont": "1.5.
|
|
44
|
-
"@ichaingo/
|
|
45
|
-
"@ichaingo/
|
|
46
|
-
"@ichaingo/
|
|
47
|
-
"@ichaingo/
|
|
35
|
+
"@ichaingo/auth": "1.5.26",
|
|
36
|
+
"@ichaingo/avatar": "1.5.26",
|
|
37
|
+
"@ichaingo/image": "1.5.26",
|
|
38
|
+
"@ichaingo/better-link": "1.5.26",
|
|
39
|
+
"@ichaingo/link": "1.5.26",
|
|
40
|
+
"@ichaingo/translation": "1.5.26",
|
|
41
|
+
"@ichaingo/ui": "1.5.26",
|
|
42
|
+
"@ichaingo/theme-toggle": "1.5.26",
|
|
43
|
+
"@ichaingo/iconfont": "1.5.26",
|
|
44
|
+
"@ichaingo/request": "1.5.26",
|
|
45
|
+
"@ichaingo/with-login": "1.5.26",
|
|
46
|
+
"@ichaingo/token": "1.5.26",
|
|
47
|
+
"@ichaingo/tooltip": "1.5.26"
|
|
48
48
|
}
|
|
49
49
|
}
|