gomtm 0.0.248 → 0.0.249

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.
@@ -0,0 +1,11 @@
1
+ import type { Message, PartialMessage } from "@bufbuild/protobuf";
2
+ import { PropsWithChildren } from "react";
3
+ import { MethodUnaryDescriptor } from "../connectquery";
4
+ export declare const curdDetailPageDataAtom: import("jotai").PrimitiveAtom<undefined> & {
5
+ init: undefined;
6
+ };
7
+ export declare function CurdDetailProvider<I extends Message<I>, O extends Message<O>>(props: {
8
+ methodGet: MethodUnaryDescriptor<I, O>;
9
+ params?: PartialMessage<I>;
10
+ } & PropsWithChildren): import("react").JSX.Element;
11
+ export declare const DetailViewDataDlg: () => import("react").JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { atom, useAtom } from "jotai";
4
+ import { ScopeAtomsHydrator } from "mtxlib/jotai/jotai-helper";
5
+ import { Dialog, DialogContent, DialogTrigger } from "mtxuilib/ui/dialog";
6
+ import { MtButton } from "mtxuilib/ui/ui-mt/Button";
7
+ import { useSuspenseQuery } from "../connectquery";
8
+ const curdDetailPageDataAtom = atom(void 0);
9
+ function CurdDetailProvider(props) {
10
+ const { children, methodGet, params } = props;
11
+ const query = useSuspenseQuery(methodGet, params);
12
+ return /* @__PURE__ */ jsxs(ScopeAtomsHydrator, { atomValues: [
13
+ [curdDetailPageDataAtom, query.data]
14
+ ], children: [
15
+ children,
16
+ /* @__PURE__ */ jsx(DetailViewDataDlg, {})
17
+ ] });
18
+ }
19
+ const DetailViewDataDlg = () => {
20
+ const [curdDetailPageData] = useAtom(curdDetailPageDataAtom);
21
+ return /* @__PURE__ */ jsxs(Dialog, { children: [
22
+ /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx(MtButton, { children: "DetailData" }) }),
23
+ /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx("pre", { children: JSON.stringify(curdDetailPageData, null, 2) }) })
24
+ ] });
25
+ };
26
+ export {
27
+ CurdDetailProvider,
28
+ DetailViewDataDlg,
29
+ curdDetailPageDataAtom
30
+ };
@@ -0,0 +1,10 @@
1
+ import type { Message, PartialMessage } from "@bufbuild/protobuf";
2
+ import { PropsWithChildren } from "react";
3
+ import { MethodUnaryDescriptor } from "../connectquery";
4
+ export declare const curdDetailPageDataAtom: import("jotai").PrimitiveAtom<undefined> & {
5
+ init: undefined;
6
+ };
7
+ export declare function CurdDetailPage<I extends Message<I>, O extends Message<O>>(props: {
8
+ methodGet: MethodUnaryDescriptor<I, O>;
9
+ params?: PartialMessage<I>;
10
+ } & PropsWithChildren): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { atom } from "jotai";
4
+ import { ScopeAtomsHydrator } from "mtxlib/jotai/jotai-helper";
5
+ import { useSuspenseQuery } from "../connectquery";
6
+ const curdDetailPageDataAtom = atom(void 0);
7
+ function CurdDetailPage(props) {
8
+ const { children, methodGet, params } = props;
9
+ const query = useSuspenseQuery(methodGet, params);
10
+ return /* @__PURE__ */ jsx(ScopeAtomsHydrator, { atomValues: [
11
+ [curdDetailPageDataAtom, query]
12
+ ], children });
13
+ }
14
+ export {
15
+ CurdDetailPage,
16
+ curdDetailPageDataAtom
17
+ };
@@ -13,12 +13,13 @@ import { Suspense } from "react";
13
13
  import { useHotkeys } from "react-hotkeys-hook";
14
14
  import { Toaster } from "sonner";
15
15
  import Dash5 from "./dash5";
16
+ import { DebugLayout } from "./debug-layout";
16
17
  import { Demo1Layout } from "./demo-layout";
17
18
  const ALL_Layouts = [
18
19
  "demo1",
19
- // "mail2",
20
20
  "dash5",
21
- "default"
21
+ "default",
22
+ "debug"
22
23
  ];
23
24
  const layoutNameValueAtom = atom("");
24
25
  const layoutNameAtom = atom((get) => {
@@ -39,10 +40,7 @@ const LayoutRender = (props) => {
39
40
  const [layoutName, setLayoutName] = useAtom(layoutNameAtom);
40
41
  return /* @__PURE__ */ jsxs(Fragment, { children: [
41
42
  /* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 0, children: [
42
- layoutName == "dash5" ? /* @__PURE__ */ jsx(Dash5, { children }) : (
43
- // layoutName == "mail2" ? <Mail2Layout>{children}</Mail2Layout> :
44
- layoutName == "demo1" ? /* @__PURE__ */ jsx(Demo1Layout, { children }) : layoutName == "default" ? /* @__PURE__ */ jsx(Fragment, { children }) : children
45
- ),
43
+ layoutName == "dash5" ? /* @__PURE__ */ jsx(Dash5, { children }) : layoutName == "debug" ? /* @__PURE__ */ jsx(DebugLayout, { children }) : layoutName == "demo1" ? /* @__PURE__ */ jsx(Demo1Layout, { children }) : layoutName == "default" ? /* @__PURE__ */ jsx(Fragment, { children }) : children,
46
44
  /* @__PURE__ */ jsx(
47
45
  ProgressBar,
48
46
  {
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from "react";
2
+ export declare const DebugLayout: (props: PropsWithChildren) => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ const DebugLayout = (props) => {
4
+ const { children } = props;
5
+ return /* @__PURE__ */ jsx("div", { className: "border bg-slate-200 p-2", children });
6
+ };
7
+ export {
8
+ DebugLayout
9
+ };
@@ -1,11 +1,8 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  const Demo1Layout = (props) => {
4
4
  const { children } = props;
5
- return /* @__PURE__ */ jsxs("div", { className: "prose p-2", children: [
6
- /* @__PURE__ */ jsx("h1", { children: "Demo1Layout" }),
7
- children
8
- ] });
5
+ return /* @__PURE__ */ jsx("div", { className: "prose p-2", children });
9
6
  };
10
7
  export {
11
8
  Demo1Layout
@@ -110,7 +110,6 @@ const gomtmFetcher = (initGlobal) => {
110
110
  init
111
111
  });
112
112
  const responseData = yield fetcher(input, init);
113
- console.log("[mtmfetch response]", responseData);
114
113
  return responseData;
115
114
  } catch (e) {
116
115
  console.error("[mtmfetch error]", {