mtxuilib 0.0.397 → 0.0.399
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 +1 -0
- package/dist/esm/components/MtUnaryCallErrorView.d.ts +6 -0
- package/dist/esm/components/MtUnaryCallErrorView.js +1 -0
- package/dist/esm/components/PageCmds.d.ts +1 -2
- package/dist/esm/components/PageCmds.js +1 -1
- package/dist/esm/components/PageSearchCmd.js +1 -1
- package/dist/esm/components/UserAvatorMenus.d.ts +6 -0
- package/dist/esm/components/UserAvatorMenus.js +1 -0
- package/dist/esm/components/auth/AuthPage.d.ts +2 -0
- package/dist/esm/components/auth/AuthPage.js +1 -0
- package/dist/esm/components/auth/LoginScreen2.d.ts +2 -0
- package/dist/esm/components/auth/LoginScreen2.js +1 -0
- package/dist/esm/components/auth/UserAuthForm.d.ts +6 -0
- package/dist/esm/components/auth/UserAuthForm.js +1 -0
- package/dist/esm/components/blog/BlogPostActions.d.ts +4 -0
- package/dist/esm/components/blog/BlogPostActions.js +1 -0
- package/dist/esm/components/blog/BlogPostCreateForm.d.ts +2 -0
- package/dist/esm/components/blog/BlogPostCreateForm.js +1 -0
- package/dist/esm/components/blog/BlogPostImportDlgUrl.d.ts +6 -0
- package/dist/esm/components/blog/BlogPostImportDlgUrl.js +1 -0
- package/dist/esm/components/blog/BlogPostList.d.ts +2 -0
- package/dist/esm/components/blog/BlogPostList.js +1 -0
- package/dist/esm/components/blog/PostCard.d.ts +5 -0
- package/dist/esm/components/blog/PostCard.js +1 -0
- package/dist/esm/components/blog/PostEditForm.d.ts +2 -0
- package/dist/esm/components/blog/PostEditForm.js +1 -0
- package/dist/esm/components/blog/post-content.d.ts +5 -0
- package/dist/esm/components/blog/post-content.js +1 -0
- package/dist/esm/components/blog/post.atoms.d.ts +11 -0
- package/dist/esm/components/blog/post.atoms.js +1 -0
- package/dist/esm/components/userFab.d.ts +3 -0
- package/dist/esm/components/userFab.js +1 -0
- package/dist/esm/curd/CommonListViewV2.d.ts +12 -0
- package/dist/esm/curd/CommonListViewV2.js +1 -0
- package/dist/esm/curd/CreateFormV2.d.ts +17 -0
- package/dist/esm/curd/CreateFormV2.js +1 -0
- package/dist/esm/curd/CurdViewView.d.ts +82 -0
- package/dist/esm/curd/CurdViewView.js +1 -0
- package/dist/esm/curd/curd-detail.d.ts +3 -0
- package/dist/esm/curd/curd-detail.js +1 -0
- package/dist/esm/demos/suspense-ssr/ExamplePage.d.ts +3 -0
- package/dist/esm/demos/suspense-ssr/ExamplePage.js +1 -0
- package/dist/esm/demos/suspense-ssr/ReactQueryError.d.ts +4 -0
- package/dist/esm/demos/suspense-ssr/ReactQueryError.js +1 -0
- package/dist/esm/demos/suspense-ssr/examples.d.ts +1 -0
- package/dist/esm/demos/suspense-ssr/examples.js +1 -1
- package/dist/esm/demos/suspense-ssr/lib.js +1 -1
- package/dist/esm/misc/ExampleErrorDemo.d.ts +4 -0
- package/dist/esm/misc/ExampleErrorDemo.js +1 -0
- package/dist/esm/store/AppMetaRender.d.ts +3 -0
- package/dist/esm/store/AppMetaRender.js +1 -0
- package/dist/esm/store/MtAppProvider.d.ts +14 -0
- package/dist/esm/store/MtAppProvider.js +1 -0
- package/dist/esm/store/commands.d.ts +9 -0
- package/dist/esm/store/commands.js +1 -0
- package/dist/esm/store/hydrateCore.d.ts +2 -0
- package/dist/esm/store/hydrateCore.js +1 -0
- package/dist/esm/store/logger.context.d.ts +16 -0
- package/dist/esm/store/logger.context.js +1 -0
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.aliases.d.cts +2 -0
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.config.dev.d.cts +29 -0
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.config.prod.d.cts +21 -0
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.config.worker.d.cts +15 -0
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.helpers.d.cts +2 -0
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.plugins.d.cts +3 -0
- package/dist/esm/webpack/webpack-clibin/webpack/webpack.rules.d.cts +29 -0
- package/dist/esm/webpack/webpack-clibin/webpack.config.d.cts +34 -0
- package/dist/esm/webpack/webpack-old/webpack/webpack.aliases.d.cts +2 -0
- package/dist/esm/webpack/webpack-old/webpack/webpack.config.dev.d.cts +29 -0
- package/dist/esm/webpack/webpack-old/webpack/webpack.config.prod.d.cts +19 -0
- package/dist/esm/webpack/webpack-old/webpack/webpack.config.worker.d.cts +15 -0
- package/dist/esm/webpack/webpack-old/webpack/webpack.helpers.d.cts +2 -0
- package/dist/esm/webpack/webpack-old/webpack/webpack.plugins.d.cts +2 -0
- package/dist/esm/webpack/webpack-old/webpack/webpack.rules.d.cts +21 -0
- package/dist/esm/webpack/webpack.config.d.mts +48 -0
- package/dist/esm/webpack/webpack2.config.d.mts +49 -0
- package/dist/esm/webpack/webpack3.config.d.mts +50 -0
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as i,jsxs as c}from"react/jsx-runtime";import{MtLink as m}from"../common/mtlink";import{useCurdView as n}from"../curd/CurdViewView";import{cn as a}from"../lib/utils";import{MtButton as r}from"../ui/ui-mt/Button";import{PostCard as l}from"./blog/PostCard";const k=o=>{var e,s;const{item:t}=o;if((e=t==null?void 0:t.item)!=null&&e.value)switch(((s=t.item)==null?void 0:s.case)||""){case"commonListItem":return i(d,{item:t.item.value});case"postCard":return i(l,{item:t.item.value});default:return i("span",{className:"bg-red-600 p-2",children:"unknow list item type"})}return null},d=o=>{const{item:t}=o,e=n();return i(r,{variant:"ghost",onClick:()=>{e.openShow(t.id)},className:a("flex min-h-16 justify-start border p-4 text-left",t.id==e.activateId&&" font-bold"),"aria-label":t.id,children:c(m,{href:e.showLink(t.id),children:[t.title||t.id,t.description&&i("div",{children:t.description})]})})};export{k as ListItemView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";const d=t=>{const{unaryError:e,retry:o}=t;return a("div",{className:"bg-red-400 p-4",children:["code: ",e.error_code,r("div",{children:r("pre",{className:"prose dark:prose-invert break-words",children:e.error_message})}),o&&r("button",{onClick:()=>{o()},children:"retry"})]})};export{d as MtUnaryCallErrorView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";import{jsx as o,jsxs as a}from"react/jsx-runtime";import{debounce as t}from"lodash";import{useState as d}from"react";import{useHotkeys as r}from"react-hotkeys-hook";import{CommandDialog as s,CommandEmpty as l,CommandInput as p,CommandList as C,CommandSeparator as u}from"../ui/command";function y(){const[m,e]=d(!1);return r("alt+d",()=>{console.log("PageCommands"),e(n=>!n)},[]),a(s,{open:m,onOpenChange:e,children:[o(p,{placeholder:"Type a command or search...",onValueChange:t(n=>{},500)}),a(C,{children:[o(l,{children:"No results found."}),o(u,{})]})]})}export{y as PageCommands};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var
|
|
1
|
+
"use client";var i=Object.defineProperty,u=Object.defineProperties;var c=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var d=(r,o,e)=>o in r?i(r,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[o]=e,n=(r,o)=>{for(var e in o||(o={}))p.call(o,e)&&d(r,e,o[e]);if(s)for(var e of s(o))f.call(o,e)&&d(r,e,o[e]);return r},m=(r,o)=>u(r,c(o));import{jsx as a,jsxs as t}from"react/jsx-runtime";import{useState as b}from"react";import{useForm as h}from"react-hook-form";import{useHotkeys as C}from"react-hotkeys-hook";import{Icons as g}from"../icons/icons";import{CommandDialog as x,CommandEmpty as y,CommandInput as k,CommandList as S,CommandSeparator as v}from"../ui/command";import{Input as N}from"../ui/input";import{MtButton as _}from"../ui/ui-mt/Button";import{MtForm as w}from"../ui/ui-mt/MtForm";const q=()=>{const[r,o]=b(!1);C("alt+s",()=>{console.log("PageCommands"),o(l=>!l)},[]);const e=h();return t(w,m(n({},e),{children:[a("form",{onSubmit:e.handleSubmit(()=>{}),children:a("div",{className:"relative flex w-full flex-wrap items-stretch",children:t("div",{className:"flex",children:[a(N,m(n({placeholder:"search"},e.register("q")),{"aria-label":"Search","aria-describedby":"button-addon1",type:"search",className:" focus:border-primary dark:focus:border-primary relative m-0 -mr-0.5 block h-auto min-w-0 flex-auto rounded-l border border-solid border-neutral-300 bg-transparent bg-clip-padding px-3 py-1 text-base font-normal leading-[1.6] text-neutral-700 outline-none transition duration-200 ease-in-out focus:z-[3] focus:text-neutral-700 focus:shadow-[inset_0_0_0_1px_rgb(59,113,202)] focus:outline-none dark:border-neutral-600 dark:text-neutral-200 dark:placeholder:text-neutral-200"})),a(_,{className:" rounded-l-0",children:a(g.search,{})})]})})}),t(x,{open:r,onOpenChange:o,children:[a(k,{placeholder:"Type a command or search...",onValueChange:l=>{o(!1)}}),t(S,{children:[a(y,{children:"No results found."}),a(v,{})]})]})]}))};export{q as PageSearchCmd};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { userAdvanceMenus } from "../store/MtAppProvider";
|
|
3
|
+
export declare const curdModuleMenusAtom: import("jotai").PrimitiveAtom<userAdvanceMenus[]> & {
|
|
4
|
+
init: userAdvanceMenus[];
|
|
5
|
+
};
|
|
6
|
+
export default function UserAvatorMenus(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as g,jsx as o,jsxs as n}from"react/jsx-runtime";import{useSuspenseQuery as S}from"gomtm/connectquery/use-query";import{curdViewList as k}from"gomtm/gomtmpb/mtm/sppb/mtm-MtmService_connectquery";import{useIsAdmin as b,useUser as f}from"gomtm/providers/userContext";import{atom as v,useAtom as h}from"jotai";import{MoonIcon as I,SunIcon as A}from"lucide-react";import{useTheme as C}from"next-themes";import{usePathname as L}from"next/navigation";import{MtLink as a}from"../common/mtlink";import{userAdvanceMenusAtom as y}from"../store/MtAppProvider";import{Avatar as T,AvatarFallback as P,AvatarImage as N}from"../ui/avatar";import{DropdownMenu as G,DropdownMenuContent as x,DropdownMenuGroup as i,DropdownMenuItem as e,DropdownMenuLabel as $,DropdownMenuPortal as m,DropdownMenuSeparator as s,DropdownMenuShortcut as p,DropdownMenuSub as D,DropdownMenuSubContent as w,DropdownMenuSubTrigger as c,DropdownMenuTrigger as Q}from"../ui/dropdown-menu";const U=v([]);function z(){var d;const M=L(),{setTheme:t}=C(),{userInfo:u}=f();return o(g,{children:(d=u==null?void 0:u.userInfo)!=null&&d.ID.length?n(G,{children:[o(Q,{asChild:!0,children:n(T,{children:[o(N,{src:"https://github.com/shadcn.png",alt:"@siteCook"}),o(P,{children:"You"})]})}),n(x,{className:"w-56",children:[o($,{children:"My Account"}),o(s,{}),n(i,{children:[o(a,{href:"/profile",children:n(e,{children:["Profile",o(p,{children:"\u21E7\u2318P"})]})}),n(e,{children:["Settings",o(p,{children:"\u2318S"})]}),o(a,{href:"/admin/site",children:n(e,{children:["Site",o(p,{children:"\u2318S"})]})})]}),o(s,{}),o(i,{children:n(D,{children:[o(c,{children:"Cx"}),o(m,{children:n(w,{children:[o(a,{href:"/admin/cx/config",children:o(e,{children:"config"})}),o(a,{href:"/admin/cx/result",children:o(e,{children:"result"})}),o(s,{})]})})]})}),o(i,{children:n(D,{children:[o(c,{children:"Blog"}),o(m,{children:o(w,{children:o(s,{})})})]})}),o(i,{children:n(D,{children:[n(c,{children:[o(A,{className:"size-[1.2rem] rotate-0 scale-100 pr-1 transition-all dark:-rotate-90 dark:scale-0"}),o(I,{className:"absolute size-[1.2rem] rotate-90 scale-0 pr-1 transition-all dark:rotate-0 dark:scale-100"}),"theme",o("span",{className:"sr-only",children:"Toggle theme"})]}),o(m,{children:n(w,{children:[o(e,{onClick:()=>t("light"),children:"Light"}),o(e,{onClick:()=>t("dark"),children:"Dark"}),o(e,{onClick:()=>t("system"),children:"System"})]})})]})}),o(s,{}),u==null?void 0:u.navs.map((l,r)=>n(e,{children:["userNav: ",l.label,o(p,{children:"\u21E7\u2318Q"})]},r)),o(F,{}),o(V,{}),o(a,{href:"/logout",children:n(e,{children:["Log out",o(p,{children:"\u21E7\u2318Q"})]})})]})]}):o(a,{variant:"ghost",href:`/login?back=${M}`,children:" login"})})}const F=()=>{const M=b(),[t,u]=h(y),[d,l]=h(U);return M?n(g,{children:[!!t.length&&t.map(r=>o(a,{href:`${r.url}`,children:n(e,{children:[r.label,o(p,{children:"\u21E7\u2318D"})]})},r.url)),!!d.length&&o("div",{className:"bg-slate-300 ",children:d.map(r=>o(a,{href:`${r.url}`,children:n(e,{children:[r.label,o(p,{children:"\u21E7\u2318D"})]})},r.url))})]}):null},V=()=>{const M=S(k);return M.data?o(g,{children:o(i,{children:n(D,{children:[o(c,{children:"\u6A21\u5757\u7BA1\u7406"}),o(m,{children:n(w,{children:[M.data.items.map(t=>{var u,d,l,r;return o(a,{href:`/admin/${(d=t.item.value)==null?void 0:d.id}`,children:n(e,{children:[((l=t.item.value)==null?void 0:l.title)||((r=t.item.value)==null?void 0:r.id),o(p,{children:"\u21E7\u2318D"})]})},(u=t.item.value)==null?void 0:u.id)}),o(s,{})]})})]})})}):null};export{U as curdModuleMenusAtom,z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as a,jsx as e,jsxs as t}from"react/jsx-runtime";import{ChevronLeft as s}from"lucide-react";import{LoginScreen2 as i}from"../../../src/components/auth/LoginScreen2";import{UserAuthForm as n}from"../../../src/components/auth/UserAuthForm";import{MtLink as o}from"../../common/mtlink";import{Icons as c}from"../../icons/icons";import{MtButton as r}from"../../ui/ui-mt/Button";function d(){return t("div",{className:"size-screen container flex flex-col items-center justify-center",children:[e("div",{className:"absolute left-4 top-4 focus:z-10 focus:outline-none md:left-8 md:top-8",children:e(o,{href:"/",children:e(r,{children:t(a,{children:[e(s,{className:"mr-2 size-4"}),"Back"]})})})}),t("div",{className:"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]",children:[t("div",{className:"flex flex-col space-y-2 text-center",children:[e(c.logo,{color:"white",className:"mx-auto size-12"}),e("h1",{className:"text-2xl font-bold ",children:"Welcome back"}),e("p",{className:"text-sm ",children:"Sign in with Github to login"})]}),e(n,{}),e(i,{}),e("p",{className:"px-8 text-center text-sm ",children:e(o,{href:"/register",className:"hover:text-brand underline",children:"Don't have an account? Sign Up"})})]})]})}export{d as AuthPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var w=Object.defineProperty;var c=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var p=(o,e,t)=>e in o?w(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,l=(o,e)=>{for(var t in e||(e={}))y.call(e,t)&&p(o,t,e[t]);if(c)for(var t of c(e))N.call(e,t)&&p(o,t,e[t]);return o};var d=(o,e,t)=>new Promise((r,u)=>{var h=s=>{try{m(t.next(s))}catch(n){u(n)}},v=s=>{try{m(t.throw(s))}catch(n){u(n)}},m=s=>s.done?r(s.value):Promise.resolve(s.value).then(h,v);m((t=t.apply(o,e)).next())});import{jsx as a,jsxs as i}from"react/jsx-runtime";import{useAuth as b}from"gomtm/providers/userContext";import{AuthLoginInput as S}from"gomtm/validations/auth";import{ZForm as M,useZodForm as x}from"../../form/ZodForm";import{MtLink as F}from"../../common/mtlink";import{Input as f}from"../../ui/input";import{MtButton as g}from"../../ui/ui-mt/Button";function G(){const o=x({schema:S,defaultValues:{}}),e=b();return i("div",{className:"mx-auto max-w-md",children:[a("div",{className:"prose",children:"Sign in"}),i("div",{className:"prose text-sm",children:["New to company?"," ",a(F,{href:"#replace-with-a-link",children:"Sign up!"})]}),a(g,{variant:"ghost",className:"bg-opacity/0.8 w-full bg-neutral-50",children:"Continue with Google"}),i(M,{form:o,className:"space-y-2",handleSubmit:r=>d(this,null,function*(){e.login.mutate(r)}),children:[a(f,l({type:"email"},o.register("username"))),a(f,l({type:"password"},o.register("password"))),a("div",{className:"flex items-center justify-between"}),a(g,{type:"submit",className:"w-full",children:"Sign in"})]}),a("footer",{className:"py-3",children:i("div",{className:"prose text-center",children:["\xA9 Mtm ltd. ",new Date().getFullYear()]})})]})}export{G as LoginScreen2};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react/experimental" />
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface UserAuthFormProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
}
|
|
5
|
+
export declare function UserAuthForm({ className, ...props }: UserAuthFormProps): React.JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var p=Object.defineProperty,v=Object.defineProperties;var f=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var n=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var o=(t,e,s)=>e in t?p(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,l=(t,e)=>{for(var s in e||(e={}))n.call(e,s)&&o(t,s,e[s]);if(r)for(var s of r(e))m.call(e,s)&&o(t,s,e[s]);return t},u=(t,e)=>v(t,f(e));var d=(t,e)=>{var s={};for(var i in t)n.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(t!=null&&r)for(var i of r(t))e.indexOf(i)<0&&m.call(t,i)&&(s[i]=t[i]);return s};import{jsx as a,jsxs as c}from"react/jsx-runtime";import{cn as b}from"../../lib/utils";import{MtButton as g}from"../../ui/ui-mt/Button";function M(s){var i=s,{className:t}=i,e=d(i,["className"]);return c("div",u(l({className:b("grid gap-6",t)},e),{children:[c("div",{className:"relative",children:[a("div",{className:"absolute inset-0 flex items-center",children:a("div",{className:"w-full border-t "})}),a("div",{className:"relative flex justify-center text-xs uppercase",children:a("span",{className:"bg-appbg px-2 ",children:"Continue with"})})]}),c(g,{type:"button",children:[a("svg",{className:"mr-2 size-4","aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"github",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",children:a("path",{fill:"currentColor",d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"})}),"Github"]})]}))}export{M as UserAuthForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{useIsAdmin as p}from"gomtm/providers/userContext";import{Icons as s}from"../../icons/icons";import{DropdownMenu as i,DropdownMenuContent as d,DropdownMenuItem as m,DropdownMenuSeparator as u,DropdownMenuShortcut as a,DropdownMenuTrigger as M}from"../../ui/dropdown-menu";import{MtButton as w}from"../../ui/ui-mt/Button";import{DropdownMenuItemLink as t}from"../../ui/ui-mt/DropdownMenuItemLink";const h=r=>{const{postId:e}=r;return p()?n(i,{children:[o(M,{asChild:!0,children:n(w,{variant:"ghost",className:"data-[state=open]:bg-muted flex size-8 p-0",children:[o(s.chevronRight,{className:"size-4"}),o("span",{className:"sr-only",children:"Open menu"})]})}),n(d,{align:"end",className:"w-[160px]",children:[o(t,{href:`/post/${e}/edit`,children:"Edit"}),o(t,{href:`/post/${e}/create`,children:"create"}),o(u,{}),n(m,{children:["Delete",o(a,{children:"\u2318\u232B"})]})]})]}):null};export{h as BlogPostItemActions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var s=Object.defineProperty;var l=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var i=(t,o,e)=>o in t?s(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,m=(t,o)=>{for(var e in o||(o={}))p.call(o,e)&&i(t,e,o[e]);if(l)for(var e of l(o))f.call(o,e)&&i(t,e,o[e]);return t};import{Fragment as n,jsx as r}from"react/jsx-runtime";import{useFormContext as u}from"react-hook-form";import{InputField as F}from"../../ui/ui-mt/input-field/InputField";const a=()=>{const t=u();return r(n,{children:t&&r(n,{children:r(F,m({label:"title"},t.register("title")))})})};export{a as BlogPostCreateForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var C=Object.defineProperty,d=Object.defineProperties;var S=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var c=(t,o,r)=>o in t?C(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,u=(t,o)=>{for(var r in o||(o={}))D.call(o,r)&&c(t,r,o[r]);if(p)for(var r of p(o))I.call(o,r)&&c(t,r,o[r]);return t},f=(t,o)=>d(t,S(o));var F=(t,o,r)=>new Promise((e,l)=>{var b=m=>{try{i(r.next(m))}catch(a){l(a)}},g=m=>{try{i(r.throw(m))}catch(a){l(a)}},i=m=>m.done?e(m.value):Promise.resolve(m.value).then(b,g);i((r=r.apply(t,o)).next())});import{Fragment as q,jsx as n,jsxs as s}from"react/jsx-runtime";import{useState as h}from"react";import{useForm as v}from"react-hook-form";import{EditFormToolbar as B}from"../../form/EditFormToolbar";import{Dialog as x,DialogContent as y}from"../../ui/dialog";import{Form as U,FormControl as M,FormDescription as P,FormField as k,FormItem as L,FormLabel as O,FormMessage as T}from"../../ui/form";import{Input as w}from"../../ui/input";import{MtButton as E}from"../../ui/ui-mt/Button";function V(){const[t,o]=h(!1);return s(q,{children:[n(E,{variant:"outline",onClick:()=>{o(!0)},children:"Import from url"}),n(x,{open:t,onOpenChange:o,children:n(y,{children:n(N,{onCancel:()=>{o(!1)},onSubmit:e=>F(this,null,function*(){o(!1)})})})})]})}function N(t){const{onCancel:o,onSubmit:r}=t,e=v();return n(U,f(u({},e),{children:s("form",{onSubmit:e.handleSubmit(l=>{r&&r(l)}),className:"flex w-full flex-col p-1",children:[n(k,{control:e.control,name:"url",render:({field:l})=>s(L,{children:[n(O,{children:"Url"}),n(M,{children:n(w,u({placeholder:"url"},l))}),n(P,{children:"\u8F93\u5165url\uFF0C \u5BFC\u5165\u7A0B\u5E8F\u5C06\u4ECE\u8FD9\u4E2A\u9875\u9762\u5C1D\u8BD5\u5BFC\u5165\u6587\u7AE0"}),n(T,{})]})}),n(B,{submitText:"ok",onCancel:o})]})}))}export{N as BlogPostImportUrlForm,V as BlogPostImportUrlFormDlg};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as o,jsx as t}from"react/jsx-runtime";import{useSuspenseInfiniteQuery as i}from"gomtm/connectquery";import{blogPostList as n}from"gomtm/gomtmpb/mtm/sppb/mtm-MtmService_connectquery";const u=()=>{const r=i(n,{pagination:{page:1}},{pageParamKey:"pagination",getNextPageParam:(a,p,e)=>({page:((e==null?void 0:e.page)||0)+1})});return t(o,{children:t("pre",{children:JSON.stringify(r,null,2)})})};export{u as BlogPostListView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import{MtLink as r}from"../../common/mtlink";import{Card as s,CardContent as i,CardDescription as l,CardFooter as d,CardHeader as p,CardTitle as c}from"../../ui/card";import{BlogPostItemActions as m}from"./BlogPostActions";const g=a=>{const{item:t}=a;return o(s,{className:"w-[350px]",children:[o(p,{children:[e(c,{children:e(r,{href:`/post/${t.id}`,className:"pb-4 text-3xl font-bold hover:text-gray-700",children:t==null?void 0:t.title})}),e(l,{children:"Deploy your new project in one-click."})]}),e(i,{children:o("article",{className:"my-4 flex flex-col",children:[e(r,{href:`/post/${t.id}`,className:"hover:opacity-75",children:t.topImage&&e("img",{src:t.topImage,alt:t.title})}),o("div",{className:"flex flex-col justify-start bg-white p-6",children:[e(r,{href:`/post/${t.id}`,className:"pb-4 text-sm font-bold uppercase text-blue-700",children:t.category||"news"}),o("p",{className:"pb-3 text-sm",children:["By ",e(r,{href:"#",children:t.author}),","]}),e("div",{children:t.excerpt})]})]})}),o(d,{className:"flex justify-end",children:[e(r,{variant:"ghost",href:`/post/${t.id}`,children:"Show"}),e(m,{postId:t.id})]})]})};export{g as PostCard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var b=Object.defineProperty;var c=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var d=(o,t,r)=>t in o?b(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,s=(o,t)=>{for(var r in t||(t={}))f.call(t,r)&&d(o,r,t[r]);if(c)for(var r of c(t))v.call(t,r)&&d(o,r,t[r]);return o};import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useFormContext as T}from"react-hook-form";import{FormControl as m,FormDescription as x,FormField as l,FormItem as n,FormLabel as i,FormMessage as p}from"../../ui/form";import{Input as u}from"../../ui/input";import{Separator as h}from"../../ui/separator";import{Switch as N}from"../../ui/switch";import{Tabs as C,TabsContent as g,TabsList as y,TabsTrigger as F}from"../../ui/tabs";import{RichTextInput as I}from"../../ui/ui-mt/input-field/RichEditorInput";function j(){const o=T();return e("div",{className:"",children:a(C,{defaultValue:"edit",children:[a("div",{className:"flex items-center px-4 py-2",children:[e("h1",{className:"text-xl font-bold",children:"edit post"}),a(y,{className:"ml-auto",children:[e(F,{value:"edit",className:"text-zinc-600 dark:text-zinc-200",children:"\u7F16\u8F91"}),e(F,{value:"op",className:"text-zinc-600 dark:text-zinc-200",children:"\u64CD\u4F5C"})]})]}),e(h,{}),a(g,{value:"edit",className:"m-0",children:[e("input",s({type:"hidden"},o.register("id",{valueAsNumber:!0}))),e(l,{control:o.control,name:"title",render:({field:t})=>a(n,{children:[e(i,{children:"\u6807\u9898"}),e(m,{children:e(u,s({placeholder:"title"},t))}),e(p,{})]})}),e("div",{className:"container mx-auto flex items-center justify-center py-2",children:e(I,s({contentType:"html"},o.register("content")))})]}),e(g,{value:"op",className:"m-0",children:a("div",{className:"space-y-4",children:[e(l,{control:o.control,name:"slugs",render:({field:t})=>a(n,{children:[e(i,{children:"slugs"}),e(m,{children:e(u,s({placeholder:"slugs"},t))}),e(p,{})]})}),e(l,{control:o.control,name:"isManual",render:({field:t})=>a(n,{className:"flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm",children:[a("div",{className:"space-y-0.5",children:[e(i,{children:"isManual"}),e(x,{children:"\u624B\u5DE5\u7F16\u8F91\u6807\u8BB0"})]}),e(m,{children:e(N,{checked:t.value,onCheckedChange:t.onChange})})]})})]})})]})})}export{j as PostEditForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o,jsxs as i}from"react/jsx-runtime";import{ImageNoExist as s}from"gomtm/consts";import{MtImage as r}from"../../common/MtImage";const c=e=>{const{post:t}=e;return i("article",{className:"prose dark:prose-invert p-2",children:[o("h1",{className:"mt-6",children:t.title}),o("section",{children:o(r,{src:t.topImage||s,alt:t.title,width:100,height:100})}),o("div",{dangerouslySetInnerHTML:{__html:t.content}})]})};export{c as BlogPostContent};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PlainMessage } from "gomtm";
|
|
2
|
+
import { BlogPost, BlogPostGetReq } from "gomtm/gomtmpb/mtm/sppb/mtm_pb";
|
|
3
|
+
export declare const postDetailAtom: import("jotai").PrimitiveAtom<PlainMessage<BlogPost> | null> & {
|
|
4
|
+
init: PlainMessage<BlogPost> | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const postIdAtom: import("jotai").PrimitiveAtom<string | null> & {
|
|
7
|
+
init: string | null;
|
|
8
|
+
};
|
|
9
|
+
export declare const blogPostGetReqAtom: import("jotai").PrimitiveAtom<Partial<PlainMessage<BlogPostGetReq>> | undefined> & {
|
|
10
|
+
init: Partial<PlainMessage<BlogPostGetReq>> | undefined;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{atom as o}from"jotai";const r=o(null),a=o(null),m=o(void 0);export{m as blogPostGetReqAtom,r as postDetailAtom,a as postIdAtom};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as C,jsx as o,jsxs as e}from"react/jsx-runtime";import{EditIcon as t}from"lucide-react";import{Suspense as a,useState as r}from"react";import{CommandDialog as s,CommandEmpty as d,CommandInput as p,CommandList as i,CommandSeparator as c}from"../ui/command";import{cn as l}from"../lib/utils";import{MtButton as u}from"../ui/ui-mt/Button";function f(){return o(C,{children:e(s,{children:[o(p,{placeholder:"Type a command or search..."}),e(i,{children:[o(d,{children:"No results found."}),o(c,{})]})]})})}const E=()=>{const[n,m]=r(!1);return e("div",{className:"fixed bottom-20 right-3",children:[o(u,{onClick:()=>{m(!0)},variant:"secondary",className:l("flex overflow-hidden rounded-full text-center shadow-md"),children:o(t,{className:"size-4"})}),n&&e(a,{children:[" ",o(f,{})]})]})};export{f as UserCommands,E as UserFab};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InfiniteData, UseSuspenseInfiniteQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { ConnectError, Message } from "gomtm";
|
|
3
|
+
import { MethodUnaryDescriptor } from "gomtm/connectquery";
|
|
4
|
+
import { MtUnaryCallError } from "gomtm/connectquery/utils";
|
|
5
|
+
import { PropsWithChildren } from "react";
|
|
6
|
+
export declare function CommonListViewProvider<I extends Message<I>, O extends Message<O>>(props: {
|
|
7
|
+
methodList: MethodUnaryDescriptor<I, any>;
|
|
8
|
+
} & PropsWithChildren): import("react").JSX.Element;
|
|
9
|
+
export declare function CommonListView<I extends Message<I>, O extends Message<O>>(): import("react").JSX.Element | null;
|
|
10
|
+
export declare function useCommonListView<T extends Message<T>>(): {
|
|
11
|
+
listQuery: UseSuspenseInfiniteQueryResult<InfiniteData<T & MtUnaryCallError, unknown>, ConnectError> | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as k,jsx as e,jsxs as f}from"react/jsx-runtime";import{useSuspenseInfiniteQuery as p}from"gomtm/connectquery";import{ListViewLayout as m}from"gomtm/gomtmpb/mtm/sppb/mtm_pb";import{atom as y,useAtom as g}from"jotai";import{useHydrateAtoms as c}from"jotai/utils";import{ListItemView as P}from"../components/ListItem";import{MtUnaryCallErrorView as L}from"../components/MtUnaryCallErrorView";import{cn as h}from"../lib/utils";import{Pagination as I,PaginationContent as v,PaginationEllipsis as w,PaginationItem as n,PaginationLink as u,PaginationNext as x,PaginationPrevious as C}from"../ui/pagination";const l=y(null);function K(t){const{children:i,methodList:r}=t,o=p(r,{page:1},{pageParamKey:"pagination",getNextPageParam:(s,d,a)=>({page:((a==null?void 0:a.page)||0)+1})});return c([[l,o]]),e(k,{children:i})}function _(){const[t,i]=g(l);return t!=null&&t.data?f("div",{className:"relative w-full",children:[e("div",{className:h("w-full"),children:t.data.pages.map((r,o)=>{var s;return r.error_code?e(L,{unaryError:r},o):e(M,{layout:r.listLayout,children:(s=r==null?void 0:r.items)==null?void 0:s.map((d,a)=>e(P,{item:d},`${o}-${a}`))},o)})}),e(I,{children:f(v,{children:[e(n,{children:e(C,{href:"#"})}),e(n,{children:e(u,{href:"#",children:"1"})}),e(n,{children:e(u,{href:"#",isActive:!0,children:"2"})}),e(n,{children:e(u,{href:"#",children:"3"})}),e(n,{children:e(w,{})}),e(n,{children:e(x,{href:"#"})})]})}),e("div",{className:"absolute right-1 top-1"})]}):null}const M=t=>{const{children:i}=t;switch(t.layout){case m.simple:return e("div",{className:"flex flex-col space-y-1 rounded-md p-2 shadow-sm",children:i});case m.grid:return e("div",{className:"grid grid-cols-2 grid-rows-3 gap-4 px-4 lg:grid-cols-3",children:i});case m.card:return e("div",{className:"grid grid-cols-2 grid-rows-3 gap-4 px-4 lg:grid-cols-3",children:i});default:return i}};function z(){const[t,i]=g(l);return{listQuery:t}}export{_ as CommonListView,K as CommonListViewProvider,z as useCommonListView};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Message } from "gomtm";
|
|
2
|
+
import { PartialMessage } from "gomtm";
|
|
3
|
+
import { MethodUnaryDescriptor } from "gomtm/connectquery";
|
|
4
|
+
import { PropsWithChildren } from "react";
|
|
5
|
+
import { DefaultValues } from "react-hook-form";
|
|
6
|
+
export declare function useCreateForm<I extends Message<I>, O extends Message<O>>(props: {
|
|
7
|
+
defaultValues: DefaultValues<PartialMessage<I>>;
|
|
8
|
+
mutationSig: MethodUnaryDescriptor<I, any>;
|
|
9
|
+
}): {
|
|
10
|
+
form: import("react-hook-form").UseFormReturn<PartialMessage<I>, any, undefined>;
|
|
11
|
+
handleSubmit: (values: any) => void;
|
|
12
|
+
handleFormSubmit: () => (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>;
|
|
13
|
+
handleCancel: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function CreateFormV2<I extends Message<I>, O extends Message<O>>(props: {
|
|
16
|
+
createForm: ReturnType<typeof useCreateForm>;
|
|
17
|
+
} & PropsWithChildren): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var F=Object.defineProperty,b=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable;var u=(e,t,o)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,c=(e,t)=>{for(var o in t||(t={}))l.call(t,o)&&u(e,o,t[o]);if(s)for(var o of s(t))d.call(t,o)&&u(e,o,t[o]);return e},f=(e,t)=>b(e,M(t));var p=(e,t)=>{var o={};for(var r in e)l.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&s)for(var r of s(e))t.indexOf(r)<0&&d.call(e,r)&&(o[r]=e[r]);return o};import{Fragment as k,jsx as n,jsxs as O}from"react/jsx-runtime";import{useMutation as C}from"gomtm/connectquery";import{useCallback as g}from"react";import{FormProvider as D,useForm as S}from"react-hook-form";import{EditFormToolbar as y}from"../form/EditFormToolbar";import{useMtRouter as I}from"../hooks/use-router";import{Dialog as P,DialogContent as V,DialogFooter as x}from"../ui/dialog";function H(e){const{defaultValues:t,mutationSig:o}=e,r=S({defaultValues:t}),m=C(o),a=g(h=>{m.mutateAsync(h)},[m]),i=g(()=>r.handleSubmit(a),[r,a]);return{form:r,handleSubmit:a,handleFormSubmit:i,handleCancel:()=>{}}}function J(e){const a=e,{children:t,createForm:o}=a,r=p(a,["children","createForm"]),m=I();return n(k,{children:n(P,{open:!0,onOpenChange:()=>{m.back()},children:n(V,{children:n(D,f(c({},o.form),{children:O("form",{onSubmit:o.handleFormSubmit,children:[t,n(x,{children:n(y,{onSubmit:i=>{o.handleSubmit(i)},onCancel:()=>m.back()})})]})}))})})})}export{J as CreateFormV2,H as useCreateForm};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { PlainMessage } from "gomtm";
|
|
2
|
+
import { MtUnaryCallError } from "gomtm/connectquery/utils";
|
|
3
|
+
import { CommentListRes, CurdView } from "gomtm/gomtmpb/mtm/sppb/mtm_pb";
|
|
4
|
+
import { PropsWithChildren } from "react";
|
|
5
|
+
export declare const activateIdAtom: import("jotai").PrimitiveAtom<string> & {
|
|
6
|
+
init: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const curdViewAtom: import("jotai").PrimitiveAtom<PlainMessage<CurdView> | null | undefined> & {
|
|
9
|
+
init: PlainMessage<CurdView> | null | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare const curdViewIdAtom: import("jotai").PrimitiveAtom<string> & {
|
|
12
|
+
init: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const curdStore: {
|
|
15
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
16
|
+
set: <Value_1, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
17
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
18
|
+
dev_subscribe_store: (l: (action: {
|
|
19
|
+
type: "write";
|
|
20
|
+
flushed: Set<import("jotai").Atom<unknown>>;
|
|
21
|
+
} | {
|
|
22
|
+
type: "async-write";
|
|
23
|
+
flushed: Set<import("jotai").Atom<unknown>>;
|
|
24
|
+
} | {
|
|
25
|
+
type: "sub";
|
|
26
|
+
flushed: Set<import("jotai").Atom<unknown>>;
|
|
27
|
+
} | {
|
|
28
|
+
type: "unsub";
|
|
29
|
+
} | {
|
|
30
|
+
type: "restore";
|
|
31
|
+
flushed: Set<import("jotai").Atom<unknown>>;
|
|
32
|
+
}) => void, rev: 2) => () => void;
|
|
33
|
+
dev_get_mounted_atoms: () => IterableIterator<import("jotai").Atom<unknown>>;
|
|
34
|
+
dev_get_atom_state: (a: import("jotai").Atom<unknown>) => ({
|
|
35
|
+
d: Map<import("jotai").Atom<unknown>, any & ({
|
|
36
|
+
e: unknown;
|
|
37
|
+
} | {
|
|
38
|
+
v: unknown;
|
|
39
|
+
})>;
|
|
40
|
+
} & ({
|
|
41
|
+
e: unknown;
|
|
42
|
+
} | {
|
|
43
|
+
v: unknown;
|
|
44
|
+
})) | undefined;
|
|
45
|
+
dev_get_mounted: (a: import("jotai").Atom<unknown>) => {
|
|
46
|
+
l: Set<() => void>;
|
|
47
|
+
t: Set<import("jotai").Atom<unknown>>;
|
|
48
|
+
u?: (() => void) | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
dev_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
|
|
51
|
+
} | {
|
|
52
|
+
get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
|
|
53
|
+
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: import("jotai").WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
|
|
54
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
55
|
+
dev_subscribe_store?: undefined;
|
|
56
|
+
dev_get_mounted_atoms?: undefined;
|
|
57
|
+
dev_get_atom_state?: undefined;
|
|
58
|
+
dev_get_mounted?: undefined;
|
|
59
|
+
dev_restore_atoms?: undefined;
|
|
60
|
+
};
|
|
61
|
+
export declare const CurdViewView: (props: {
|
|
62
|
+
idOrName: string;
|
|
63
|
+
} & PropsWithChildren) => import("react").JSX.Element;
|
|
64
|
+
export declare function useCurdView(): {
|
|
65
|
+
curdView: CurdView;
|
|
66
|
+
canEdit: boolean | undefined;
|
|
67
|
+
canCreate: boolean | undefined;
|
|
68
|
+
canDelete: boolean | undefined;
|
|
69
|
+
openShow: (id: string) => void;
|
|
70
|
+
invalidateList: () => Promise<void>;
|
|
71
|
+
invalidateGet: () => Promise<void>;
|
|
72
|
+
activateId: string;
|
|
73
|
+
setActivateId: (args_0: string | ((prev: string) => string)) => void;
|
|
74
|
+
editLink: (id: string) => string;
|
|
75
|
+
createLink: string;
|
|
76
|
+
showLink: (id: string) => string;
|
|
77
|
+
};
|
|
78
|
+
export declare function useCurdViewList<T = CommentListRes & MtUnaryCallError, E = any>(): {
|
|
79
|
+
query: import("@tanstack/react-query").UseSuspenseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<T, unknown>, E>;
|
|
80
|
+
loadedCount: number;
|
|
81
|
+
canLoadMore: boolean;
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var h=(a,e,n)=>new Promise((u,p)=>{var s=r=>{try{i(n.next(r))}catch(t){p(t)}},c=r=>{try{i(n.throw(r))}catch(t){p(t)}},i=r=>r.done?u(r.value):Promise.resolve(r.value).then(s,c);i((n=n.apply(a,e)).next())});import{jsxs as J}from"react/jsx-runtime";import{useQueryClient as Q,useSuspenseInfiniteQuery as I}from"@tanstack/react-query";import{toPlainMessage as R}from"gomtm";import{useSuspenseQuery as U}from"gomtm/connectquery";import{curdViewGet as K}from"gomtm/gomtmpb/mtm/sppb/mtm-MtmService_connectquery";import{mtmCallUnaryMethod as O}from"gomtm/mtmFetcher";import{createInfiniteQueryKey as G,createQueryKey as T}from"gomtm/mtmquery";import{useExtInfo as b}from"gomtm/providers/GomtmProvider";import{useIsAdmin as z}from"gomtm/providers/userContext";import{Provider as W,atom as C,createStore as D,useAtom as P}from"jotai";import{usePathname as F}from"next/navigation";import{compile as g,match as v}from"path-to-regexp";import{useCallback as f,useMemo as m}from"react";import{useMtRouter as j}from"../hooks/use-router";const B=C("0"),H=C(null),S=C(""),y=D(),dt=a=>{const{idOrName:e,children:n}=a;return m(()=>{y.set(S,e)},[e]),J(W,{store:y,children:["idOrName:",e,n]})};function ht(){const a=F(),[e,n]=P(B,{store:y}),[u,p]=P(S,{store:y}),s=z(),c=j(),i=Q(),r=U(K,{id:u}),t=m(()=>{var o,d;return(d=(o=r.data)==null?void 0:o.item)==null?void 0:d.value},[r.data]),E=m(()=>s,[s]),L=m(()=>s,[s]),x=m(()=>s,[s]),l=f(o=>t!=null&&t.routeShow?g(t==null?void 0:t.routeShow,{encode:encodeURIComponent})({id:o}):"",[t==null?void 0:t.routeShow]),M=f(o=>{l&&c.push(l(o))},[c,l]),N=f(()=>h(this,null,function*(){t&&(yield i.invalidateQueries({queryKey:G(t.svcName,t.methodList)}))}),[t,i]),k=f(()=>h(this,null,function*(){t&&(yield i.invalidateQueries({queryKey:T(t.svcName,t.methodGet)}))}),[t,i]),q=f(o=>t!=null&&t.routeEdit?g(t==null?void 0:t.routeEdit,{encode:encodeURIComponent})({id:o}):"",[t==null?void 0:t.routeEdit]),A=m(()=>t!=null&&t.routeCreate?g(t==null?void 0:t.routeCreate,{encode:encodeURIComponent})({id:e}):"",[t==null?void 0:t.routeCreate,e]);return m(()=>{if(t!=null&&t.routeShow){const o=v(t.routeShow)(a);o&&n(o.params.id)}else if(t!=null&&t.routeEdit){const o=v(t.routeShow)(a);o&&n(o.params.id)}},[t==null?void 0:t.routeEdit,t==null?void 0:t.routeShow,a,n]),{curdView:t,canEdit:E,canCreate:L,canDelete:x,openShow:M,invalidateList:N,invalidateGet:k,activateId:e,setActivateId:n,editLink:q,createLink:A,showLink:l}}function yt(){const a=b(),[e,n]=P(H),u=I({queryKey:[e==null?void 0:e.svcName,e==null?void 0:e.methodList],queryFn:i=>h(this,null,function*(){const r=yield O(a,(e==null?void 0:e.svcName)||"",(e==null?void 0:e.methodList)||"");return R(r)}),initialPageParam:{},getNextPageParam:()=>{}}),p=(e==null?void 0:e.pageSize)||12,s=m(()=>u.data?u.data.pages.length*p:0,[p,u.data]),c=m(()=>!0,[]);return{query:u,loadedCount:s,canLoadMore:c}}export{dt as CurdViewView,B as activateIdAtom,y as curdStore,H as curdViewAtom,S as curdViewIdAtom,ht as useCurdView,yt as useCurdViewList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as V,jsx as e,jsxs as r}from"react/jsx-runtime";import{useAtom as s}from"jotai";import{useSearchParams as p}from"next/navigation";import{createContext as c,useMemo as l,useState as D}from"react";import{Icons as w}from"../icons/icons";import{DropdownMenu as m,DropdownMenuContent as C,DropdownMenuGroup as h,DropdownMenuItem as f,DropdownMenuLabel as M,DropdownMenuSeparator as a,DropdownMenuShortcut as P,DropdownMenuTrigger as S}from"../ui/dropdown-menu";import{MtButton as v}from"../ui/ui-mt/Button";import{activateIdAtom as I,useCurdView as b}from"./CurdViewView";const x=c(void 0);function E(t){const[n,o]=D(!1);return e(x.Provider,{value:{isOpenEdit:n,setIsOpenEdit:o},children:t.children})}function k(t){const{children:n}=t,[o,i]=s(I),d=p();return l(()=>{const u=d.get("id");u&&i(u)},[d,i]),o?e(V,{children:e(E,{})}):null}const j=()=>{const t=b();return r(m,{children:[e(S,{asChild:!0,children:e(v,{variant:"ghost",className:"m-0 flex h-10 w-10 items-center justify-center border p-0 shadow-sm backdrop-blur",children:e(w.ellipsis,{})})}),r(C,{className:"w-56",children:[e(M,{children:"Edit"}),e(a,{}),e(h,{children:t.canEdit&&r(f,{onSelect:()=>{},children:["Edit",e(P,{children:"\u21E7\u2318P"})]})}),e(a,{})]})]})};export{k as CurdViewShow,j as DetailViewActions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as i,jsx as r,jsxs as e}from"react/jsx-runtime";import u from"next/dynamic";import{Card as a,CardContent as n,CardTitle as d}from"../../ui/card";import{DemoReactQueryError as C}from"./ReactQueryError";import{DemoUserDetail as m}from"./examples";import{QueryErrorResetBoundary as c}from"@tanstack/react-query";import{ErrorBoundary as y}from"react-error-boundary";import{MtButton as f}from"../../ui/ui-mt/Button";const E=u(()=>import("./ExampleLazyComponent").then(t=>t.ExampleLazyComponent),{}),Q=()=>e(i,{children:[r(m,{userId:"5",randomError:!0}),r(m,{userId:"6",randomError:!0}),r("h3",{children:"with AutoSuspense"}),e(a,{children:[r(d,{children:"lazy example"}),r(n,{children:r(m,{userId:"7",randomError:!0})})]}),e(a,{children:[r(d,{children:"lazy example"}),r(n,{children:r(E,{})})]}),r(a,{children:r(n,{children:r(C,{})})})]});function b(t){const{children:p}=t;return r(i,{children:r(c,{children:({reset:s})=>r(y,{onReset:s,fallbackRender:({resetErrorBoundary:l,error:o})=>e("div",{className:"green-red-100 prose dark:prose-invert container m-1 mx-auto border p-1 text-lg",children:[e("div",{className:"flex gap-2",children:[r("h1",{className:"pb-1 text-center",children:" error"}),r(f,{onClick:()=>l(),variant:"ghost",children:"Retry"})]}),r("pre",{children:o==null?void 0:o.toString()}),r("div",{className:"flex items-center justify-center p-1"})]}),children:p})})})}export{Q as ExamplePage,b as RqErrorBoundary};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var m=Object.defineProperty;var s=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var a=(t,e,r)=>e in t?m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d=(t,e)=>{for(var r in e||(e={}))p.call(e,r)&&a(t,r,e[r]);if(s)for(var r of s(e))f.call(e,r)&&a(t,r,e[r]);return t};import{jsx as n,jsxs as c}from"react/jsx-runtime";import{useQueryClient as y}from"@tanstack/react-query";import{useState as E}from"react";import{MtButton as u}from"../../ui/ui-mt/Button";import{RqErrorBoundary as k}from"./ExamplePage";import{DemoUserDetail as l}from"./examples";function q({children:t}){const[e,r]=E([]),i=y();return c("div",{children:[c("div",{className:"flex gap-2 p-2",children:[n(u,{onClick:()=>{r(o=>[...o,{userId:(o.length+1).toString(),randomError:!0,isHardError:!1}]),console.log("click 1",e)},children:"add(softerro)"}),n(u,{onClick:()=>{r(o=>[...o,{userId:(o.length+1).toString(),randomError:!0,isHardError:!0}])},children:"add(harderror)"}),n(u,{onClick:()=>{r([]),i.invalidateQueries({queryKey:["userId"]}),i.clear()},children:"clear"})]}),e.map((o,I)=>o.isHardError?n(k,{children:n(l,d({},o),o.userId)},o.userId):n(l,d({},o),o.userId))]})}export{q as DemoReactQueryError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var
|
|
1
|
+
"use client";var c=(d,a,o)=>new Promise((n,r)=>{var i=e=>{try{t(o.next(e))}catch(s){r(s)}},l=e=>{try{t(o.throw(e))}catch(s){r(s)}},t=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,l);t((o=o.apply(d,a)).next())});import{Fragment as g,jsx as m,jsxs as u}from"react/jsx-runtime";import{useSuspenseQuery as y}from"@tanstack/react-query";import{MtUnaryCallErrorView as E}from"../../components/MtUnaryCallErrorView";import{fakeFetchUser as p}from"./lib";const f=(d,a)=>c(void 0,null,function*(){try{return{code:"",data:yield p(d,!a)}}catch(o){return{error_code:"some_error_code",error_message:"error message"}}});function _(d){var i,l,t,e,s;const{userId:a,randomError:o,isHardError:n}=d,r=y({queryKey:["userId",a],queryFn:()=>c(this,null,function*(){if(n)throw console.log("isHardError",n),new Error("isHardError=true");return f(a,o)})});return r.error?u("div",{children:["query error:",JSON.stringify(r.error)]}):u("div",{className:"border-spacing-1 border p-2",children:[u("div",{className:"bg-slate-200",children:["userId:",a,",randomError:",o,",isHardError:",n]}),r.data&&((i=r.data)!=null&&i.error_code)?m(g,{children:m(E,{unaryError:r.data})}):u("pre",{children:[(t=(l=r.data)==null?void 0:l.data)==null?void 0:t.id,",",JSON.stringify((s=(e=r.data)==null?void 0:e.data)==null?void 0:s.id,null,2)]})]})}export{_ as DemoUserDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const n=(
|
|
1
|
+
const n=(t,e=!1)=>{const o=Math.random();if(!e&&o>.5)throw new Error("\u968F\u673A\u51FA\u9519\u3002\u3002\u3002"+o);return console.log("ramdonNum",o),fetch(`https://jsonplaceholder.typicode.com/users/${t}?_delay=2000`,{next:{revalidate:0}}).then(s=>s.json())},r=()=>fetch("https://jsonplaceholder.typicode.com/posts",{}).then(t=>t.json()),c=t=>fetch(`https://jsonplaceholder.typicode.com/posts/${t}`,{}).then(e=>e.json());export{n as fakeFetchUser,c as fetchPost,r as fetchPosts};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ExampleError2: () => import("react").JSX.Element;
|
|
3
|
+
export declare const ExampleError1: () => never;
|
|
4
|
+
export declare const WiehErrorExample: import("react").ForwardRefExoticComponent<object & import("react").RefAttributes<any>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as E,jsx as r}from"react/jsx-runtime";import{ErrorBoundary as e,withErrorBoundary as n}from"react-error-boundary";const l=()=>r(E,{children:r(e,{fallback:r("div",{children:"error123"}),children:r(o,{})})}),o=()=>{throw new Error("\u{1F4A5}\u{1F4A5}\u{1F4A5}")},p=n(o,{fallback:r("div",{children:"Something went wrong"}),onError(t,a){}});export{o as ExampleError1,l as ExampleError2,p as WiehErrorExample};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as n,jsx as o,jsxs as l}from"react/jsx-runtime";import{atom as m,useAtom as s,useSetAtom as i}from"jotai";const e=m("site-title-1"),c=()=>{const[t]=s(e);return l(n,{children:[t&&o("title",{children:t}),o("meta",{name:"somemtm",content:"mark123"})]})},p=t=>{i(e)(t)};export{c as AppMetaRender,p as usePageTitle};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export interface userAdvanceMenus {
|
|
3
|
+
label: string;
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const userAdvanceMenusAtom: import("jotai").PrimitiveAtom<userAdvanceMenus[]> & {
|
|
7
|
+
init: userAdvanceMenus[];
|
|
8
|
+
};
|
|
9
|
+
export declare const editParamAtom: import("jotai").PrimitiveAtom<any> & {
|
|
10
|
+
init: any;
|
|
11
|
+
};
|
|
12
|
+
export declare function MtAppProvider(props: {
|
|
13
|
+
initExtKv: Record<string, any | undefined>;
|
|
14
|
+
} & PropsWithChildren): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as r,jsxs as e}from"react/jsx-runtime";import{Suspense as n}from"react";import{ReactQueryDevtools as s}from"@tanstack/react-query-devtools";import{GomtmProvider as a}from"gomtm/providers/GomtmProvider";import{UserProvider as p}from"gomtm/providers/userContext";import{atom as o}from"jotai";import{AppProgressBar as d}from"next-nprogress-bar";import{ThemeProvider as l}from"next-themes";import{Toaster as f}from"sonner";import{TailwindIndicator as u}from"../common/tailwind-indicator";import{DefaultHeader as v}from"../components/Header";import{PageCommands as P}from"../components/PageCmds";import{TooltipProvider as c}from"../ui/tooltip";import{AppMetaRender as g}from"./AppMetaRender";import{GlobalCommands as h}from"./commands";import{LoggerProvider as T}from"./logger.context";const W=o([]),H=o(null);function I(t){const{children:i,initExtKv:m}=t;return r(a,{initExtKv:m,children:r(T,{children:e(p,{children:[r(l,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e(c,{delayDuration:0,children:[r(v,{}),i,r(d,{height:"4px",color:"#4934eb",options:{showSpinner:!1},shallowRouting:!0}),r(s,{}),r(f,{}),r(u,{}),r(P,{}),r(n,{children:r(h,{})})]})}),r(g,{})]})})})}export{I as MtAppProvider,H as editParamAtom,W as userAdvanceMenusAtom};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PlainMessage } from 'gomtm';
|
|
3
|
+
import { CmdkItem } from "gomtm/gomtmpb/mtm/sppb/mtm_pb";
|
|
4
|
+
interface GlobalCmds {
|
|
5
|
+
items: PlainMessage<CmdkItem>[];
|
|
6
|
+
}
|
|
7
|
+
export declare const _globalCmds: GlobalCmds;
|
|
8
|
+
export declare function GlobalCommands(): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as g,jsx as m,jsxs as l}from"react/jsx-runtime";import{ADMIN_ROLE as o}from"gomtm/consts";import{useIsAdmin as t}from"gomtm/providers/userContext";import{useState as d}from"react";import{useHotkeys as s}from"react-hotkeys-hook";import{CommandDialog as p,CommandEmpty as i,CommandGroup as u,CommandInput as C,CommandList as f}from"../ui/command";const j={items:[{group:"demo",label:"json_form",url:"/demo/jsonform",allowRoles:[o]},{group:"demo",label:"hydrate-demo",url:"/demo/hydrate-demo",allowRoles:[o]},{group:"demo",label:"fetchpage",url:"/demo/fetchpage",allowRoles:[o]},{group:"runjob",label:"runjob:deploy",url:"/admin/job",allowRoles:[o]}]};function w(){const[a,e]=d(!1);s("alt+m",()=>{e(n=>!n)},[]);const r=t();return m(g,{children:l(p,{open:a,onOpenChange:e,children:[m(C,{placeholder:"Type a command or search..."}),l(f,{children:[m(i,{children:"No results found."}),m(u,{heading:"\u6A21\u5757"}),r&&"ADMIN"]})]})})}export{w as GlobalCommands,j as _globalCmds};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=(n,o,e)=>new Promise((x,c)=>{var E=t=>{try{i(e.next(t))}catch(m){c(m)}},h=t=>{try{i(e.throw(t))}catch(m){c(m)}},i=t=>t.done?x(t.value):Promise.resolve(t.value).then(E,h);i((e=e.apply(n,o)).next())});import{Fragment as K,jsx as k}from"react/jsx-runtime";import{ExtKey_Hostname as p,ExtKey_SelfBackend as f,ExtKey_mtmaccessToken as s,ExtKey_mtmbackend as a}from"gomtm/consts";import{ExtinfoSS as r}from"gomtm/sscore";import{MtAppProvider as l}from"./MtAppProvider";function y(n){return d(this,null,function*(){const{children:o}=n;return r(p)?k(l,{initExtKv:{[p]:r(p),[s]:r(s),[a]:r(a),[f]:r(f)},children:o}):k(K,{children:"missing backend"})})}export{y as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare function LoggerProvider(props: {} & PropsWithChildren): import("react").JSX.Element;
|
|
3
|
+
export declare function useLogger(): {
|
|
4
|
+
info: {
|
|
5
|
+
(...data: any[]): void;
|
|
6
|
+
(...data: any[]): void;
|
|
7
|
+
(...data: any[]): void;
|
|
8
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
9
|
+
};
|
|
10
|
+
error: {
|
|
11
|
+
(...data: any[]): void;
|
|
12
|
+
(...data: any[]): void;
|
|
13
|
+
(...data: any[]): void;
|
|
14
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as f}from"react/jsx-runtime";import{createContext as u,useContext as c,useMemo as g,useState as d}from"react";import{useMtmApp as l}from"gomtm/providers/GomtmProvider";import{mtlogger as r}from"../lib/mt-logger";const i=u(void 0);function P(t){const{children:e}=t,[o,n]=d(r);return f(i.Provider,{value:{logger:o},children:e})}const s=()=>{};function a(){if(c(i)===void 0)throw new Error("useLogger must be used within a LoggerProvider");const e=l(),o=g(()=>e.isDebug?r.log:s,[e.isDebug]),n=g(()=>e.isDebug?r.error:s,[e.isDebug]);return{info:o,error:n}}export{P as LoggerProvider,a as useLogger};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export let mode: string;
|
|
2
|
+
export let entry: string[];
|
|
3
|
+
export namespace module {
|
|
4
|
+
let rules: any;
|
|
5
|
+
}
|
|
6
|
+
export namespace output {
|
|
7
|
+
let filename: string;
|
|
8
|
+
let chunkFilename: string;
|
|
9
|
+
}
|
|
10
|
+
export let plugins: import("webpack").BannerPlugin[];
|
|
11
|
+
export namespace resolve {
|
|
12
|
+
let extensions: string[];
|
|
13
|
+
let alias: any;
|
|
14
|
+
}
|
|
15
|
+
export let stats: string;
|
|
16
|
+
export let devtool: string;
|
|
17
|
+
export namespace devServer {
|
|
18
|
+
let open: boolean;
|
|
19
|
+
let compress: boolean;
|
|
20
|
+
let port: number;
|
|
21
|
+
}
|
|
22
|
+
export namespace optimization {
|
|
23
|
+
namespace splitChunks {
|
|
24
|
+
let chunks: string;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export namespace performance {
|
|
28
|
+
let hints: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare var nodeModules: {};
|
|
2
|
+
declare const outDir: string;
|
|
3
|
+
export declare let mode: string;
|
|
4
|
+
export declare let entry: string[];
|
|
5
|
+
export declare let target: string;
|
|
6
|
+
export { nodeModules as externals };
|
|
7
|
+
export declare namespace module {
|
|
8
|
+
let rules: any;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace output {
|
|
11
|
+
export let filename: string;
|
|
12
|
+
export { outDir as path };
|
|
13
|
+
export let chunkFilename: string;
|
|
14
|
+
export let clean: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare let plugins: any[];
|
|
17
|
+
export declare namespace resolve {
|
|
18
|
+
let extensions: string[];
|
|
19
|
+
let alias: any;
|
|
20
|
+
}
|
|
21
|
+
export declare let stats: string;
|