turn into callout option
This commit is contained in:
parent
0a05ce6133
commit
618f56577d
1 changed files with 16 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { Dispatch, FC, SetStateAction } from "react";
|
import React, { Dispatch, FC, SetStateAction } from "react";
|
||||||
import {
|
import {
|
||||||
IconBlockquote,
|
IconBlockquote,
|
||||||
|
IconCaretRightFilled,
|
||||||
IconCheck,
|
IconCheck,
|
||||||
IconCheckbox,
|
IconCheckbox,
|
||||||
IconChevronDown,
|
IconChevronDown,
|
||||||
|
|
@ -8,6 +9,7 @@ import {
|
||||||
IconH1,
|
IconH1,
|
||||||
IconH2,
|
IconH2,
|
||||||
IconH3,
|
IconH3,
|
||||||
|
IconInfoCircle,
|
||||||
IconList,
|
IconList,
|
||||||
IconListNumbers,
|
IconListNumbers,
|
||||||
IconTypography,
|
IconTypography,
|
||||||
|
|
@ -55,6 +57,8 @@ export const NodeSelector: FC<NodeSelectorProps> = ({
|
||||||
isTaskItem: ctx.editor.isActive("taskItem"),
|
isTaskItem: ctx.editor.isActive("taskItem"),
|
||||||
isBlockquote: ctx.editor.isActive("blockquote"),
|
isBlockquote: ctx.editor.isActive("blockquote"),
|
||||||
isCodeBlock: ctx.editor.isActive("codeBlock"),
|
isCodeBlock: ctx.editor.isActive("codeBlock"),
|
||||||
|
isCallout: ctx.editor.isActive("callout"),
|
||||||
|
isDetails: ctx.editor.isActive("details"),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -124,6 +128,18 @@ export const NodeSelector: FC<NodeSelectorProps> = ({
|
||||||
command: () => editor.chain().focus().toggleCodeBlock().run(),
|
command: () => editor.chain().focus().toggleCodeBlock().run(),
|
||||||
isActive: () => editorState?.isCodeBlock,
|
isActive: () => editorState?.isCodeBlock,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Callout",
|
||||||
|
icon: IconInfoCircle,
|
||||||
|
command: () => editor.chain().focus().toggleCallout().run(),
|
||||||
|
isActive: () => editorState?.isCallout,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Toggle block",
|
||||||
|
icon: IconCaretRightFilled,
|
||||||
|
command: () => editor.chain().focus().setDetails().run(),
|
||||||
|
isActive: () => editorState?.isDetails,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const activeItem = items.filter((item) => item.isActive()).pop() ?? {
|
const activeItem = items.filter((item) => item.isActive()).pop() ?? {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue