import { BlockQuoteIcon, BulletedListIcon, CodeIcon, Heading1Icon, Heading2Icon, Heading3Icon, HorizontalRuleIcon, OrderedListIcon, PageBreakIcon, TableIcon, TodoListIcon, ImageIcon, StarredIcon, WarningIcon, InfoIcon, AttachmentIcon, ClockIcon, CalendarIcon, MathIcon, DoneIcon, EmbedIcon, } from "outline-icons"; import * as React from "react"; import styled from "styled-components"; import Image from "@shared/editor/components/Img"; import { MenuItem } from "@shared/editor/types"; import { Dictionary } from "~/hooks/useDictionary"; import { metaDisplay } from "~/utils/keyboard"; const Img = styled(Image)` border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px #fff; margin: 4px; width: 18px; height: 18px; `; export default function blockMenuItems(dictionary: Dictionary): MenuItem[] { return [ { name: "heading", title: dictionary.h1, keywords: "h1 heading1 title", icon: , shortcut: "^ ⇧ 1", attrs: { level: 1 }, }, { name: "heading", title: dictionary.h2, keywords: "h2 heading2", icon: , shortcut: "^ ⇧ 2", attrs: { level: 2 }, }, { name: "heading", title: dictionary.h3, keywords: "h3 heading3", icon: , shortcut: "^ ⇧ 3", attrs: { level: 3 }, }, { name: "separator", }, { name: "checkbox_list", title: dictionary.checkboxList, icon: , keywords: "checklist checkbox task", shortcut: "^ ⇧ 7", }, { name: "bullet_list", title: dictionary.bulletList, icon: , shortcut: "^ ⇧ 8", }, { name: "ordered_list", title: dictionary.orderedList, icon: , shortcut: "^ ⇧ 9", }, { name: "separator", }, { name: "image", title: dictionary.image, icon: , keywords: "picture photo", }, { name: "video", title: dictionary.video, icon: , keywords: "mov avi upload player", }, { name: "attachment", title: dictionary.file, icon: , keywords: "file upload attach", }, { name: "table", title: dictionary.table, icon: , attrs: { rowsCount: 3, colsCount: 3 }, }, { name: "blockquote", title: dictionary.quote, icon: , keywords: "blockquote pullquote", shortcut: `${metaDisplay} ]`, }, { name: "code_block", title: dictionary.codeBlock, icon: , shortcut: "^ ⇧ \\", keywords: "script", }, { name: "math_block", title: dictionary.mathBlock, icon: , keywords: "math katex latex", }, { name: "hr", title: dictionary.hr, icon: , shortcut: `${metaDisplay} _`, keywords: "horizontal rule break line", }, { name: "hr", title: dictionary.pageBreak, icon: , keywords: "page print break line", attrs: { markup: "***" }, }, { name: "date", title: dictionary.insertDate, keywords: "clock today", icon: , }, { name: "time", title: dictionary.insertTime, keywords: "clock now", icon: , }, { name: "datetime", title: dictionary.insertDateTime, keywords: "clock today date", icon: , }, { name: "separator", }, { name: "container_notice", title: dictionary.infoNotice, icon: , keywords: "notice card information", attrs: { style: "info" }, }, { name: "container_notice", title: dictionary.successNotice, icon: , keywords: "notice card success", attrs: { style: "success" }, }, { name: "container_notice", title: dictionary.warningNotice, icon: , keywords: "notice card error", attrs: { style: "warning" }, }, { name: "container_notice", title: dictionary.tipNotice, icon: , keywords: "notice card suggestion", attrs: { style: "tip" }, }, { name: "separator", }, { name: "code_block", title: "Mermaid Diagram", icon: Mermaid Diagram, keywords: "diagram flowchart", attrs: { language: "mermaidjs" }, }, ]; }