@0xchain/header 1.1.0-beta.6 → 1.1.0-beta.7

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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { JSX } from 'react/jsx-runtime';
3
3
 
4
4
  export declare function emitUserEvent(eventName: string, data?: any): void;
5
5
 
6
- declare function HeaderBar({ extra, children, className, hideNews, hideLogin, source }: HeaderBarProps): Promise<JSX.Element>;
6
+ declare function HeaderBar({ extra, children, className, hideNews, hideLogin, source, brand }: HeaderBarProps): Promise<JSX.Element>;
7
7
  export default HeaderBar;
8
8
 
9
9
  export declare interface HeaderBarProps extends default_2.HTMLAttributes<HTMLDivElement> {
@@ -12,8 +12,17 @@ export declare interface HeaderBarProps extends default_2.HTMLAttributes<HTMLDiv
12
12
  hideNews?: boolean;
13
13
  hideLogin?: boolean;
14
14
  source?: HeaderSource;
15
+ /** 品牌标识:iChatGo(默认)或 CHAINDIGG */
16
+ brand?: HeaderBrand;
15
17
  }
16
18
 
19
+ /**
20
+ * 品牌标识
21
+ * - "iChatGo": iChatGo 品牌(默认)
22
+ * - "CHAINDIGG": CHAINDIGG 品牌
23
+ */
24
+ export declare type HeaderBrand = "iChatGo" | "CHAINDIGG";
25
+
17
26
  export declare enum HeaderSource {
18
27
  EXPLORER = "explorer",
19
28
  CHAT = "chat",
package/dist/index.js CHANGED
@@ -1,46 +1,56 @@
1
- import { jsxs as r, Fragment as x, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
2
  import { twMerge as i } from "tailwind-merge";
3
3
  import k from "@0xchain/request";
4
- import m, { HeaderSource as o } from "./lib/Right.js";
4
+ import l, { HeaderSource as a } from "./lib/Right.js";
5
5
  import g from "./lib/Logo.js";
6
- import { cookies as E } from "next/headers";
7
- import { USER_EVENTS as _, emitUserEvent as w, onUserEvent as j } from "./lib/events.js";
8
- async function N({ extra: l, children: p, className: f, hideNews: d, hideLogin: c, source: t = o.DEFAULT }) {
6
+ import { cookies as v } from "next/headers";
7
+ import { HeaderProvider as E } from "./lib/context.js";
8
+ import { USER_EVENTS as w, emitUserEvent as j, onUserEvent as G } from "./lib/events.js";
9
+ async function R({
10
+ extra: f,
11
+ children: p,
12
+ className: h,
13
+ hideNews: d = !1,
14
+ hideLogin: c = !1,
15
+ source: r = a.DEFAULT,
16
+ brand: s = "iChatGo"
17
+ }) {
9
18
  var n;
10
19
  let e = {
11
20
  data: {}
12
21
  };
13
- try {
14
- const s = (n = (await E()).get("refresh_token")) == null ? void 0 : n.value;
15
- if (typeof s < "u" && s !== "")
16
- try {
17
- e = await k.get("/v2/users/profile", {
18
- baseURL: process.env.AUTH_INNER_API_URL
19
- });
20
- } catch (h) {
21
- console.error(h), e = { data: {} };
22
- }
23
- } catch {
24
- e = { data: {} };
25
- }
26
- return /* @__PURE__ */ r(x, { children: [
27
- /* @__PURE__ */ r("div", { className: i("sticky left-0 right-0 top-0 bg-background h-16 z-999", t === o.CHAT ? "hidden md:block" : "block", f), children: [
28
- /* @__PURE__ */ r("div", { className: "md:bg-card h-13 text-center flex flex-wrap justify-between items-center gap-2 px-4", children: [
29
- /* @__PURE__ */ r("div", { className: i("items-center flex-1 gap-6", t === o.CHAT ? "hidden md:flex" : "flex"), children: [
30
- /* @__PURE__ */ a(g, {}),
22
+ if (s !== "CHAINDIGG")
23
+ try {
24
+ const m = (n = (await v()).get("refresh_token")) == null ? void 0 : n.value;
25
+ if (typeof m < "u" && m !== "")
26
+ try {
27
+ e = await k.get("/v2/users/profile", {
28
+ baseURL: process.env.AUTH_INNER_API_URL
29
+ });
30
+ } catch (x) {
31
+ console.error(x), e = { data: {} };
32
+ }
33
+ } catch {
34
+ e = { data: {} };
35
+ }
36
+ return /* @__PURE__ */ t(E, { brand: s, children: [
37
+ /* @__PURE__ */ t("div", { className: i("sticky left-0 right-0 top-0 bg-background h-16 z-999", r === a.CHAT ? "hidden md:block" : "block", h), children: [
38
+ /* @__PURE__ */ t("div", { className: "md:bg-card h-13 text-center flex flex-wrap justify-between items-center gap-2 px-4", children: [
39
+ /* @__PURE__ */ t("div", { className: i("items-center flex-1 gap-6", r === a.CHAT ? "hidden md:flex" : "flex"), children: [
40
+ /* @__PURE__ */ o(g, {}),
31
41
  p
32
42
  ] }),
33
- /* @__PURE__ */ a(m, { hideNews: d, hideLogin: c, user: (e == null ? void 0 : e.data) || {} })
43
+ /* @__PURE__ */ o(l, { hideNews: d, hideLogin: c, user: (e == null ? void 0 : e.data) || {} })
34
44
  ] }),
35
- l
45
+ f
36
46
  ] }),
37
- /* @__PURE__ */ a("div", { className: i(t === o.CHAT ? "block md:hidden" : "hidden"), children: /* @__PURE__ */ a(m, { hideNews: d, source: t, hideLogin: c, user: (e == null ? void 0 : e.data) || {} }) })
47
+ /* @__PURE__ */ o("div", { className: i(r === a.CHAT ? "block md:hidden" : "hidden"), children: /* @__PURE__ */ o(l, { hideNews: d, source: r, hideLogin: c, user: (e == null ? void 0 : e.data) || {} }) })
38
48
  ] });
39
49
  }
40
50
  export {
41
- o as HeaderSource,
42
- _ as USER_EVENTS,
43
- N as default,
44
- w as emitUserEvent,
45
- j as onUserEvent
51
+ a as HeaderSource,
52
+ w as USER_EVENTS,
53
+ R as default,
54
+ j as emitUserEvent,
55
+ G as onUserEvent
46
56
  };
@@ -1,21 +1,42 @@
1
1
  'use client';
2
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
- import i from "rc-drawer";
4
- import { Menu as d, X as m } from "lucide-react";
5
- import f from "./Nav.js";
6
- import { useState as p } from "react";
7
- function b({ hideLogin: a, hideNews: n, user: s }) {
8
- const [o, t] = p(!1);
9
- if (!o)
10
- return /* @__PURE__ */ e(d, { onClick: () => t(!0), size: 32, style: { color: "var(--foreground)" }, className: "md:hidden bg-card rounded-lg p-[4px] " });
2
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
3
+ import d from "rc-drawer";
4
+ import { Menu as f, X as m } from "lucide-react";
5
+ import p from "./Nav.js";
6
+ import { useState as u } from "react";
7
+ import { useIsChaindigg as g } from "./context.js";
8
+ function N({
9
+ hideLogin: s = !1,
10
+ hideNews: n = !1,
11
+ user: i
12
+ }) {
13
+ const e = g(), [a, t] = u(!1);
14
+ if (!a)
15
+ return /* @__PURE__ */ o(
16
+ f,
17
+ {
18
+ onClick: () => t(!0),
19
+ size: 32,
20
+ style: { color: "var(--foreground)" },
21
+ className: "md:hidden bg-card rounded-lg p-[4px]"
22
+ }
23
+ );
11
24
  const l = (r) => {
12
25
  r == null || r.preventDefault(), r == null || r.stopPropagation(), t(!1);
13
26
  };
14
- return /* @__PURE__ */ e(i, { open: o, placement: "right", className: "block md:hidden fixed top-0 bottom-0 left-0 right-0 z-1001 bg-background/70 p-2 h-screen", children: /* @__PURE__ */ c("div", { className: "w-full max-h-[calc(100svh-16px)] overflow-y-auto p-3 bg-card rounded-lg", children: [
15
- /* @__PURE__ */ e("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ e(m, { size: 24, style: { color: "var(--foreground)" }, onClick: (r) => l(r) }) }),
16
- /* @__PURE__ */ e(f, { onClick: (r) => l(r), hideLogin: a, hideNews: n, user: s })
17
- ] }) });
27
+ return /* @__PURE__ */ o(
28
+ d,
29
+ {
30
+ open: a,
31
+ placement: "right",
32
+ className: `block md:hidden fixed top-0 bottom-0 left-0 right-0 z-1001 p-2 ${e ? "bg-background" : "bg-background/70 h-screen"}`,
33
+ children: /* @__PURE__ */ c("div", { className: `w-full overflow-y-auto p-3 bg-card rounded-lg ${e ? "max-h-full" : "max-h-[calc(100svh-16px)]"}`, children: [
34
+ /* @__PURE__ */ o("div", { className: "flex justify-end items-center p-2", children: /* @__PURE__ */ o(m, { size: 24, style: { color: "var(--foreground)" }, onClick: (r) => l(r) }) }),
35
+ /* @__PURE__ */ o(p, { onClick: (r) => l(r), hideLogin: s, hideNews: n, user: i })
36
+ ] })
37
+ }
38
+ );
18
39
  }
19
40
  export {
20
- b as default
41
+ N as default
21
42
  };
package/dist/lib/Logo.js CHANGED
@@ -1,23 +1,65 @@
1
1
  'use client';
2
- import { jsx as r } from "react/jsx-runtime";
2
+ import { jsxs as t, jsx as r } from "react/jsx-runtime";
3
3
  import o from "@0xchain/image";
4
- import t from "@0xchain/link";
5
- import { twMerge as e } from "tailwind-merge";
6
- function p() {
7
- return /* @__PURE__ */ r(t, { suppressHydrationWarning: !0, href: "/", baseUrl: process.env.NEXT_PUBLIC_BASE_URL, className: e(
8
- "w-auto shrink-0 block cursor-pointer"
9
- ), children: /* @__PURE__ */ r(
10
- o,
4
+ import e from "@0xchain/link";
5
+ import { twMerge as i } from "tailwind-merge";
6
+ import { useIsChaindigg as s } from "./context.js";
7
+ function g() {
8
+ return s() ? /* @__PURE__ */ t(
9
+ e,
11
10
  {
12
- src: `${process.env.NEXT_PUBLIC_CDN_URL}/logo.png`,
13
- width: 154,
14
- height: 32,
15
- alt: "logo",
16
- objectFit: "contain",
17
- priority: !0
11
+ suppressHydrationWarning: !0,
12
+ href: "/explorer",
13
+ baseUrl: "",
14
+ className: i("w-auto shrink-0 block cursor-pointer"),
15
+ children: [
16
+ /* @__PURE__ */ r(
17
+ o,
18
+ {
19
+ className: "block dark:hidden",
20
+ src: `${process.env.NEXT_PUBLIC_CDN_URL}/uploads/2026/01/07/695dcb36c177e.png`,
21
+ width: 154,
22
+ height: 32,
23
+ alt: "logo",
24
+ objectFit: "contain",
25
+ priority: !0
26
+ }
27
+ ),
28
+ /* @__PURE__ */ r(
29
+ o,
30
+ {
31
+ className: "hidden dark:block",
32
+ src: `${process.env.NEXT_PUBLIC_CDN_URL}/uploads/2026/01/07/695dcf43c95d8.png`,
33
+ width: 154,
34
+ height: 32,
35
+ alt: "logo",
36
+ objectFit: "contain",
37
+ priority: !0
38
+ }
39
+ )
40
+ ]
18
41
  }
19
- ) });
42
+ ) : /* @__PURE__ */ r(
43
+ e,
44
+ {
45
+ suppressHydrationWarning: !0,
46
+ href: "/",
47
+ baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
48
+ className: i("w-auto shrink-0 block cursor-pointer"),
49
+ children: /* @__PURE__ */ r(
50
+ o,
51
+ {
52
+ src: `${process.env.NEXT_PUBLIC_CDN_URL}/logo.png`,
53
+ width: 154,
54
+ height: 32,
55
+ alt: "logo",
56
+ objectFit: "contain",
57
+ priority: !0
58
+ }
59
+ )
60
+ }
61
+ );
20
62
  }
21
63
  export {
22
- p as default
64
+ g as default
23
65
  };
package/dist/lib/Nav.js CHANGED
@@ -1,102 +1,175 @@
1
1
  'use client';
2
- import { jsx as r, jsxs as d, Fragment as L } from "react/jsx-runtime";
3
- import _ from "@0xchain/link";
4
- import v from "./User/index.js";
5
- import N from "./Setting/index.js";
6
- import u from "@0xchain/translation";
7
- import { twMerge as a } from "tailwind-merge";
8
- import S from "@0xchain/better-link";
9
- import { useLocale as k } from "next-intl";
10
- import P from "./User/Logout.js";
11
- import { useState as m, useCallback as B, useEffect as T } from "react";
12
- import I from "./User/SignIn.js";
13
- import { fetchUserProfile as j } from "@0xchain/auth";
14
- import { onUserEvent as A, cleanUserEvent as R, USER_EVENTS as f } from "./events.js";
15
- import { usePathname as C } from "next/navigation";
16
- import D from "./Explorer.js";
17
- function ee({ onClick: o = () => {
18
- }, hideNews: p = !1, hideLogin: c = !1, user: h }) {
19
- const { gotoAISQL: x, gotoChat: g } = S(), t = k(), l = C(), [U, w] = m(""), [s, E] = m(h), [X, b] = m(!1), y = [
2
+ import { jsx as r, jsxs as i, Fragment as P } from "react/jsx-runtime";
3
+ import p from "@0xchain/link";
4
+ import j from "./User/index.js";
5
+ import c from "./Setting/index.js";
6
+ import h from "@0xchain/translation";
7
+ import { twMerge as l } from "tailwind-merge";
8
+ import I from "@0xchain/better-link";
9
+ import { useLocale as T } from "next-intl";
10
+ import k from "./User/Logout.js";
11
+ import { useState as m, useCallback as A, useEffect as R } from "react";
12
+ import C from "./User/SignIn.js";
13
+ import { fetchUserProfile as X } from "@0xchain/auth";
14
+ import { onUserEvent as D, cleanUserEvent as K, USER_EVENTS as x } from "./events.js";
15
+ import { usePathname as $ } from "next/navigation";
16
+ import g from "./Explorer.js";
17
+ import { useIsChaindigg as q } from "./context.js";
18
+ function le({ onClick: t = () => {
19
+ }, hideNews: w = !1, hideLogin: U = !1, user: b }) {
20
+ const a = q(), { gotoAISQL: y, gotoChat: E } = I(), s = T(), n = $(), [L, v] = m(""), [d, N] = m(b), [F, _] = m(!1), S = [
20
21
  {
21
22
  baseUrl: process.env.NEXT_PUBLIC_CHAT_URL,
22
- href: g({ locale: t }),
23
- key: `/${t}`,
23
+ href: E({ locale: s }),
24
+ key: `/${s}`,
24
25
  label: /* @__PURE__ */ r("span", { children: "iSearch" }),
25
- show: (e) => e === `/${t}` || e.includes(`/${t}/conversation`)
26
+ show: (e) => e === `/${s}` || e.includes(`/${s}/conversation`)
26
27
  },
27
28
  {
28
29
  baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
29
- href: x({ locale: t }),
30
+ href: y({ locale: s }),
30
31
  key: "/sql",
31
32
  label: "iSQL",
32
- show: (e) => e.includes(`/${t}/sql`)
33
+ show: (e) => e.includes(`/${s}/sql`)
33
34
  },
34
35
  {
35
36
  baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
36
37
  href: "/explorer",
37
38
  key: "/explorer",
38
- label: /* @__PURE__ */ r(D, { onClick: o, onExpandChange: b }),
39
+ label: /* @__PURE__ */ r(g, { onClick: t, onExpandChange: _ }),
39
40
  show: (e) => e.includes("/explorer")
40
41
  },
41
- // {
42
- // baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
43
- // href: `/etf/btc-us`,
44
- // key: '/etf',
45
- // label: <Translation value="etf" parentKey="menu" />,
46
- // show: (pathname: string) => {
47
- // return pathname.includes(`/etf`)
48
- // }
49
- // },
50
42
  {
51
43
  baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
52
44
  href: "/news",
53
45
  key: "/news",
54
- label: /* @__PURE__ */ r(u, { value: "news", parentKey: "menu" }),
46
+ label: /* @__PURE__ */ r(h, { value: "news", parentKey: "menu" }),
55
47
  show: (e) => e.includes("/news")
56
48
  },
57
49
  {
58
50
  baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
59
51
  href: "/ranking/token",
60
52
  key: "/ranking",
61
- label: /* @__PURE__ */ r(u, { value: "ranking", parentKey: "menu" }),
53
+ label: /* @__PURE__ */ r(h, { value: "ranking", parentKey: "menu" }),
62
54
  show: (e) => e.includes("/ranking")
63
55
  }
64
- ].filter((e) => p ? !["/explorer", "/chat", "/sql"].includes(e.key) : !0), i = B(() => new Promise((e) => {
65
- j().then((n) => {
66
- E(n), w((/* @__PURE__ */ new Date()).getTime().toString()), e(n);
56
+ ].filter((e) => w ? !["/explorer", "/chat", "/sql"].includes(e.key) : !0), B = [
57
+ {
58
+ baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
59
+ href: "/explorer",
60
+ key: "/explorer",
61
+ label: /* @__PURE__ */ r(g, {}),
62
+ show: (e) => e.includes("/explorer")
63
+ }
64
+ ], u = a ? B : S, f = A(() => new Promise((e) => {
65
+ X().then((o) => {
66
+ N(o), v((/* @__PURE__ */ new Date()).getTime().toString()), e(o);
67
67
  });
68
68
  }), []);
69
- return T(() => (A(f.PROFILE_UPDATED, i), () => {
70
- R(f.PROFILE_UPDATED, i);
71
- }), []), /* @__PURE__ */ d(
69
+ return R(() => {
70
+ if (!a)
71
+ return D(x.PROFILE_UPDATED, f), () => {
72
+ K(x.PROFILE_UPDATED, f);
73
+ };
74
+ }, [a]), a ? /* @__PURE__ */ i(
75
+ "nav",
76
+ {
77
+ className: l(
78
+ "flex flex-col justify-start items-start md:px-3",
79
+ "md:flex-row md:justify-end md:items-start md:px-0",
80
+ "md:gap-6"
81
+ ),
82
+ children: [
83
+ /* @__PURE__ */ r(
84
+ "ul",
85
+ {
86
+ className: l(
87
+ "flex flex-col justify-start items-start w-full h-full text-sm leading-[44px] z-1001 text-foreground",
88
+ "md:flex-row md:items-center md:w-auto md:h-[34px] md:leading-[34px] md:gap-6",
89
+ "order-2 md:order-0"
90
+ ),
91
+ children: u.map((e, o) => /* @__PURE__ */ r(
92
+ "li",
93
+ {
94
+ className: l(
95
+ "w-full md:w-auto h-11 md:h-auto cursor-pointer hover:text-primary",
96
+ e.show(n) && "border-b-2 border-primary text-primary"
97
+ ),
98
+ children: e.href === n ? e.label : /* @__PURE__ */ r(
99
+ p,
100
+ {
101
+ href: e.href,
102
+ onClick: t,
103
+ className: "h-full flex items-center justify-start",
104
+ baseUrl: e.baseUrl,
105
+ suppressHydrationWarning: !0,
106
+ children: e.label
107
+ }
108
+ )
109
+ },
110
+ o
111
+ ))
112
+ }
113
+ ),
114
+ /* @__PURE__ */ r(c, { onClick: t })
115
+ ]
116
+ }
117
+ ) : /* @__PURE__ */ i(
72
118
  "nav",
73
119
  {
74
- className: a(
120
+ className: l(
75
121
  "flex flex-col justify-start items-start md:px-3",
76
- "md:flex-row md:justify-end md:items-center md:px-0",
122
+ "md:flex-row md:justify-end md:items-center md:px-0",
77
123
  "md:gap-4"
78
124
  ),
79
125
  children: [
80
126
  /* @__PURE__ */ r(
81
127
  "ul",
82
128
  {
83
- className: a(
84
- "flex flex-col justify-start items-start w-full h-full text-sm z-1001 text-foreground",
85
- "md:flex-row md:items-center md:w-auto md:h-[34px] md:gap-6",
129
+ className: l(
130
+ "flex flex-col justify-start items-start w-full h-full text-sm z-1001 text-foreground",
131
+ "md:flex-row md:items-center md:w-auto md:h-[34px] md:gap-6",
86
132
  "order-2 md:order-0"
87
133
  ),
88
- children: y.map((e, n) => /* @__PURE__ */ r("li", { className: a("w-full md:px-4 md:py-1 md:h-auto font-bold md:w-auto cursor-pointer md:rounded-full", e.key === "/explorer" ? "h-auto" : "h-11", e.show(l) ? "md:text-primary md:bg-primary/20" : "md:hover:bg-border"), children: e.href === l ? e.label : /* @__PURE__ */ r(_, { href: e.href, onClick: o, className: "h-full flex items-center justify-start", baseUrl: e.baseUrl, suppressHydrationWarning: !0, children: e.label }) }, n))
134
+ children: u.map((e, o) => /* @__PURE__ */ r(
135
+ "li",
136
+ {
137
+ className: l(
138
+ "w-full md:px-4 md:py-1 md:h-auto font-bold md:w-auto cursor-pointer md:rounded-full",
139
+ e.key === "/explorer" ? "h-auto" : "h-11",
140
+ e.show(n) ? "md:text-primary md:bg-primary/20" : "md:hover:bg-border"
141
+ ),
142
+ children: e.href === n ? e.label : /* @__PURE__ */ r(
143
+ p,
144
+ {
145
+ href: e.href,
146
+ onClick: t,
147
+ className: "h-full flex items-center justify-start",
148
+ baseUrl: e.baseUrl,
149
+ suppressHydrationWarning: !0,
150
+ children: e.label
151
+ }
152
+ )
153
+ },
154
+ o
155
+ ))
89
156
  }
90
157
  ),
91
- /* @__PURE__ */ r(N, { onClick: o }),
92
- !l.includes("/login") && !c ? /* @__PURE__ */ d(L, { children: [
93
- /* @__PURE__ */ r(v, { onClick: o, userInfo: s }, U),
94
- s != null && s.id ? /* @__PURE__ */ r("div", { className: "flex md:hidden h-11 md:h-auto cursor-pointer whitespace-nowrap order-3 bg-background rounded-lg p-2 mt-3 w-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ r(P, {}) }) : /* @__PURE__ */ r(I, { onClick: o, className: "flex md:hidden h-11 cursor-pointer whitespace-nowrap order-3 bg-primary text-white rounded-lg p-2 mt-3 w-full items-center justify-center" })
158
+ /* @__PURE__ */ r(c, { onClick: t }),
159
+ !n.includes("/login") && !U ? /* @__PURE__ */ i(P, { children: [
160
+ /* @__PURE__ */ r(j, { onClick: t, userInfo: d }, L),
161
+ d != null && d.id ? /* @__PURE__ */ r("div", { className: "flex md:hidden h-11 md:h-auto cursor-pointer whitespace-nowrap order-3 bg-background rounded-lg p-2 mt-3 w-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ r(k, {}) }) : /* @__PURE__ */ r(
162
+ C,
163
+ {
164
+ onClick: t,
165
+ className: "flex md:hidden h-11 cursor-pointer whitespace-nowrap order-3 bg-primary text-white rounded-lg p-2 mt-3 w-full items-center justify-center"
166
+ }
167
+ )
95
168
  ] }) : null
96
169
  ]
97
170
  }
98
171
  );
99
172
  }
100
173
  export {
101
- ee as default
174
+ le as default
102
175
  };
package/dist/lib/Right.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
- import i from "./Nav.js";
3
- import l from "./Drawer.js";
4
- import { twMerge as o } from "tailwind-merge";
5
- var d = /* @__PURE__ */ ((t) => (t.EXPLORER = "explorer", t.CHAT = "chat", t.DEFAULT = "default", t))(d || {});
2
+ import l from "./Nav.js";
3
+ import i from "./Drawer.js";
4
+ import { twMerge as s } from "tailwind-merge";
5
+ var o = /* @__PURE__ */ ((t) => (t.EXPLORER = "explorer", t.CHAT = "chat", t.DEFAULT = "default", t))(o || {});
6
6
  function x({
7
- hideNews: t,
8
- hideLogin: m,
9
- user: a,
10
- source: e = "default"
7
+ hideNews: t = !1,
8
+ hideLogin: a = !1,
9
+ user: e,
10
+ source: m = "default"
11
11
  /* DEFAULT */
12
12
  }) {
13
- return /* @__PURE__ */ f("div", { className: o(e === "chat" ? "" : "flex justify-end items-center md:gap-10 z-1001"), children: [
14
- /* @__PURE__ */ r(l, { hideLogin: m, hideNews: t, user: a }),
15
- /* @__PURE__ */ r("div", { className: "hidden md:block", children: /* @__PURE__ */ r(i, { hideNews: t, hideLogin: m, user: a }) })
13
+ return /* @__PURE__ */ f("div", { className: s(m === "chat" ? "" : "flex justify-end items-center md:gap-10 z-1001"), children: [
14
+ /* @__PURE__ */ r(i, { hideLogin: a, hideNews: t, user: e }),
15
+ /* @__PURE__ */ r("div", { className: "hidden md:block", children: /* @__PURE__ */ r(l, { hideNews: t, hideLogin: a, user: e }) })
16
16
  ] });
17
17
  }
18
18
  export {
19
- d as HeaderSource,
19
+ o as HeaderSource,
20
20
  x as default
21
21
  };
@@ -1,18 +1,45 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import i from "@0xchain/iconfont";
3
- import a from "@0xchain/tooltip";
1
+ 'use client';
2
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
3
+ import t from "@0xchain/iconfont";
4
+ import n from "@0xchain/tooltip";
4
5
  import r from "./SettingBody.js";
5
- function g({ onClick: o = () => {
6
+ import { useIsChaindigg as c } from "../context.js";
7
+ function p({ onClick: d = () => {
6
8
  } }) {
7
- return /* @__PURE__ */ n("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
8
- /* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-card hover:bg-border rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(a, { side: "bottom", onChange: (t) => {
9
- document.querySelectorAll("iframe").forEach((d) => {
10
- d.style.pointerEvents = t ? "none" : "auto";
11
- });
12
- }, needClick: !0, contentClassName: "bg-card w-70 rounded-lg bg-card text-foreground border border-border", trigger: /* @__PURE__ */ e(i, { type: "icon-centersetup", className: "text-2xl" }), arrowClassName: "fill-card", children: /* @__PURE__ */ e(r, { onClick: o }) }) }),
9
+ const i = c(), a = (s) => {
10
+ document.querySelectorAll("iframe").forEach((l) => {
11
+ l.style.pointerEvents = s ? "none" : "auto";
12
+ });
13
+ };
14
+ return i ? /* @__PURE__ */ o("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
15
+ /* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-card rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(
16
+ n,
17
+ {
18
+ side: "bottom",
19
+ needClick: !0,
20
+ contentClassName: "w-70 rounded-lg bg-card shadow-lg text-foreground border-transparent outline-none",
21
+ trigger: /* @__PURE__ */ e(t, { type: "icon-setting", className: "text-2xl border border-transparent hover:border-border" }),
22
+ arrowClassName: "fill-module",
23
+ children: /* @__PURE__ */ e(r, { onClick: d })
24
+ }
25
+ ) }),
26
+ /* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(r, {}) })
27
+ ] }) : /* @__PURE__ */ o("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
28
+ /* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-card hover:bg-border rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(
29
+ n,
30
+ {
31
+ side: "bottom",
32
+ onChange: a,
33
+ needClick: !0,
34
+ contentClassName: "bg-card w-70 rounded-lg bg-card text-foreground border border-border",
35
+ trigger: /* @__PURE__ */ e(t, { type: "icon-centersetup", className: "text-2xl" }),
36
+ arrowClassName: "fill-card",
37
+ children: /* @__PURE__ */ e(r, { onClick: d })
38
+ }
39
+ ) }),
13
40
  /* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(r, {}) })
14
41
  ] });
15
42
  }
16
43
  export {
17
- g as default
44
+ p as default
18
45
  };
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import { createContext as o, useContext as i } from "react";
4
+ const t = o({
5
+ brand: "iChatGo"
6
+ });
7
+ function C({
8
+ children: e,
9
+ brand: r = "iChatGo"
10
+ }) {
11
+ return /* @__PURE__ */ n(t.Provider, { value: { brand: r }, children: e });
12
+ }
13
+ function a() {
14
+ return i(t);
15
+ }
16
+ function s() {
17
+ const { brand: e } = a();
18
+ return e === "CHAINDIGG";
19
+ }
20
+ export {
21
+ C as HeaderProvider,
22
+ a as useHeaderContext,
23
+ s as useIsChaindigg
24
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xchain/header",
3
- "version": "1.1.0-beta.6",
3
+ "version": "1.1.0-beta.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -32,19 +32,19 @@
32
32
  "tailwind-merge": "3.3.1",
33
33
  "next": "15.5.6",
34
34
  "antd": "6.1.1",
35
- "@0xchain/better-link": "1.1.0-beta.6",
36
- "@0xchain/link": "1.1.0-beta.6",
37
- "@0xchain/image": "1.1.0-beta.6",
38
- "@0xchain/auth": "1.1.0-beta.6",
39
- "@0xchain/avatar": "1.1.0-beta.6",
40
- "@0xchain/theme-toggle": "1.1.0-beta.6",
41
- "@0xchain/iconfont": "1.1.0-beta.6",
42
- "@0xchain/with-login": "1.1.0-beta.6",
43
- "@0xchain/tooltip": "1.1.0-beta.6",
44
- "@0xchain/token": "1.1.0-beta.6",
45
- "@0xchain/request": "1.1.0-beta.6",
46
- "@0xchain/translation": "1.1.0-beta.6",
47
- "@0xchain/ui": "1.1.0-beta.6"
35
+ "@0xchain/auth": "1.1.0-beta.7",
36
+ "@0xchain/avatar": "1.1.0-beta.7",
37
+ "@0xchain/better-link": "1.1.0-beta.7",
38
+ "@0xchain/image": "1.1.0-beta.7",
39
+ "@0xchain/link": "1.1.0-beta.7",
40
+ "@0xchain/translation": "1.1.0-beta.7",
41
+ "@0xchain/ui": "1.1.0-beta.7",
42
+ "@0xchain/theme-toggle": "1.1.0-beta.7",
43
+ "@0xchain/iconfont": "1.1.0-beta.7",
44
+ "@0xchain/with-login": "1.1.0-beta.7",
45
+ "@0xchain/request": "1.1.0-beta.7",
46
+ "@0xchain/tooltip": "1.1.0-beta.7",
47
+ "@0xchain/token": "1.1.0-beta.7"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"