gomtm 0.0.162 → 0.0.163
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/components/ListItem.d.ts +6 -0
- package/dist/esm/components/ListItem.js +49 -0
- package/dist/esm/components/auth/AuthPage.d.ts +2 -0
- package/dist/esm/components/auth/AuthPage.js +36 -0
- package/dist/esm/components/auth/LoginScreen2.d.ts +2 -0
- package/dist/esm/components/auth/LoginScreen2.js +106 -0
- package/dist/esm/components/auth/UserAuthForm.d.ts +6 -0
- package/dist/esm/components/auth/UserAuthForm.js +76 -0
- package/dist/esm/components/blog/BlogPostActions.d.ts +4 -0
- package/dist/esm/components/blog/BlogPostActions.js +34 -0
- package/dist/esm/components/blog/BlogPostCreateForm.d.ts +2 -0
- package/dist/esm/components/blog/BlogPostCreateForm.js +27 -0
- package/dist/esm/components/blog/BlogPostImportDlgUrl.d.ts +6 -0
- package/dist/esm/components/blog/BlogPostImportDlgUrl.js +94 -0
- package/dist/esm/components/blog/PostCard.d.ts +5 -0
- package/dist/esm/components/blog/PostCard.js +38 -0
- package/dist/esm/components/blog/PostEditForm.d.ts +2 -0
- package/dist/esm/components/blog/PostEditForm.js +91 -0
- package/dist/esm/components/blog/post-content.d.ts +5 -0
- package/dist/esm/components/blog/post-content.js +15 -0
- package/dist/esm/components/blog/post.atoms.d.ts +11 -0
- package/dist/esm/components/blog/post.atoms.js +9 -0
- package/dist/esm/curd/CommonListViewV2.d.ts +4 -3
- package/dist/esm/curd/CommonListViewV2.js +6 -6
- package/dist/esm/curd/CreateFormV2.d.ts +2 -3
- package/dist/esm/curd/CreateFormV2.js +1 -1
- package/dist/esm/curd/CurdViewView.d.ts +2 -2
- package/dist/esm/curd/CurdViewView.js +3 -6
- package/dist/esm/gomtm-clients-ss.d.ts +6 -0
- package/dist/esm/gomtm-clients-ss.js +9 -3
- package/dist/esm/gomtmpb/mtm/sppb/mtm_pb.d.ts +5 -9
- package/dist/esm/gomtmpb/mtm/sppb/mtm_pb.js +20 -63
- package/dist/esm/hooks/useAuth.d.ts +5 -0
- package/dist/esm/hooks/useAuth.js +43 -0
- package/dist/esm/lib/auth/jwt.d.ts +7 -0
- package/dist/esm/lib/auth/jwt.js +43 -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 +6 -6
- package/dist/esm/providers/GomtmProvider.js +4 -1
- package/dist/esm/providers/logger.context.d.ts +4 -0
- package/dist/esm/store/CurdListViewV3.d.ts +13 -0
- package/dist/esm/store/CurdListViewV3.js +98 -0
- package/dist/esm/store/ExampleStoreProvider.d.ts +6 -0
- package/dist/esm/store/ExampleStoreProvider.js +43 -0
- package/dist/esm/store/GomtmBackendProvider.d.ts +8 -0
- package/dist/esm/store/GomtmBackendProvider.js +28 -0
- package/dist/esm/validations/env.d.ts +2 -2
- package/dist/esm/validations/spContentModi.d.ts +8 -8
- package/dist/esm/validations/spRoute.d.ts +8 -8
- package/dist/gomtm +0 -0
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +119 -7
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { Search } from "lucide-react";
|
|
23
|
+
import { CommandDialog, CommandEmpty, CommandInput, CommandList, CommandSeparator } from "mtxuilib/ui/command";
|
|
24
|
+
import { Input } from "mtxuilib/ui/input";
|
|
25
|
+
import { MtForm } from "mtxuilib/ui/ui-mt/MtForm";
|
|
26
|
+
import { useState } from "react";
|
|
27
|
+
import { useForm } from "react-hook-form";
|
|
28
|
+
import { useHotkeys } from "react-hotkeys-hook";
|
|
29
|
+
const PageSearchCmd = () => {
|
|
30
|
+
const [open, setOpen] = useState(false);
|
|
31
|
+
useHotkeys("alt+s", () => {
|
|
32
|
+
setOpen((open2) => !open2);
|
|
33
|
+
}, []);
|
|
34
|
+
const form = useForm();
|
|
35
|
+
return /* @__PURE__ */ jsxs(MtForm, __spreadProps(__spreadValues({}, form), { children: [
|
|
36
|
+
/* @__PURE__ */ jsx("form", { onSubmit: form.handleSubmit(() => {
|
|
37
|
+
}), children: /* @__PURE__ */ jsxs("div", { className: "relative ml-auto flex-1 md:grow-0", children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Search, { className: "text-muted-foreground absolute left-2.5 top-2.5 h-4 w-4" }),
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
Input,
|
|
41
|
+
{
|
|
42
|
+
type: "search",
|
|
43
|
+
placeholder: "Search...",
|
|
44
|
+
className: "bg-background w-full rounded-lg pl-8 md:w-[200px] lg:w-[336px]",
|
|
45
|
+
onChange: (e) => {
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] }) }),
|
|
50
|
+
/* @__PURE__ */ jsxs(CommandDialog, { open, onOpenChange: setOpen, children: [
|
|
51
|
+
/* @__PURE__ */ jsx(CommandInput, { placeholder: "Type a command or search...", onValueChange: (s) => {
|
|
52
|
+
setOpen(false);
|
|
53
|
+
} }),
|
|
54
|
+
/* @__PURE__ */ jsxs(CommandList, { children: [
|
|
55
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: "No results found." }),
|
|
56
|
+
/* @__PURE__ */ jsx(CommandSeparator, {})
|
|
57
|
+
] })
|
|
58
|
+
] })
|
|
59
|
+
] }));
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
PageSearchCmd
|
|
63
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { MtLink } from "mtxuilib/common/mtlink";
|
|
4
|
+
import UserAvatorMenus from "../UserAvatorMenus";
|
|
5
|
+
import { PageSearchCmd } from "./PageSearchCmd";
|
|
6
|
+
import { MainNav } from "./main-nav";
|
|
7
|
+
const FrontLayoutHeader = () => {
|
|
8
|
+
return /* @__PURE__ */ jsx("header", { className: "bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-10 w-full border-b backdrop-blur", children: /* @__PURE__ */ jsxs("div", { className: "flex h-14 items-center", children: [
|
|
9
|
+
/* @__PURE__ */ jsx("div", { className: "hidden w-52 items-center justify-center md:flex", children: /* @__PURE__ */ jsx(MtLink, { href: "/", className: "flex items-center space-x-2" }) }),
|
|
10
|
+
/* @__PURE__ */ jsx(MainNav, {}),
|
|
11
|
+
/* @__PURE__ */ jsx("nav", { className: " flex items-center space-x-6 text-sm font-medium" }),
|
|
12
|
+
/* @__PURE__ */ jsx(PageSearchCmd, {}),
|
|
13
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 shrink items-center justify-end space-x-2 pr-4", children: /* @__PURE__ */ jsx("nav", { className: "flex items-center", children: /* @__PURE__ */ jsx(UserAvatorMenus, {}) }) })
|
|
14
|
+
] }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
FrontLayoutHeader
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { FrontLayoutHeader } from "./header";
|
|
4
|
+
const FrontLayout = (props) => {
|
|
5
|
+
const { children } = props;
|
|
6
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7
|
+
/* @__PURE__ */ jsx(FrontLayoutHeader, {}),
|
|
8
|
+
children
|
|
9
|
+
] });
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
FrontLayout
|
|
13
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
34
|
+
import { MtLink } from "mtxuilib/common/mtlink";
|
|
35
|
+
import { Icons } from "mtxuilib/icons/icons";
|
|
36
|
+
import { cn } from "mtxuilib/lib/utils";
|
|
37
|
+
import { ScrollArea } from "mtxuilib/ui/scroll-area";
|
|
38
|
+
import { Sheet, SheetContent, SheetTrigger } from "mtxuilib/ui/sheet";
|
|
39
|
+
import { MtButton } from "mtxuilib/ui/ui-mt/Button";
|
|
40
|
+
import Link from "next/link";
|
|
41
|
+
import { useRouter } from "next/navigation";
|
|
42
|
+
import { useState } from "react";
|
|
43
|
+
function MainNav() {
|
|
44
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-2 pl-2 md:gap-2", children: /* @__PURE__ */ jsx("div", { className: "pr-1", children: /* @__PURE__ */ jsx("nav", { className: "hidden gap-1 md:flex" }) }) }),
|
|
46
|
+
/* @__PURE__ */ jsx(MobileNav, {})
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
function MobileNav() {
|
|
50
|
+
const [open, setOpen] = useState(false);
|
|
51
|
+
return /* @__PURE__ */ jsxs(Sheet, { open, onOpenChange: setOpen, children: [
|
|
52
|
+
/* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
53
|
+
MtButton,
|
|
54
|
+
{
|
|
55
|
+
variant: "ghost",
|
|
56
|
+
className: "mr-2 px-0 text-base hover:bg-transparent focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 md:hidden",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Icons.ellipsis, { className: "h-5 w-5" }),
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Menu" })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
) }),
|
|
63
|
+
/* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "pr-0", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
MobileLink,
|
|
66
|
+
{
|
|
67
|
+
href: "/",
|
|
68
|
+
className: "flex items-center",
|
|
69
|
+
onOpenChange: setOpen,
|
|
70
|
+
children: /* @__PURE__ */ jsx(Icons.logo, { className: "mr-2 h-4 w-4" })
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "my-4 h-[calc(100vh-8rem)] pb-10 pl-2", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col space-y-2" }) })
|
|
74
|
+
] })
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
function MobileLink(_a) {
|
|
78
|
+
var _b = _a, {
|
|
79
|
+
href,
|
|
80
|
+
onOpenChange,
|
|
81
|
+
className,
|
|
82
|
+
children
|
|
83
|
+
} = _b, props = __objRest(_b, [
|
|
84
|
+
"href",
|
|
85
|
+
"onOpenChange",
|
|
86
|
+
"className",
|
|
87
|
+
"children"
|
|
88
|
+
]);
|
|
89
|
+
const router = useRouter();
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
Link,
|
|
92
|
+
__spreadProps(__spreadValues({
|
|
93
|
+
href,
|
|
94
|
+
onClick: () => {
|
|
95
|
+
router.push(href.toString());
|
|
96
|
+
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
97
|
+
},
|
|
98
|
+
className: cn(className)
|
|
99
|
+
}, props), {
|
|
100
|
+
children
|
|
101
|
+
})
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function MainNavOld() {
|
|
105
|
+
return /* @__PURE__ */ jsxs("div", { className: "mr-4 hidden md:flex", children: [
|
|
106
|
+
/* @__PURE__ */ jsxs(MtLink, { href: "/", className: "mr-6 flex items-center space-x-2", children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Icons.logo, { className: "size-6" }),
|
|
108
|
+
/* @__PURE__ */ jsx("span", { className: "hidden font-bold sm:inline-block" })
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsx("nav", { className: " flex items-center space-x-6 text-sm font-medium" })
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
MainNav,
|
|
115
|
+
MainNavOld
|
|
116
|
+
};
|
|
@@ -19,8 +19,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
22
|
-
import { ExtKey_Hostname,
|
|
23
|
-
import { ExtinfoSS } from "
|
|
22
|
+
import { ExtKey_Hostname, ExtKey_mtmbackend } from "../consts";
|
|
23
|
+
import { ExtinfoSS } from "../sscore";
|
|
24
24
|
import { GomtmProvider } from "./GomtmProvider";
|
|
25
25
|
function GomtmAppSS(props) {
|
|
26
26
|
return __async(this, null, function* () {
|
|
@@ -33,10 +33,10 @@ function GomtmAppSS(props) {
|
|
|
33
33
|
GomtmProvider,
|
|
34
34
|
{
|
|
35
35
|
initExtKv: {
|
|
36
|
-
[ExtKey_Hostname]: ExtinfoSS(ExtKey_Hostname),
|
|
37
|
-
[ExtKey_mtmaccessToken]: ExtinfoSS(ExtKey_mtmaccessToken),
|
|
38
|
-
[ExtKey_mtmbackend]: ExtinfoSS(ExtKey_mtmbackend)
|
|
39
|
-
[ExtKey_SelfBackend]: ExtinfoSS(ExtKey_SelfBackend)
|
|
36
|
+
// [ExtKey_Hostname]: ExtinfoSS(ExtKey_Hostname),
|
|
37
|
+
// [ExtKey_mtmaccessToken]: ExtinfoSS(ExtKey_mtmaccessToken),
|
|
38
|
+
[ExtKey_mtmbackend]: ExtinfoSS(ExtKey_mtmbackend)
|
|
39
|
+
// [ExtKey_SelfBackend]: ExtinfoSS(ExtKey_SelfBackend)
|
|
40
40
|
},
|
|
41
41
|
children
|
|
42
42
|
}
|
|
@@ -53,7 +53,10 @@ const useHostname = () => {
|
|
|
53
53
|
const { hostname } = useMtmApp();
|
|
54
54
|
if (hostname)
|
|
55
55
|
return hostname;
|
|
56
|
-
|
|
56
|
+
if (typeof window != "undefined") {
|
|
57
|
+
return window.location.host;
|
|
58
|
+
}
|
|
59
|
+
return "";
|
|
57
60
|
};
|
|
58
61
|
const useExtInfo = () => {
|
|
59
62
|
const backendUrl = useMtmBackendUrl();
|
|
@@ -2,10 +2,14 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
export declare function LoggerProvider(props: {} & PropsWithChildren): import("react").JSX.Element;
|
|
3
3
|
export declare function useLogger(): {
|
|
4
4
|
info: {
|
|
5
|
+
(...data: any[]): void;
|
|
6
|
+
(...data: any[]): void;
|
|
5
7
|
(...data: any[]): void;
|
|
6
8
|
(message?: any, ...optionalParams: any[]): void;
|
|
7
9
|
};
|
|
8
10
|
error: {
|
|
11
|
+
(...data: any[]): void;
|
|
12
|
+
(...data: any[]): void;
|
|
9
13
|
(...data: any[]): void;
|
|
10
14
|
(message?: any, ...optionalParams: any[]): void;
|
|
11
15
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnyMessage, Message, PlainMessage } from "@bufbuild/protobuf";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
import { MethodUnaryDescriptor } from "../connectquery";
|
|
4
|
+
export declare function Curd3ListProvider<I extends Message<I>, O extends Message<O>>(props: {
|
|
5
|
+
params: Partial<PlainMessage<I>>;
|
|
6
|
+
methodList: MethodUnaryDescriptor<I, O>;
|
|
7
|
+
} & PropsWithChildren): import("react").JSX.Element;
|
|
8
|
+
export declare const useCurd3List: () => {
|
|
9
|
+
params: PlainMessage<AnyMessage>;
|
|
10
|
+
curd3MethodList: MethodUnaryDescriptor<AnyMessage, AnyMessage> | null;
|
|
11
|
+
};
|
|
12
|
+
export declare const Curd3ListViewDebug: () => import("react").JSX.Element;
|
|
13
|
+
export declare const Curd2ListView: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __async = (__this, __arguments, generator) => {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
var fulfilled = (value) => {
|
|
5
|
+
try {
|
|
6
|
+
step(generator.next(value));
|
|
7
|
+
} catch (e) {
|
|
8
|
+
reject(e);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var rejected = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
step(generator.throw(value));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
reject(e);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { atom, useAtom } from "jotai";
|
|
24
|
+
import { createConnectTransport } from "@connectrpc/connect-web";
|
|
25
|
+
import { ScopeProvider } from "mtxlib/jotai/ScopeProvider";
|
|
26
|
+
import { AtomsHydrator } from "mtxlib/jotai/jotai-helper";
|
|
27
|
+
import { callUnaryMethod } from "../connectquery";
|
|
28
|
+
import { gomtmFetcher } from "../gomtm-clients-ss";
|
|
29
|
+
import { gomtmBaseUrlAtom } from "./GomtmBackendProvider";
|
|
30
|
+
const curd3BackendUrlAtom = atom((get) => {
|
|
31
|
+
const value1 = get(gomtmBaseUrlAtom);
|
|
32
|
+
if (value1) {
|
|
33
|
+
return value1;
|
|
34
|
+
}
|
|
35
|
+
if (typeof window == "undefined") {
|
|
36
|
+
console.log("get gomtm backendurl(SSR)", process.env.MTM_BACKEND);
|
|
37
|
+
return process.env.MTM_BACKEND || "";
|
|
38
|
+
}
|
|
39
|
+
return "";
|
|
40
|
+
});
|
|
41
|
+
const curd2TransportAtom = atom((get) => {
|
|
42
|
+
const baseUrl = get(curd3BackendUrlAtom);
|
|
43
|
+
return createConnectTransport({
|
|
44
|
+
baseUrl,
|
|
45
|
+
fetch: gomtmFetcher()
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
const curd3ListParamsAtom = atom({});
|
|
49
|
+
const curd3MethodListAtom = atom(null);
|
|
50
|
+
const curd3ItemsAtom = atom((get) => __async(void 0, null, function* () {
|
|
51
|
+
const params = get(curd3ListParamsAtom);
|
|
52
|
+
const methodList = get(curd3MethodListAtom);
|
|
53
|
+
if (!methodList) {
|
|
54
|
+
throw new Error("curd3ItemsAtom, missing methodList");
|
|
55
|
+
}
|
|
56
|
+
const transport = get(curd2TransportAtom);
|
|
57
|
+
return yield callUnaryMethod(methodList, params, { transport });
|
|
58
|
+
}));
|
|
59
|
+
function Curd3ListProvider(props) {
|
|
60
|
+
const { params, methodList, children } = props;
|
|
61
|
+
return /* @__PURE__ */ jsx(ScopeProvider, { atoms: [curd3ListParamsAtom, curd3MethodListAtom], children: /* @__PURE__ */ jsx(AtomsHydrator, { atomValues: [
|
|
62
|
+
[curd3ListParamsAtom, params],
|
|
63
|
+
[curd3MethodListAtom, methodList]
|
|
64
|
+
], children }) });
|
|
65
|
+
}
|
|
66
|
+
const useCurd3List = () => {
|
|
67
|
+
const [curd3ListParams] = useAtom(curd3ListParamsAtom);
|
|
68
|
+
const [curd3MethodList] = useAtom(curd3MethodListAtom);
|
|
69
|
+
return {
|
|
70
|
+
params: curd3ListParams,
|
|
71
|
+
curd3MethodList
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const Curd3ListViewDebug = () => {
|
|
75
|
+
const curd3 = useCurd3List();
|
|
76
|
+
const [gomtmBaseUrl] = useAtom(gomtmBaseUrlAtom);
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-slate-200 p-2", children: [
|
|
78
|
+
/* @__PURE__ */ jsx("h1", { children: "Curd3ListViewDebug" }),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
80
|
+
"params: ",
|
|
81
|
+
/* @__PURE__ */ jsx("pre", { children: JSON.stringify(curd3, null, 2) })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
84
|
+
"gomtmBaseUrl:",
|
|
85
|
+
gomtmBaseUrl
|
|
86
|
+
] })
|
|
87
|
+
] });
|
|
88
|
+
};
|
|
89
|
+
const Curd2ListView = () => {
|
|
90
|
+
const [items] = useAtom(curd3ItemsAtom);
|
|
91
|
+
return /* @__PURE__ */ jsx("div", { className: "bg-blue-100 p-2", children: /* @__PURE__ */ jsx("pre", { children: JSON.stringify(items, null, 2) }) });
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
Curd2ListView,
|
|
95
|
+
Curd3ListProvider,
|
|
96
|
+
Curd3ListViewDebug,
|
|
97
|
+
useCurd3List
|
|
98
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const exampleParamsAtom: import("jotai").PrimitiveAtom<string> & {
|
|
3
|
+
init: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const exampleValue1Atom2: import("jotai").Atom<string>;
|
|
6
|
+
export declare const StoreExample: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Provider, atom, createStore, useAtom } from "jotai";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
const exampleParamsAtom = atom("value1");
|
|
6
|
+
const exampleValue1Atom2 = atom((get) => {
|
|
7
|
+
return get(exampleParamsAtom);
|
|
8
|
+
});
|
|
9
|
+
const ExampleProvider = (props) => {
|
|
10
|
+
const { value, children } = props;
|
|
11
|
+
const innerStore = useMemo(() => {
|
|
12
|
+
const store = createStore();
|
|
13
|
+
store.set(exampleParamsAtom, value);
|
|
14
|
+
return store;
|
|
15
|
+
}, [value]);
|
|
16
|
+
return /* @__PURE__ */ jsx(Provider, { store: innerStore, children });
|
|
17
|
+
};
|
|
18
|
+
const DemoShowExampleValue = () => {
|
|
19
|
+
const [value, setValue] = useAtom(exampleParamsAtom);
|
|
20
|
+
const [value2, setValue2] = useAtom(exampleValue1Atom2);
|
|
21
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-red-100 p-2", children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
23
|
+
"value:",
|
|
24
|
+
value
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
27
|
+
"value2:",
|
|
28
|
+
value2
|
|
29
|
+
] })
|
|
30
|
+
] });
|
|
31
|
+
};
|
|
32
|
+
const StoreExample = () => {
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
34
|
+
/* @__PURE__ */ jsx("h1", { children: "\u6F14\u793A\u6B63\u786E\u7684 jotai provider \u7684\u4F7F\u7528\u65B9\u5F0F" }),
|
|
35
|
+
/* @__PURE__ */ jsx(ExampleProvider, { value: "value11111111111", children: /* @__PURE__ */ jsx(DemoShowExampleValue, {}) }),
|
|
36
|
+
/* @__PURE__ */ jsx(ExampleProvider, { value: "value22222222", children: /* @__PURE__ */ jsx(DemoShowExampleValue, {}) })
|
|
37
|
+
] });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
StoreExample,
|
|
41
|
+
exampleParamsAtom,
|
|
42
|
+
exampleValue1Atom2
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
export declare const gomtmBaseUrlAtom: import("jotai").PrimitiveAtom<string> & {
|
|
3
|
+
init: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const GomtmBackendProvider: (props: {
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
} & PropsWithChildren) => import("react").JSX.Element;
|
|
8
|
+
export declare const useGomtmBackend: () => void;
|