Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
/docs/.jekyll-cache/
/docs/.jekyll-metadata
/docs/Gemfile.lock
.yarn/install-state.gz
5 changes: 5 additions & 0 deletions src/editor/command_dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const COMMANDS = [
"unlink",
"toggleHighlight",
"removeHighlight",
"setFormatHeadingXLarge",
"setFormatHeadingLarge",
"setFormatHeadingMedium",
"setFormatHeadingSmall",
Expand Down Expand Up @@ -211,6 +212,10 @@ export class CommandDispatcher {
this.editor.focus()
}

dispatchSetFormatHeadingXLarge() {
this.contents.applyHeadingFormat("h1")
}

dispatchSetFormatHeadingLarge() {
this.contents.applyHeadingFormat("h2")
}
Expand Down
16 changes: 10 additions & 6 deletions src/elements/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export class LexicalToolbarElement extends HTMLElement {

this.#setButtonPressed("format", isInHeading || isStrikethrough || isUnderline)
this.#setButtonPressed("paragraph", !isInHeading)
this.#setButtonPressed("heading-xlarge", headingTag === "h1")
this.#setButtonPressed("heading-large", headingTag === "h2")
this.#setButtonPressed("heading-medium", headingTag === "h3")
this.#setButtonPressed("heading-small", headingTag === "h4")
Expand Down Expand Up @@ -363,14 +364,17 @@ export class LexicalToolbarElement extends HTMLElement {
<button type="button" name="paragraph" data-command="setFormatParagraph" title="Paragraph">
${ToolbarIcons.paragraph} <span>Normal</span>
</button>
<button type="button" name="heading-large" data-command="setFormatHeadingLarge" title="Large heading">
${ToolbarIcons.h2} <span>Large Heading</span>
<button type="button" name="heading-xlarge" data-command="setFormatHeadingXLarge" title="Heading 1">
${ToolbarIcons.h1} <span>Heading 1</span>
</button>
<button type="button" name="heading-medium" data-command="setFormatHeadingMedium" title="Medium heading">
${ToolbarIcons.h3} <span>Medium Heading</span>
<button type="button" name="heading-large" data-command="setFormatHeadingLarge" title="Heading 2">
${ToolbarIcons.h2} <span>Heading 2</span>
</button>
<button class="lexxy-editor__toolbar-group-end" type="button" name="heading-small" data-command="setFormatHeadingSmall" title="Small heading">
${ToolbarIcons.h4} <span>Small Heading</span>
<button type="button" name="heading-medium" data-command="setFormatHeadingMedium" title="Heading 3">
${ToolbarIcons.h3} <span>Heading 3</span>
</button>
<button type="button" name="heading-small" data-command="setFormatHeadingSmall" title="Heading 4">
${ToolbarIcons.h4} <span>Heading 4</span>
</button>
<div class="lexxy-editor__toolbar-separator" role="separator"></div>
<button type="button" name="strikethrough" data-command="strikethrough" title="Strikethrough">
Expand Down
5 changes: 5 additions & 0 deletions src/elements/toolbar_icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading