2026-09-20 15:52:22 +08:00
|
|
|
import { IndentDecrease, IndentIncrease } from "@workspace/ui/components/icon"
|
2026-07-31 15:07:09 +08:00
|
|
|
import { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from "lexical"
|
|
|
|
|
import type { LexicalActionDefinition } from "../types"
|
|
|
|
|
import { lexicalMessages } from "../messages"
|
|
|
|
|
|
|
|
|
|
export const outdentAction: LexicalActionDefinition = {
|
|
|
|
|
name: "outdent",
|
|
|
|
|
label: lexicalMessages.outdent,
|
|
|
|
|
icon: IndentDecrease,
|
|
|
|
|
execute: ({ editor }) => {
|
|
|
|
|
editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const indentAction: LexicalActionDefinition = {
|
|
|
|
|
name: "indent",
|
|
|
|
|
label: lexicalMessages.indent,
|
|
|
|
|
icon: IndentIncrease,
|
|
|
|
|
execute: ({ editor }) => {
|
|
|
|
|
editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)
|
|
|
|
|
},
|
|
|
|
|
}
|