@ichaingo/header 1.4.72 → 1.4.85
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.js +24 -22
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, Fragment as x, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { twMerge as i } from "tailwind-merge";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import k from "@ichaingo/request";
|
|
4
|
+
import m, { HeaderSource as a } from "./lib/Right.js";
|
|
5
5
|
import g from "./lib/Logo.js";
|
|
6
|
-
import {
|
|
7
|
-
import { USER_EVENTS as
|
|
8
|
-
async function N({ extra: l, children:
|
|
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 = a.DEFAULT }) {
|
|
9
|
+
var n;
|
|
9
10
|
let e = {
|
|
10
11
|
data: {}
|
|
11
12
|
};
|
|
12
13
|
try {
|
|
13
|
-
|
|
14
|
+
const s = (n = (await E()).get("refresh_token")) == null ? void 0 : n.value;
|
|
15
|
+
if (typeof s < "u" && s !== "")
|
|
14
16
|
try {
|
|
15
|
-
e = await
|
|
17
|
+
e = await k.get("/v2/users/profile", {
|
|
16
18
|
baseURL: process.env.AUTH_INNER_API_URL
|
|
17
19
|
});
|
|
18
|
-
} catch (
|
|
19
|
-
console.error(
|
|
20
|
+
} catch (h) {
|
|
21
|
+
console.error(h), e = { data: {} };
|
|
20
22
|
}
|
|
21
23
|
} catch {
|
|
22
24
|
e = { data: {} };
|
|
23
25
|
}
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
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 === a.CHAT ? "hidden md:block" : "block", f), children: [
|
|
28
|
+
/* @__PURE__ */ r("div", { className: "md:bg-module 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 === a.CHAT ? "hidden md:flex" : "flex"), children: [
|
|
30
|
+
/* @__PURE__ */ o(g, {}),
|
|
31
|
+
p
|
|
30
32
|
] }),
|
|
31
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ o(m, { hideNews: d, hideLogin: c, user: (e == null ? void 0 : e.data) || {} })
|
|
32
34
|
] }),
|
|
33
35
|
l
|
|
34
36
|
] }),
|
|
35
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ o("div", { className: i(t === a.CHAT ? "block md:hidden" : "hidden"), children: /* @__PURE__ */ o(m, { hideNews: d, source: t, hideLogin: c, user: (e == null ? void 0 : e.data) || {} }) })
|
|
36
38
|
] });
|
|
37
39
|
}
|
|
38
40
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
a as HeaderSource,
|
|
42
|
+
_ as USER_EVENTS,
|
|
41
43
|
N as default,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
w as emitUserEvent,
|
|
45
|
+
j as onUserEvent
|
|
44
46
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.85",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"react-dom": "^19.1.0",
|
|
28
28
|
"tailwind-merge": "^2.5.5",
|
|
29
29
|
"next": "15.1.6",
|
|
30
|
-
"@ichaingo/auth": "1.4.
|
|
31
|
-
"@ichaingo/
|
|
32
|
-
"@ichaingo/
|
|
33
|
-
"@ichaingo/
|
|
34
|
-
"@ichaingo/
|
|
35
|
-
"@ichaingo/
|
|
36
|
-
"@ichaingo/
|
|
37
|
-
"@ichaingo/
|
|
38
|
-
"@ichaingo/iconfont": "1.4.
|
|
39
|
-
"@ichaingo/
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
42
|
-
"@ichaingo/
|
|
30
|
+
"@ichaingo/auth": "1.4.85",
|
|
31
|
+
"@ichaingo/avatar": "1.4.85",
|
|
32
|
+
"@ichaingo/link": "1.4.85",
|
|
33
|
+
"@ichaingo/translation": "1.4.85",
|
|
34
|
+
"@ichaingo/better-link": "1.4.85",
|
|
35
|
+
"@ichaingo/image": "1.4.85",
|
|
36
|
+
"@ichaingo/ui": "1.4.85",
|
|
37
|
+
"@ichaingo/theme-toggle": "1.4.85",
|
|
38
|
+
"@ichaingo/iconfont": "1.4.85",
|
|
39
|
+
"@ichaingo/request": "1.4.85",
|
|
40
|
+
"@ichaingo/token": "1.4.85",
|
|
41
|
+
"@ichaingo/with-login": "1.4.85",
|
|
42
|
+
"@ichaingo/tooltip": "1.4.85"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"rollup-plugin-preserve-use-client": "^1.0.0",
|