ff_tiptap_viewer 0.0.3
ff_tiptap_viewer: ^0.0.3 copied to clipboard
Renders TipTap JSON as native, selectable Flutter widgets with per-node theming.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
0.0.3 - 2026-06-15 #
Adopt a TipTap-style StarterKit, make extension sets a first-class concept,
add the remaining viewer-relevant StarterKit nodes/marks, and fully decouple
Mention from the core. This is a breaking change set.
Added #
StarterKit: the default extension set (used whenextensionsis null), mirroring TipTap's StarterKit for a viewer. Toggle members off with per-member bool flags (e.g.StarterKit(blockquote: false)); customize a member by listing your own instance after the kit (flattening is last-wins).TiptapExtensionSet: a base class for reusable extension bundles. Subclass it to build your own set (e.g. aDripstoneset); sets flatten recursively, so a set may contain other sets.- New nodes:
Heading(per-level styles viaTiptapViewerTheme.headingStyle),CodeBlock(monospace, whitespace-preserving, tinted),HorizontalRule,HardBreak(withHardBreak(mode: …)rendering it as anewline(default) or aspace). - New marks:
Code(inline monospace) andLink(in StarterKit, styled but non-interactive by default; addLink(onTap: …)after the kit to make links tappable). TiptapMarkExtension.buildRecognizer: lets a mark attach a tap recognizer (used byLink).TiptapInlineExtension.toPlainText/buildFlattened: hooks an inline extension uses to contribute its flattened/plain-text form (used byMention).inlineLeafText(extensions): builds aninlineLeafhook fortoPlainText, so mentions (and other inline extensions) appear in extracted text when enabled.- Theme tokens:
headingStyles,codeBlockBackground/Padding/Radius/TextStyle,inlineCodeStyle,hrColor/hrThickness/hrSpacing,linkColor/linkUnderline.
Changed #
TiptapExtensionis now asealed, typeless base (like TipTap'sExtension); thetypegetter moved to a newTiptapTypedExtensionlayer above nodes/marks. Custom extensions keep subclassingTiptapBlockExtension/TiptapInlineExtension/TiptapMarkExtensionas before.- The zero-config default now renders headings, code blocks, horizontal rules, hard breaks, inline code, and (non-interactive) links.
TiptapNode.toPlainText()/TiptapDocument.toPlainText()no longer emit@labelfor mentions by default — pass aninlineLeafhook (e.g. viainlineLeafText([StarterKit(), Mention()])) to include them. This matches mentions being opt-in everywhere else.Mentionmoved to its own file and is no longer special-cased anywhere in the renderer or model; it is now an ordinary inline extension built only from public API.
Removed #
kDefaultTiptapExtensions— useStarterKit(the default whenextensionsis null, or listconst StarterKit()explicitly).
0.0.2 - 2026-06-13 #
Add a flattened plain/inline rendering path for compact, truncatable previews.
Added #
TiptapTextwidget: flattens a whole document into a single truncatable inline run for compact previews, instead of the block columnTiptapViewerbuilds. SupportsmaxLines+overflow, a hardmaxCharscap (with an optionalellipsis),includeStylestyle stripping (keep vs. drop bold/italic/ underline/strike), a configurable blockseparator, and opt-inselectable. Mentions render as@labelso a preview never silently drops one.TiptapDocument.toPlainText()/TiptapNode.toPlainText(): pure-string flattening (mentions as@label, block siblings joined by a separator) for callers that just need text (search, accessibility labels).TiptapRenderer.buildFlattenedSpan(): the inline-flattening primitive behindTiptapText.
0.0.1 - 2026-06-13 #
Initial release: render TipTap JSON as native, selectable Flutter widgets via a
composable extension list and a single TiptapViewerTheme styling surface.
Added #
- Initial scaffold:
TiptapViewerwidget rendering TipTap JSON (string or map). - Model layer:
TiptapDocument,TiptapNode,TiptapMarkwith tolerant parsing. - Extension system: block/inline/mark extensions with a disabled-behavior rule
(
unwrap/strip) and debug-only warnings for dropped types. - Nodes:
Doc,Paragraph,Blockquote,BulletList,OrderedList(honorsstart),ListItem,TextNode. - Marks:
Bold,Italic,Underline,Strike. - Custom extension
Mention(opt-in; not in the default set) withhighlight/chip/plaindisplay modes and anonTapcallback. TiptapViewerThemesingle styling surface with.fromContext+copyWith.renderEmptyParagraphstheme option (defaultfalse) to strip empty paragraphs instead of rendering them as blank-line spacers.nestedListIndenttheme token so nested lists indent less than top-level lists.MentionDisplay.plainto render a mention as its bare label text (no color, weight, chip, or tap), as an alternative tohighlight/chipor stripping it from the active extension set.- Opt-out
selectable(SelectionArea) selection/copy support. - Example app with live node/mark toggles, theme selector, mention display toggle, and a fake-FlutterFlow theme mapping.
- Unit + widget tests; GitHub Actions CI (analyze + test + publish dry-run).