gomtm 0.0.191 → 0.0.193

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.
@@ -2,9 +2,11 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useAtom } from "jotai";
4
4
  import { MtLink } from "mtxuilib/common/mtlink";
5
+ import { flexRender } from "mtxuilib/lib/render";
5
6
  import { cn } from "mtxuilib/lib/utils";
6
7
  import { useDebug } from "mtxuilib/store/app.atoms";
7
8
  import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "mtxuilib/ui/card";
9
+ import { exampleListItemComponent } from "../../curd/CommonListViewV2";
8
10
  import { curdActivateIdAtom, curdDashPathPrefixAtom } from "../../curd/curd.atoms";
9
11
  import { BlogPostItemActions } from "./BlogPostActions";
10
12
  const PostCard = (props) => {
@@ -12,6 +14,7 @@ const PostCard = (props) => {
12
14
  const debug = useDebug();
13
15
  const [curdActivateId, setcurdActivateId] = useAtom(curdActivateIdAtom);
14
16
  const [dashPrefix] = useAtom(curdDashPathPrefixAtom);
17
+ const [Comp] = useAtom(exampleListItemComponent);
15
18
  return /* @__PURE__ */ jsxs(
16
19
  Card,
17
20
  {
@@ -47,7 +50,8 @@ const PostCard = (props) => {
47
50
  ] }) }),
48
51
  /* @__PURE__ */ jsxs(CardFooter, { className: "flex justify-end", children: [
49
52
  /* @__PURE__ */ jsx(MtLink, { variant: "ghost", href: `/post/${item.id}`, children: "Show" }),
50
- /* @__PURE__ */ jsx(BlogPostItemActions, { postId: item.id })
53
+ /* @__PURE__ */ jsx(BlogPostItemActions, { postId: item.id }),
54
+ Comp ? flexRender(Comp, {}) : /* @__PURE__ */ jsx("div", { children: "no comp" })
51
55
  ] })
52
56
  ]
53
57
  }
@@ -2,6 +2,10 @@ import { Message } from "@bufbuild/protobuf";
2
2
  import { PropsWithChildren } from "react";
3
3
  import { MethodUnaryDescriptor } from "../connectquery";
4
4
  export declare const curdSlugPathAtom: import("jotai").Atom<string>;
5
+ export declare const exampleListItemValueComponent: import("jotai").PrimitiveAtom<any> & {
6
+ init: any;
7
+ };
8
+ export declare const exampleListItemComponent: import("jotai").Atom<any>;
5
9
  export declare function CommonListViewProvider<I extends Message<I>, O extends Message<O>>(props: {
6
10
  methodList: MethodUnaryDescriptor<I, any>;
7
11
  slugPath?: string;
@@ -12,8 +12,22 @@ const listQueryAtom = atom(null);
12
12
  const curdSlugPathValueAtom = atom("");
13
13
  const curdSlugPathAtom = atom((get) => {
14
14
  const value = get(curdSlugPathValueAtom);
15
- return value || "/";
15
+ if (value == "/") {
16
+ return "";
17
+ }
18
+ return value || "";
19
+ });
20
+ const exampleListItemValueComponent = atom(void 0);
21
+ const exampleListItemComponent = atom((get) => {
22
+ const v = get(exampleListItemValueComponent);
23
+ if (v) {
24
+ return v;
25
+ }
26
+ return HelloComp;
16
27
  });
28
+ const HelloComp = () => {
29
+ return /* @__PURE__ */ jsx("div", { children: "HelloComp" });
30
+ };
17
31
  function CommonListViewProvider(props) {
18
32
  const { children, methodList, slugPath } = props;
19
33
  const listquery = useSuspenseInfiniteQuery(methodList, {
@@ -84,5 +98,7 @@ const ListLayout = (props) => {
84
98
  export {
85
99
  CommonListView,
86
100
  CommonListViewProvider,
87
- curdSlugPathAtom
101
+ curdSlugPathAtom,
102
+ exampleListItemComponent,
103
+ exampleListItemValueComponent
88
104
  };