How basecamp/lexxy works
Lexxy is a Rails-integrated rich-text editor built on Lexical. Users edit formatted content in a custom editor, use toolbar, prompt, table, and attachment interactions, and produce HTML compatible with Action Text. The frontend also provides Markdown behavior, code highlighting, configurable prompts, attachment previews, and sanitization; the Rails engine connects it to Action Text and Active Storage. Several feature modules are represented from the tree and README, but their internal wiring is not shown, so those relationships are omitted.
Main entry points: editor.js Editor element · index.js JS entry · engine.rb Rails engine · custom_action_text_attachment_node.js Custom attachment
Components 23
Editor runtime
- JS entry
src/index.js - Editor element
src/elements/editor.js - Editor config
src/config/lexxy.js - Selection
src/editor/selection.js - Editor sanitizer
src/editor/sanitizer.js - Format helpers
src/helpers/format_helper.js - HTML helpers
src/helpers/html_helper.js - Lexical helpers
src/helpers/lexical_helper.js
Editing interactions
- Toolbar
src/elements/toolbar.js - Heading dropdown
src/elements/dropdown/heading.js - Prompt UI
src/elements/prompt.js - Table tools
src/elements/table/table_tools.js - Table controller
src/elements/table/table_controller.js - Markdown handler
src/editor/markdown/leading_tag_handler.js - Code highlighting
src/helpers/code_highlighting_helper.js
Attachments
- Action Text attachment
src/nodes/action_text_attachment_node.js - Custom attachment
src/nodes/custom_action_text_attachment_node.js - Custom drag and drop
src/editor/attachments/custom/drag_and_drop.js
Rails integration
- Rails engine
lib/lexxy/engine.rb - Action Text editor adapter
lib/action_text/editor/lexxy_editor.rb - Remote video attachable
lib/action_text/attachables/remote_video.rb - Preview URL support
lib/active_storage/blob_with_preview_url.rb
Other components
- Editor user
Connections 17
- Editor user → Editor element: edits content
- JS entry → Editor config: configures
src/index.js - JS entry → Editor sanitizer: exports
src/index.js - JS entry → Code highlighting: exports
src/index.js - JS entry → Editor element: registers elements
- Editor element → Selection: uses
src/elements/editor.js - Editor element → Toolbar: uses
src/elements/editor.js - Editor element → Markdown handler: uses
src/elements/editor.js - Editor element → Lexical helpers: uses
src/elements/editor.js - Heading dropdown → Toolbar: uses icons
src/elements/dropdown/heading.js - Table tools → Table controller: uses
src/elements/table/table_tools.js - Action Text attachment → HTML helpers: creates markup
src/nodes/action_text_attachment_node.js - Custom attachment → Editor sanitizer: sanitizes through
src/nodes/custom_action_text_attachment_node.js - Custom drag and drop → Custom attachment: moves
src/editor/attachments/custom/drag_and_drop.js - Rails engine → Action Text editor adapter: registers adapter
lib/lexxy/engine.rb - Rails engine → Remote video attachable: loads attachable
lib/lexxy/engine.rb - Rails engine → Preview URL support: loads extension
lib/lexxy/engine.rb