Skip to content

sereneinserenade/lexical-comments

Repository files navigation

lexical-comments

Example implementation of having Google-Docs like comments in https://lexical.dev . Main ingredient that makes this possible is CommentNode which is Highly inspired by the LinkNode from Lexical.

A ⭐️ to the repo if you 👍 / ❤️ what I'm doing would be much appreciated. If you're using this extension and making money from it, it'd be very kind of you to ❤️ Sponsor me. If you're looking for a dev to work you on your project's Rich Text Editor with or as a frontend developer, DM me on Discord/Twitter/LinkedIn👨‍💻🤩.

Demo

Bildschirmaufnahme.2022-04-17.um.15.36.29.mp4

How to use

The real implementation of CommentNode for Lexical is in comment.ts, you can copy-paste that file in your project. Rest is just a custom implementation of using CommentNode and storing comments in Recoil state on update and updating comments via commands provided in comment.ts.

If you have any questions/suggestions about the implementation, open an issue or create a Pull Request.

Contributing

Show your ❤️ by ⭐️ing this repository. Your support means a lot.

Clone the repo, do something, make a PR(or don't). You know what's the drill. Looking forward to your PRs, you amazing devs.

LICENCE

MIT License
MIT License

Copyright (c) 2022 Jeet Mandaliya (github: sereneinserenade)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Stargazers

Stargazers repo roster for @sereneinserenade/lexical-comments

Made possible by these badass packages!

    "@lexical/react": "^0.2.1",
    "@nextui-org/react": "^1.0.8-beta.5",
    "lexical": "^0.2.1",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-icons": "^4.3.1",
    "recoil": "^0.7.2",
    "sass": "^1.50.0",
    "uuid": "^8.3.2"

    "typescript": "^4.6.3",
    "vite": "^2.9.2"