@wikex/admin-kit 0.2.2 → 0.4.0
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 +11 -0
- package/README.md +2 -2
- package/dist/admin/before-login.js +2 -2
- package/dist/admin/brand.js +1 -1
- package/dist/admin/header.js +137 -53
- package/dist/admin/nav-client.js +87 -147
- package/dist/{chunk-SM6CCKQQ.js → chunk-AY7N3B45.js} +5 -5
- package/dist/scanner.d.ts +23 -0
- package/dist/scanner.js +72 -0
- package/dist/starter-client.js +1 -1
- package/package.json +2 -1
- package/src/styles/_minimal-dashboard.scss +724 -0
- package/src/styles/admin.scss +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Các thay đổi đáng chú ý của `@wikex/admin-kit` được ghi tại đây theo Semantic Versioning.
|
|
4
4
|
|
|
5
|
+
## 0.4.0 - 2026-09-13
|
|
6
|
+
|
|
7
|
+
- Thay admin shell cũ bằng dashboard layout dựa trên Minimal TypeScript 7.6.1.
|
|
8
|
+
- Thêm nav vertical/mini/mobile, workspace header và account drawer theo cùng một design system.
|
|
9
|
+
- Giữ nguyên Payload forms, Live Preview, visual editor, block modal và project adapters.
|
|
10
|
+
|
|
11
|
+
## 0.3.0 - 2026-09-13
|
|
12
|
+
|
|
13
|
+
- Thêm project scanner để phát hiện route Next.js và component React ở build-time.
|
|
14
|
+
- Component có metadata `defineWikexBlock()` hoặc hậu tố `.wikex` được đánh dấu có thể cấu hình trong CMS.
|
|
15
|
+
|
|
5
16
|
## 0.2.1 - 2026-09-12
|
|
6
17
|
|
|
7
18
|
- Publish JavaScript build và type declarations để Payload CLI chạy được trong project độc lập.
|
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Admin shell dùng chung cho các website Payload CMS của Wikex.
|
|
|
4
4
|
|
|
5
5
|
Package sở hữu:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- dashboard shell dựa trên Minimal TypeScript 7.6.1 với nav vertical/mini/mobile;
|
|
8
|
+
- workspace header, account drawer, đăng nhập, đổi theme và branding động;
|
|
9
9
|
- Live Preview editor, drawer thuộc tính, block picker và resize text;
|
|
10
10
|
- font family, line-height và runtime áp dụng typography;
|
|
11
11
|
- chuẩn hóa tiếng Việt và hướng dẫn kích thước upload ảnh.
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
var BeforeLogin = () => {
|
|
10
10
|
const { siteName } = useAdminBrand();
|
|
11
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
12
|
-
/* @__PURE__ */ jsxs("span", { className: "
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", { className: "wikex-auth-intro", children: [
|
|
12
|
+
/* @__PURE__ */ jsxs("span", { className: "wikex-auth-intro__eyebrow", children: [
|
|
13
13
|
siteName,
|
|
14
14
|
" \xB7 Trung t\xE2m n\u1ED9i dung"
|
|
15
15
|
] }),
|
package/dist/admin/brand.js
CHANGED
package/dist/admin/header.js
CHANGED
|
@@ -1,94 +1,178 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use client";
|
|
3
|
+
import {
|
|
4
|
+
LogoutButton_default
|
|
5
|
+
} from "../chunk-GZ2B5BTH.js";
|
|
3
6
|
import {
|
|
4
7
|
AdminIcon
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import
|
|
8
|
+
} from "../chunk-AY7N3B45.js";
|
|
9
|
+
import {
|
|
10
|
+
useAdminBrand
|
|
11
|
+
} from "../chunk-X7VETFVD.js";
|
|
7
12
|
import {
|
|
8
13
|
ThemeToggle_default
|
|
9
14
|
} from "../chunk-SAI5SWZA.js";
|
|
10
15
|
|
|
11
16
|
// src/admin/Header.tsx
|
|
12
|
-
import { Link
|
|
13
|
-
import {
|
|
17
|
+
import { Link as Link2, useConfig as useConfig2, useNav } from "@payloadcms/ui";
|
|
18
|
+
import { GalleryVerticalEnd, Menu } from "lucide-react";
|
|
19
|
+
|
|
20
|
+
// src/admin/AccountDrawer.tsx
|
|
21
|
+
import { Link, useAuth, useConfig } from "@payloadcms/ui";
|
|
22
|
+
import { Settings2, X } from "lucide-react";
|
|
23
|
+
import { usePathname } from "next/navigation";
|
|
14
24
|
import { formatAdminURL } from "payload/shared";
|
|
25
|
+
import { useEffect, useMemo, useState } from "react";
|
|
26
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
+
var getInitials = (name, email) => {
|
|
28
|
+
const source = name?.trim() || email?.split("@")[0] || "AD";
|
|
29
|
+
return source.split(/\s+/).slice(0, 2).map((part) => part.charAt(0).toUpperCase()).join("");
|
|
30
|
+
};
|
|
31
|
+
var AccountDrawer = () => {
|
|
32
|
+
const pathname = usePathname();
|
|
33
|
+
const { user } = useAuth();
|
|
34
|
+
const {
|
|
35
|
+
config: {
|
|
36
|
+
admin: { routes: adminRoutes },
|
|
37
|
+
routes: { admin: adminRoute }
|
|
38
|
+
}
|
|
39
|
+
} = useConfig();
|
|
40
|
+
const [open, setOpen] = useState(false);
|
|
41
|
+
const userLabel = user?.name?.trim() || user?.email?.split("@")[0] || "Qu\u1EA3n tr\u1ECB vi\xEAn";
|
|
42
|
+
const initials = useMemo(() => getInitials(user?.name, user?.email), [user?.email, user?.name]);
|
|
43
|
+
useEffect(() => setOpen(false), [pathname]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (!open) return;
|
|
46
|
+
const closeOnEscape = (event) => {
|
|
47
|
+
if (event.key === "Escape") setOpen(false);
|
|
48
|
+
};
|
|
49
|
+
window.addEventListener("keydown", closeOnEscape);
|
|
50
|
+
return () => window.removeEventListener("keydown", closeOnEscape);
|
|
51
|
+
}, [open]);
|
|
52
|
+
return /* @__PURE__ */ jsxs("div", { className: `wikex-account-drawer ${open ? "wikex-account-drawer--open" : ""}`, children: [
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
"aria-expanded": open,
|
|
57
|
+
"aria-label": `M\u1EDF t\xE0i kho\u1EA3n ${userLabel}`,
|
|
58
|
+
className: "wikex-account-button",
|
|
59
|
+
onClick: () => setOpen(true),
|
|
60
|
+
title: userLabel,
|
|
61
|
+
type: "button",
|
|
62
|
+
children: /* @__PURE__ */ jsx("span", { children: initials })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
"aria-label": "\u0110\xF3ng t\xE0i kho\u1EA3n",
|
|
69
|
+
className: "wikex-account-drawer__backdrop",
|
|
70
|
+
onClick: () => setOpen(false),
|
|
71
|
+
tabIndex: open ? 0 : -1,
|
|
72
|
+
type: "button"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsxs(
|
|
76
|
+
"aside",
|
|
77
|
+
{
|
|
78
|
+
"aria-hidden": !open,
|
|
79
|
+
"aria-label": "T\xE0i kho\u1EA3n qu\u1EA3n tr\u1ECB",
|
|
80
|
+
"aria-modal": "true",
|
|
81
|
+
className: "wikex-account-drawer__panel",
|
|
82
|
+
role: "dialog",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
"aria-label": "\u0110\xF3ng",
|
|
88
|
+
className: "wikex-account-drawer__close",
|
|
89
|
+
onClick: () => setOpen(false),
|
|
90
|
+
tabIndex: open ? 0 : -1,
|
|
91
|
+
type: "button",
|
|
92
|
+
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsxs("div", { className: "wikex-account-drawer__profile", children: [
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: "wikex-account-drawer__avatar", children: initials }),
|
|
97
|
+
/* @__PURE__ */ jsx("strong", { children: userLabel }),
|
|
98
|
+
/* @__PURE__ */ jsx("small", { children: user?.email || "T\xE0i kho\u1EA3n qu\u1EA3n tr\u1ECB" })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsx("div", { className: "wikex-account-drawer__menu", children: /* @__PURE__ */ jsxs(
|
|
101
|
+
Link,
|
|
102
|
+
{
|
|
103
|
+
className: "wikex-account-drawer__link",
|
|
104
|
+
href: formatAdminURL({ adminRoute, path: adminRoutes.account }),
|
|
105
|
+
prefetch: false,
|
|
106
|
+
tabIndex: open ? 0 : -1,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx(Settings2, { "aria-hidden": "true" }),
|
|
109
|
+
"C\xE0i \u0111\u1EB7t t\xE0i kho\u1EA3n"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
) }),
|
|
113
|
+
/* @__PURE__ */ jsx("div", { className: "wikex-account-drawer__footer", children: /* @__PURE__ */ jsx(LogoutButton_default, { tabIndex: open ? 0 : -1 }) })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] });
|
|
118
|
+
};
|
|
119
|
+
var AccountDrawer_default = AccountDrawer;
|
|
15
120
|
|
|
16
121
|
// src/admin/ViewSite.tsx
|
|
17
122
|
import { ArrowUpRight } from "lucide-react";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
var AdminViewSite = () => /* @__PURE__ */
|
|
123
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
124
|
+
var AdminViewSite = () => /* @__PURE__ */ jsxs2("a", { className: "admin-view-site", "data-slot": "button", href: "/", rel: "noreferrer", target: "_blank", children: [
|
|
20
125
|
"Xem website",
|
|
21
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ jsx2(ArrowUpRight, { "aria-hidden": "true" })
|
|
22
127
|
] });
|
|
23
128
|
var ViewSite_default = AdminViewSite;
|
|
24
129
|
|
|
25
130
|
// src/admin/Header.tsx
|
|
26
|
-
import { jsx as
|
|
27
|
-
var getInitials = (name, email) => {
|
|
28
|
-
const source = name?.trim() || email?.split("@")[0] || "AD";
|
|
29
|
-
return source.split(/\s+/).slice(0, 2).map((part) => part.charAt(0).toUpperCase()).join("");
|
|
30
|
-
};
|
|
131
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
31
132
|
var AdminHeader = () => {
|
|
32
|
-
const
|
|
133
|
+
const brand = useAdminBrand();
|
|
33
134
|
const { setNavOpen } = useNav();
|
|
34
135
|
const {
|
|
35
136
|
config: {
|
|
36
|
-
admin: { routes: adminRoutes },
|
|
37
137
|
routes: { admin: adminRoute }
|
|
38
138
|
}
|
|
39
|
-
} =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ jsxs2("div", { className: "minimal-admin-header__left", children: [
|
|
44
|
-
/* @__PURE__ */ jsx2(
|
|
139
|
+
} = useConfig2();
|
|
140
|
+
return /* @__PURE__ */ jsx3("header", { className: "wikex-dashboard-header", children: /* @__PURE__ */ jsxs3("div", { className: "wikex-dashboard-header__container", children: [
|
|
141
|
+
/* @__PURE__ */ jsxs3("div", { className: "wikex-dashboard-header__left", children: [
|
|
142
|
+
/* @__PURE__ */ jsx3(
|
|
45
143
|
"button",
|
|
46
144
|
{
|
|
47
145
|
"aria-label": "M\u1EDF menu qu\u1EA3n tr\u1ECB",
|
|
48
|
-
className: "
|
|
146
|
+
className: "wikex-dashboard-header__menu",
|
|
49
147
|
onClick: () => setNavOpen(true),
|
|
50
148
|
type: "button",
|
|
51
|
-
children: /* @__PURE__ */
|
|
149
|
+
children: /* @__PURE__ */ jsx3(Menu, { "aria-hidden": "true" })
|
|
52
150
|
}
|
|
53
151
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
152
|
+
/* @__PURE__ */ jsx3(
|
|
153
|
+
Link2,
|
|
56
154
|
{
|
|
57
155
|
"aria-label": "V\u1EC1 dashboard",
|
|
58
|
-
className: "
|
|
156
|
+
className: "wikex-dashboard-header__mobile-logo",
|
|
59
157
|
href: adminRoute,
|
|
60
158
|
prefetch: false,
|
|
61
|
-
children: /* @__PURE__ */
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
] }),
|
|
65
|
-
/* @__PURE__ */ jsxs2("div", { className: "minimal-admin-header__actions", children: [
|
|
66
|
-
/* @__PURE__ */ jsx2(ViewSite_default, {}),
|
|
67
|
-
/* @__PURE__ */ jsx2(ThemeToggle_default, {}),
|
|
68
|
-
/* @__PURE__ */ jsx2(
|
|
69
|
-
Link,
|
|
70
|
-
{
|
|
71
|
-
"aria-label": `M\u1EDF t\xE0i kho\u1EA3n ${userLabel}`,
|
|
72
|
-
className: "minimal-admin-header__settings",
|
|
73
|
-
href: formatAdminURL({ adminRoute, path: adminRoutes.account }),
|
|
74
|
-
prefetch: false,
|
|
75
|
-
title: "C\xE0i \u0111\u1EB7t t\xE0i kho\u1EA3n",
|
|
76
|
-
children: /* @__PURE__ */ jsx2(Settings2, { "aria-hidden": "true" })
|
|
159
|
+
children: /* @__PURE__ */ jsx3(AdminIcon, {})
|
|
77
160
|
}
|
|
78
161
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)
|
|
162
|
+
/* @__PURE__ */ jsxs3("div", { className: "wikex-dashboard-header__workspace", children: [
|
|
163
|
+
/* @__PURE__ */ jsx3("span", { className: "wikex-dashboard-header__workspace-icon", children: /* @__PURE__ */ jsx3(GalleryVerticalEnd, { "aria-hidden": "true" }) }),
|
|
164
|
+
/* @__PURE__ */ jsxs3("span", { className: "wikex-dashboard-header__workspace-copy", children: [
|
|
165
|
+
/* @__PURE__ */ jsx3("small", { children: "Kh\xF4ng gian l\xE0m vi\u1EC7c" }),
|
|
166
|
+
/* @__PURE__ */ jsx3("strong", { children: brand.siteName })
|
|
167
|
+
] })
|
|
168
|
+
] })
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ jsxs3("div", { className: "wikex-dashboard-header__actions", children: [
|
|
171
|
+
/* @__PURE__ */ jsx3(ViewSite_default, {}),
|
|
172
|
+
/* @__PURE__ */ jsx3(ThemeToggle_default, {}),
|
|
173
|
+
/* @__PURE__ */ jsx3(AccountDrawer_default, {})
|
|
90
174
|
] })
|
|
91
|
-
] });
|
|
175
|
+
] }) });
|
|
92
176
|
};
|
|
93
177
|
var Header_default = AdminHeader;
|
|
94
178
|
export {
|
package/dist/admin/nav-client.js
CHANGED
|
@@ -3,16 +3,13 @@
|
|
|
3
3
|
import {
|
|
4
4
|
AdminIcon,
|
|
5
5
|
AdminLogo
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-AY7N3B45.js";
|
|
7
7
|
import {
|
|
8
8
|
useAdminBrand
|
|
9
9
|
} from "../chunk-X7VETFVD.js";
|
|
10
|
-
import {
|
|
11
|
-
LogoutButton_default
|
|
12
|
-
} from "../chunk-GZ2B5BTH.js";
|
|
13
10
|
|
|
14
11
|
// src/admin/NavClient.tsx
|
|
15
|
-
import { Link,
|
|
12
|
+
import { Link, useConfig, useNav } from "@payloadcms/ui";
|
|
16
13
|
import {
|
|
17
14
|
BookOpenText,
|
|
18
15
|
BriefcaseBusiness,
|
|
@@ -20,12 +17,10 @@ import {
|
|
|
20
17
|
ChevronRight,
|
|
21
18
|
FileText,
|
|
22
19
|
FolderKanban,
|
|
23
|
-
GalleryVerticalEnd,
|
|
24
20
|
Home,
|
|
25
21
|
Image,
|
|
26
22
|
LayoutDashboard,
|
|
27
23
|
Library,
|
|
28
|
-
Menu,
|
|
29
24
|
PanelBottom,
|
|
30
25
|
PanelTop,
|
|
31
26
|
Settings2,
|
|
@@ -35,7 +30,7 @@ import {
|
|
|
35
30
|
} from "lucide-react";
|
|
36
31
|
import { usePathname } from "next/navigation";
|
|
37
32
|
import { formatAdminURL } from "payload/shared";
|
|
38
|
-
import { useEffect,
|
|
33
|
+
import React, { useEffect, useState } from "react";
|
|
39
34
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
40
35
|
var iconBySlug = {
|
|
41
36
|
categories: Tags,
|
|
@@ -51,14 +46,9 @@ var iconBySlug = {
|
|
|
51
46
|
users: Users
|
|
52
47
|
};
|
|
53
48
|
var translateGroupLabel = (label) => label === "Collections" ? "B\u1ED9 s\u01B0u t\u1EADp" : label === "Globals" ? "Thi\u1EBFt l\u1EADp chung" : label;
|
|
54
|
-
var getInitials = (name, email) => {
|
|
55
|
-
const source = name?.trim() || email?.split("@")[0] || "AD";
|
|
56
|
-
return source.split(/\s+/).slice(0, 2).map((part) => part.charAt(0).toUpperCase()).join("");
|
|
57
|
-
};
|
|
58
49
|
var AdminNavClient = ({ groups }) => {
|
|
59
50
|
const pathname = usePathname();
|
|
60
51
|
const brand = useAdminBrand();
|
|
61
|
-
const { user } = useAuth();
|
|
62
52
|
const { hydrated, navOpen, navRef, setNavOpen, shouldAnimate } = useNav();
|
|
63
53
|
const {
|
|
64
54
|
config: {
|
|
@@ -70,8 +60,7 @@ var AdminNavClient = ({ groups }) => {
|
|
|
70
60
|
const [isMini, setIsMini] = useState(false);
|
|
71
61
|
const [isMobile, setIsMobile] = useState(false);
|
|
72
62
|
useEffect(() => {
|
|
73
|
-
|
|
74
|
-
setIsMini(storedValue === "true");
|
|
63
|
+
setIsMini(window.localStorage.getItem("wikex-dashboard-nav-mini") === "true");
|
|
75
64
|
}, []);
|
|
76
65
|
useEffect(() => {
|
|
77
66
|
const mediaQuery = window.matchMedia("(max-width: 768px)");
|
|
@@ -81,168 +70,119 @@ var AdminNavClient = ({ groups }) => {
|
|
|
81
70
|
return () => mediaQuery.removeEventListener("change", syncViewport);
|
|
82
71
|
}, []);
|
|
83
72
|
useEffect(() => {
|
|
84
|
-
document.documentElement.style.setProperty(
|
|
85
|
-
|
|
73
|
+
document.documentElement.style.setProperty(
|
|
74
|
+
"--nav-width",
|
|
75
|
+
isMini ? "var(--layout-nav-mini-width)" : "var(--layout-nav-vertical-width)"
|
|
76
|
+
);
|
|
77
|
+
window.localStorage.setItem("wikex-dashboard-nav-mini", String(isMini));
|
|
86
78
|
return () => {
|
|
87
79
|
document.documentElement.style.removeProperty("--nav-width");
|
|
88
80
|
};
|
|
89
81
|
}, [isMini]);
|
|
90
|
-
const userLabel = user?.name?.trim() || user?.email?.split("@")[0] || "Qu\u1EA3n tr\u1ECB vi\xEAn";
|
|
91
|
-
const initials = useMemo(() => getInitials(user?.name, user?.email), [user?.email, user?.name]);
|
|
92
82
|
const closeMobileNav = () => {
|
|
93
83
|
if (window.matchMedia("(max-width: 768px)").matches) setNavOpen(false);
|
|
94
84
|
};
|
|
95
|
-
const classes = [
|
|
96
|
-
"minimal-nav",
|
|
97
|
-
navOpen && "minimal-nav--open",
|
|
98
|
-
isMini && "minimal-nav--mini",
|
|
99
|
-
shouldAnimate && "minimal-nav--animate",
|
|
100
|
-
hydrated && "minimal-nav--hydrated"
|
|
101
|
-
].filter(Boolean).join(" ");
|
|
102
85
|
const isActive = (href) => pathname === href || href !== adminRoute && pathname.startsWith(`${href}/`);
|
|
86
|
+
const rootClasses = [
|
|
87
|
+
"wikex-dashboard-nav",
|
|
88
|
+
navOpen && "wikex-dashboard-nav--open",
|
|
89
|
+
isMini && "wikex-dashboard-nav--mini",
|
|
90
|
+
shouldAnimate && "wikex-dashboard-nav--animate",
|
|
91
|
+
hydrated && "wikex-dashboard-nav--hydrated"
|
|
92
|
+
].filter(Boolean).join(" ");
|
|
93
|
+
const navItem = ({
|
|
94
|
+
active,
|
|
95
|
+
href,
|
|
96
|
+
icon: Icon,
|
|
97
|
+
label
|
|
98
|
+
}) => /* @__PURE__ */ jsxs(
|
|
99
|
+
Link,
|
|
100
|
+
{
|
|
101
|
+
"aria-current": active ? "page" : void 0,
|
|
102
|
+
className: `wikex-nav-section__item ${active ? "wikex-nav-section__item--active" : ""}`,
|
|
103
|
+
href,
|
|
104
|
+
onClick: closeMobileNav,
|
|
105
|
+
prefetch: false,
|
|
106
|
+
title: label,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx("span", { className: "wikex-nav-section__icon", children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }) }),
|
|
109
|
+
/* @__PURE__ */ jsx("span", { className: "wikex-nav-section__title", children: label })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
103
113
|
return /* @__PURE__ */ jsxs(
|
|
104
114
|
"aside",
|
|
105
115
|
{
|
|
106
116
|
"aria-label": "\u0110i\u1EC1u h\u01B0\u1EDBng qu\u1EA3n tr\u1ECB",
|
|
107
|
-
className:
|
|
117
|
+
className: rootClasses,
|
|
108
118
|
inert: isMobile && !navOpen || void 0,
|
|
109
119
|
children: [
|
|
110
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
111
|
-
/* @__PURE__ */ jsxs("div", { className: "minimal-nav__brand-row", children: [
|
|
112
|
-
/* @__PURE__ */ jsxs(
|
|
113
|
-
Link,
|
|
114
|
-
{
|
|
115
|
-
"aria-label": `V\u1EC1 dashboard ${brand.siteName}`,
|
|
116
|
-
className: "minimal-nav__brand",
|
|
117
|
-
href: adminRoute,
|
|
118
|
-
onClick: closeMobileNav,
|
|
119
|
-
prefetch: false,
|
|
120
|
-
children: [
|
|
121
|
-
/* @__PURE__ */ jsx("span", { className: "minimal-nav__brand-full", children: /* @__PURE__ */ jsx(AdminLogo, {}) }),
|
|
122
|
-
/* @__PURE__ */ jsx("span", { className: "minimal-nav__brand-icon", children: /* @__PURE__ */ jsx(AdminIcon, {}) })
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
/* @__PURE__ */ jsx(
|
|
127
|
-
"button",
|
|
128
|
-
{
|
|
129
|
-
"aria-label": "\u0110\xF3ng menu",
|
|
130
|
-
className: "minimal-nav__mobile-close",
|
|
131
|
-
onClick: () => setNavOpen(false),
|
|
132
|
-
type: "button",
|
|
133
|
-
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
] }),
|
|
120
|
+
/* @__PURE__ */ jsxs("div", { className: "wikex-dashboard-nav__top", children: [
|
|
137
121
|
/* @__PURE__ */ jsxs(
|
|
138
122
|
Link,
|
|
139
123
|
{
|
|
140
|
-
|
|
124
|
+
"aria-label": `V\u1EC1 dashboard ${brand.siteName}`,
|
|
125
|
+
className: "wikex-dashboard-nav__logo",
|
|
141
126
|
href: adminRoute,
|
|
142
127
|
onClick: closeMobileNav,
|
|
143
128
|
prefetch: false,
|
|
144
|
-
title: brand.siteName,
|
|
145
129
|
children: [
|
|
146
|
-
/* @__PURE__ */ jsx("span", { className: "
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */ jsx("small", { children: "Kh\xF4ng gian l\xE0m vi\u1EC7c" }),
|
|
149
|
-
/* @__PURE__ */ jsx("strong", { children: brand.siteName })
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */ jsx(Menu, { "aria-hidden": "true", className: "minimal-nav__workspace-menu" })
|
|
130
|
+
/* @__PURE__ */ jsx("span", { className: "wikex-dashboard-nav__logo-full", children: /* @__PURE__ */ jsx(AdminLogo, {}) }),
|
|
131
|
+
/* @__PURE__ */ jsx("span", { className: "wikex-dashboard-nav__logo-icon", children: /* @__PURE__ */ jsx(AdminIcon, {}) })
|
|
152
132
|
]
|
|
153
133
|
}
|
|
154
134
|
),
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */ jsx("span", { className: "minimal-nav__group-label", children: translateGroupLabel(group.label) }),
|
|
176
|
-
group.items.map((item) => {
|
|
177
|
-
const href = formatAdminURL({
|
|
178
|
-
adminRoute,
|
|
179
|
-
path: `/${item.type}/${item.slug}`
|
|
180
|
-
});
|
|
181
|
-
const Icon = iconBySlug[item.slug] || FileText;
|
|
182
|
-
const active = isActive(href);
|
|
183
|
-
return /* @__PURE__ */ jsxs(
|
|
184
|
-
Link,
|
|
185
|
-
{
|
|
186
|
-
"aria-current": active ? "page" : void 0,
|
|
187
|
-
className: `minimal-nav__item ${active ? "minimal-nav__item--active" : ""}`,
|
|
188
|
-
href,
|
|
189
|
-
onClick: closeMobileNav,
|
|
190
|
-
prefetch: false,
|
|
191
|
-
title: item.label,
|
|
192
|
-
children: [
|
|
193
|
-
/* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
|
|
194
|
-
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
195
|
-
]
|
|
196
|
-
},
|
|
197
|
-
`${item.type}-${item.slug}`
|
|
198
|
-
);
|
|
199
|
-
})
|
|
200
|
-
] }, group.label)),
|
|
201
|
-
folders && folders.browseByFolder && /* @__PURE__ */ jsxs("div", { className: "minimal-nav__group", children: [
|
|
202
|
-
/* @__PURE__ */ jsx("span", { className: "minimal-nav__group-label", children: "Th\u01B0 vi\u1EC7n" }),
|
|
203
|
-
/* @__PURE__ */ jsxs(
|
|
204
|
-
Link,
|
|
205
|
-
{
|
|
206
|
-
"aria-current": isActive(formatAdminURL({ adminRoute, path: adminRoutes.browseByFolder })) ? "page" : void 0,
|
|
207
|
-
className: `minimal-nav__item ${isActive(formatAdminURL({ adminRoute, path: adminRoutes.browseByFolder })) ? "minimal-nav__item--active" : ""}`,
|
|
208
|
-
href: formatAdminURL({ adminRoute, path: adminRoutes.browseByFolder }),
|
|
209
|
-
onClick: closeMobileNav,
|
|
210
|
-
prefetch: false,
|
|
211
|
-
title: "Duy\u1EC7t theo th\u01B0 m\u1EE5c",
|
|
212
|
-
children: [
|
|
213
|
-
/* @__PURE__ */ jsx(Library, { "aria-hidden": "true" }),
|
|
214
|
-
/* @__PURE__ */ jsx("span", { children: "Duy\u1EC7t theo th\u01B0 m\u1EE5c" })
|
|
215
|
-
]
|
|
216
|
-
}
|
|
217
|
-
)
|
|
218
|
-
] })
|
|
135
|
+
/* @__PURE__ */ jsx(
|
|
136
|
+
"button",
|
|
137
|
+
{
|
|
138
|
+
"aria-label": "\u0110\xF3ng menu",
|
|
139
|
+
className: "wikex-dashboard-nav__mobile-close",
|
|
140
|
+
onClick: () => setNavOpen(false),
|
|
141
|
+
type: "button",
|
|
142
|
+
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsx("div", { className: "wikex-dashboard-nav__scrollbar", ref: navRef, children: /* @__PURE__ */ jsxs("nav", { className: `wikex-nav-section ${isMini ? "wikex-nav-section--mini" : ""}`, children: [
|
|
147
|
+
/* @__PURE__ */ jsxs("section", { className: "wikex-nav-section__group", children: [
|
|
148
|
+
/* @__PURE__ */ jsx("h2", { className: "wikex-nav-section__subheader", children: "T\u1ED5ng quan" }),
|
|
149
|
+
navItem({
|
|
150
|
+
active: pathname === adminRoute,
|
|
151
|
+
href: adminRoute,
|
|
152
|
+
icon: LayoutDashboard,
|
|
153
|
+
label: "T\u1ED5ng quan"
|
|
154
|
+
})
|
|
219
155
|
] }),
|
|
220
|
-
/* @__PURE__ */ jsxs("
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
|
|
223
|
-
{
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
156
|
+
groups.map((group) => /* @__PURE__ */ jsxs("section", { className: "wikex-nav-section__group", children: [
|
|
157
|
+
/* @__PURE__ */ jsx("h2", { className: "wikex-nav-section__subheader", children: translateGroupLabel(group.label) }),
|
|
158
|
+
group.items.map((item) => {
|
|
159
|
+
const href = formatAdminURL({
|
|
160
|
+
adminRoute,
|
|
161
|
+
path: `/${item.type}/${item.slug}`
|
|
162
|
+
});
|
|
163
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: navItem({
|
|
164
|
+
active: isActive(href),
|
|
165
|
+
href,
|
|
166
|
+
icon: iconBySlug[item.slug] || FileText,
|
|
167
|
+
label: item.label
|
|
168
|
+
}) }, `${item.type}-${item.slug}`);
|
|
169
|
+
})
|
|
170
|
+
] }, group.label)),
|
|
171
|
+
folders && folders.browseByFolder && /* @__PURE__ */ jsxs("section", { className: "wikex-nav-section__group", children: [
|
|
172
|
+
/* @__PURE__ */ jsx("h2", { className: "wikex-nav-section__subheader", children: "Th\u01B0 vi\u1EC7n" }),
|
|
173
|
+
navItem({
|
|
174
|
+
active: isActive(formatAdminURL({ adminRoute, path: adminRoutes.browseByFolder })),
|
|
175
|
+
href: formatAdminURL({ adminRoute, path: adminRoutes.browseByFolder }),
|
|
176
|
+
icon: Library,
|
|
177
|
+
label: "Duy\u1EC7t theo th\u01B0 m\u1EE5c"
|
|
178
|
+
})
|
|
239
179
|
] })
|
|
240
|
-
] }),
|
|
180
|
+
] }) }),
|
|
241
181
|
/* @__PURE__ */ jsx(
|
|
242
182
|
"button",
|
|
243
183
|
{
|
|
244
184
|
"aria-label": isMini ? "M\u1EDF r\u1ED9ng menu" : "Thu g\u1ECDn menu",
|
|
245
|
-
className: "
|
|
185
|
+
className: "wikex-dashboard-nav__toggle",
|
|
246
186
|
onClick: () => setIsMini((current) => !current),
|
|
247
187
|
title: isMini ? "M\u1EDF r\u1ED9ng menu" : "Thu g\u1ECDn menu",
|
|
248
188
|
type: "button",
|
|
@@ -14,7 +14,7 @@ var BrandLogo = ({
|
|
|
14
14
|
}) => /* @__PURE__ */ jsx(
|
|
15
15
|
"span",
|
|
16
16
|
{
|
|
17
|
-
className: ["
|
|
17
|
+
className: ["wikex-logo__asset", className].filter(Boolean).join(" "),
|
|
18
18
|
style: { alignItems: "center", display: "inline-flex", height, maxWidth },
|
|
19
19
|
children: /* @__PURE__ */ jsx(
|
|
20
20
|
Image,
|
|
@@ -31,11 +31,11 @@ var BrandLogo = ({
|
|
|
31
31
|
);
|
|
32
32
|
var AdminIcon = () => {
|
|
33
33
|
const brand = useAdminBrand();
|
|
34
|
-
return /* @__PURE__ */ jsx("span", { className: "
|
|
34
|
+
return /* @__PURE__ */ jsx("span", { className: "wikex-logo wikex-logo--icon", children: /* @__PURE__ */ jsx(
|
|
35
35
|
BrandLogo,
|
|
36
36
|
{
|
|
37
37
|
asset: brand.logo,
|
|
38
|
-
className: "
|
|
38
|
+
className: "wikex-logo__image",
|
|
39
39
|
height: 32,
|
|
40
40
|
maxWidth: 32,
|
|
41
41
|
siteName: brand.siteName
|
|
@@ -44,11 +44,11 @@ var AdminIcon = () => {
|
|
|
44
44
|
};
|
|
45
45
|
var AdminLogo = () => {
|
|
46
46
|
const brand = useAdminBrand();
|
|
47
|
-
return /* @__PURE__ */ jsx("span", { "aria-label": brand.siteName, className: "
|
|
47
|
+
return /* @__PURE__ */ jsx("span", { "aria-label": brand.siteName, className: "wikex-logo wikex-logo--full", role: "img", children: /* @__PURE__ */ jsx(
|
|
48
48
|
BrandLogo,
|
|
49
49
|
{
|
|
50
50
|
asset: brand.logo,
|
|
51
|
-
className: "
|
|
51
|
+
className: "wikex-logo__image",
|
|
52
52
|
height: 42,
|
|
53
53
|
maxWidth: 190,
|
|
54
54
|
siteName: brand.siteName
|