Skip to content
Discussion options

You must be logged in to vote

Hey @pil0u, I'd recommend a Lexxy extension to register a Lexical extension to intercept the command and tranforms node, and get a built-in toolbar hook.

For example, to turn-off bold text, I'd start down the path of registering a high priority command handler for FORMAT_TEXT_COMMAND and return true to stop further handling:

// configure Lexxy
import * as Lexxy from "@37signals/lexxy"

Lexxy.configure({
  global: {
    extensions: [ NoBoldExtension ]
  }
})

// No Bold Extension

import { defineExtension, COMMAND_PRIORITY_HIGH, FORMAT_TEXT_COMMAND } from "lexical"
import * as Lexxy from "@37signals/lexxy"

class NoBoldExtension extends Lexxy.Extension {
  get enabled() {
    return this.e…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by samuelpecher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants