1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Lexical: Added clear formatting button

This commit is contained in:
Dan Brown
2024-06-12 14:24:50 +01:00
parent e889bc680b
commit a475cf68bf
2 changed files with 24 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import {EditorButton, FormatPreviewButton} from "./framework/buttons";
import {
blockquote, bold, code,
blockquote, bold, clearFormating, code,
dangerCallout, details,
h2, h3, h4, h5, image,
infoCallout, italic, link, paragraph,
@ -15,9 +15,11 @@ import {el} from "../helpers";
export function getMainEditorFullToolbar(): EditorContainerUiElement {
return new EditorSimpleClassContainer('editor-toolbar-main', [
// History state
new EditorButton(undo),
new EditorButton(redo),
// Block formats
new EditorFormatMenu([
new FormatPreviewButton(el('h2'), h2),
new FormatPreviewButton(el('h3'), h3),
@ -31,6 +33,7 @@ export function getMainEditorFullToolbar(): EditorContainerUiElement {
new FormatPreviewButton(el('p', {class: 'callout danger'}), dangerCallout),
]),
// Inline formats
new EditorButton(bold),
new EditorButton(italic),
new EditorButton(underline),
@ -38,11 +41,14 @@ export function getMainEditorFullToolbar(): EditorContainerUiElement {
new EditorButton(superscript),
new EditorButton(subscript),
new EditorButton(code),
new EditorButton(clearFormating),
// Insert types
new EditorButton(link),
new EditorButton(image),
new EditorButton(details),
// Meta elements
new EditorButton(source),
]);
}