gomtm 0.0.246 → 0.0.248
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/esm/consts.d.ts +1 -0
- package/dist/esm/consts.js +2 -0
- package/dist/esm/ly/LayoutBase.d.ts +5 -0
- package/dist/esm/ly/LayoutBase.js +85 -0
- package/dist/esm/ly/UserAvatorMenus.js +17 -9
- package/dist/esm/ly/dash5/index.js +6 -2
- package/dist/esm/ly/demo-layout/index.d.ts +2 -0
- package/dist/esm/ly/demo-layout/index.js +12 -0
- package/dist/esm/ly--/DashLayout.d.ts +2 -0
- package/dist/esm/ly--/DashLayout.js +39 -0
- package/dist/esm/ly--/UserAvatorMenus.d.ts +2 -0
- package/dist/esm/ly--/UserAvatorMenus.js +63 -0
- package/dist/esm/ly--/dash5/aside.d.ts +2 -0
- package/dist/esm/ly--/dash5/aside.js +40 -0
- package/dist/esm/ly--/dash5/components/PageCreate.d.ts +4 -0
- package/dist/esm/ly--/dash5/components/PageCreate.js +8 -0
- package/dist/esm/ly--/dash5/components/PageEdit.d.ts +4 -0
- package/dist/esm/ly--/dash5/components/PageEdit.js +8 -0
- package/dist/esm/ly--/dash5/components/PageList.d.ts +4 -0
- package/dist/esm/ly--/dash5/components/PageList.js +9 -0
- package/dist/esm/ly--/dash5/components/PageShow.d.ts +4 -0
- package/dist/esm/ly--/dash5/components/PageShow.js +8 -0
- package/dist/esm/ly--/dash5/header.d.ts +2 -0
- package/dist/esm/ly--/dash5/header.js +123 -0
- package/dist/esm/ly--/dash5/index.d.ts +2 -0
- package/dist/esm/ly--/dash5/index.js +21 -0
- package/dist/esm/ly--/front-layout/PageCmds.d.ts +2 -0
- package/dist/esm/ly--/front-layout/PageCmds.js +25 -0
- package/dist/esm/ly--/front-layout/PageSearchCmd.d.ts +2 -0
- package/dist/esm/ly--/front-layout/PageSearchCmd.js +63 -0
- package/dist/esm/ly--/front-layout/header.d.ts +2 -0
- package/dist/esm/ly--/front-layout/header.js +18 -0
- package/dist/esm/ly--/front-layout/index.d.ts +2 -0
- package/dist/esm/ly--/front-layout/index.js +13 -0
- package/dist/esm/ly--/front-layout/main-nav.d.ts +3 -0
- package/dist/esm/ly--/front-layout/main-nav.js +116 -0
- package/dist/esm/providers/GomtmAppSS.js +7 -3
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/esm/consts.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const MTM_SERVER_COOKIE_ACTIVATE_SELFBACKEND_URL = "mtm:selfbacke
|
|
|
11
11
|
export declare const DEFAULT_revalidate_SECONDS = 3;
|
|
12
12
|
export declare const LOGIN_CALLBACK_URL_KEY = "back";
|
|
13
13
|
export declare const MTM_API_PREFIX = "/api";
|
|
14
|
+
export declare const LayoutNameCookie = "layout";
|
|
14
15
|
export declare const ExtKey_Hostname = "host";
|
|
15
16
|
export declare const ExtKey_mtmaccessToken = "access_token";
|
|
16
17
|
export declare const ItemAction_list_new_item = "list_new_item";
|
package/dist/esm/consts.js
CHANGED
|
@@ -11,6 +11,7 @@ const MTM_SERVER_COOKIE_ACTIVATE_SELFBACKEND_URL = "mtm:selfbackendUrl";
|
|
|
11
11
|
const DEFAULT_revalidate_SECONDS = 3;
|
|
12
12
|
const LOGIN_CALLBACK_URL_KEY = "back";
|
|
13
13
|
const MTM_API_PREFIX = "/api";
|
|
14
|
+
const LayoutNameCookie = "layout";
|
|
14
15
|
const ExtKey_Hostname = "host";
|
|
15
16
|
const ExtKey_mtmaccessToken = "access_token";
|
|
16
17
|
const ItemAction_list_new_item = "list_new_item";
|
|
@@ -43,6 +44,7 @@ export {
|
|
|
43
44
|
ImageNoExist,
|
|
44
45
|
ItemAction_list_new_item,
|
|
45
46
|
LOGIN_CALLBACK_URL_KEY,
|
|
47
|
+
LayoutNameCookie,
|
|
46
48
|
ListView_DefaultPageSize,
|
|
47
49
|
Listview_list_filter,
|
|
48
50
|
MEMBER_ROLE,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
4
|
+
import { atom, useAtom } from "jotai";
|
|
5
|
+
import { ScopeAtomsHydrator } from "mtxlib/jotai/jotai-helper";
|
|
6
|
+
import { TailwindIndicator } from "mtxuilib/common/tailwind-indicator";
|
|
7
|
+
import { AppMetaRender } from "mtxuilib/store/AppMetaRender";
|
|
8
|
+
import { Dialog, DialogContent, DialogTitle } from "mtxuilib/ui/dialog";
|
|
9
|
+
import { TooltipProvider } from "mtxuilib/ui/tooltip";
|
|
10
|
+
import { MtButton } from "mtxuilib/ui/ui-mt/Button";
|
|
11
|
+
import { AppProgressBar as ProgressBar } from "next-nprogress-bar";
|
|
12
|
+
import { Suspense } from "react";
|
|
13
|
+
import { useHotkeys } from "react-hotkeys-hook";
|
|
14
|
+
import { Toaster } from "sonner";
|
|
15
|
+
import Dash5 from "./dash5";
|
|
16
|
+
import { Demo1Layout } from "./demo-layout";
|
|
17
|
+
const ALL_Layouts = [
|
|
18
|
+
"demo1",
|
|
19
|
+
// "mail2",
|
|
20
|
+
"dash5",
|
|
21
|
+
"default"
|
|
22
|
+
];
|
|
23
|
+
const layoutNameValueAtom = atom("");
|
|
24
|
+
const layoutNameAtom = atom((get) => {
|
|
25
|
+
return get(layoutNameValueAtom);
|
|
26
|
+
}, (_, set, value) => {
|
|
27
|
+
set(layoutNameValueAtom, value);
|
|
28
|
+
});
|
|
29
|
+
const openLayoutSwitchDlgAtom = atom(false);
|
|
30
|
+
const LayoutBase = (props) => {
|
|
31
|
+
const { layoutName, children } = props;
|
|
32
|
+
return /* @__PURE__ */ jsx(ScopeAtomsHydrator, { atomValues: [
|
|
33
|
+
[layoutNameAtom, layoutName],
|
|
34
|
+
[openLayoutSwitchDlgAtom, false]
|
|
35
|
+
], children: /* @__PURE__ */ jsx(LayoutRender, { children }) });
|
|
36
|
+
};
|
|
37
|
+
const LayoutRender = (props) => {
|
|
38
|
+
const { children } = props;
|
|
39
|
+
const [layoutName, setLayoutName] = useAtom(layoutNameAtom);
|
|
40
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 0, children: [
|
|
42
|
+
layoutName == "dash5" ? /* @__PURE__ */ jsx(Dash5, { children }) : (
|
|
43
|
+
// layoutName == "mail2" ? <Mail2Layout>{children}</Mail2Layout> :
|
|
44
|
+
layoutName == "demo1" ? /* @__PURE__ */ jsx(Demo1Layout, { children }) : layoutName == "default" ? /* @__PURE__ */ jsx(Fragment, { children }) : children
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
ProgressBar,
|
|
48
|
+
{
|
|
49
|
+
height: "4px",
|
|
50
|
+
color: "#4934eb",
|
|
51
|
+
options: { showSpinner: false },
|
|
52
|
+
shallowRouting: true
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsx(ReactQueryDevtools, {}),
|
|
56
|
+
/* @__PURE__ */ jsx(Toaster, {}),
|
|
57
|
+
/* @__PURE__ */ jsx(TailwindIndicator, {})
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsx(AppMetaRender, {}),
|
|
60
|
+
/* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(LayoutSwitchDlg, {}) })
|
|
61
|
+
] });
|
|
62
|
+
};
|
|
63
|
+
const LayoutSwitchDlg = () => {
|
|
64
|
+
const [openLayoutSwitchDlg, setOpenLayoutSwitchDlg] = useAtom(openLayoutSwitchDlgAtom);
|
|
65
|
+
const [layoutName, setLayoutName] = useAtom(layoutNameAtom);
|
|
66
|
+
useHotkeys("alt+l", () => {
|
|
67
|
+
setOpenLayoutSwitchDlg(!openLayoutSwitchDlg);
|
|
68
|
+
}, []);
|
|
69
|
+
return /* @__PURE__ */ jsx(Dialog, { open: openLayoutSwitchDlg, onOpenChange: setOpenLayoutSwitchDlg, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
70
|
+
/* @__PURE__ */ jsxs(DialogTitle, { children: [
|
|
71
|
+
"LayoutSwitch,",
|
|
72
|
+
layoutName
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-2 bg-red-100 p-2", children: ALL_Layouts.map((layout) => {
|
|
75
|
+
return /* @__PURE__ */ jsx(MtButton, { onClick: () => {
|
|
76
|
+
setLayoutName(layout);
|
|
77
|
+
setOpenLayoutSwitchDlg(false);
|
|
78
|
+
}, children: layout }, layout);
|
|
79
|
+
}) })
|
|
80
|
+
] }) });
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
LayoutBase,
|
|
84
|
+
layoutNameAtom
|
|
85
|
+
};
|
|
@@ -4,12 +4,13 @@ import { MoonIcon, SunIcon } from "lucide-react";
|
|
|
4
4
|
import { MtLink } from "mtxuilib/common/mtlink";
|
|
5
5
|
import { Avatar, AvatarFallback, AvatarImage } from "mtxuilib/ui/avatar";
|
|
6
6
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "mtxuilib/ui/dropdown-menu";
|
|
7
|
+
import { DropdownMenuItemLink } from "mtxuilib/ui/ui-mt/DropdownMenuItemLink";
|
|
7
8
|
import { usePathname } from "next/navigation";
|
|
8
9
|
import { useAuth } from "../store/auth";
|
|
9
10
|
function UserAvatorMenus() {
|
|
10
11
|
const pathName = usePathname();
|
|
11
12
|
const auth = useAuth();
|
|
12
|
-
return /* @__PURE__ */ jsx(Fragment, { children: !auth.
|
|
13
|
+
return /* @__PURE__ */ jsx(Fragment, { children: !auth.userId ? /* @__PURE__ */ jsx(MtLink, { variant: "ghost", href: `/login?next=${pathName}`, children: " login" }) : /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
13
14
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Avatar, { children: [
|
|
14
15
|
/* @__PURE__ */ jsx(AvatarImage, { src: "/mtm_images/placeholder-user.jpg", alt: "@siteCook" }),
|
|
15
16
|
/* @__PURE__ */ jsx(AvatarFallback, { children: "You" })
|
|
@@ -40,10 +41,6 @@ function UserAvatorMenus() {
|
|
|
40
41
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
41
42
|
] }) })
|
|
42
43
|
] }) }),
|
|
43
|
-
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
44
|
-
/* @__PURE__ */ jsx(DropdownMenuSubTrigger, { children: "Blog" }),
|
|
45
|
-
/* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) }) })
|
|
46
|
-
] }) }),
|
|
47
44
|
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuSub, { children: /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [
|
|
48
45
|
/* @__PURE__ */ jsx(SunIcon, { className: "size-[1.2rem] rotate-0 scale-100 pr-1 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
49
46
|
/* @__PURE__ */ jsx(MoonIcon, { className: "absolute size-[1.2rem] rotate-90 scale-0 pr-1 transition-all dark:rotate-0 dark:scale-100" }),
|
|
@@ -51,13 +48,24 @@ function UserAvatorMenus() {
|
|
|
51
48
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
|
|
52
49
|
] }) }) }),
|
|
53
50
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
54
|
-
/* @__PURE__ */ jsx(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
] }) })
|
|
51
|
+
/* @__PURE__ */ jsx(DropdownMenuGroupDevelop, {}),
|
|
52
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: "/logout", children: " Log out " }),
|
|
53
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: "/", children: "\u9996\u9875" })
|
|
58
54
|
] })
|
|
59
55
|
] }) });
|
|
60
56
|
}
|
|
57
|
+
const DropdownMenuGroupDevelop = () => {
|
|
58
|
+
return /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(DropdownMenuSubTrigger, { children: "\u8C03\u8BD5\u8F85\u52A9" }),
|
|
60
|
+
/* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs(DropdownMenuSubContent, { children: [
|
|
61
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `/post/create`, children: "/post/create" }),
|
|
62
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `/post/create2`, children: "/post/create2" }),
|
|
63
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `/post/edit`, children: "/post/edit" }),
|
|
64
|
+
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `/debuginfo`, children: "/debuginfo" }),
|
|
65
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
66
|
+
] }) })
|
|
67
|
+
] }) });
|
|
68
|
+
};
|
|
61
69
|
export {
|
|
62
70
|
UserAvatorMenus as default
|
|
63
71
|
};
|
|
@@ -9,9 +9,13 @@ function Dash5(props) {
|
|
|
9
9
|
/* @__PURE__ */ jsx(Dash5Aside, {}),
|
|
10
10
|
/* @__PURE__ */ jsxs("div", { className: "flex min-h-dvh flex-col sm:pl-14", children: [
|
|
11
11
|
/* @__PURE__ */ jsx(Header, {}),
|
|
12
|
-
/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ jsxs("main", { className: cn(
|
|
13
13
|
"flex h-full min-h-full flex-1"
|
|
14
|
-
), children
|
|
14
|
+
), children: [
|
|
15
|
+
/* @__PURE__ */ jsx("div", { children: "111111111" }),
|
|
16
|
+
children,
|
|
17
|
+
/* @__PURE__ */ jsx("div", { children: "222222222" })
|
|
18
|
+
] }),
|
|
15
19
|
/* @__PURE__ */ jsx("div", { className: "bg-slate-50" })
|
|
16
20
|
] })
|
|
17
21
|
] });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
const Demo1Layout = (props) => {
|
|
4
|
+
const { children } = props;
|
|
5
|
+
return /* @__PURE__ */ jsxs("div", { className: "prose p-2", children: [
|
|
6
|
+
/* @__PURE__ */ jsx("h1", { children: "Demo1Layout" }),
|
|
7
|
+
children
|
|
8
|
+
] });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
Demo1Layout
|
|
12
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
4
|
+
import { atom, useAtom } from "jotai";
|
|
5
|
+
import { TailwindIndicator } from "mtxuilib/common/tailwind-indicator";
|
|
6
|
+
import { AppMetaRender } from "mtxuilib/store/AppMetaRender";
|
|
7
|
+
import { TooltipProvider } from "mtxuilib/ui/tooltip";
|
|
8
|
+
import { AppProgressBar as ProgressBar } from "next-nprogress-bar";
|
|
9
|
+
import { Toaster } from "sonner";
|
|
10
|
+
import Dash5 from "./dash5";
|
|
11
|
+
const dashLayoutNameAtom = atom("default");
|
|
12
|
+
const DashLayout = (props) => {
|
|
13
|
+
const { children } = props;
|
|
14
|
+
const [dashLayoutName, setDashLayoutName] = useAtom(dashLayoutNameAtom);
|
|
15
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 0, children: [
|
|
17
|
+
dashLayoutName == "default" ? /* @__PURE__ */ jsx(Dash5, { children }) : /* @__PURE__ */ jsxs("div", { className: "bg-slate-300 p-2", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("h1", { children: "unknow layout name" }),
|
|
19
|
+
children
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
ProgressBar,
|
|
23
|
+
{
|
|
24
|
+
height: "4px",
|
|
25
|
+
color: "#4934eb",
|
|
26
|
+
options: { showSpinner: false },
|
|
27
|
+
shallowRouting: true
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx(ReactQueryDevtools, {}),
|
|
31
|
+
/* @__PURE__ */ jsx(Toaster, {}),
|
|
32
|
+
/* @__PURE__ */ jsx(TailwindIndicator, {})
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsx(AppMetaRender, {})
|
|
35
|
+
] });
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
DashLayout
|
|
39
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { MoonIcon, SunIcon } from "lucide-react";
|
|
4
|
+
import { MtLink } from "mtxuilib/common/mtlink";
|
|
5
|
+
import { Avatar, AvatarFallback, AvatarImage } from "mtxuilib/ui/avatar";
|
|
6
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "mtxuilib/ui/dropdown-menu";
|
|
7
|
+
import { usePathname } from "next/navigation";
|
|
8
|
+
import { useAuth } from "../store/auth";
|
|
9
|
+
function UserAvatorMenus() {
|
|
10
|
+
const pathName = usePathname();
|
|
11
|
+
const auth = useAuth();
|
|
12
|
+
return /* @__PURE__ */ jsx(Fragment, { children: !auth.isAdmin ? /* @__PURE__ */ jsx(MtLink, { variant: "ghost", href: `/login?next=${pathName}`, children: " login" }) : /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Avatar, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(AvatarImage, { src: "/mtm_images/placeholder-user.jpg", alt: "@siteCook" }),
|
|
15
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: "You" })
|
|
16
|
+
] }) }),
|
|
17
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { className: "w-56", children: [
|
|
18
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "My Account" }),
|
|
19
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
20
|
+
/* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(MtLink, { href: "/profile", children: /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|
|
22
|
+
"Profile",
|
|
23
|
+
/* @__PURE__ */ jsx(DropdownMenuShortcut, { children: "\u21E7\u2318P" })
|
|
24
|
+
] }) }),
|
|
25
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|
|
26
|
+
"Settings",
|
|
27
|
+
/* @__PURE__ */ jsx(DropdownMenuShortcut, { children: "\u2318S" })
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsx(MtLink, { href: "/admin/site", children: /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|
|
30
|
+
"Site",
|
|
31
|
+
/* @__PURE__ */ jsx(DropdownMenuShortcut, { children: "\u2318S" })
|
|
32
|
+
] }) })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
35
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(DropdownMenuSubTrigger, { children: "Cx" }),
|
|
37
|
+
/* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs(DropdownMenuSubContent, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx(MtLink, { href: "/admin/cx/config", children: /* @__PURE__ */ jsx(DropdownMenuItem, { children: "config" }) }),
|
|
39
|
+
/* @__PURE__ */ jsx(MtLink, { href: "/admin/cx/result", children: /* @__PURE__ */ jsx(DropdownMenuItem, { children: "result" }) }),
|
|
40
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
41
|
+
] }) })
|
|
42
|
+
] }) }),
|
|
43
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
44
|
+
/* @__PURE__ */ jsx(DropdownMenuSubTrigger, { children: "Blog" }),
|
|
45
|
+
/* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) }) })
|
|
46
|
+
] }) }),
|
|
47
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuSub, { children: /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [
|
|
48
|
+
/* @__PURE__ */ jsx(SunIcon, { className: "size-[1.2rem] rotate-0 scale-100 pr-1 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
49
|
+
/* @__PURE__ */ jsx(MoonIcon, { className: "absolute size-[1.2rem] rotate-90 scale-0 pr-1 transition-all dark:rotate-0 dark:scale-100" }),
|
|
50
|
+
"theme",
|
|
51
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
|
|
52
|
+
] }) }) }),
|
|
53
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
54
|
+
/* @__PURE__ */ jsx(MtLink, { href: "/logout", children: /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|
|
55
|
+
"Log out",
|
|
56
|
+
/* @__PURE__ */ jsx(DropdownMenuShortcut, { children: "\u21E7\u2318Q" })
|
|
57
|
+
] }) })
|
|
58
|
+
] })
|
|
59
|
+
] }) });
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
UserAvatorMenus as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
Package2,
|
|
5
|
+
Settings
|
|
6
|
+
} from "lucide-react";
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "mtxuilib/ui/tooltip";
|
|
8
|
+
import Link from "next/link";
|
|
9
|
+
const Dash5Aside = () => {
|
|
10
|
+
return /* @__PURE__ */ jsxs("aside", { className: "bg-background fixed inset-y-0 left-0 z-10 hidden w-14 flex-col border-r sm:flex", children: [
|
|
11
|
+
/* @__PURE__ */ jsx("nav", { className: "flex flex-col items-center gap-4 px-2 sm:py-5", children: /* @__PURE__ */ jsxs(
|
|
12
|
+
Link,
|
|
13
|
+
{
|
|
14
|
+
href: "/dash",
|
|
15
|
+
className: "bg-primary text-primary-foreground group flex h-9 w-9 shrink-0 items-center justify-center gap-2 rounded-full text-lg font-semibold md:h-8 md:w-8 md:text-base",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Package2, { className: "h-4 w-4 transition-all group-hover:scale-110" }),
|
|
18
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Acme Inc" })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
) }),
|
|
22
|
+
/* @__PURE__ */ jsx("nav", { className: "mt-auto flex flex-col items-center gap-4 px-2 sm:py-5", children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
24
|
+
Link,
|
|
25
|
+
{
|
|
26
|
+
href: "#",
|
|
27
|
+
className: "text-muted-foreground hover:text-foreground flex h-9 w-9 items-center justify-center rounded-lg transition-colors md:h-8 md:w-8",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Settings, { className: "h-5 w-5" }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Settings" })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
) }),
|
|
34
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Settings" })
|
|
35
|
+
] }) })
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
Dash5Aside
|
|
40
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
Home,
|
|
5
|
+
LineChart,
|
|
6
|
+
Package,
|
|
7
|
+
Package2,
|
|
8
|
+
PanelLeft,
|
|
9
|
+
Search,
|
|
10
|
+
ShoppingCart,
|
|
11
|
+
Users2
|
|
12
|
+
} from "lucide-react";
|
|
13
|
+
import { cn } from "mtxuilib/lib/utils";
|
|
14
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "mtxuilib/ui/breadcrumb";
|
|
15
|
+
import { Button } from "mtxuilib/ui/button";
|
|
16
|
+
import { Input } from "mtxuilib/ui/input";
|
|
17
|
+
import { Sheet, SheetContent, SheetTrigger } from "mtxuilib/ui/sheet";
|
|
18
|
+
import Link from "next/link";
|
|
19
|
+
import UserAvatorMenus from "../UserAvatorMenus";
|
|
20
|
+
const Header = () => {
|
|
21
|
+
return /* @__PURE__ */ jsxs("header", { className: cn(
|
|
22
|
+
"bg-background sticky top-0 z-30 flex h-14 items-center gap-4 border-b px-4 pt-1 sm:static sm:h-auto sm:border-0 sm:bg-transparent sm:px-6"
|
|
23
|
+
), children: [
|
|
24
|
+
/* @__PURE__ */ jsxs(Sheet, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { size: "icon", variant: "outline", className: "sm:hidden", children: [
|
|
26
|
+
/* @__PURE__ */ jsx(PanelLeft, { className: "h-5 w-5" }),
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Menu" })
|
|
28
|
+
] }) }),
|
|
29
|
+
/* @__PURE__ */ jsx(SheetContent, { side: "left", className: "sm:max-w-xs", children: /* @__PURE__ */ jsxs("nav", { className: "grid gap-6 text-lg font-medium", children: [
|
|
30
|
+
/* @__PURE__ */ jsxs(
|
|
31
|
+
Link,
|
|
32
|
+
{
|
|
33
|
+
href: "#",
|
|
34
|
+
className: "bg-primary text-primary-foreground group flex h-10 w-10 shrink-0 items-center justify-center gap-2 rounded-full text-lg font-semibold md:text-base",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Package2, { className: "h-5 w-5 transition-all group-hover:scale-110" }),
|
|
37
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Acme Inc" })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsxs(
|
|
42
|
+
Link,
|
|
43
|
+
{
|
|
44
|
+
href: "#",
|
|
45
|
+
className: "text-muted-foreground hover:text-foreground flex items-center gap-4 px-2.5",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Home, { className: "h-5 w-5" }),
|
|
48
|
+
"Dashboard"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsxs(
|
|
53
|
+
Link,
|
|
54
|
+
{
|
|
55
|
+
href: "#",
|
|
56
|
+
className: "text-foreground flex items-center gap-4 px-2.5",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(ShoppingCart, { className: "h-5 w-5" }),
|
|
59
|
+
"Orders"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ jsxs(
|
|
64
|
+
Link,
|
|
65
|
+
{
|
|
66
|
+
href: "#",
|
|
67
|
+
className: "text-muted-foreground hover:text-foreground flex items-center gap-4 px-2.5",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Package, { className: "h-5 w-5" }),
|
|
70
|
+
"Products"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsxs(
|
|
75
|
+
Link,
|
|
76
|
+
{
|
|
77
|
+
href: "#",
|
|
78
|
+
className: "text-muted-foreground hover:text-foreground flex items-center gap-4 px-2.5",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Users2, { className: "h-5 w-5" }),
|
|
81
|
+
"Customers"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ jsxs(
|
|
86
|
+
Link,
|
|
87
|
+
{
|
|
88
|
+
href: "#",
|
|
89
|
+
className: "text-muted-foreground hover:text-foreground flex items-center gap-4 px-2.5",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(LineChart, { className: "h-5 w-5" }),
|
|
92
|
+
"Settings"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }) })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsx(Breadcrumb, { className: "hidden md:flex", children: /* @__PURE__ */ jsxs(BreadcrumbList, { children: [
|
|
99
|
+
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: "/dash", children: "Dash" }) }) }),
|
|
100
|
+
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
101
|
+
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: "#", children: "Orders" }) }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
103
|
+
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, { children: "Recent Orders" }) })
|
|
104
|
+
] }) }),
|
|
105
|
+
/* @__PURE__ */ jsxs("div", { className: "relative ml-auto flex-1 md:grow-0", children: [
|
|
106
|
+
/* @__PURE__ */ jsx(Search, { className: "text-muted-foreground absolute left-2.5 top-2.5 h-4 w-4" }),
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
Input,
|
|
109
|
+
{
|
|
110
|
+
type: "search",
|
|
111
|
+
placeholder: "Search...",
|
|
112
|
+
className: "bg-background w-full rounded-lg pl-8 md:w-[200px] lg:w-[336px]",
|
|
113
|
+
onChange: (e) => {
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ jsx(UserAvatorMenus, {})
|
|
119
|
+
] });
|
|
120
|
+
};
|
|
121
|
+
export {
|
|
122
|
+
Header
|
|
123
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "mtxuilib/lib/utils";
|
|
4
|
+
import { Dash5Aside } from "./aside";
|
|
5
|
+
import { Header } from "./header";
|
|
6
|
+
function Dash5(props) {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-muted/40 flex min-h-screen w-full flex-col", children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Dash5Aside, {}),
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-dvh flex-col sm:pl-14", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Header, {}),
|
|
12
|
+
/* @__PURE__ */ jsx("main", { className: cn(
|
|
13
|
+
"flex h-full min-h-full flex-1"
|
|
14
|
+
), children }),
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: "bg-slate-50" })
|
|
16
|
+
] })
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
Dash5 as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { debounce } from "lodash";
|
|
4
|
+
import { CommandDialog, CommandEmpty, CommandInput, CommandList, CommandSeparator } from "mtxuilib/ui/command";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { useHotkeys } from "react-hotkeys-hook";
|
|
7
|
+
function PageCommands() {
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
useHotkeys("alt+d", () => {
|
|
10
|
+
console.log("PageCommands");
|
|
11
|
+
setOpen((open2) => !open2);
|
|
12
|
+
}, []);
|
|
13
|
+
const handleValueChange = (search) => {
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ jsxs(CommandDialog, { open, onOpenChange: setOpen, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(CommandInput, { placeholder: "Type a command or search...", onValueChange: debounce(handleValueChange, 500) }),
|
|
17
|
+
/* @__PURE__ */ jsxs(CommandList, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: "No results found." }),
|
|
19
|
+
/* @__PURE__ */ jsx(CommandSeparator, {})
|
|
20
|
+
] })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
PageCommands
|
|
25
|
+
};
|