gomtm 0.0.268 → 0.0.269
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,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Icons } from "mtxuilib/icons/icons";
|
|
3
4
|
import { CommandDialog, CommandEmpty, CommandInput, CommandList, CommandSeparator } from "mtxuilib/ui/command";
|
|
4
5
|
import { MtButton } from "mtxuilib/ui/ui-mt/Button";
|
|
5
6
|
import { useState } from "react";
|
|
@@ -10,8 +11,10 @@ const GoMtmDebug = () => {
|
|
|
10
11
|
if (!mtapp.isDebug) {
|
|
11
12
|
return null;
|
|
12
13
|
}
|
|
13
|
-
return /* @__PURE__ */ jsxs("div", { className: "fixed bottom-12 right-
|
|
14
|
-
/* @__PURE__ */ jsx(MtButton, {
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { className: "fixed bottom-12 right-2 bg-red-300", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(MtButton, { onClick: () => {
|
|
16
|
+
setOpen(true);
|
|
17
|
+
}, children: /* @__PURE__ */ jsx(Icons.bug, {}) }),
|
|
15
18
|
/* @__PURE__ */ jsxs(CommandDialog, { open, onOpenChange: setOpen, children: [
|
|
16
19
|
/* @__PURE__ */ jsx(CommandInput, { placeholder: "Type a command or search...", onValueChange: (s) => {
|
|
17
20
|
setOpen(false);
|
package/dist/esm/consts.d.ts
CHANGED
|
@@ -26,4 +26,5 @@ export declare const ImageNoExist = "/images/404.jpg";
|
|
|
26
26
|
export declare const ADMIN_ROLE = "admin";
|
|
27
27
|
export declare const MEMBER_ROLE = "member";
|
|
28
28
|
export declare const TRPC_API_PREFIX = "/api.v1/trpc";
|
|
29
|
-
export declare const HOTKEY_Debug = "
|
|
29
|
+
export declare const HOTKEY_Debug = "alt+j";
|
|
30
|
+
export declare const HOTKEY_Switchlayout = "alt+l";
|
package/dist/esm/consts.js
CHANGED
|
@@ -26,7 +26,8 @@ const ImageNoExist = "/images/404.jpg";
|
|
|
26
26
|
const ADMIN_ROLE = "admin";
|
|
27
27
|
const MEMBER_ROLE = "member";
|
|
28
28
|
const TRPC_API_PREFIX = "/api.v1/trpc";
|
|
29
|
-
const HOTKEY_Debug = "
|
|
29
|
+
const HOTKEY_Debug = "alt+j";
|
|
30
|
+
const HOTKEY_Switchlayout = "alt+l";
|
|
30
31
|
export {
|
|
31
32
|
ADMIN_ROLE,
|
|
32
33
|
ActionCreate,
|
|
@@ -40,6 +41,7 @@ export {
|
|
|
40
41
|
DEFAULT_revalidate_SECONDS,
|
|
41
42
|
ExtKey_Hostname,
|
|
42
43
|
HOTKEY_Debug,
|
|
44
|
+
HOTKEY_Switchlayout,
|
|
43
45
|
HeaderMtmApi,
|
|
44
46
|
HeaderMtmHost,
|
|
45
47
|
ImageNoExist,
|
|
@@ -10,6 +10,7 @@ import { AppProgressBar as ProgressBar } from "next-nprogress-bar";
|
|
|
10
10
|
import { Suspense, lazy } from "react";
|
|
11
11
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
12
12
|
import { Toaster } from "sonner";
|
|
13
|
+
import { HOTKEY_Switchlayout } from "../consts";
|
|
13
14
|
import { useMtmApp } from "../providers/GomtmProvider";
|
|
14
15
|
const ALL_Layouts = [
|
|
15
16
|
"demo1",
|
|
@@ -48,9 +49,9 @@ const LayoutBase = (props) => {
|
|
|
48
49
|
};
|
|
49
50
|
const LayoutSwitchDlg = () => {
|
|
50
51
|
const mtapp = useMtmApp();
|
|
51
|
-
useHotkeys(
|
|
52
|
-
mtapp.setOpenLayoutSwitchDlg(!
|
|
53
|
-
}, []);
|
|
52
|
+
useHotkeys(HOTKEY_Switchlayout, () => {
|
|
53
|
+
mtapp.setOpenLayoutSwitchDlg((pre) => !pre);
|
|
54
|
+
}, [mtapp.setOpenLayoutSwitchDlg, mtapp.openLayoutSwitchDlg]);
|
|
54
55
|
return /* @__PURE__ */ jsx(Dialog, { open: mtapp.openLayoutSwitchDlg, onOpenChange: mtapp.setOpenLayoutSwitchDlg, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
55
56
|
/* @__PURE__ */ jsxs(DialogTitle, { children: [
|
|
56
57
|
"LayoutSwitch,",
|
|
@@ -40,7 +40,8 @@ function GomtmProvider(props) {
|
|
|
40
40
|
const [_cookieStr, setCookieStr] = useState("");
|
|
41
41
|
const [_globalSearchParams, setGlobalSearchParams] = useState({});
|
|
42
42
|
useHotkeys(HOTKEY_Debug, () => {
|
|
43
|
-
|
|
43
|
+
console.log("set debug");
|
|
44
|
+
setDebug((pre) => !pre);
|
|
44
45
|
}, [_isDebug, setDebug]);
|
|
45
46
|
const searchParams = useSearchParams();
|
|
46
47
|
const globalSearchParams = useMemo(() => {
|