import { jsx as _jsx } from "react/jsx-runtime";
import { icons } from "../../bundle/config/icons.js";
import { HeadingPreview } from "../../bundle/config/previews/HeadingPreview.js";
import { TextPreview } from "../../bundle/config/previews/TextPreview.js";
import { MToolbarColors } from "../../bundle/toolbar/markup/MToolbarColors.js";
import { MToolbarFilePopup } from "../../bundle/toolbar/markup/MToolbarFilePopup.js";
import { MToolbarImagePopup } from "../../bundle/toolbar/markup/MToolbarImagePopup.js";
import { WToolbarColors } from "../../bundle/toolbar/wysiwyg/WToolbarColors.js";
import { WToolbarTextSelect } from "../../bundle/toolbar/wysiwyg/WToolbarTextSelect.js";
import { gptHotKeys } from "../../extensions/additional/GPT/constants.js";
import { headingType, pType } from "../../extensions/specs.js";
import { i18n as i18nHint } from "../../i18n/hints/index.js";
import { i18n } from "../../i18n/menubar/index.js";
import { insertHRule, insertLink, insertMermaidDiagram, insertYfmHtmlBlock, insertYfmTable, insertYfmTabs, liftListItem as liftListItemCommand, redo, redoDepth, sinkListItem as sinkListItemCommand, toBulletList, toH1, toH2, toH3, toH4, toH5, toH6, toOrderedList, toggleBold, toggleItalic, toggleMarked, toggleMonospace, toggleStrikethrough, toggleUnderline, undo, undoDepth, wrapToBlockquote, wrapToCheckbox, wrapToCodeBlock, wrapToInlineCode, wrapToMathBlock, wrapToMathInline, wrapToYfmCut, wrapToYfmNote, } from "../../markup/commands/index.js";
import { Action as A, formatter as f } from "../../shortcuts/index.js";
import { ToolbarDataType } from "../../toolbar/index.js";
const noop = () => { };
const inactive = () => false;
const enable = () => true;
const disable = () => false;
// ---- Undo ----
export const undoItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'undo'),
    icon: icons.undo,
    hotkey: f.toView(A.Undo),
};
export const undoItemWysiwyg = {
    hintWhenDisabled: false,
    exec: (e) => e.actions.undo.run(),
    isActive: (e) => e.actions.undo.isActive(),
    isEnable: (e) => e.actions.undo.isEnable(),
};
export const undoItemMarkup = {
    hintWhenDisabled: false,
    exec: (e) => undo(e.cm),
    isActive: inactive,
    isEnable: (e) => undoDepth(e.cm.state) > 0,
};
// ---- Redo ----
export const redoItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'redo'),
    icon: icons.redo,
    hotkey: f.toView(A.Redo),
};
export const redoItemWysiwyg = {
    hintWhenDisabled: false,
    exec: (e) => e.actions.redo.run(),
    isActive: (e) => e.actions.redo.isActive(),
    isEnable: (e) => e.actions.redo.isEnable(),
};
export const redoItemMarkup = {
    hintWhenDisabled: false,
    exec: (e) => redo(e.cm),
    isActive: inactive,
    isEnable: (e) => redoDepth(e.cm.state) > 0,
};
// ---- Bold ----
export const boldItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'bold'),
    icon: icons.bold,
    hotkey: f.toView(A.Bold),
};
export const boldItemWysiwyg = {
    exec: (e) => e.actions.bold.run(),
    isActive: (e) => e.actions.bold.isActive(),
    isEnable: (e) => e.actions.bold.isEnable(),
};
export const boldItemMarkup = {
    exec: (e) => toggleBold(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Italic ----
export const italicItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'italic'),
    icon: icons.italic,
    hotkey: f.toView(A.Italic),
};
export const italicItemWysiwyg = {
    exec: (e) => e.actions.italic.run(),
    isActive: (e) => e.actions.italic.isActive(),
    isEnable: (e) => e.actions.italic.isEnable(),
};
export const italicItemMarkup = {
    exec: (e) => toggleItalic(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Underline ----
export const underlineItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'underline'),
    icon: icons.underline,
    hotkey: f.toView(A.Underline),
};
export const underlineItemWysiwyg = {
    exec: (e) => e.actions.underline.run(),
    isActive: (e) => e.actions.underline.isActive(),
    isEnable: (e) => e.actions.underline.isEnable(),
};
export const underlineItemMarkup = {
    exec: (e) => toggleUnderline(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Strikethrough ----
export const strikethroughItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'strike'),
    icon: icons.strikethrough,
    hotkey: f.toView(A.Strike),
};
export const strikethroughItemWysiwyg = {
    exec: (e) => e.actions.strike.run(),
    isActive: (e) => e.actions.strike.isActive(),
    isEnable: (e) => e.actions.strike.isEnable(),
};
export const strikethroughItemMarkup = {
    exec: (e) => toggleStrikethrough(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Monospace ----
export const monospaceItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'mono'),
    icon: icons.mono,
};
export const monospaceItemWysiwyg = {
    exec: (e) => e.actions.mono.run(),
    isActive: (e) => e.actions.mono.isActive(),
    isEnable: (e) => e.actions.mono.isEnable(),
};
export const monospaceItemMarkup = {
    exec: (e) => toggleMonospace(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Marked ----
export const markedItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'mark'),
    icon: icons.mark,
};
export const markedItemWysiwyg = {
    exec: (e) => e.actions.mark.run(),
    isActive: (e) => e.actions.mark.isActive(),
    isEnable: (e) => e.actions.mark.isEnable(),
};
export const markedItemMarkup = {
    exec: (e) => toggleMarked(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Checkbox ----
export const checkboxItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'checkbox'),
    icon: icons.checklist,
};
export const checkboxItemWysiwyg = {
    exec: (e) => e.actions.addCheckbox.run(),
    isActive: (e) => e.actions.addCheckbox.isActive(),
    isEnable: (e) => e.actions.addCheckbox.isEnable(),
};
export const checkboxItemMarkup = {
    exec: (e) => wrapToCheckbox(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Link ----
export const linkItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'link'),
    icon: icons.link,
    hotkey: f.toView(A.Link),
};
export const linkItemWysiwyg = {
    exec: (e) => e.actions.addLink.run(),
    isActive: (e) => e.actions.addLink.isActive(),
    isEnable: (e) => e.actions.addLink.isEnable(),
};
export const linkItemMarkup = {
    exec: (e) => insertLink(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Quote ----
export const quoteItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'quote'),
    icon: icons.quote,
    hotkey: f.toView(A.Quote),
};
export const quoteItemWysiwyg = {
    exec: (e) => e.actions.quote.run(),
    isActive: (e) => e.actions.quote.isActive(),
    isEnable: (e) => e.actions.quote.isEnable(),
};
export const quoteItemMarkup = {
    exec: (e) => wrapToBlockquote(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Cut ----
export const cutItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'cut'),
    icon: icons.cut,
    hotkey: f.toView(A.Cut),
};
export const cutItemWysiwyg = {
    exec: (e) => e.actions.toYfmCut.run(),
    isActive: (e) => e.actions.toYfmCut.isActive(),
    isEnable: (e) => e.actions.toYfmCut.isEnable(),
};
export const cutItemMarkup = {
    exec: (e) => wrapToYfmCut(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Note ----
export const noteItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'note'),
    icon: icons.note,
    hotkey: f.toView(A.Note),
};
export const noteItemWysiwyg = {
    exec: (e) => e.actions.toYfmNote.run(),
    isActive: (e) => e.actions.toYfmNote.isActive(),
    isEnable: (e) => e.actions.toYfmNote.isEnable(),
};
export const noteItemMarkup = {
    exec: (e) => wrapToYfmNote(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Table ----
export const tableItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'table'),
    icon: icons.table,
};
export const tableItemWysiwyg = {
    exec: (e) => e.actions.createYfmTable.run(),
    isActive: (e) => e.actions.createYfmTable.isActive(),
    isEnable: (e) => e.actions.createYfmTable.isEnable(),
};
export const tableItemMarkup = {
    exec: (e) => insertYfmTable(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Code ----
export const codeItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'code_inline'),
    icon: icons.code,
    hotkey: f.toView(A.Code),
};
export const codeItemWysiwyg = {
    exec: (e) => e.actions.code.run(),
    isActive: (e) => e.actions.code.isActive(),
    isEnable: (e) => e.actions.code.isEnable(),
};
export const codeItemMarkup = {
    exec: (e) => wrapToInlineCode(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Image ----
export const imageItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'image'),
    icon: icons.image,
};
export const imagePopupItemView = {
    type: ToolbarDataType.ButtonPopup,
    title: i18n.bind(null, 'image'),
    icon: icons.image,
};
export const imageItemWysiwyg = {
    exec: (e) => e.actions.addImageWidget.run(),
    isActive: (e) => e.actions.addImageWidget.isActive(),
    isEnable: (e) => e.actions.addImageWidget.isEnable(),
};
export const imageItemMarkup = {
    exec: noop,
    isActive: inactive,
    isEnable: enable,
    renderPopup: (props) => _jsx(MToolbarImagePopup, { ...props }),
};
// ---- File ----
export const fileItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'file'),
    icon: icons.file,
};
export const filePopupItemView = {
    type: ToolbarDataType.ButtonPopup,
    title: i18n.bind(null, 'file'),
    icon: icons.file,
};
export const fileItemWysiwyg = {
    exec: (e) => e.actions.addFile.run(),
    isActive: (e) => e.actions.addFile.isActive(),
    isEnable: (e) => e.actions.addFile.isEnable(),
};
export const fileItemMarkup = {
    exec: noop,
    isActive: inactive,
    isEnable: enable,
    renderPopup: (props) => _jsx(MToolbarFilePopup, { ...props }),
};
// ---- Tabs ----
export const tabsItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'tabs'),
    icon: icons.tabs,
};
export const tabsItemWysiwyg = {
    exec: (e) => e.actions.toYfmTabs.run(),
    isActive: (e) => e.actions.toYfmTabs.isActive(),
    isEnable: (e) => e.actions.toYfmTabs.isEnable(),
};
export const tabsItemMarkup = {
    exec: (e) => insertYfmTabs(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Math Inline ----
export const mathInlineItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'math_inline'),
    icon: icons.functionInline,
    hint: () => `${i18nHint.bind(null, 'math_hint')()} ${i18nHint.bind(null, 'math_hint_katex')()}`,
};
export const mathInlineItemWysiwyg = {
    exec: (e) => e.actions.addMathInline.run(),
    isActive: (e) => e.actions.addMathInline.isActive(),
    isEnable: (e) => e.actions.addMathInline.isEnable(),
};
export const mathInlineItemMarkup = {
    exec: (e) => wrapToMathInline(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Math Block ----
export const mathBlockItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'math_block'),
    icon: icons.functionBlock,
    hint: () => `${i18nHint.bind(null, 'math_hint')()} ${i18nHint.bind(null, 'math_hint_katex')()}`,
};
export const mathBlockItemWysiwyg = {
    exec: (e) => e.actions.toMathBlock.run(),
    isActive: (e) => e.actions.toMathBlock.isActive(),
    isEnable: (e) => e.actions.toMathBlock.isEnable(),
};
export const mathBlockItemMarkup = {
    exec: (e) => wrapToMathBlock(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Yfm Html Block ----
export const yfmHtmlBlockItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'html'),
    icon: icons.html,
};
export const yfmHtmlBlockItemWysiwyg = {
    exec: (e) => e.actions.createYfmHtmlBlock.run(),
    isActive: (e) => e.actions.createYfmHtmlBlock.isActive(),
    isEnable: (e) => e.actions.createYfmHtmlBlock.isEnable(),
};
export const yfmHtmlBlockItemMarkup = {
    exec: (e) => insertYfmHtmlBlock(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Mermaid ----
export const mermaidItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'mermaid'),
    icon: icons.mermaid,
};
export const mermaidItemWysiwyg = {
    exec: (e) => e.actions.createMermaid.run(),
    isActive: (e) => e.actions.createMermaid.isActive(),
    isEnable: (e) => e.actions.createMermaid.isEnable(),
};
export const mermaidItemMarkup = {
    exec: (e) => insertMermaidDiagram(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Code Block ----
export const codeBlockItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'codeblock'),
    icon: icons.codeBlock,
    hotkey: f.toView(A.CodeBlock),
};
export const codeBlockItemWysiwyg = {
    exec: (e) => e.actions.toCodeBlock.run(),
    isActive: (e) => e.actions.toCodeBlock.isActive(),
    isEnable: (e) => e.actions.toCodeBlock.isEnable(),
};
export const codeBlockItemMarkup = {
    exec: (e) => wrapToCodeBlock(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Horizontal Rule ----
export const hruleItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'hrule'),
    icon: icons.horizontalRule,
};
export const hruleItemWysiwyg = {
    exec: (e) => e.actions.hRule.run(),
    isActive: (e) => e.actions.hRule.isActive(),
    isEnable: (e) => e.actions.hRule.isEnable(),
};
export const hruleItemMarkup = {
    exec: (e) => insertHRule(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Emoji ----
export const emojiItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'emoji'),
    icon: icons.emoji,
};
export const emojiItemWysiwyg = {
    exec: (e) => e.actions.openEmojiSuggest.run({}),
    isActive: (e) => e.actions.openEmojiSuggest.isActive(),
    isEnable: (e) => e.actions.openEmojiSuggest.isEnable(),
};
export const emojiItemMarkup = {
    exec: noop,
    hintWhenDisabled: i18n.bind(null, 'emoji__hint'),
    isActive: inactive,
    isEnable: disable,
};
// ---- Heading 1 ----
export const heading1ItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'heading1'),
    icon: icons.h1,
    hotkey: f.toView(A.Heading1),
    preview: _jsx(HeadingPreview, { level: 1 }),
};
export const heading1ItemWysiwyg = {
    exec: (e) => e.actions.toH1.run(),
    isActive: (e) => e.actions.toH1.isActive(),
    isEnable: (e) => e.actions.toH1.isEnable(),
};
export const heading1ItemMarkup = {
    exec: (e) => toH1(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Heading 2 ----
export const heading2ItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'heading2'),
    icon: icons.h2,
    hotkey: f.toView(A.Heading2),
    preview: _jsx(HeadingPreview, { level: 2 }),
};
export const heading2ItemWysiwyg = {
    exec: (e) => e.actions.toH2.run(),
    isActive: (e) => e.actions.toH2.isActive(),
    isEnable: (e) => e.actions.toH2.isEnable(),
};
export const heading2ItemMarkup = {
    exec: (e) => toH2(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Heading 3 ----
export const heading3ItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'heading3'),
    icon: icons.h3,
    hotkey: f.toView(A.Heading3),
    preview: _jsx(HeadingPreview, { level: 3 }),
};
export const heading3ItemWysiwyg = {
    exec: (e) => e.actions.toH3.run(),
    isActive: (e) => e.actions.toH3.isActive(),
    isEnable: (e) => e.actions.toH3.isEnable(),
};
export const heading3ItemMarkup = {
    exec: (e) => toH3(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Heading 4 ----
export const heading4ItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'heading4'),
    icon: icons.h4,
    hotkey: f.toView(A.Heading4),
    preview: _jsx(HeadingPreview, { level: 4 }),
};
export const heading4ItemWysiwyg = {
    exec: (e) => e.actions.toH4.run(),
    isActive: (e) => e.actions.toH4.isActive(),
    isEnable: (e) => e.actions.toH4.isEnable(),
};
export const heading4ItemMarkup = {
    exec: (e) => toH4(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Heading 5 ----
export const heading5ItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'heading5'),
    icon: icons.h5,
    hotkey: f.toView(A.Heading5),
    preview: _jsx(HeadingPreview, { level: 5 }),
};
export const heading5ItemWysiwyg = {
    exec: (e) => e.actions.toH5.run(),
    isActive: (e) => e.actions.toH5.isActive(),
    isEnable: (e) => e.actions.toH5.isEnable(),
};
export const heading5ItemMarkup = {
    exec: (e) => toH5(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Heading 6 ----
export const heading6ItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'heading6'),
    icon: icons.h6,
    hotkey: f.toView(A.Heading6),
    preview: _jsx(HeadingPreview, { level: 6 }),
};
export const heading6ItemWysiwyg = {
    exec: (e) => e.actions.toH6.run(),
    isActive: (e) => e.actions.toH6.isActive(),
    isEnable: (e) => e.actions.toH6.isEnable(),
};
export const heading6ItemMarkup = {
    exec: (e) => toH6(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Bullet List ----
export const bulletListItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'ulist'),
    icon: icons.bulletList,
    hotkey: f.toView(A.BulletList),
};
export const bulletListItemWysiwyg = {
    exec: (e) => e.actions.toBulletList.run(),
    isActive: (e) => e.actions.toBulletList.isActive(),
    isEnable: (e) => e.actions.toBulletList.isEnable(),
};
export const bulletListItemMarkup = {
    exec: (e) => toBulletList(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Ordered List ----
export const orderedListItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'olist'),
    icon: icons.orderedList,
    hotkey: f.toView(A.OrderedList),
};
export const orderedListItemWysiwyg = {
    exec: (e) => e.actions.toOrderedList.run(),
    isActive: (e) => e.actions.toOrderedList.isActive(),
    isEnable: (e) => e.actions.toOrderedList.isEnable(),
};
export const orderedListItemMarkup = {
    exec: (e) => toOrderedList(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Sink List ----
export const sinkListItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'list__action_sink'),
    icon: icons.sink,
    hotkey: f.toView(A.SinkListItem),
};
export const sinkListItemWysiwyg = {
    exec: (e) => e.actions.sinkListItem.run(),
    hintWhenDisabled: () => i18n('list_action_disabled'),
    isActive: (e) => e.actions.sinkListItem.isActive(),
    isEnable: (e) => e.actions.sinkListItem.isEnable(),
};
export const sinkListItemMarkup = {
    exec: (e) => sinkListItemCommand(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Lift List ----
export const liftListItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'list__action_lift'),
    icon: icons.lift,
    hotkey: f.toView(A.LiftListItem),
};
export const liftListItemWysiwyg = {
    exec: (e) => e.actions.liftListItem.run(),
    hintWhenDisabled: () => i18n('list_action_disabled'),
    isActive: (e) => e.actions.liftListItem.isActive(),
    isEnable: (e) => e.actions.liftListItem.isEnable(),
};
export const liftListItemMarkup = {
    exec: (e) => liftListItemCommand(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Toggle Heading Folding ----
export const toggleHeadingFoldingItemView = {
    type: ToolbarDataType.SingleButton,
    icon: icons.foldingHeading,
    title: () => i18n('folding-heading'),
    hint: () => i18n('folding-heading__hint'),
};
export const toggleHeadingFoldingItemWysiwyg = {
    isActive: (editor) => editor.actions.toggleHeadingFolding?.isActive() ?? false,
    isEnable: (editor) => editor.actions.toggleHeadingFolding?.isEnable() ?? false,
    exec: (editor) => editor.actions.toggleHeadingFolding.run(),
    condition: 'enabled',
};
// ---- Text Context ----
export const textContextItemView = {
    type: ToolbarDataType.ReactComponent,
};
export const textContextItemWisywig = {
    component: WToolbarTextSelect,
    width: 0,
    condition: ({ selection: { $from, $to }, schema }) => {
        if (!$from.sameParent($to))
            return false;
        const { parent } = $from;
        return parent.type === pType(schema) || parent.type === headingType(schema);
    },
};
// ---- Paragraph ----
export const paragraphItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'text'),
    icon: icons.text,
    hotkey: f.toView(A.Text),
    doNotActivateList: true,
    preview: _jsx(TextPreview, {}),
};
export const paragraphItemWisywig = {
    exec: (e) => e.actions.toParagraph.run(),
    isActive: (e) => e.actions.toParagraph.isActive(),
    isEnable: (e) => e.actions.toParagraph.isEnable(),
};
export const paragraphItemMarkup = {
    exec: noop,
    isActive: inactive,
    isEnable: enable,
};
// --- Colorify ----
export const colorifyItemView = {
    type: ToolbarDataType.ReactComponent,
};
export const colorifyItemWysiwyg = {
    component: WToolbarColors,
    width: 42,
};
export const colorifyItemMarkup = {
    component: MToolbarColors,
    width: 42,
};
// ---- GPT ----
export const gptItemView = {
    type: ToolbarDataType.SingleButton,
    title: i18n.bind(null, 'gpt'),
    hotkey: gptHotKeys.openGptKeyTooltip,
    icon: icons.gpt,
};
export const gptItemWysiwyg = {
    exec: (e) => e.actions.addGptWidget.run({}),
    isActive: (e) => e.actions.addGptWidget.isActive(),
    isEnable: (e) => e.actions.addGptWidget.isEnable(),
};
export const gptItemMarkup = {
    exec: (e) => insertMermaidDiagram(e.cm),
    isActive: inactive,
    isEnable: enable,
};
// ---- Heading list ----
export const headingListItemView = {
    type: ToolbarDataType.ListButton,
    icon: icons.headline,
    title: i18n.bind(null, 'heading'),
    withArrow: true,
};
// ---- Lists list ----
export const listsListItemView = {
    type: ToolbarDataType.ListButton,
    icon: icons.bulletList,
    withArrow: true,
    title: i18n.bind(null, 'list'),
};
// ---- Move list ----
export const moveListItemView = {
    type: ToolbarDataType.ListButton,
    icon: icons.lift,
    withArrow: true,
    title: i18n.bind(null, 'move_list'),
};
// ---- Code list ----
export const codeBlocksListItemView = {
    type: ToolbarDataType.ListButton,
    icon: icons.code,
    title: i18n.bind(null, 'code'),
    withArrow: true,
};
// ---- Math list ----
export const mathListItemView = {
    type: ToolbarDataType.ListButton,
    icon: icons.functionInline,
    withArrow: true,
    title: i18n.bind(null, 'math'),
};
//# sourceMappingURL=items.js.map
