TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/euclidesseg/euclides-workspace/llms.txt
Use this file to discover all available pages before exploring further.
EuclidesRichEditorComponent is the main editor component that provides a full-featured rich text editing experience powered by ProseMirror.
Overview
This component is a standalone Angular component that implements a rich text editor with formatting capabilities, list management, text alignment, and undo/redo functionality. Component Selector:euclides-rich-editor
Basic Usage
Component Architecture
The editor component implements two Angular lifecycle hooks:AfterViewInit- Initializes the ProseMirror editor view after Angular renders the componentOnDestroy- Cleans up the editor view when the component is destroyed
Dependencies
The component injects two core services:EditorCommandsService- Handles all formatting and editing commandsEditorStateService- Manages undo/redo state and history
Public Methods
The component exposes the following methods for programmatic control:Text Formatting
Text Alignment
'left'- Align text to the left'center'- Center align text'right'- Align text to the right'justify'- Justify text
Lists
'bullet_list'- Unordered list with bullets'ordered_list'- Numbered list'task_list'- Task list with checkboxes
Code Blocks
History Management
Link Management
- Automatically adds
https://protocol if missing - Updates existing links when called on linked text
- Creates new links for selected text or inserts clickable URL
Component Template Structure
The editor component consists of two main sections:1. Navigation Toolbar
Provides formatting buttons for:- Text formatting (bold, italic, strikethrough)
- Text alignment (left, center, right, justify)
- Lists (bullet, ordered)
- Code blocks
- Links
- Undo/redo
2. Editor Area
The editable content area where users type and format text:The editor view is created in
ngAfterViewInit to ensure the DOM element is available before ProseMirror initialization.Usage with Template Reference
You can access component methods using template references:Internal Implementation Details
ProseMirror Integration
The component creates a ProseMirrorEditorView instance using the EditorEngine.create() method:
Focus Management
All formatting methods automatically return focus to the editor after executing commands, ensuring smooth editing experience.Link Detection
The editor uses thegetLinkRange() utility to detect if the current cursor position is within a link mark, enabling context-aware link editing.
Location: euclides-rich-editor.component.ts:88
Cleanup
The component properly destroys the ProseMirror view when the component is destroyed:See Also
- Link Popover Component - UI for managing links
- Editor Schema - ProseMirror schema definition
- Editor Commands Service - Available editor commands