5fffc4743f
* remove legacy openMenu=shape state and unused actions * close menus/popups in applicable cases when opening a different one * split ui z-indexes to account prefer different overlap * make top canvas area clickable on mobile * make mobile main menu closable by clicking outside and reduce width * offset picker popups from viewport border on mobile * reduce items gap in mobile main menu * show top picks for canvas bg colors in all ui modes * fix menu separator visibility on mobile * fix command palette items not being filtered
36 lines
937 B
TypeScript
36 lines
937 B
TypeScript
import { KEYS } from "@excalidraw/common";
|
|
|
|
import { CaptureUpdateAction } from "@excalidraw/element";
|
|
|
|
import { HelpIconThin } from "../components/icons";
|
|
|
|
import { register } from "./register";
|
|
|
|
export const actionShortcuts = register({
|
|
name: "toggleShortcuts",
|
|
label: "welcomeScreen.defaults.helpHint",
|
|
icon: HelpIconThin,
|
|
viewMode: true,
|
|
trackEvent: { category: "menu", action: "toggleHelpDialog" },
|
|
perform: (_elements, appState, _, { focusContainer }) => {
|
|
if (appState.openDialog?.name === "help") {
|
|
focusContainer();
|
|
}
|
|
return {
|
|
appState: {
|
|
...appState,
|
|
openDialog:
|
|
appState.openDialog?.name === "help"
|
|
? null
|
|
: {
|
|
name: "help",
|
|
},
|
|
openMenu: null,
|
|
openPopup: null,
|
|
},
|
|
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
};
|
|
},
|
|
keyTest: (event) => event.key === KEYS.QUESTION_MARK,
|
|
});
|