Simplify your stack and build anything. Or everything.
Build tomorrowโ€™s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
Itโ€™s time to take back your content infrastructure.

How to add lexical plugins to the richText editor

default discord avatar
snailedlt2 years ago
14

Hey, I'm wondering if it's possible to add [lexical plugins](

https://lexical.dev/docs/react/plugins

) to the lexical richText editor, and if so... how?



Seems like there should be some documentation on this



I specifically want to add the [lexical table plugin](

https://lexical.dev/docs/packages/lexical-table

)

  • default discord avatar
    markatomniux2 years ago

    Haha this plugin is a legend, something we all want but we can't seem to have

  • default discord avatar
    weetikveelman2 years ago

    the one we need but do not deserve



    ๐Ÿ˜”

  • default discord avatar
    arinji.2 years ago
    @290479081865084929

    did you find any way to do tables in payload 2?



    https://github.com/AlessioGr/payload-plugin-lexical?tab=readme-ov-file

    This dosent seem to install on payload version 2.0.0



    is it a planed feature?



    or is there another tables plugin

  • default discord avatar
    snailedlt2 years ago

    Nope, we scrapped the feature for now. Hope the devs add a table feature soon tho

  • default discord avatar
    arinji.2 years ago

    Yea, just doing rows and columns arrays for now

  • default discord avatar
    snailedlt2 years ago

    If you're implementing that, could you please upload the code for the converter somewhere? Would love more insight into how the converter feature works

  • default discord avatar
    arinji.2 years ago

    im converting the json in my frontend, do you wanna see that code?

  • default discord avatar
    snailedlt2 years ago

    yes please! ๐Ÿ˜„



    @890486507872342027

    I'll just tag you in case you missed my answer ๐Ÿ™‚

  • default discord avatar
    arinji.2 years ago

    Oh my bad, i did miss it.



    We just did a normal text area



    the rows and colums thing was to slow



      let table: [][] = node.fields.content.split("\n").map((row: string) => {
        return row.split("|").map((cell: string) => {
          return cell;
        });
      });
  • default discord avatar
    snailedlt2 years ago

    ahh, okey



    so that's using a text area instead of a richText field with blocks then?

  • default discord avatar
    arinji.2 years ago

    yea



    it was to slow to use rows and cols blocks. So we decided to use text area till tables are supported

  • default discord avatar
    snailedlt2 years ago

    understandable



    do you still have the code for the converter tho?



    @890486507872342027

    ๐Ÿ™‚

  • default discord avatar
    snailedlt2 years ago

    Thanks a bunch!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.