tldraw
Version:
A tiny little drawing editor.
319 lines (318 loc) • 11.2 kB
JavaScript
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { useShowCollaborationUi } from "../../hooks/useCollaborationStatus.mjs";
import { TldrawUiMenuActionItem } from "../primitives/menus/TldrawUiMenuActionItem.mjs";
import { TldrawUiMenuGroup } from "../primitives/menus/TldrawUiMenuGroup.mjs";
import { TldrawUiMenuItem } from "../primitives/menus/TldrawUiMenuItem.mjs";
import { TldrawUiMenuToolItem } from "../primitives/menus/TldrawUiMenuToolItem.mjs";
function DefaultKeyboardShortcutsDialogContent() {
const showCollaborationUi = useShowCollaborationUi();
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsxs(TldrawUiMenuGroup, { label: "shortcuts-dialog.tools", id: "tools", children: [
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "toggle-tool-lock" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "insert-media" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "select" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "draw" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "eraser" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "hand" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "rectangle" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "ellipse" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "arrow" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "line" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "text" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "frame" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "note" }),
/* @__PURE__ */ jsx(TldrawUiMenuToolItem, { toolId: "laser" }),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "pointer-down",
label: "tool.pointer-down",
kbd: ",",
onSelect: () => {
}
}
)
] }),
/* @__PURE__ */ jsxs(TldrawUiMenuGroup, { label: "shortcuts-dialog.preferences", id: "preferences", children: [
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "toggle-dark-mode" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "toggle-focus-mode" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "toggle-grid" })
] }),
/* @__PURE__ */ jsxs(TldrawUiMenuGroup, { label: "shortcuts-dialog.edit", id: "edit", children: [
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "undo" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "redo" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "cut" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "copy" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "paste" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "select-all" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "delete" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "duplicate" })
] }),
/* @__PURE__ */ jsxs(TldrawUiMenuGroup, { label: "shortcuts-dialog.view", id: "view", children: [
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "select-zoom-tool" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "zoom-in" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "zoom-out" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "zoom-to-100" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "zoom-to-fit" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "zoom-to-selection" }),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "zoom-quick",
label: "action.zoom-quick",
kbd: "shift+z",
onSelect: () => {
}
}
)
] }),
/* @__PURE__ */ jsxs(TldrawUiMenuGroup, { label: "shortcuts-dialog.transform", id: "transform", children: [
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "bring-to-front" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "bring-forward" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "send-backward" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "send-to-back" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "group" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "ungroup" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "flip-horizontal" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "flip-vertical" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "align-top" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "align-center-vertical" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "align-bottom" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "align-left" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "align-center-horizontal" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "align-right" })
] }),
/* @__PURE__ */ jsxs(TldrawUiMenuGroup, { label: "shortcuts-dialog.text-formatting", id: "text", children: [
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-bold",
label: "tool.rich-text-bold",
kbd: "cmd+b",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-italic",
label: "tool.rich-text-italic",
kbd: "cmd+i",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-code",
label: "tool.rich-text-code",
kbd: "cmd+e",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-highlight",
label: "tool.rich-text-highlight",
kbd: "cmd+shift+h",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-strikethrough",
label: "tool.rich-text-strikethrough",
kbd: "cmd+shift+s",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-link",
label: "tool.rich-text-link",
kbd: "cmd+shift+k",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-header",
label: "tool.rich-text-header",
kbd: "cmd+alt+[[1-6]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-orderedList",
label: "tool.rich-text-orderedList",
kbd: "cmd+shift+7",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "text-bulletedlist",
label: "tool.rich-text-bulletList",
kbd: "cmd+shift+8",
onSelect: () => {
}
}
)
] }),
/* @__PURE__ */ jsxs(TldrawUiMenuGroup, { label: "shortcuts-dialog.a11y", id: "a11y", children: [
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-select-next-shape",
label: "a11y.select-shape",
kbd: "[[Tab]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-select-next-shape-direction",
label: "a11y.select-shape-direction",
kbd: "cmd+[[\u2191\u2192\u2193\u2190]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-select-next-shape-container",
label: "a11y.enter-leave-container",
kbd: "cmd+shift+[[\u2191\u2193]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-pan-camera",
label: "a11y.pan-camera",
kbd: "[[Space]]+[[\u2191\u2192\u2193\u2190]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "adjust-shape-styles",
label: "a11y.adjust-shape-styles",
kbd: "cmd+[[Enter]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "open-context-menu",
label: "a11y.open-context-menu",
kbd: "cmd+shift+[[Enter]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-move-shape",
label: "a11y.move-shape",
kbd: "[[\u2191\u2192\u2193\u2190]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-move-shape-faster",
label: "a11y.move-shape-faster",
kbd: "shift+[[\u2191\u2192\u2193\u2190]]",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-rotate-shape-cw",
label: "a11y.rotate-shape-cw",
kbd: "shift+\uFE65",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-rotate-shape-cw-fine",
label: "a11y.rotate-shape-cw-fine",
kbd: "shift+alt+\uFE65",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-rotate-shape-ccw",
label: "a11y.rotate-shape-ccw",
kbd: "shift+\uFE64",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-rotate-shape-ccw-fine",
label: "a11y.rotate-shape-ccw-fine",
kbd: "shift+alt+\uFE64",
onSelect: () => {
}
}
),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "enlarge-shapes" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "shrink-shapes" }),
/* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "a11y-repeat-shape-announce" }),
/* @__PURE__ */ jsx(
TldrawUiMenuItem,
{
id: "a11y-open-keyboard-shortcuts",
label: "a11y.open-keyboard-shortcuts",
kbd: "cmd+alt+/",
onSelect: () => {
}
}
)
] }),
showCollaborationUi && /* @__PURE__ */ jsx(TldrawUiMenuGroup, { label: "shortcuts-dialog.collaboration", id: "collaboration", children: /* @__PURE__ */ jsx(TldrawUiMenuActionItem, { actionId: "open-cursor-chat" }) })
] });
}
export {
DefaultKeyboardShortcutsDialogContent
};
//# sourceMappingURL=DefaultKeyboardShortcutsDialogContent.mjs.map