gomtm 0.0.249 → 0.0.251

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.
@@ -12,8 +12,8 @@ export declare const DEFAULT_revalidate_SECONDS = 3;
12
12
  export declare const LOGIN_CALLBACK_URL_KEY = "back";
13
13
  export declare const MTM_API_PREFIX = "/api";
14
14
  export declare const LayoutNameCookie = "layout";
15
+ export declare const IsDebugCookie = "is_debug";
15
16
  export declare const ExtKey_Hostname = "host";
16
- export declare const ExtKey_mtmaccessToken = "access_token";
17
17
  export declare const ItemAction_list_new_item = "list_new_item";
18
18
  export declare const Listview_list_filter = "Listview_list_filter";
19
19
  export declare const ActionEdit = "edit";
@@ -12,8 +12,8 @@ const DEFAULT_revalidate_SECONDS = 3;
12
12
  const LOGIN_CALLBACK_URL_KEY = "back";
13
13
  const MTM_API_PREFIX = "/api";
14
14
  const LayoutNameCookie = "layout";
15
+ const IsDebugCookie = "is_debug";
15
16
  const ExtKey_Hostname = "host";
16
- const ExtKey_mtmaccessToken = "access_token";
17
17
  const ItemAction_list_new_item = "list_new_item";
18
18
  const Listview_list_filter = "Listview_list_filter";
19
19
  const ActionEdit = "edit";
@@ -38,10 +38,10 @@ export {
38
38
  Cookie_Site_Host,
39
39
  DEFAULT_revalidate_SECONDS,
40
40
  ExtKey_Hostname,
41
- ExtKey_mtmaccessToken,
42
41
  HeaderMtmApi,
43
42
  HeaderMtmHost,
44
43
  ImageNoExist,
44
+ IsDebugCookie,
45
45
  ItemAction_list_new_item,
46
46
  LOGIN_CALLBACK_URL_KEY,
47
47
  LayoutNameCookie,
@@ -136,10 +136,8 @@ const PanelRemove = () => {
136
136
  ] }) });
137
137
  };
138
138
  const PanelCreate = () => {
139
- const [activateItem] = useAtom(activateItemAtom);
140
139
  const [removeMeghodSig] = useAtom(removeMethodSigAtom);
141
140
  const [openCreatePanel, setOpenCreatePanel] = useAtom(openCreatePanelAtom);
142
- const mutation = useMutation(removeMeghodSig);
143
141
  return /* @__PURE__ */ jsx(Dialog, { open: openCreatePanel, onOpenChange: setOpenCreatePanel, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
144
142
  /* @__PURE__ */ jsx(DialogTitle, { children: "TODO create item Dlg" }),
145
143
  /* @__PURE__ */ jsx(MtButton, { onClick: () => __async(void 0, null, function* () {
@@ -4,16 +4,19 @@ import { atom, useAtom } from "jotai";
4
4
  import { ScopeAtomsHydrator } from "mtxlib/jotai/jotai-helper";
5
5
  import { Dialog, DialogContent, DialogTrigger } from "mtxuilib/ui/dialog";
6
6
  import { MtButton } from "mtxuilib/ui/ui-mt/Button";
7
+ import { Suspense } from "react";
7
8
  import { useSuspenseQuery } from "../connectquery";
9
+ import { isDebugAtom } from "../providers/GomtmProvider";
8
10
  const curdDetailPageDataAtom = atom(void 0);
9
11
  function CurdDetailProvider(props) {
10
12
  const { children, methodGet, params } = props;
13
+ const [isDebug] = useAtom(isDebugAtom);
11
14
  const query = useSuspenseQuery(methodGet, params);
12
15
  return /* @__PURE__ */ jsxs(ScopeAtomsHydrator, { atomValues: [
13
16
  [curdDetailPageDataAtom, query.data]
14
17
  ], children: [
15
18
  children,
16
- /* @__PURE__ */ jsx(DetailViewDataDlg, {})
19
+ isDebug && /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(DetailViewDataDlg, {}) })
17
20
  ] });
18
21
  }
19
22
  const DetailViewDataDlg = () => {
@@ -1,4 +1,16 @@
1
1
  import { PropsWithChildren } from "react";
2
+ export declare const LzDash5: import("react").ComponentType<{
3
+ children?: import("react").ReactNode;
4
+ }>;
5
+ export declare const LzDemo: import("react").ComponentType<{
6
+ children?: import("react").ReactNode;
7
+ }>;
8
+ export declare const LzDebugLayout: import("react").ComponentType<{
9
+ children?: import("react").ReactNode;
10
+ }>;
11
+ export declare const LzFrontLayout: import("react").ComponentType<{
12
+ children?: import("react").ReactNode;
13
+ }>;
2
14
  export declare const layoutNameAtom: import("jotai").WritableAtom<string, [value: string], void>;
3
15
  export declare const LayoutBase: (props: {
4
16
  layoutName?: string;
@@ -9,18 +9,30 @@ import { Dialog, DialogContent, DialogTitle } from "mtxuilib/ui/dialog";
9
9
  import { TooltipProvider } from "mtxuilib/ui/tooltip";
10
10
  import { MtButton } from "mtxuilib/ui/ui-mt/Button";
11
11
  import { AppProgressBar as ProgressBar } from "next-nprogress-bar";
12
+ import dynamic from "next/dynamic";
12
13
  import { Suspense } from "react";
13
14
  import { useHotkeys } from "react-hotkeys-hook";
14
15
  import { Toaster } from "sonner";
15
- import Dash5 from "./dash5";
16
16
  import { DebugLayout } from "./debug-layout";
17
- import { Demo1Layout } from "./demo-layout";
18
17
  const ALL_Layouts = [
19
18
  "demo1",
20
19
  "dash5",
21
20
  "default",
22
- "debug"
21
+ "debug",
22
+ "front"
23
23
  ];
24
+ const LzDash5 = dynamic(() => import("./dash5").then((x) => x.default), {
25
+ ssr: true
26
+ });
27
+ const LzDemo = dynamic(() => import("./demo-layout").then((x) => x.Demo1Layout), {
28
+ ssr: true
29
+ });
30
+ const LzDebugLayout = dynamic(() => import("./debug-layout").then((x) => x.DebugLayout), {
31
+ ssr: true
32
+ });
33
+ const LzFrontLayout = dynamic(() => import("./front-layout").then((x) => x.FrontLayout), {
34
+ ssr: true
35
+ });
24
36
  const layoutNameValueAtom = atom("");
25
37
  const layoutNameAtom = atom((get) => {
26
38
  return get(layoutNameValueAtom);
@@ -40,7 +52,10 @@ const LayoutRender = (props) => {
40
52
  const [layoutName, setLayoutName] = useAtom(layoutNameAtom);
41
53
  return /* @__PURE__ */ jsxs(Fragment, { children: [
42
54
  /* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 0, children: [
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,
55
+ /* @__PURE__ */ jsx("div", { children: layoutName }),
56
+ /* @__PURE__ */ jsx("div", {}),
57
+ /* @__PURE__ */ jsx(DebugLayout, {}),
58
+ /* @__PURE__ */ jsx(LzDebugLayout, { children }),
44
59
  /* @__PURE__ */ jsx(
45
60
  ProgressBar,
46
61
  {
@@ -79,5 +94,9 @@ const LayoutSwitchDlg = () => {
79
94
  };
80
95
  export {
81
96
  LayoutBase,
97
+ LzDash5,
98
+ LzDebugLayout,
99
+ LzDemo,
100
+ LzFrontLayout,
82
101
  layoutNameAtom
83
102
  };
@@ -21,10 +21,10 @@ var __async = (__this, __arguments, generator) => {
21
21
  import { Fragment, jsx } from "react/jsx-runtime";
22
22
  import { ScopeAtomsHydrator } from "mtxlib/jotai/jotai-helper";
23
23
  import { cookies, headers } from "next/headers";
24
- import { LayoutNameCookie } from "../consts";
24
+ import { IsDebugCookie, LayoutNameCookie } from "../consts";
25
25
  import { layoutNameAtom } from "../ly/LayoutBase";
26
26
  import { ssrGetBackendUrl } from "../mtmFetcher";
27
- import { GomtmProvider, cookiesAtom } from "./GomtmProvider";
27
+ import { GomtmProvider, cookiesAtom, isDebugAtom } from "./GomtmProvider";
28
28
  function GomtmAppSS(props) {
29
29
  return __async(this, null, function* () {
30
30
  const { children } = props;
@@ -34,9 +34,11 @@ function GomtmAppSS(props) {
34
34
  }
35
35
  const cookiesStr = headers().get("Cookie");
36
36
  const layoutName = cookies().get(LayoutNameCookie);
37
+ const isDebug = cookies().get(IsDebugCookie);
37
38
  return /* @__PURE__ */ jsx(GomtmProvider, { backendUrl: backend, children: /* @__PURE__ */ jsx(ScopeAtomsHydrator, { atomValues: [
38
39
  [cookiesAtom, cookiesStr],
39
- [layoutNameAtom, layoutName]
40
+ [layoutNameAtom, layoutName],
41
+ [isDebugAtom, isDebug]
40
42
  ], children }) });
41
43
  });
42
44
  }