bullet_editor 0.2.0
bullet_editor: ^0.2.0 copied to clipboard
A structured rich text editor for Flutter built on a single TextField. Supports headings, lists, tasks, code blocks, block quotes, and full markdown round-trip serialization.
0.2.0 #
API changes #
- Generalize inline entities across the public API.
EditorController,EditorSchema,InlineEntityDef,InlineEntityInfo, andInlineEntityEditInfonow use an explicit inline-entity key type so apps can define custom entity types instead of being limited to built-in links. - Add
EditorController.inlineEntitiesInSelection()to return the resolved inline entity runs touched by the current selection. This lets host apps make their own decisions when a selection touches zero, one, or multiple entities. - Refine inline entity editing around
setInlineEntity()/removeInlineEntity()and typed entity payloads such asLinkData.
Improvements #
- Move resolved entity-selection logic out of the example app and into the package so host apps no longer need to walk document segments manually to build link-editing flows.
- The example app now uses the controller's resolved-entity API for link editing, including partial selections inside links and adjacent-link cases.
- Add regression coverage for mid-segment typing, adjacent-link replacement, and resolved inline-entity selection.
Bug fixes #
- Fix typing immediately after a markdown-generated link extending the link.
- Fix typing inside an existing link dropping the link entity instead of preserving it.
- Fix
setInlineEntity(..., text: ...)when replacing link text next to another link. Replacement text is now inserted with its final entity styles/attributes directly instead of inheriting a neighboring link and then toggling off. - Fix markdown
**...**input so bold wrapping wins over italic when typing double-star delimiters incrementally. - Keep link markdown input rules ordered ahead of bold/italic wrap rules in
EditorSchema.inputRules.
0.1.11 #
Features #
- Add
LinkInfoclass andlinkInfogetter onEditorControllerfor pre-filling link dialogs. Handles collapsed cursor (in link or plain text) and selections spanning multiple segments/blocks with different URLs.
Bug fixes #
- Fix link tap firing when tapping empty space below or to the right of
link text. The widget now verifies the pointer-down position is on actual
text using line metrics before triggering
onLinkTap.
0.1.10 #
Features #
- Typing
[ ]or[x]on a paragraph now converts to a task item, matching the existing- [ ]shortcut for users who forget the hyphen.
0.1.9 #
Bug fixes #
setBlockTypenow applies to all blocks in a non-collapsed selection, not just the first. Affects bullet list, numbered list, task item, heading, and all other block type conversions.
0.1.8 #
Bug fixes #
- Fix iOS autocorrect moving cursor inside the corrected word. The controller now uses the platform cursor when it's past the edit region (autocorrect pattern) and the diff-based cursor otherwise.
Features #
setLinknow accepts an optionaltextparameter. With a collapsed cursor, it inserts linked text at the cursor position instead of being a no-op. Existing links can also have their display text updated.
0.1.7 #
Bug fixes #
- Fix diacritics (dead keys) on Safari Web. Safari appends the resolved character instead of replacing the dead key during composing. The controller now avoids syncing back to the platform during active composing and rewrites the diff when an insert lands outside the composing range.
0.1.6 #
Bug fixes #
- Fix markdown decode depth normalization: when collapsing blocks under non-childable parents (headings, etc.), the entire sibling group is now shifted together, preserving relative relationships.
0.1.5 #
Bug fixes #
- Fix outdent reordering siblings. Outdenting a block now adopts its subsequent siblings as children (matching Notion/Google Docs behavior), preserving visual order.
0.1.4 #
Bug fixes #
- Fix keyboard shortcuts (Cmd+B, Cmd+I, Shift+Enter, etc.) not working in
host apps. Moved all key handling from
FocusNode.onKeyEvent(whichEditableTextoverwrites) toShortcuts+Actionswidgets. - Fix markdown decoder nesting indented list items under headings/paragraphs.
Blocks whose parent type has
canHaveChildren: falseare now collapsed to sibling level during decode.
0.1.3 #
Improvements #
- Moved rich copy/cut business logic from
BulletEditorwidget toEditorController(richCopy(),richCut(),deleteSelection()). deleteSelection()resets non-default block types to paragraph when the selection starts at offset 0.- Tab/Shift+Tab indent/outdent, Cmd+B/I/Shift+S inline style shortcuts, and
rich copy/cut are now handled internally by
BulletEditorviaActionsoverrides — no host-app wiring needed.
Tests #
- Added unit tests for
deleteSelection,richCopy, andrichCut.
0.1.1 #
Bug fixes #
MarkdownCodecis now generic (MarkdownCodec<B>) sodecode()returnsDocument<B>instead ofDocument<dynamic>. Eliminates runtime type cast errors when using typed schemas.
Features #
- Shift+Enter inserts a soft line break (
\n) within a block instead of splitting into a new block. Works on all non-void block types. - Markdown codec encodes/decodes CommonMark hard line breaks (
\nand\\\n). - Paragraphs now have
spacingBefore: 0.3for visual separation between blocks.
0.1.0 #
Initial public release.
Block types #
- Paragraph, Heading 1-6, Bullet list, Numbered list, Task item (checkbox), Block quote, Fenced code block, Divider
Inline styles #
- Bold, Italic, Strikethrough, Inline code, Links, Autolinks
Editor features #
- Markdown shortcuts (type
#,-,>,```,---, etc.) - Inline wrap shortcuts (
**,*,`,~~) - Keyboard shortcuts (Cmd+B, Cmd+I, Cmd+Shift+S)
- Nested blocks via Tab/Shift+Tab
- Undo/redo with selection restoration
- Schema-driven architecture with custom block/inline support
Markdown codec #
- CommonMark-aligned decode and encode
- Backslash escape handling
- Fence-aware block splitting for code blocks
- Round-trip fidelity for ATX headings, thematic breaks, and emphasis