gomtm 0.0.194 → 0.0.196

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.
@@ -1,14 +1,12 @@
1
1
  import { AnyMessage, PlainMessage } from "@bufbuild/protobuf";
2
2
  import { CommontListRes } from "../gomtmpb/mtm/sppb/mtm_pb";
3
- export declare const curdDashPathPrefixAtom: import("jotai").PrimitiveAtom<string> & {
4
- init: string;
5
- };
6
3
  export declare const curdActivateIdAtom: import("jotai").PrimitiveAtom<string> & {
7
4
  init: string;
8
5
  };
9
6
  export declare const curd3ListParamsAtom: import("jotai").PrimitiveAtom<PlainMessage<AnyMessage>> & {
10
7
  init: PlainMessage<AnyMessage>;
11
8
  };
9
+ export declare const paramsAtom: import("jotai").Atom<any>;
12
10
  export declare const curdPathAtom: import("jotai").PrimitiveAtom<string> & {
13
11
  init: string;
14
12
  };
@@ -20,13 +20,17 @@ var __async = (__this, __arguments, generator) => {
20
20
  });
21
21
  };
22
22
  import { atom } from "jotai";
23
- import { CommontListRes } from "../gomtmpb/mtm/sppb/mtm_pb";
24
- import { gomtmBaseUrlAtom } from "../providers/GomtmProvider";
25
23
  import { usePathname } from "next/navigation";
26
24
  import { useMemo } from "react";
27
- const curdDashPathPrefixAtom = atom("/gomtmadmin");
25
+ import { CommontListRes } from "../gomtmpb/mtm/sppb/mtm_pb";
26
+ import { gomtmBaseUrlAtom } from "../providers/GomtmProvider";
28
27
  const curdActivateIdAtom = atom("");
29
28
  const curd3ListParamsAtom = atom({});
29
+ const paramsValueAtom = atom(void 0);
30
+ const paramsAtom = atom((get) => {
31
+ const v = get(paramsValueAtom);
32
+ return v;
33
+ });
30
34
  const curdPathAtom = atom("");
31
35
  const curd3ItemsV2Atom = atom((get) => __async(void 0, null, function* () {
32
36
  const slugPath = get(curdPathAtom);
@@ -52,7 +56,7 @@ export {
52
56
  curd3ItemsV2Atom,
53
57
  curd3ListParamsAtom,
54
58
  curdActivateIdAtom,
55
- curdDashPathPrefixAtom,
56
59
  curdPathAtom,
60
+ paramsAtom,
57
61
  useCurdSlugName
58
62
  };
@@ -4,5 +4,5 @@ export declare const PostCardListItem: (props: {
4
4
  item: PostCardItem;
5
5
  }) => import("react").JSX.Element;
6
6
  export declare const PostCardItemActions: (props: {
7
- postId: string;
7
+ id: string;
8
8
  }) => import("react").JSX.Element;
@@ -4,16 +4,15 @@ import { useAtom } from "jotai";
4
4
  import { MtLink } from "mtxuilib/common/mtlink";
5
5
  import { cn } from "mtxuilib/lib/utils";
6
6
  import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "mtxuilib/ui/card";
7
- import { curdActivateIdAtom, curdDashPathPrefixAtom } from "../curd.atoms";
7
+ import { curdActivateIdAtom } from "../curd.atoms";
8
8
  import { Icons } from "mtxuilib/icons/icons";
9
9
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "mtxuilib/ui/dropdown-menu";
10
- import { MtButton } from "mtxuilib/ui/ui-mt/Button";
11
10
  import { DropdownMenuItemLink } from "mtxuilib/ui/ui-mt/DropdownMenuItemLink";
12
11
  import { curdSlugPathAtom } from "../CommonListViewV2";
13
12
  const PostCardListItem = (props) => {
14
13
  const { item } = props;
15
14
  const [curdActivateId, setcurdActivateId] = useAtom(curdActivateIdAtom);
16
- const [dashPrefix] = useAtom(curdDashPathPrefixAtom);
15
+ const [curdSlugPath] = useAtom(curdSlugPathAtom);
17
16
  return /* @__PURE__ */ jsxs(
18
17
  Card,
19
18
  {
@@ -26,18 +25,18 @@ const PostCardListItem = (props) => {
26
25
  },
27
26
  children: [
28
27
  /* @__PURE__ */ jsxs(CardHeader, { children: [
29
- /* @__PURE__ */ jsx(CardTitle, { children: /* @__PURE__ */ jsx(MtLink, { href: `${dashPrefix}/post/${item.id}`, className: "pb-4 text-3xl font-bold hover:text-gray-700", children: item == null ? void 0 : item.title }) }),
28
+ /* @__PURE__ */ jsx(CardTitle, { children: /* @__PURE__ */ jsx(MtLink, { href: `${curdSlugPath}/${item.id}`, className: "pb-4 text-3xl font-bold hover:text-gray-700", children: item == null ? void 0 : item.title }) }),
30
29
  /* @__PURE__ */ jsx(CardDescription, { children: "Deploy your new project in one-click." })
31
30
  ] }),
32
31
  /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("article", { className: "my-4 flex flex-col", children: [
33
32
  /* @__PURE__ */ jsx(MtLink, {
34
- href: `/post/${item.id}`,
33
+ href: `${curdSlugPath}/${item.id}`,
35
34
  className: "hover:opacity-75",
36
35
  // eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text
37
36
  children: item.topImage && /* @__PURE__ */ jsx("img", { src: item.topImage, alt: item.title })
38
37
  }),
39
38
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-start bg-white p-6", children: [
40
- /* @__PURE__ */ jsx(MtLink, { href: `/post/${item.id}`, className: "pb-4 text-sm font-bold uppercase text-blue-700", children: item.category || "news" }),
39
+ /* @__PURE__ */ jsx(MtLink, { href: `${curdSlugPath}/${item.id}`, className: "pb-4 text-sm font-bold uppercase text-blue-700", children: item.category || "news" }),
41
40
  /* @__PURE__ */ jsxs("p", { className: "pb-3 text-sm", children: [
42
41
  "By ",
43
42
  /* @__PURE__ */ jsx(MtLink, { href: "#", children: item.author }),
@@ -47,32 +46,32 @@ const PostCardListItem = (props) => {
47
46
  ] })
48
47
  ] }) }),
49
48
  /* @__PURE__ */ jsxs(CardFooter, { className: "flex justify-end", children: [
50
- /* @__PURE__ */ jsx(MtLink, { variant: "ghost", href: `/post/${item.id}`, children: "Show" }),
51
- /* @__PURE__ */ jsx(PostCardItemActions, { postId: item.id })
49
+ /* @__PURE__ */ jsx(MtLink, { variant: "ghost", href: `${curdSlugPath}/${item.id}`, children: "Show" }),
50
+ /* @__PURE__ */ jsx(PostCardItemActions, { id: item.id })
52
51
  ] })
53
52
  ]
54
53
  }
55
54
  );
56
55
  };
57
56
  const PostCardItemActions = (props) => {
58
- const { postId } = props;
57
+ const { id } = props;
59
58
  const [curdSlugPath] = useAtom(curdSlugPathAtom);
60
59
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
61
60
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
62
- MtButton,
61
+ MtLink,
63
62
  {
63
+ href: `${curdSlugPath}/${id}`,
64
64
  variant: "ghost",
65
65
  className: "data-[state=open]:bg-muted flex size-8 p-0",
66
66
  children: [
67
67
  /* @__PURE__ */ jsx(Icons.chevronRight, { className: "size-4" }),
68
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Open menu" })
68
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "more" })
69
69
  ]
70
70
  }
71
71
  ) }),
72
72
  /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-[160px]", children: [
73
- /* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `/post/${postId}/create`, children: "create" }),
74
- /* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `/post/show`, children: "show" }),
75
- /* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/edit`, children: "edit" }),
73
+ /* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/create/${id}`, children: "create" }),
74
+ /* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/edit/${id}`, children: "edit" }),
76
75
  /* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${curdSlugPath}/listdebug`, children: "list debug" }),
77
76
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
78
77
  /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [