Skip to content

Conversation

Soxasora
Copy link
Member

@Soxasora Soxasora commented Sep 9, 2025

Description

Introduces Lexical as a Markdown/Rich Text editor and renderer

Screenshots

tbd

New things

  • KaTeX is used in place of MathJax to render equations and LaTeX.
  • Shiki is used in place of React Syntax Highlighter to highlight code blocks - it is undoubtedly faster and lighter than RSH, reaching 4kB of size in the bundle (this has to be re-verified later)
  • Uploads are now concurrently processed, also featuring a percentage, with placeholder per each upload - the user can continue to write while it uploads
  • MediaOrLink preserves scroll on load, supports captions and resize
  • Embeds refactor with a load timeout that spawns an error component (context)
  • HTML from a lexical JSON state is parsed server-side via Linkedom, a performance-focused DOM simulator
  • TBD, a lot has changed from the last update

Additional Context

Lexical is also used as a renderer (stripped of any plugins) of its editorState in JSON.
Since Lexical renders client-side, the HTML produced by Lexical is used as a placeholder with 1:1 styling until Lexical takes over
TBD, a lot has changed from the last update

Progress

  • editor renders
  • can create items
  • can edit items (and restore a lexical editorState)
  • can switch between markdown and rich text
  • can instantly produce and serve sanitized HTML in SSR
  • experimental Shiki-based plain text and live markdown mode
  • can serve all embeds we support
  • can upload files!
  • can auto link everything
  • can render in markdown, lexical, html, json2jsx. indecise much?
  • can mention people, not yet subs
  • forgot

TODO

TBD, a lot has changed from the last update*

Checklist

Are your changes backward compatible? Please answer below:

For example, a change is not backward compatible if you removed a GraphQL field or dropped a database column.
tbd

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:
tbd

For frontend changes: Tested on mobile, light and dark mode? Please answer below:
tbd

Did you introduce any new environment variables? If so, call them out explicitly here:
tbd

Did you use AI for this? If so, how much did it assist you?
Ask: better lexical understanding, things that weren't clear in documentation or in code, best practices
Agent: autocompletion and refactors

… SN theme, formik bridge touchups, a better toolbar style
…gic, image markdown transformer, testing on more scenarios
…t, re-introduce usage of Lexical in read mode
@Soxasora Soxasora changed the title rich text editor and renderer Hybrid Text Editor Sep 20, 2025
@Soxasora Soxasora changed the title Hybrid Text Editor Rich and Markdown Text Editor Oct 10, 2025
Copy link

socket-security bot commented Oct 11, 2025

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
happy-dom@20.0.0 has a Critical CVE.

CVE: GHSA-qpm2-6cq5-7pq5 happy-dom's --disallow-code-generation-from-strings is not sufficient for isolating untrusted JavaScript (CRITICAL)

Affected versions: < 20.0.2

Patched version: 20.0.2

From: package-lock.jsonnpm/@lexical/headless@0.37.0npm/happy-dom@20.0.0

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/happy-dom@20.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

- Helper floating toolbar on selection
  - graceful appear/disappear of the toolbar
  - debounce reposition to check if the selection actually didn't change
  - reposition tolerance
- Show a tooltip on toolbar item hover
  - ActionTooltip now accepts delay, transitions and a different structure
  - Show a tooltip after 0.5 seconds
  - graceful transition
  - hide the tooltip on click
- prevent importing an empty editor state
- adjust code nodes theme for dark and light mode
- hide floating elements far away from the viewport
- tweaks to floating elements animations
- fix overflow and overflowing button on Reader and Reader loading placeholder
- accept and use a callback ref for LexicalReader and a normal ref for (markdown) Text

bits:
- split SNLexical in LexicalEditor and LexicalReader
- forward ref to loading placeholder and Reader
…ers on dynamic Editor import; fix newlines on SSR markdown conversions
…down]; save pure lexical state in local; start in markdown mode by default
…upport; overflow at 50vh for truncated HTML; prepare for imgproxy support
…ort via applySNCustomizations, embed HTML placeholder
- safer SSR conversions, withDOM wrapper
- rename blockType normal to paragraph
- migrate LexicalReader to the new extension paradigm
- change math nodes placeholder
- refactor: re-organize lib/lexical in functionalities [core, content, decorative, formatting, misc]
- refactor: re-organize components/lexical in functionalities
- MaxLength plugin for constrained text boxes
Soxasora and others added 4 commits October 19, 2025 14:00
…HTML placeholder; mitigate: corrupt selection switching between markdown and rich modes; dev: debug HTML mode; State of Lexical docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature new product features that weren't there before multimedia ui/ux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant