diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ad60eb..af61ff5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.13.0 + +- **Character-range highlight boxes:** `RenderHyperBox.getBoxesForCharRange(charStart, charEnd)` returns the rects of a character range, for drawing your own highlights (search hits, annotations, read-aloud). Offsets are local to each `RenderHyperBox`, so in virtualized / `auto` mode (>10k chars) they restart at 0 per chunk. Also new: `RenderHyperBox.debugLineFragments()` for the laid-out fragment geometry. By [@DrkXo](https://github.com/DrkXo) ([#26](https://github.com/brewkits/hyper_render/pull/26)). +- **`text-overflow: ellipsis` fixes** (in `hyper_render_core`): the `…` glyph is no longer counted as a hidden source character, a selection highlight no longer covers it, and an empty line where nothing fits before the ellipsis now shows `…`. +- **Line-breaking fixes** (in `hyper_render_core`, rendering changes): wrapped lines no longer overflow the box (every full CJK line overflowed by a fraction of a glyph), RTL paragraphs wrap properly, `word-break` / `overflow-wrap` set on a block reach its text (`break-all` had no effect), an over-long word breaks after as many characters as fit instead of after its first letter, a word that doesn't fit beside a float moves below it, lines no longer start one space in (after `
` or an indented tag), and centered / right-aligned lines ignore trailing spaces. +- **Line-breaking performance on massive unspaced text blocks** ([#28](https://github.com/brewkits/hyper_render/issues/28), [#29](https://github.com/brewkits/hyper_render/pull/29)): single-pass native multi-line layout via ICU `computeLineMetrics()` when lines are uniform and free of floats, eliminating layout freezes on long unspaced text blocks. Bounded candidate prefix search in the fallback line breaker prevents quadratic `O(N^2)` text shaping overhead. New debug hooks `HyperRenderDebugHooks.onTextPainterLayout` / `onLineLayoutTextPainter` for layout call profiling. By [@DrkXo](https://github.com/DrkXo). +- **Requires `hyper_render_core` `^1.13.0`.** + ## 1.12.0 - **Dark surfaces: links, `
`, `` / `
` and `` now use dark-surface colors** ([#23](https://github.com/brewkits/hyper_render/issues/23)). In 1.11.0 only the default text color followed a dark theme; these built-in colors were still tuned for light surfaces and measured 4.1:1 (links), 3.9:1 (`
`) and **2.5:1** (`
`) on `#121212`. They now keep at least 4.5:1, and the inline `` / `` chips become dark chips instead of bright blocks. The palette is chosen from the *effective text color*: light text means a dark surface, so a dark `Theme` with `textColor: Colors.black87` (a white pane) keeps the light-surface palette, and a light `Theme` with a light `textColor` gets the dark one. Light-surface output is unchanged. Author CSS and inline styles still win. `
`, `` and table headers keep their light backgrounds (their text is kept readable by the 1.11.0 contrast guard). **Requires `hyper_render_core` `^1.12.0`** (`StyleResolver.darkSurface`). `hyper_render_epub` 0.1.3 needs no update: it goes through `HyperViewer`, so it picks this up automatically. diff --git a/README.md b/README.md index 8cb42d3..b040a5f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Already using `flutter_html`? You don't need to rewrite your widget tree or lear ```dart // 1. In your pubspec.yaml: // dependencies: -// hyper_render: ^1.12.0 +// hyper_render: ^1.13.0 // 2. In your Dart file — replace this single line: // ❌ import 'package:flutter_html/flutter_html.dart'; @@ -68,7 +68,7 @@ Html( ```yaml dependencies: - hyper_render: ^1.12.0 + hyper_render: ^1.13.0 ``` ```dart diff --git a/ROADMAP.md b/ROADMAP.md index 11c1458..03e78e7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -14,6 +14,7 @@ This document outlines the architectural roadmap for **HyperRender** to become t | **v1.10.0** | Shipped 2026-10-02 | **DevTools v2 & Stylesheet CSS Correctness** | Timeline / Selection / live CSS-variable / snapshot DevTools tabs; stylesheet `var()`, `url()`, `calc()` and `:root` fixed. | | **v1.11.0** | Shipped 2026-10-04 | **Dark Mode & Root Colors** | Dark-`Theme` text default, `HyperViewer(textColor:)` / `EpubReader(textColor:)`, `body`/`html` `color`, `:root` fix, contrast guard (#20). | | **v1.12.0** | Shipped 2026-10-04 | **Dark-Surface Element Colors** | Links, `
`, `` / `
`, `` keep >= 4.5:1 on dark surfaces (#23). |
+| **v1.13.0** | Shipped 2026-10-08 | **Character-Range Highlight Geometry** | `getBoxesForCharRange` / `debugLineFragments` for app-drawn highlights; ellipsis character-count fix (#26). |
 | **Next** | Unscheduled | **Native Vector Diagramming & Headless Export** | Pure Canvas/Vector Mermaid.js & GraphViz (Zero-WebView), Headless Image & PDF byte stream generator. |
 | **v2.0.0** | Q1 2027 | **Interactive Editorial & Magazine Typography** | Medium-style Text Annotation/Highlighting layer, Multi-column layout (`column-count`), Z-Index Stacking Context, Vertical Text (`writing-mode: vertical-rl`). |
 
diff --git a/doc/CSS_PROPERTIES_MATRIX.md b/doc/CSS_PROPERTIES_MATRIX.md
index 0a65ac3..a82d480 100644
--- a/doc/CSS_PROPERTIES_MATRIX.md
+++ b/doc/CSS_PROPERTIES_MATRIX.md
@@ -1,7 +1,7 @@
 # CSS Properties Support Matrix
 
-Last Updated: October 4, 2026
-Version: 1.12.0
+Last Updated: October 8, 2026
+Version: 1.13.0
 
 This document lists CSS property support in HyperRender.
 
diff --git a/doc/MIGRATION_GUIDE.md b/doc/MIGRATION_GUIDE.md
index 2d8f97a..d841735 100644
--- a/doc/MIGRATION_GUIDE.md
+++ b/doc/MIGRATION_GUIDE.md
@@ -1,6 +1,17 @@
 # Migration Guide
 
-> **Current version: v1.12.0**
+> **Current version: v1.13.0**
+
+## Upgrading to v1.13.0
+
+No breaking changes. New: `RenderHyperBox.getBoxesForCharRange` and `debugLineFragments` ([#26](https://github.com/brewkits/hyper_render/pull/26)). Two small `text-overflow: ellipsis` changes: selecting truncated text no longer highlights the `…` glyph, and a line where not even one character fits before the ellipsis now shows `…` instead of staying empty.
+
+**Line breaking changed in a few cases**, so wrapped text can land on different lines than in 1.12.0: lines no longer overflow the box by part of a glyph (most visible in CJK), RTL paragraphs wrap properly, `word-break` / `overflow-wrap` on a block now apply to its text, an over-long word breaks after as many characters as fit, a word that doesn't fit beside a float moves below it, lines no longer start one space in after `
` or an indented tag, and centered / right-aligned lines no longer count trailing spaces. If you have pixel tests of wrapped text, expect to regenerate them. + +```yaml +dependencies: + hyper_render: ^1.13.0 +``` ## Upgrading to v1.12.0 @@ -216,6 +227,9 @@ These APIs are stable and will remain backward-compatible in v2.0: ## Version History +### v1.13.0 (October 2026) +- `RenderHyperBox.getBoxesForCharRange` / `debugLineFragments`, ellipsis character-count fix ([#26](https://github.com/brewkits/hyper_render/pull/26)) + ### v1.12.0 (October 2026) - Dark-surface colors for links, `
`, `` / `
` and `` ([#23](https://github.com/brewkits/hyper_render/issues/23))
 
diff --git a/doc/ROADMAP.md b/doc/ROADMAP.md
index a03ac6e..54db51c 100644
--- a/doc/ROADMAP.md
+++ b/doc/ROADMAP.md
@@ -1,7 +1,7 @@
 # HyperRender — Product Roadmap
 
-**Last Updated**: 2026-10-03
-**Current Stable**: v1.12.0
+**Last Updated**: 2026-10-08
+**Current Stable**: v1.13.0
 **Repository**: [github.com/brewkits/hyper_render](https://github.com/brewkits/hyper_render)
 
 This document tracks the long-term direction of the HyperRender ecosystem.
@@ -33,6 +33,7 @@ For detailed CSS property tracking, see [`CSS_PROPERTIES_MATRIX.md`](CSS_PROPERT
   `hyper_render_markdown`, `hyper_render_highlight`, `hyper_render_clipboard`
 - **`hyper_render_devtools` v1.0.0** — UDT Tree inspector, Computed Style panel, Layout fragment/line data, demo mode (no live app required); published to pub.dev
 - **`hyper_render_devtools` v1.8.0** (2026-10-02) — the panel actually connects now (#17), plus Timeline, Selection debugger, live CSS-variable editing and JSON snapshot export. Requires `hyper_render_core` 1.10.0.
+- **Character-range highlight geometry** (1.13.0) — `RenderHyperBox.getBoxesForCharRange` returns line-aligned rects for any character range (search hits, annotations), and `debugLineFragments()` exposes laid-out fragment geometry; `text-overflow: ellipsis` no longer counts the `…` glyph as a source character (#26, by @DrkXo).
 - **Dark-surface element colors** (1.12.0) — links, `
`, `` / `
` and `` switch to dark-surface variants (>= 4.5:1) when the effective text color is light (#23).
 - **Dark mode & root colors** (1.11.0) — unstyled text follows a dark `Theme`, `HyperViewer(textColor:)` / `EpubReader(textColor:)`, `body`/`html` `color` honoured, `:root` matches only the document root, readable text on light UA surfaces (#20). Block plugins on custom tags (``) now render (#22).
 - **Stylesheet CSS correctness** (core 1.10.0) — `var()`, `url()`, `calc()` in `