From 052475b767edb1287d97fd99963098c9735b6b29 Mon Sep 17 00:00:00 2001 From: Gregory Moskaliuk Date: Sat, 25 Apr 2026 09:26:15 +0200 Subject: [PATCH] docs: add selectionColor + selectionHandleColor to API reference --- docs/API_REFERENCE.md | 16 ++++++++++++++++ docs/MACOS.md | 1 + docs/WEB.md | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/API_REFERENCE.md b/docs/API_REFERENCE.md index c02faaa2..462bfaa5 100644 --- a/docs/API_REFERENCE.md +++ b/docs/API_REFERENCE.md @@ -105,6 +105,22 @@ Whether text can be selected. | --------- | ------------- | -------- | | `boolean` | `true` | Both | +### `selectionColor` + +Color of the text selection highlight. On iOS, this also affects the caret and selection handle colors (they share a single tint). On macOS, only the selection background is affected. On Android, use `selectionHandleColor` to override the handle color independently. + +| Type | Default Value | Platform | +| ------------ | ------------- | ------------------ | +| `ColorValue` | - | Both, macOS, Web | + +### `selectionHandleColor` + +Color of the selection handles (drag anchors). No-op on Android API levels below 29. + +| Type | Default Value | Platform | +| ------------ | ------------- | -------- | +| `ColorValue` | - | Android | + ### `md4cFlags` Configuration for md4c parser extension flags. diff --git a/docs/MACOS.md b/docs/MACOS.md index 10e8c044..af0fb371 100644 --- a/docs/MACOS.md +++ b/docs/MACOS.md @@ -12,6 +12,7 @@ These will be addressed in upcoming releases: - **Tail fade-in animation** falls back to instant reveal (no `CADisplayLink` on macOS) - **VoiceOver** accessibility is stubbed (pending `NSAccessibility` implementation) - **Font scale observation** does not respond to system font size changes +- **`selectionColor`** affects only the selection background. The iOS-style caret + handle tinting isn't available on macOS, since AppKit's `NSTextView` doesn't expose them via `tintColor`. ## Example app diff --git a/docs/WEB.md b/docs/WEB.md index a34c4118..fc744894 100644 --- a/docs/WEB.md +++ b/docs/WEB.md @@ -11,7 +11,7 @@ All core `EnrichedMarkdownText` features are supported on web, including: - Full GFM: tables (with horizontal scroll), task lists (with checkbox interaction), strikethrough, links, images (block and inline), code blocks, LaTeX math (block and inline) - All `markdownStyle` customisation options - `onLinkPress`, `onLinkLongPress` (mapped to `contextmenu` event), `onTaskListItemPress` callbacks -- `allowTrailingMargin`, `containerStyle`, `selectable`, `md4cFlags` (`underline`, `latexMath`) +- `allowTrailingMargin`, `containerStyle`, `selectable`, `selectionColor`, `md4cFlags` (`underline`, `latexMath`) - RTL support via the `dir` prop (CSS logical properties automatically flip blockquote borders, list indentation, etc.) ### Accessibility @@ -39,6 +39,7 @@ The web implementation also exports `WebMarkdownTextProps` which extends `Enrich | `allowFontScaling` / `maxFontSizeMultiplier` | React Native text scaling props. Browsers handle font scaling natively via OS accessibility settings. | | `streamingAnimation` | Native-only tail fade-in animation. Not yet implemented on web. | | `contextMenuItems` | Not supported — browsers don't allow extending the native context menu. | +| `selectionHandleColor` | Android-only — desktop browsers don't render selection handles. | ## Not supported on web