atproto blogging
1//! weaver-editor-core: Pure Rust editor logic without framework dependencies.
2//!
3//! This crate provides:
4//! - `TextBuffer` trait for text storage abstraction
5//! - `EditorRope` - ropey-backed implementation
6//! - `UndoableBuffer<T>` - TextBuffer wrapper with undo/redo
7//! - `EditorDocument` trait - interface for editor implementations
8//! - `PlainEditor<T>` - simple field-based EditorDocument impl
9//! - `EditorAction`, `InputType`, `Key` - platform-agnostic input/action types
10//! - Rendering types and offset mapping utilities
11
12pub mod actions;
13pub mod document;
14pub mod execute;
15pub mod offset_map;
16pub mod paragraph;
17pub mod platform;
18pub mod render;
19pub mod render_cache;
20pub mod syntax;
21pub mod text;
22pub mod text_helpers;
23pub mod types;
24pub mod undo;
25pub mod visibility;
26pub mod writer;
27
28pub use offset_map::{
29 OffsetMapping, RenderResult, SnapDirection, SnappedPosition, find_mapping_for_byte,
30 find_mapping_for_char, find_nearest_valid_position, is_valid_cursor_position,
31};
32pub use paragraph::{ParagraphRender, hash_source, make_paragraph_id};
33pub use smol_str::SmolStr;
34pub use syntax::{SyntaxSpanInfo, SyntaxType, classify_syntax};
35pub use text::{EditorRope, TextBuffer};
36pub use types::{
37 Affinity, CompositionState, CursorRect, CursorState, EditInfo, EditorImage, Selection,
38 SelectionRect, BLOCK_SYNTAX_ZONE,
39};
40pub use document::{EditorDocument, PlainEditor};
41pub use render::{EmbedContentProvider, ImageResolver, WikilinkValidator};
42pub use undo::{UndoManager, UndoableBuffer};
43pub use visibility::VisibilityState;
44pub use writer::{EditorImageResolver, EditorWriter, SegmentedWriter, WriterResult};
45pub use platform::{
46 ClipboardPlatform, CursorPlatform, CursorSync, PlatformError, clipboard_copy,
47 clipboard_copy_as_html, clipboard_cut, clipboard_paste, render_markdown_to_html,
48 strip_zero_width,
49};
50pub use actions::{
51 EditorAction, FormatAction, InputType, Key, KeyCombo, KeybindingConfig, KeydownResult,
52 Modifiers, Range,
53};
54pub use execute::{
55 apply_formatting, execute_action, execute_action_with_clipboard, handle_keydown,
56 handle_keydown_with_clipboard, snap_direction_for_action,
57};
58pub use text_helpers::{
59 ListContext, count_leading_zero_width, detect_list_context, find_line_end, find_line_start,
60 find_word_boundary_backward, find_word_boundary_forward, is_list_item_empty,
61 is_zero_width_char,
62};
63pub use render_cache::{
64 CachedParagraph, IncrementalRenderResult, RenderCache, apply_delta, is_boundary_affecting,
65 render_paragraphs_incremental,
66};
67
68// Re-export dependencies needed by browser crate.
69pub use markdown_weaver;
70pub use weaver_renderer;