drawnui-react 0.1.0-preview.42 → 0.1.0-preview.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -49,6 +49,48 @@ property names, layout and drawing rules. What you learn here works there, and s
49
49
 
50
50
  DrawnUI is MIT licensed in every language and on every platform: desktop, mobile, web and embedded devices. Ship it in commercial products with no attribution badge, no about screen and no per-device royalty.
51
51
 
52
+ ## What's new in 0.1.0-preview.44
53
+
54
+ - **3D add-on 0.1.0-preview.44:** pictures on 3D models are drawn smooth, with their mipmaps and anisotropic
55
+ filtering (images on materials, the product box of the [demo](https://add3dreact.drawnui.net)).
56
+ - **FPS counter:** the FPS counter shows the real frame rate: `SkiaLabelFps` keeps the canvas drawing while it is
57
+ shown, as in DrawnUI for .NET and Rust.
58
+
59
+ ## What's new in 0.1.0-preview.43
60
+
61
+ - **3D add-on:** [`drawnui-react-add3d`](https://www.npmjs.com/package/drawnui-react-add3d) puts real 3D inside the
62
+ drawn UI: glTF models with their animations, a product viewer that turns, zooms and resets, many animated
63
+ characters on a 2D field in one pass, shapes made in code, Lit, Toon and Flat looks. Live demo:
64
+ [add3dreact.drawnui.net](https://add3dreact.drawnui.net), article:
65
+ [drawnui.net/articles/add3d.html](https://drawnui.net/articles/add3d.html).
66
+ - **Text selection:** selectable labels (`AccessibilityTextSelectable`) select as in DrawnUi.Net, drawn in
67
+ `SkiaLabel.TextSelectionColor`: a mouse drag (across several labels, in reading order), a double click for a word, a
68
+ long press on touch with a Copy button; Ctrl+C copies, and the context menu sees the selection
69
+ (`canvas.SelectedText`, `CopyTextSelection()`, `ClearTextSelection()`).
70
+ - **Long press on touch:** a long press raises the context menu on phones and tablets too, in every browser; on
71
+ selectable text it selects the word first, or keeps the selection it presses on.
72
+ - **Long press time:** 0.75 s, the same in every DrawnUI engine; set it with `TouchEffect.LongPressTimeMsDefault`.
73
+ - **Text fields on phones:** a tap opens the on-screen keyboard at once, its return key ends editing in a single-line
74
+ field, and a keyboard the user closed stays closed while the page scrolls.
75
+ - **Fields above the keyboard:** `SkiaScroll.AdaptToKeyboardAuto` (opt-in, with `AdaptToKeyboardGap`) keeps the focused
76
+ field above the on-screen keyboard, the last field of a form too.
77
+ - **Double tap:** a double tap reaches the controls as two taps in iOS Safari too, and counts by when the taps
78
+ happened, so it holds while frames are busy (a 3D viewer's reset).
79
+ - **Screen readers:** the texts inside a button, radio, switch, tab or image are read once, as the control's name;
80
+ inside a scroll the reading and Tab order follow the content.
81
+ - **Password fields:** screen readers hear a password field's placeholder, never the typed text.
82
+ - **React 19.2:** the package declares React 19.2 or newer, the version its renderer runs on.
83
+ - **Right click in a text field:** a right click keeps the caret and the selection, so the context menu sees what was
84
+ selected.
85
+ - **Mouse wheel over text fields:** a focused text field no longer stops the mouse wheel: the page scrolls over the field
86
+ and around it.
87
+ - **Tab at typing speed:** Tab moves on at typing speed when focus scrolls the page.
88
+ - **Reading and Tab order:** the reading and Tab order of a page stays the same while it scrolls: Tab after the last
89
+ control comes back to the top.
90
+ - **Keyboard focus:** when the control with the keyboard focus disappears, the focus moves to the next control.
91
+ - **`FillBlendMode`** on controls and shapes.
92
+ - **Image loads:** a cancelled image load reports a cancel, as in DrawnUi.Net.
93
+
52
94
  ## What's new in 0.1.0-preview.42
53
95
 
54
96
  - **Images:** images that show the same file or URL share one decoded copy; image memory stays within a budget
@@ -265,13 +307,13 @@ label readable and every button focusable without touching each control.
265
307
  The overlay has `pointer-events: none`, so hover and all pointer gestures still reach the canvas — the
266
308
  Blazor "accessible control loses hover" limitation does not apply.
267
309
 
268
- Text selection (React extension, opt-in): `AccessibilityTextSelectable` on a `SkiaLabel` renders its laid-out lines
269
- as real, invisible DOM text in the overlay — one span per drawn line, in the same font (registered fonts are also
270
- installed as CSS `FontFace`s) and stretched to the drawn line width — with pointer events on. The browser then
271
- selects, copies (Ctrl+C / context menu) and reads it like an HTML paragraph, and the wheel over it still scrolls the
272
- drawn content. It is off by default and must stay off on anything gesture-driven (buttons, carousels, drawers): the
273
- selectable text owns the pointer, so taps and pans under it never reach the drawn control. Everything else in the
274
- overlay is `user-select: none`, so select-all only highlights opted-in text.
310
+ Text selection (opt-in, as DrawnUi.Net): `AccessibilityTextSelectable` on a `SkiaLabel` lets the user select and copy
311
+ its text, drawn by the label in `SkiaLabel.TextSelectionColor`. Mouse: drag (across several labels in reading order, a
312
+ drag held past a scroll's edge scrolls it), double click for a word; Ctrl+C / Cmd+C copies, a click elsewhere clears.
313
+ Touch: a long press selects a word and shows a drawn Copy button; drag to extend. A right click or a long press raises
314
+ the control's `ContextMenu` with the selection kept (`canvas.SelectedText`, `CopyTextSelection()`,
315
+ `ClearTextSelection()`). The label takes the mouse press for this, so keep it off on labels inside gesture-driven
316
+ controls. The overlay stays for screen readers and the keyboard only: nothing in it is ever selected in the DOM.
275
317
 
276
318
  ## Crawlers and AI agents: static HTML from the accessibility tree
277
319
 
package/SKIPPED.md CHANGED
@@ -10,7 +10,7 @@ DrawnUi name and semantics; nothing here is a redesign, only an omission.
10
10
  | `UseCache` | partial | `None`, `Operations` / `OperationsFull` (SkPicture replay), `Image` (offscreen surface snapshot, GPU-backed on WebGL, nearest-sampled blit), `ImageDoubleBuffered` (`RenderObjectPrevious` kept and drawn when a new cache cannot be produced yet, `DrawPlaceholder(ctx)` hook when there is none; recording itself is synchronous — no background thread, same as DrawnUi.Blazor with `CanUseCacheDoubleBuffering = false`), `ImageComposite` / `ImageCompositeGPU` (per-child composite, see the `UseCache="ImageComposite"` row below). `GPU` resolves to `Image` and `ImageCompositeGPU` to `ImageComposite`: no separate GPU-only path. `Super.CacheEnabled`, `RenderObject`/`CachedObject`, `InvalidateCache`, `DestroyRenderingObject`, `Canvas.DisposeObject` (deleted after flush). Defaults per C#: `SkiaLabel`/`SkiaSvg` Operations, everything else None. Not ported: `CacheSharing`, `AllowCaching`, offscreen bake threads, cache validity by GRContext. |
11
11
  | Incremental invalidation | partial | `Measure` returns the previous size when `!NeedMeasure` and constraints+scale are unchanged; `Update()`/`InvalidateMeasure()` bubble up and stale every ancestor cache; `Repaint()` keeps caches. Arrange still runs per frame for the whole tree; no dirty regions, no `DirtyChildrenTracker`. Post-animators on a control nested INSIDE a cached ancestor are drawn only when that ancestor re-records. |
12
12
  | Gestures core: `Canvas.Gestures` (Disabled/Enabled/Lock), `ProcessGestures(args, apply)`, `ConsumeGestures`, `Tapped`/`ChildTapped`, `InputTransparent`, `BlockGesturesBelow`, `LockChildrenGestures`, `HitBoxAuto`/`HitIsInside`/`IsGestureForChild`, `SkiaGesturesParameters`/`GestureEventProcessingInfo`/`SkiaGesturesInfo`/`ControlTappedEventArgs` | ported | Pointer events -> per-pointer `OnTouchAction` state machine (port of DrawnUi.Blazor) -> Down/Panning/Tapped/Up, queued and processed at frame start. Tap slop = 16pt like AppoMobi TouchEffect. The control that consumes a gesture keeps receiving it until it lets go (DrawnUi `Canvas.HadInput`, one pointer here instead of C#'s set): without it a drag handle, a slider thumb or a held button stops getting `Panning` the moment the finger leaves its box, and a control that stops consuming hands routing straight back to the tree (a button whose press turns into a scroll pan). Every mouse button is delivered (`Event.Pointer`: `Button`, `ButtonNumber`, `DeviceType`, `PressedButtons`, the AppoMobi.Gestures PointerData): a right click is Down / Up / Tapped with `Button` "Right" plus a `ContextMenu`; handlers that must be primary-only check `e.Parameters.Event.Pointer?.Button`. |
13
- | Gestures: `Pointer` (routed as a gesture; hover itself is ported, see `ReceivesHover`; `LongPressing` is produced since 2026-10-10: `Canvas.LongPressTimeMs` 1500 held still, no Tapped after it), `SoftLock`, `AddGestures` attached props, `OnGestures` delegate | skipped | The enum members exist for parity and are never produced. Multi-touch is ported: a Panning while two or more fingers are down carries `Manipulation` (AppoMobi ManipulationInfo: pinch scale, turn, center, totals, finger count) and a press that had a second finger is no tap. Ported instead of skipped: velocity (`Gestures.ts` fills `Distance.Velocity` per move, the scroll / snapping physics run on it) and transform-aware mapping — a child receives the point through the inverse `RenderTransformMatrix` (`TransformPointToLocalSpace`), so rotated / scaled / translated controls hit-test correctly. `ChildOffset` stays zero because that inverse matrix replaces the C# cache-offset math (`TranslateInputCoords`), not because transforms are missing. `Wheel` IS produced (`Canvas.onWheel`). |
13
+ | Gestures: `Pointer` (routed as a gesture; hover itself is ported, see `ReceivesHover`; `LongPressing` is produced: held still for `TouchEffect.LongPressTimeMsDefault` (AppoMobi name, 750 ms, settable; `Canvas.LongPressTimeMs` is its alias), no Tapped after it), `SoftLock`, `AddGestures` attached props, `OnGestures` delegate | skipped | The enum members exist for parity and are never produced. Multi-touch is ported: a Panning while two or more fingers are down carries `Manipulation` (AppoMobi ManipulationInfo: pinch scale, turn, center, totals, finger count) and a press that had a second finger is no tap. Ported instead of skipped: velocity (`Gestures.ts` fills `Distance.Velocity` per move, the scroll / snapping physics run on it) and transform-aware mapping — a child receives the point through the inverse `RenderTransformMatrix` (`TransformPointToLocalSpace`), so rotated / scaled / translated controls hit-test correctly. `ChildOffset` stays zero because that inverse matrix replaces the C# cache-offset math (`TranslateInputCoords`), not because transforms are missing. `Wheel` IS produced (`Canvas.onWheel`). |
14
14
  | C# multi-subscriber `event`s | changed shape | One callback per event prop (`Tapped={fn}`), same names. `Command*` (ICommand) variants not ported. |
15
15
  | `Opacity`, `TranslationX/Y`, `Rotation`, `ScaleX/Y` (+`Scale`), `SkewX/Y`, `RotationX/Y/Z`, `TranslationZ`, `AnchorX/Y`, `HasTransform`, `RenderTransformMatrix`, `TransformPointToLocalSpace` | ported | Same matrix order as C# `ApplyTransforms` (pivot → rotation → scale/skew → 3D → translation; 3D = C# `Create3dMatrix`, camera 576 px, TranslationZ as depth), image caches drawn smooth once the final matrix distorts them (C# `WillDrawDistorted`, a picture holding image blits records again when its playback turns distorted or straight), opacity = `saveLayer` alpha over the subtree, gestures mapped through the inverse matrix (`IsGestureForChild`, child receives the local point), accessibility rect = transformed bounds. Animations: `AnimateAsync`, `AnimateRangeAsync`, `FadeToAsync`, `ScaleToAsync`, `TranslateToAsync`, `RotateToAsync` as Promises with `AbortSignal` (one running per kind, like the C# per-property cancellation). Not ported: `Perspective1/2`, `CameraAngle`, `LinkTransforms`, `AddTranslationX/Y`, `UseTranslation*` overrides, `CustomizeLayerPaint`, `SkipRenderingOutOfBounds`. |
16
16
  | `Left` / `Top` | ported (as a translate) | Same paint-time offset in points, but folded into the render matrix (a `canvas.translate`, hit-testing follows) for every control, cached or not; C# applies them only when blitting a cache. |
@@ -19,7 +19,7 @@ DrawnUi name and semantics; nothing here is a redesign, only an omission.
19
19
  | Disposal (`Dispose` / `OnDisposing`) | ported | The React renderer calls `Dispose()` when an element leaves the tree (`detachDeletedInstance`): caches, gradient shaders, running `*ToAsync` animations, overlay effects, the accessibility node, then the children (static and templated pool); `SkiaScroll`/`SnappingLayout` stop their animators, `SkiaSvg` drops its raster, `SkiaLottie`/`SkiaGif` free the Skottie animation / frames; `Canvas.Dispose` disposes the content. Not ported: `IsDisposing` staged disposal, `Disposing` event, `OnWillDisposeWithChildren`. |
20
20
  | Hover: `ReceivesHover` (opt-in; on by default in SkiaButton, SkiaSlider, the toggles, SkiaRadioButton, SkiaCarousel, SkiaDrawer), `IsHovered`, `HoverChanged` (turns `ReceivesHover` on, as C# `OnHovered`) | ported | drawnui-cross 6m: every opted-in control under the mouse is hovered; nothing changes while a scroll, carousel or drawer moves its content, one check at the last pointer position when it stops and after an add / remove, a rebind, a hidden hovered control or an instant scroll jump; pointerleave clears at once; touch never hovers (`Canvas.Hover`, a `HoverManager`). Not ported: C# `SetHover`, `CheckHovered` / `OnHover` / `IsPointerOver` (no Pointer gestures are routed), SkiaSpinner / wheel picker (no such controls). |
21
21
  | `KeyboardManager` | ported | Window-level keydown / keyup capture listeners like `drawnui-keyboard.js`: `KeyDown` / `KeyUp` with the DOM `event.code` ("KeyA", "ArrowLeft"; C# maps the same codes to `InputKey`), `KeyChar` for printable keys without Ctrl / Alt / Meta, `IsShiftPressed` / `IsControlPressed` / `IsAltPressed`, `AttachToKeyboard` (idempotent, pointerdown pulls window focus inside iframes), `BlurExternalTextInput`, `IsOwnedByElement` / `IsInputMethodKey` (React additions: a handler acting on keys skips keys a focused DOM element or the input method owns, C# 845b26e9); `Subscribe` / `Unsubscribe` instead of C# events. Not ported: `InputKey` enum (codes are strings). |
22
- | `SkiaEditor` | partial | SkiaShape host with padding, content `SkiaLabel` (single-line: `HorizontalTextAlignment` Center / End get the field as the label's minimum width, so short text centers and long text still scrolls), placeholder label, caret (blinking 1 s, `CursorColor`, `CanShowCursor`) and selection overlay (`SelectionColor`) painted by the editor, single line (`MaxLines` 1, scrolls horizontally to the caret) / multiline (`MaxLines` != 1, `AutoHeight`) with own scroll offsets instead of the C# inner `SkiaScroll`; `Text` (line breaks normalized, spaces for single line), `PlaceholderText/Color/HorizontalAlignment`, `FontSize` (12) / `FontFamily` / `FontWeight` / `TextColor` / `TextGradient` / `LineHeight` / `Horizontal|VerticalTextAlignment`, `IsPassword` (bullets), `ReturnType` (Send submits multiline), `KeyboardType` / `IsSpellCheckEnabled` / `UseMarkdown` / `UseUnicode` accepted, `CursorPosition`, `SelectionLength`, `IsFocused` (one focused editor at a time), `ControlStyle` (C# `ApplyControlStyleVisuals` palettes over unset values), events `TextChanged` / `FocusChanged` / `CursorMoved` / `TextSubmitted`, `Submit` / `SelectAll` / `SetSelection` / `SelectWord` / `GetSelectedText` / `DeleteSelection` / `InsertAtCursor` / `CutSelection` / `CopySelection` / `PasteFromClipboard` (navigator.clipboard), the Blazor head stubs `StubTypeText` / `StubPressEnter` / `StubBackspace` / `StubDelete` (grapheme clusters via Intl.Segmenter) / `StubMoveCursor` / `StubSelectRange` / `StubSelectAll` / `HandleVerticalArrow`, Ctrl+A / C / X / V, Home / End, Escape blurs, tap places the caret, drag selects, long press selects a word, shift + tap extends. Keys come from `KeyboardManager` like the Blazor / Wasm heads; on top of that (not in DrawnUi.Blazor) a focused editor is mirrored by a hidden DOM textarea (`TextInputProxy`, `inputmode` from `KeyboardType`, `enterkeyhint` from `ReturnType`) so IME composition, the mobile soft keyboard, autocorrect and native paste / cut / undo reach the editor: every input event is diffed against the editor text and replayed through `StubSelectRange` + `StubTypeText` / `StubBackspace` / `StubPressEnter`; while the proxy holds DOM focus, Backspace / Delete / Enter / Ctrl+C / X / V key events are left to it. iOS may need a second tap for the keyboard (focus() runs on the next frame, outside the touch handler). Not ported: `SkiaCursor` control + `CursorGradient`, `SkiaEditorSelection` handles, `Superview.FocusedChild`, `CommandOn*`, `SkiaEditorDocument` (rich formatting), single-line Enter clearing focus (Blazor keeps it). Right-to-left and mixed text: a single-line field starts a right-to-left paragraph at its right edge; the caret, taps, Left / Right (visual moves) and the selection follow the screen, stops at grapheme boundaries (drawnui-cross 6ak, same rules as DrawnUi.Rust). |
22
+ | `SkiaEditor` | partial | SkiaShape host with padding, content `SkiaLabel` (single-line: `HorizontalTextAlignment` Center / End get the field as the label's minimum width, so short text centers and long text still scrolls), placeholder label, caret (blinking 1 s, `CursorColor`, `CanShowCursor`) and selection overlay (`SelectionColor`) painted by the editor, single line (`MaxLines` 1, scrolls horizontally to the caret) / multiline (`MaxLines` != 1, `AutoHeight`) with own scroll offsets instead of the C# inner `SkiaScroll`; `Text` (line breaks normalized, spaces for single line), `PlaceholderText/Color/HorizontalAlignment`, `FontSize` (12) / `FontFamily` / `FontWeight` / `TextColor` / `TextGradient` / `LineHeight` / `Horizontal|VerticalTextAlignment`, `IsPassword` (bullets), `ReturnType` (Send submits multiline), `KeyboardType` / `IsSpellCheckEnabled` / `UseMarkdown` / `UseUnicode` accepted, `CursorPosition`, `SelectionLength`, `IsFocused` (one focused editor at a time), `ControlStyle` (C# `ApplyControlStyleVisuals` palettes over unset values), events `TextChanged` / `FocusChanged` / `CursorMoved` / `TextSubmitted`, `Submit` / `SelectAll` / `SetSelection` / `SelectWord` / `GetSelectedText` / `DeleteSelection` / `InsertAtCursor` / `CutSelection` / `CopySelection` / `PasteFromClipboard` (navigator.clipboard), the Blazor head stubs `StubTypeText` / `StubPressEnter` / `StubBackspace` / `StubDelete` (grapheme clusters via Intl.Segmenter) / `StubMoveCursor` / `StubSelectRange` / `StubSelectAll` / `HandleVerticalArrow`, Ctrl+A / C / X / V, Home / End, Escape blurs, tap places the caret, drag selects, long press selects a word, shift + tap extends. Keys come from `KeyboardManager` like the Blazor / Wasm heads; on top of that (not in DrawnUi.Blazor) a focused editor is mirrored by a hidden DOM textarea (`TextInputProxy`, `inputmode` from `KeyboardType`, `enterkeyhint` from `ReturnType`) so IME composition, the mobile soft keyboard, autocorrect and native paste / cut / undo reach the editor: every input event is diffed against the editor text and replayed through `StubSelectRange` + `StubTypeText` / `StubBackspace` / `StubPressEnter`; while the proxy holds DOM focus, Backspace / Delete / Enter / Ctrl+C / X / V key events are left to it. On touch the field takes the keyboard inside the tap that focuses it (iOS opens it only then), and a touch elsewhere never reopens a keyboard the user closed. Not ported: `SkiaCursor` control + `CursorGradient`, `SkiaEditorSelection` handles, `Superview.FocusedChild`, `CommandOn*`, `SkiaEditorDocument` (rich formatting). Enter in a single-line field: the soft keyboard's return key (done / go / search / send) of a field focused by a tap ends editing and closes the keyboard, as a MAUI single-line field; a physical keyboard's Enter keeps the field focused, as DrawnUi.Blazor. Right-to-left and mixed text: a single-line field starts a right-to-left paragraph at its right edge; the caret, taps, Left / Right (visual moves) and the selection follow the screen, stops at grapheme boundaries (drawnui-cross 6ak, same rules as DrawnUi.Rust). |
23
23
  | `SkiaSprite` / `SkiaSpriteSet` | ported | Sprite: `Source` (sheets cached per source, `CachedSpriteSheets`), `Columns` / `Rows` / `MaxFrames`, `FramesPerSecond` (24), `FrameSequence` / `AnimationName` + `CreateAnimationSequence` / `RegisteredAnimations`, `CurrentFrame`, `TotalFrames` / `DurationMs` / `FrameDurationMs` / `FrameWidth` / `FrameHeight`, `ApplyPlacementConfig` (units-per-pixel, size, anchor, offset = C# SpriteFrameImage ResolveFrameMetrics), transparent frame borders trimmed per frame (pixels read once), nearest sampling, AspectFit of the frame, `DisplayRect`, `Success` / `Error`, the AnimatedFramesRenderer playback. Set: `State`, `Define(state, source, columns, rows, fps, repeat, autoPlay, placement)`, `CurrentSprite`, `OnChangeState` hook, hit box from the drawn frame. Not ported: `Display` as a separate SkiaImage child (`SpriteFrameImage`) and the standalone `SkiaSprite(display)` ctor, `RescalingQuality` other than None, `InflateAmount`, `ClearCache` / `RemoveFromCache` (SkiaImageManager owns the images), `SkiaSpriteSet.InvalidateInternal`. Code-behind subclasses (FastRepro `WarriorSprite`) mount through a ref + `AddSubView` and are disposed by the mounting effect. |
24
24
  | `IsClippedToBounds`, `ClipEffects` | ported | Clip to `DrawingRect` around content, children and post-animators; `ClipEffects=false` grows the clip by the aggregated effects margin so a child's shadow/glow can escape. Layouts aggregate their children's effects margins (C# `AggregatedEffectsMarginPixels`), cached per control and reset by `InvalidateMeasure`. Not ported: `Clipping` callback, `ClipWith`, `ClipFrom`, platform clips; C# currently ignores `ClipEffects` in its render path (always expands). |
25
25
  | `Padding` on base `SkiaControl` | skipped | Only `SkiaLayout.Padding` exists. |
@@ -29,7 +29,7 @@ DrawnUi name and semantics; nothing here is a redesign, only an omission.
29
29
  | `LockRatio` | ported | Same as C#: a single set `WidthRequest`/`HeightRequest` drives both sides (`CalculateSizeRequest`), otherwise the constraints are locked with `SmartMax`/`SmartMin` × \|ratio\| (sign decides larger/smaller side, infinite side loses). |
30
30
  | `HorizontalFillRatio`/`VerticalFillRatio` | ported | Applied at arrange like C# `DefineAvailableSize` (the Fill box is scaled, alignment stays inside the full box); measure is not affected (C# passes `useModifiers=false` there too). |
31
31
  | `ZIndex` | ported | Static children of a layout are drawn in ZIndex order (stable for equal values), gestures go to the top-most first; the sorted list is cached until a child or a ZIndex changes (C# `GetOrderedSubviews`). Templated cells keep index order. |
32
- | `FillGradient`, `SkiaShape.StrokeGradient` | ported | `SkiaGradient` as a plain object: `Type` Linear (Start/End ratios or CSS `Angle`), Circular / Conical (radius = half the smaller side), Oval (radial scaled to the box), Sweep (around the center, `Value1`/`Value2` angles), `ColorPositions`, `TileMode`, `Light` (< 1 darker: red, green and blue × `Light`, as C# `MakeDarker`; > 1 lighter: HSL lightness × `Light`, clamped, hue and saturation kept, as .NET MAUI `AddLuminosity` and C# f77136c4), `Opacity`, `BlendMode`; C# `SetupGradient` paint setup (white base); shaders cached per gradient object and rect (C# `Version` cache: a new React literal replaces the old shaders). On a `SkiaLabel` it goes to one place (C# 9637994b): the background when the label has a `BackgroundColor` (its text keeps `TextColor`), else the glyphs. `SkiaLabel.FillGradient` paints the glyphs (`GradientByLines` default true = per line bounds, false = the text block) and the background only when `BackgroundColor` is set, like the C# label override. `SkiaLabel` text stroke (`StrokeColor`, `StrokeWidth` points, `StrokeGradient`) and drop shadow (`DropShadowColor`, `DropShadowSize`, `DropShadowOffsetX/Y`) in the C# order shadow → stroke → fill, measurement inflated by stroke × 2 and shadow size + offset like C#. Not ported: `Background` MAUI brushes, `FillBlendMode`. |
32
+ | `FillGradient`, `SkiaShape.StrokeGradient` | ported | `SkiaGradient` as a plain object: `Type` Linear (Start/End ratios or CSS `Angle`), Circular / Conical (radius = half the smaller side), Oval (radial scaled to the box), Sweep (around the center, `Value1`/`Value2` angles), `ColorPositions`, `TileMode`, `Light` (< 1 darker: red, green and blue × `Light`, as C# `MakeDarker`; > 1 lighter: HSL lightness × `Light`, clamped, hue and saturation kept, as .NET MAUI `AddLuminosity` and C# f77136c4), `Opacity`, `BlendMode`; C# `SetupGradient` paint setup (white base); shaders cached per gradient object and rect (C# `Version` cache: a new React literal replaces the old shaders). On a `SkiaLabel` it goes to one place (C# 9637994b): the background when the label has a `BackgroundColor` (its text keeps `TextColor`), else the glyphs. `SkiaLabel.FillGradient` paints the glyphs (`GradientByLines` default true = per line bounds, false = the text block) and the background only when `BackgroundColor` is set, like the C# label override. `SkiaLabel` text stroke (`StrokeColor`, `StrokeWidth` points, `StrokeGradient`) and drop shadow (`DropShadowColor`, `DropShadowSize`, `DropShadowOffsetX/Y`) in the C# order shadow → stroke → fill, measurement inflated by stroke × 2 and shadow size + offset like C#. `FillBlendMode` (the background fill's blend mode; on a `SkiaShape` it also wins over the gradient's own, as C#). Not ported: `Background` MAUI brushes. |
33
33
  | `SkiaShell` | partial | An engine control in `drawnui-react/core` (`new SkiaShell()`, `Routes` / `RootContent` / popups / modals / toasts take controls or factories, usable without React); the JSX `<SkiaShell>` is a thin wrapper over it that renders JSX content through portals. `Routes` (route -> JSX page factory), `GoToAsync(route, animated)` / `GoBackAsync(animated)` / `PopToRootAsync` with the SkiaViewSwitcher slide (`PagesAnimationSpeed` 200 ms, pushed pages opaque over the page below, lower pages hidden when idle), `NavigationStack`, `CanGoBack`, `Route`, nav bar with Back + title, `useShell()`; `OpenPopupAsync(content, { animated, closeWhenBackgroundTapped, showOverlay, backgroundColor })` (C# PopupWrapper: dimmed backdrop, scale 0.5→1 + fade over `PopupsAnimationSpeed`, tap outside the content closes), `ClosePopupAsync`, `CloseAllPopups`; `PushModalAsync(content, { useGestures, animated, freezeBackground })` (C# ModalWrapper: full-screen `SkiaDrawer` FromBottom HeaderSize 0, drag-to-close with `useGestures`), `PopModalAsync`; `ShowToast(text | content, ms)` (C# layout: bottom banner, slide + fade 300/250 ms, `ShellDefaults.Toast*`), `CloseAllToasts`; `PopupsCount`/`ModalsCount`/`ToastsCount`; `ShellDefaults` = the C# statics (`PopupBackgroundColor`, `PopupsBackgroundBlur`, `PopupsAnimationSpeed`, `PopupsCancelAnimationsAfterMs`, `ZIndex*`, `Toast*`, tab colors); popups/modals sit on a `SkiaBackdrop` (blur + tint); `Tabs` (C# SkiaViewSwitcher tabs: bottom tab bar, per-tab page stacks, `SelectedTab`, `SelectTabAsync`, `PopTabToRootAsync`); `GoBackAsync` follows C# `GoBackDefault` (top popup, then modal, then page); React extension `UseBrowserHistory` (default true): pages in the URL hash `#/a/b`, one history entry per page / popup / modal, browser Back unwinds in the same order, deep links restore the page stack. Not ported: `NavigationLayout` view switcher, frozen-screenshot backgrounds, `pixelsScaleInFrom`, `RegisterRoute` by type, `IHandleGoBack`, `PushAsync(page instance)`; `AnimateTabs` + `TabsAnimationSpeed` (150) ported with the C# SelectLeftTab/SelectRightTab slide (0.75 width, fade, back-ease 0.55) — only the tab roots animate, pages pushed inside the leaving tab drop instantly. Browser history: a `popstate` at the same depth with another hash (a plain `<a href="#/route">` link, a typed hash) rebuilds the stack like a forward navigation. |
34
34
  | Styles / `ConfigureStyles` | ported | `Super.UseDrawnUi().ConfigureStyles(styles => styles.AddStyle({ TargetType, ApplyToDerivedTypes, Setters }))`, the C# `Style` shape with the `Setter` list written as a plain object (`Setters: { FontFamily: "FontText" }`) because controls hold plain properties instead of BindableProperty. Per-class resolution cached, base-type styles applied furthest-first so the nearest wins, exact type last (C# `ResolveStylesForType`). Applied by the reconciler between `new` and the JSX props, so props override; a control built in code-behind is styled on its first `Measure` and keeps values that differ from its class defaults (the React stand-in for C# `ExplicitPropertiesSet`, which needs BindableProperty). Not ported: `BasedOn`, `Class`, `Triggers`, `Behaviors`, the per-control `Style` property, `ConditionalStyle`. |
35
35
  | Animators core: `AnimatorBase` / `SkiaValueAnimator` / `RenderingAnimator` (`IOverlayEffect`), `Canvas.RegisterAnimator`/`AnimatingControls`, `PostAnimators` + `ExecutePostAnimators`, `Easing` (Linear/Cubic*) | ported | Frame-driven: a running animator keeps frames coming, idle canvas draws nothing. An animator started before its control is attached waits in `PendingUnattachedAnimators` and starts on the control's first arrange (C# starts it in `SuperViewChanged`). Frame time = the frame's vsync timestamp, see PARITY "Animators run on vsync time". |
@@ -58,7 +58,7 @@ DrawnUi name and semantics; nothing here is a redesign, only an omission.
58
58
  | `AccessibilityModal`, `Canvas.ArrowsStartKeyboardNavigation` | ported | drawnui-cross 6av, C# 6e87c9ae / 914428d2 / 981ff09e / 86467ece / 77d1dca4 / 6aee5c51: a shown modal limits screen readers and Tab to its subtree plus popup windows (topmost wins), reads as a dialog with its name, takes the keyboard when it appears with the keyboard in use and gives it back when it goes; the flat overlay's container is the dialog (role, name, aria-modal). With nothing focused (or only a control behind the modal) and the canvas option on, an arrow starts keyboard navigation. SkiaShell popups and modals are such dialogs (the popup wrapper is no Tab stop). Live regions are read on the next frame. |
59
59
  | Keyboard navigation (drawnui-cross 6c) | ported | Through the accessibility overlay, the DrawnUi.Blazor way: Tab / Shift+Tab walk the interactive nodes in reading order, Enter / Space activate (`SkiaAccessibilityManager.Activate`), ArrowLeft / Right / Up / Down, Home / End, PageUp / PageDown go to the focused control first (`OnAccessibilityKey`, `SkiaAccessibilityManager.Key`: `SkiaSlider` steps, `SkiaEditor` keeps them while editing), then to its arrow-key group (`MoveInGroup`). A container with a composite role (`Aria.IsCompositeRole`: list, listbox, grid, toolbar, radiogroup, tablist, menu, menubar) is one Tab stop (roving tabindex, `IsTabStop`, entered on the item focused last); the arrows move by item index (Column: Up / Down, Row: Left / Right, Wrap / Grid / Split: all four, Up / Down by a row), no wrap, items not realized are scrolled in with `ScrollToIndex` and focused once drawn (`OnKeyboardFocusRequested`). `SkiaEditor` is a Tab stop: Tab in takes the caret, Tab / Shift+Tab leave it for the next node (also after a click into it). Focus ring = the overlay element's `:focus-visible` outline; focus scrolls the node into view in every enclosing scroll. Not ported: `FocusedChild` / canvas `KeyboardFocusNode`, Escape leaving the drawn nodes, a canvas-drawn focus ring. |
60
60
  | Canvas draw events | ported | `WillFirstTimeDraw` (once, right before the first frame drawn on a ready surface, with that frame's `{ Canvas, Surface }`), `WasDrawn` (after every frame, no context, like the C# `null`), `WasRendered` (set after the first frame completes, so the first `WasDrawn` still sees `false`, C# order), `CanRender` (surface ready). JSX: `<Canvas WillFirstTimeDraw WasDrawn>`; the engine draws frame 1 in its constructor, so the component hands both callbacks to the constructor's `init`. Not ported: `WillDraw`. |
61
- | Rendering stats | partial | `Canvas.FPS` (frames drawn over the last second) and `Canvas.FrameTime` (ms of the last measure + arrange + render, GPU flush excluded) are computed every frame and reachable from React through the `<Canvas>` ref. `SkiaLabelFps` ported (label on top, input-transparent, parent-independent, re-measures itself on draw; its value changes only on frames that running animators request, see PARITY). Not ported: `SkiaLabelFps.ForceRefresh` / `Format` / `MonoForDigits`, `Super.EnableRenderingStats`. |
61
+ | Rendering stats | partial | `Canvas.FPS` (frames drawn over the last second) and `Canvas.FrameTime` (ms of the last measure + arrange + render, GPU flush excluded) are computed every frame and reachable from React through the `<Canvas>` ref. `SkiaLabelFps` ported (label on top, input-transparent, parent-independent, re-measures itself on draw; it shows the value on every frame it draws and asks for the next one, so the canvas keeps drawing while it is shown, as DrawnUi.Net and Rust). Not ported: `SkiaLabelFps.ForceRefresh` / `Format` / `MonoForDigits`, `Super.EnableRenderingStats`. |
62
62
  | Insets / safe areas | ported | `Super.Insets` measures `env(safe-area-inset-*)` off a probe element (once, and again on resize / orientation), `Super.OnInsetsChanged` notifies; `SkiaShell` pads its nav and tab bars with them. Not ported: the C# per-page `IgnoreSafeArea` / MAUI inset plumbing. |
63
63
 
64
64
  ## Controls
@@ -79,17 +79,17 @@ DrawnUi name and semantics; nothing here is a redesign, only an omission.
79
79
  | `SkiaHotspot` | ported | Fill/Fill, `Tapped`, `Down`, `Up`, `LockPanning`, `TouchDown`; consumes only Tapped like the C# one. No `AnimationTapped`/ripple/shimmer. |
80
80
  | `SkiaButton` | partial | Default look only: rounded frame radius 8 (hardcoded like the C# default content), centered label, `Text`/`TextColor`/`FontSize`/`FontFamily`/`BackgroundColor`/`IsPressed`/`RespondsToGestures` (`IsDisabled` = its obsolete opposite)/`LockPanning`, `Tapped`/`Down`/`Up`. `RespondsToGestures = false`: no press, no `Tapped`/`Down`/`Up`, a press or tap on it stops there, keyboard skips it, reported disabled (drawnui-cross 6w). `IsPressed` is tracked but has no visual; press feedback = `ApplyEffect="Ripple"`. No `ButtonStyle` platform looks, icons, `TextCase`, elevation, shimmer, `BtnText`/`BtnShape` templating. |
81
81
  | `SkiaImage` | partial | Effects ported: `AddEffect` (BlackAndWhite, Grayscale (the 0.21 / 0.72 / 0.07 weights, as C# Grayscale2), Pastel, Sepia, InvertColors, Tint + `ColorTint`/`EffectBlendMode`, Darken, Lighten, Contrast, Saturation, Brightness, TSL, Gamma ≈ linear fit — CanvasKit has no table color filter), `Blur` (image filter, mirror tile), `ZoomX/ZoomY`, `HorizontalOffset/VerticalOffset`; C# color matrices use 0..255 translations, CanvasKit 0..1 — converted. `HSL` (hue from `Gamma`, `Saturation`, `Brightness`, tint blend), `Custom` = your own `PaintColorFilter` (C# public fields `PaintColorFilter` / `PaintImageFilter`, the latter replaces `Blur`), `ImageBitmap` (decoded image shared, not owned), `LoadPriority` of the queued `Source` load. Not ported: `UseGradient`/`StartColor`/`EndColor`, sprites, `InflateAmount`, `EraseChangedContent`, `RescaleSource`/`RescalingQuality`. `Source` (URL), `Aspect` (all `TransformAspect` values; `Tile` repeats the image at its natural size from the aligned copy, as C#, same `RescaleAspect` math), `HorizontalAlignment`/`VerticalAlignment`, `Success`/`Error`, `IsLoading`, `LoadedSource`, `DisplayRect`, `AspectScale`; overflow clipped to the box. Not ported: `LoadSourceOnFirstDraw`, `PreviewBase64`, `ImageBitmap`/`LoadedImageSource`, `RescaleSource`/`CacheRescaledSource`/`RescalingQuality`, all adjustments (`Brightness`…`Blur`, `ColorTint`, gradient, `Zoom*`, offsets), sprites, `DrawWhenEmpty`, `EraseChangedContent`, `UseAssembly`. Measure: bounded box taken as is, unbounded axis from source aspect; no `NeedAutoWidth/Height` from Start alignment. |
82
- | `SkiaImageManager` | ported | As DrawnUi.Net: `LoadImageManagedAsync(url, signal, priority)` caches and goes through the priority queue (High > Normal > Low, `MaxParallelLoads` 5 in flight, one fetch per source serves every requester); `LoadImageAsync(url, signal)` is a direct load outside the cache whose image the caller owns; `ReuseBitmaps` (on: every control on a source shares one decoded image; off: the cache keeps one copy and each caller gets a copy of its own, `GetFromCache` too); `CacheLongevitySecs` (1800) expiry; `CacheBudgetMb` (128, 0 = no limit) of decoded pixels, over it the images no control holds go, used longest ago first (DrawnUI for Rust trim), `Instance.CacheMemoryMb`, `Trim()`; `RemoveFromCache` / `ClearCache` / `AddToCache` / `UpdateInCache` / `GetFromCache` / `GetFromCacheInternal` never delete an image a control holds (`Hold` / `Free`, used by SkiaImage, SkiaSprite and shader-effect textures); keys case-insensitive, local paths normalized; `UseCache`; `EnableHttpRetry` (`HttpRetryMaxAttempts` 3); a failed load resolves to `undefined` and raises `CanReload(source, error)`; `RegisterImage`, `IsLoadingLocked`, `HttpBaseAddress`, `IsOffline`; `PreloadImage(s)`, `CancelAll` (only loads waiting for a slot). React divergence: a cancelled load resolves to `undefined` (C# throws). |
82
+ | `SkiaImageManager` | ported | As DrawnUi.Net: `LoadImageManagedAsync(url, signal, priority)` caches and goes through the priority queue (High > Normal > Low, `MaxParallelLoads` 5 in flight, one fetch per source serves every requester); `LoadImageAsync(url, signal)` is a direct load outside the cache whose image the caller owns; `ReuseBitmaps` (on: every control on a source shares one decoded image; off: the cache keeps one copy and each caller gets a copy of its own, `GetFromCache` too); `CacheLongevitySecs` (1800) expiry; `CacheBudgetMb` (128, 0 = no limit) of decoded pixels, over it the images no control holds go, used longest ago first (DrawnUI for Rust trim), `Instance.CacheMemoryMb`, `Trim()`; `RemoveFromCache` / `ClearCache` / `AddToCache` / `UpdateInCache` / `GetFromCache` / `GetFromCacheInternal` never delete an image a control holds (`Hold` / `Free`, used by SkiaImage, SkiaSprite and shader-effect textures); keys case-insensitive, local paths normalized; `UseCache`; `EnableHttpRetry` (`HttpRetryMaxAttempts` 3); a failed load resolves to `undefined`; `RegisterImage`, `IsLoadingLocked` (turned off it raises `CanReload`), `HttpBaseAddress`, `IsOffline`; `PreloadImage(s)`, `CancelAll` (only loads waiting for a slot, they resolve to `undefined`). Cancels as the DrawnUi.Net Blazor head: a cached load, or one waiting for `IsLoadingLocked`, whose caller's signal aborts rejects with the abort (an `AbortError`, C# `OperationCanceledException`); with `UseCache` off a cancelled load resolves to `undefined`. |
83
83
  | `SkiaImageTiles` | ported | `TileWidth` / `TileHeight` (points, nothing drawn until set), `TileAspect` (AspectCover), `TileOffsetX` / `TileOffsetY` (wrap), `TileCacheType` (Image) for the inner tile `SkiaImage` sharing the decoded source, clipped to bounds. |
84
84
  | `SkiaSvg` | partial | Inline `SvgString` without `xmlns` gets it injected (browsers refuse to decode an `<img>` SVG without it, SkiaSharp does not care) — the C# check-mark markup relies on that. `Source` (URL) / `SvgString`, `Aspect` (default `AspectFitFill`, uses the shared `RescaleAspect` math, not SkiaSvg's own matrix path; `Tile` repeats the picture at its natural size, one SVG unit per point, from the aligned copy), alignments, `TintColor` (SrcIn), `Success`/`Error`, `IsLoading`, `DisplayRect`. Rendering: browser decodes the SVG, rasterized at the displayed pixel size and cached per size (CanvasKit npm has no SVG module). Not ported: shadows, FontAwesome duotone colors, `FillGradient`, `Zoom*`/offsets/`InflateAmount`, `IconFilePath`/embedded resources, `UseCache=Operations` default (no caching yet). |
85
- | `SkiaScroll` | partial | Own size as C#: a side without a request that is not `Fill` takes the content's size, up to the space given. `Orientation` Vertical/Horizontal/Both/Neither (Neither: pans never move the viewport, the wheel is not consumed so a parent scroll may take it; programmatic `ScrollTo` still works), single `Content`, `ViewportOffsetX/Y` (points, <= 0), pan with the C# 0.85 delta interpolation, fling on the DrawnUi deceleration curve (`FrictionScrolled`, `ChangeVelocityScrolled`, `MaxVelocity`, edge-cut duration), rubber-band overscroll (`Bounces`, `RubberEffect`) + spring bounce (`RubberDamping`, `MaxBounceVelocity`), mouse wheel (`WheelLineSize` per notch, an event moving by its share of a notch: `Canvas.WheelDeltaPerNotch` 100 CSS px after `deltaMode` lines x 40 / pages x 800, dominant axis, as the C# browser heads; `AutoScrollingSpeedMs` glide for a notch, an event under half a notch moves at once (touchpads, see PARITY); events accumulate onto the running move's exact target, and a restarted glide starts at the event so a fast swipe moves on every frame; `Wheel.IsHorizontal`: a vertical scroll leaves horizontal events, a horizontal scroll takes both, C# ba03cb20), `ScrollTo`/`ScrollToTop`/`ScrollToBottom`/`StopScrolling`, `Scrolled`, `IgnoreWrongDirection`, `RespondsToGestures`, `IsUserPanning`/`IsScrolling`, `ContentSize`, `ContentOffsetBounds`, `OverScrolled`. `Header` / `Footer` (JSX children with `Tag="Header"` / `Tag="Footer"`; the header scrolls in the flow, `HeaderSticky` pins it at the viewport start drawn over the content, `HeaderBehind` draws it under the content, `HeaderParallaxRatio` (1 = with the content, 0.5 = half speed), `ParallaxOverscrollEnabled`, `ContentOffset` between a behind / sticky header and the content; both add to the scroll extent), scroll bars (`ScrollBarsVisibility` None / Vertical / Horizontal / Both creating default `SkiaScrollBar`s, `ScrollBar` / `ScrollBarHorizontal` custom `IScrollBar` controls via `Tag="ScrollBar"` / `"ScrollBarHorizontal"`, `ScrollBarThumbColor` / `ScrollBarTrackColor`; `SkiaScrollBar`: `Dock`, `ThumbColor`, `TrackColor`, `Thickness` 4, `EdgeMargin` 2, `MinThumbSize` 32, `AutoHide` + `HideDelaySecs` 1 + `HideDurationSecs` 0.25, thumb squashed on overscroll, `IsDraggable` + `GrabPadding` 8: the scroll takes a gesture that starts on the bar from down to up, thumb drag keeps the grab point, a track press jumps the thumb under the pointer, the content gets neither the pan nor the tap; a custom `IScrollBar` opts in by implementing `IsDraggable` / `BeginDrag` / `GetDragProgress`; bars are parent-independent (C# `IsParentIndependent`): a thumb resize invalidates the bar alone and the scroll re-measures it on draw, nothing above re-measures), pull to refresh (`RefreshEnabled`, `RefreshCommand` callback, `IsRefreshing` two-way, `RefreshDistanceLimit` 150, `RefreshShowDistance` 50, `RefreshIndicator` `IRefreshIndicator` control via `Tag="RefreshIndicator"`; `RefreshIndicator` base: `Orientation`, `SetDragRatio` slides the view in with the pull and parks it at RefreshShowDistance, `IsRunning` + `OnIsRunningChanged`, `VisibleRatio`), `SnapToChildren` Center / Side after a fling or a release (`Snap`, `CheckNeedToSnap`), `TrackIndexPosition` Start / Center / End + `TrackIndexPositionOffset` reporting `CurrentIndex` / `CurrentIndexChanged`. `ScrollToIndex` Start / Center / End as an open order (C# OrderedScrollToIndex): a row not measured yet is gone to by the estimate and aimed again every frame until its place is measured and the viewport stands on it; a press, the wheel or another scroll drops it; LoadMore waits while it is open. Controls outside the clip are skipped with their subtree (C# stack Virtualisation, for every control; see PARITY). Not ported: zoom (`ViewportZoom`, `ZoomLocked`), `ReverseGestures` (inverted chat), keyboard adaptation, `ResetScrollPositionOnContentSizeChanged`, `ScrollType`, `ScrollingEnded` event, `LottieRefreshIndicator`, virtualization hooks (`Virtualisation`, `UseVirtual`, windowed content bounds); the C# refresh-indicator position curve is replaced by a linear slide-in. |
85
+ | `SkiaScroll` | partial | Own size as C#: a side without a request that is not `Fill` takes the content's size, up to the space given. `Orientation` Vertical/Horizontal/Both/Neither (Neither: pans never move the viewport, the wheel is not consumed so a parent scroll may take it; programmatic `ScrollTo` still works), single `Content`, `ViewportOffsetX/Y` (points, <= 0), pan with the C# 0.85 delta interpolation, fling on the DrawnUi deceleration curve (`FrictionScrolled`, `ChangeVelocityScrolled`, `MaxVelocity`, edge-cut duration), rubber-band overscroll (`Bounces`, `RubberEffect`) + spring bounce (`RubberDamping`, `MaxBounceVelocity`), mouse wheel (`WheelLineSize` per notch, an event moving by its share of a notch: `Canvas.WheelDeltaPerNotch` 100 CSS px after `deltaMode` lines x 40 / pages x 800, dominant axis, as the C# browser heads; `AutoScrollingSpeedMs` glide for a notch, an event under half a notch moves at once (touchpads, see PARITY); events accumulate onto the running move's exact target, and a restarted glide starts at the event so a fast swipe moves on every frame; `Wheel.IsHorizontal`: a vertical scroll leaves horizontal events, a horizontal scroll takes both, C# ba03cb20), `ScrollTo`/`ScrollToTop`/`ScrollToBottom`/`StopScrolling`, `Scrolled`, `IgnoreWrongDirection`, `RespondsToGestures`, `IsUserPanning`/`IsScrolling`, `ContentSize`, `ContentOffsetBounds`, `OverScrolled`. `Header` / `Footer` (JSX children with `Tag="Header"` / `Tag="Footer"`; the header scrolls in the flow, `HeaderSticky` pins it at the viewport start drawn over the content, `HeaderBehind` draws it under the content, `HeaderParallaxRatio` (1 = with the content, 0.5 = half speed), `ParallaxOverscrollEnabled`, `ContentOffset` between a behind / sticky header and the content; both add to the scroll extent), scroll bars (`ScrollBarsVisibility` None / Vertical / Horizontal / Both creating default `SkiaScrollBar`s, `ScrollBar` / `ScrollBarHorizontal` custom `IScrollBar` controls via `Tag="ScrollBar"` / `"ScrollBarHorizontal"`, `ScrollBarThumbColor` / `ScrollBarTrackColor`; `SkiaScrollBar`: `Dock`, `ThumbColor`, `TrackColor`, `Thickness` 4, `EdgeMargin` 2, `MinThumbSize` 32, `AutoHide` + `HideDelaySecs` 1 + `HideDurationSecs` 0.25, thumb squashed on overscroll, `IsDraggable` + `GrabPadding` 8: the scroll takes a gesture that starts on the bar from down to up, thumb drag keeps the grab point, a track press jumps the thumb under the pointer, the content gets neither the pan nor the tap; a custom `IScrollBar` opts in by implementing `IsDraggable` / `BeginDrag` / `GetDragProgress`; bars are parent-independent (C# `IsParentIndependent`): a thumb resize invalidates the bar alone and the scroll re-measures it on draw, nothing above re-measures), pull to refresh (`RefreshEnabled`, `RefreshCommand` callback, `IsRefreshing` two-way, `RefreshDistanceLimit` 150, `RefreshShowDistance` 50, `RefreshIndicator` `IRefreshIndicator` control via `Tag="RefreshIndicator"`; `RefreshIndicator` base: `Orientation`, `SetDragRatio` slides the view in with the pull and parks it at RefreshShowDistance, `IsRunning` + `OnIsRunningChanged`, `VisibleRatio`), `SnapToChildren` Center / Side after a fling or a release (`Snap`, `CheckNeedToSnap`), `TrackIndexPosition` Start / Center / End + `TrackIndexPositionOffset` reporting `CurrentIndex` / `CurrentIndexChanged`. `ScrollToIndex` Start / Center / End as an open order (C# OrderedScrollToIndex): a row not measured yet is gone to by the estimate and aimed again every frame until its place is measured and the viewport stands on it; a press, the wheel or another scroll drops it; LoadMore waits while it is open. Controls outside the clip are skipped with their subtree (C# stack Virtualisation, for every control; see PARITY). Not ported: zoom (`ViewportZoom`, `ZoomLocked`), `ReverseGestures` (inverted chat), keyboard adaptation, `ResetScrollPositionOnContentSizeChanged`, `ScrollType`, `ScrollingEnded` event, `LottieRefreshIndicator`, virtualization hooks (`Virtualisation`, `UseVirtual`, windowed content bounds); the C# refresh-indicator position curve is replaced by a linear slide-in. The on-screen keyboard: `AdaptToKeyboardFor` / `AdaptToKeyboardSize` (an app moves a field above it) and the opt-in `AdaptToKeyboardAuto` (off by default, `AdaptToKeyboardGap` 8): the canvas reads the keyboard from the visual viewport, hands the focused field and the covered height to its nearest scroll with the setting, and that scroll gets the covered part as room at its content end while the keyboard is up (the last field rises too) and settles at the end when it closes. |
86
86
  | `SkiaShape` (+ `SkiaFrame`) | partial | `BevelType` Bevel / Emboss + `Bevel` (`Depth`, `LightColor`, `ShadowColor`, `Opacity`; C# `PaintBevelEffect` edge paths for Rectangle, rounded Rectangle, Circle/Ellipse, Polygon, Path via ContourMeasure halves). `Shadows` (`SkiaShadow` X/Y/Blur/Opacity/Color/ShadowOnly, plain literals accepted): fill painted once per shadow with a DropShadow image filter (C# `PaintWithShadowsInternal`), hollow shapes clip their outline away so only the outside shadow remains; caches record the effects margin (`3·Blur·scale ± offset`, C# `MergeShadowMargin`) via `ComputeEffectsMargin`/`ExpandedCacheRect`. Not ported: `PlatformShadow` (MAUI `Shadow` brush), `ExpandDirtyRegion`, bevel/emboss. `Type` Rectangle/Circle/Ellipse/Arc (`Value1` start, `Value2` sweep)/Polygon+Line (`Points` ratios)/Path (`PathData`, fitted + centered), `CornerRadius` (uniform or per-corner), `StrokeWidth` (points, negative = px) drawn inside the bounds, `StrokeColor`, `StrokeCap`, `ClipBackgroundColor`, children laid out inside the stroke and clipped to the shape, `CreateClip` = shape, `FillGradient` fill, `UseCache=Operations` default. Not ported: `Squricle`, `Custom`, `SmoothPoints`, `StrokePath` (dashes), `StrokeGradient`, `StrokeBlendMode`, sub-1px stroke compensation, `MeasuredStrokeAware*` exposure, `LayoutChildren` override hook. |
87
87
  | `SkiaButton` | partial | Now a `SkiaLayout` hosting a `SkiaShape` frame (`Tag="BtnShape"`) + `SkiaLabel` (`Tag="BtnText"`), sized from the label + Padding; `CornerRadius` (default 8), `StrokeColor`/`StrokeWidth`, `BackgroundColor`, text props, `ApplyEffect`, `Tapped`/`Down`/`Up`. Still no `ButtonStyle` looks, icons, `TextCase`, elevation, shimmer, custom templating through tags. |
88
88
  | `SnappingLayout` | ported | `Animated`, `RespondsToGestures`, `IgnoreWrongDirection`, `Bounces`, `RubberDamping`, `RubberEffect`, `AutoVelocityMultiplyPts`, `SnapDistanceRatio`, `SnapPoints`, `CurrentPosition`, `CurrentSnap`, `ContentOffsetBounds`, `IsUserPanning`/`IsUserFocused`, `InTransition`, `Scrolled`/`TransitionChanged`/`Stopped`, `ClampOffset` (rubber), `FindNearestAnchor`, `SelectNextAnchor` (dot product), `ScrollToNearestAnchor`, `ScrollToOffset` (spring `Spring(1+RubberDamping, 200, 0.5·(1+RubberDamping))` when `Bounces`, else 0.1–0.8 s from velocity). The settled state is reported when the snap animation stops (C# relies on `ApplyPosition` ticks). Not ported: `AnimatorSpring` reuse, `SnapDistanceRatio` for non-carousel layouts, hover. |
89
89
  | `UseCache="ImageComposite"` / `ImageCompositeGPU`, `Left` / `Top` | ported | ImageComposite keeps its offscreen surface across records; a change deeper than a direct child (a color through props or a color setter = `UpdateDraw`, or `RepaintComposition`) is erased and redrawn by its area (drawnui-cross 6m: the control as drawn before and now, through every ancestor's transform; an effect or a backdrop on the way draws the child whole; a rect change, more than `MaxCompositionAreas` 16 areas or more than `MaxCompositionShare` 0.5 of the composite records whole; `LastCompositeRecord.Areas` / `Changed`; children outside the areas are not traversed); a child that calls `RepaintComposition` (transform / own repaint) is tracked as dirty by its composite ancestors (`TrackChildAsDirty`, `DirtyChildrenInternal`), the next record erases the dirty children's old + new transformed bounds plus the siblings they overlap and paints only those (`IsRenderingWithComposition`, layouts skip the rest); own content, a remeasure, a size / scale change record fully (`LastCompositeRecord` diagnostics). `Left` / `Top` on a cached control blit the cache at the offset without a matrix or save/restore (the translation is still set as `RenderTransformMatrix` so gestures / accessibility map through it); uncached controls keep the matrix path. Not ported: `ExpandDirtyRegion`, C# `CachedObject` surface reuse for plain `Image`. |
90
90
  | `SkiaCarousel` | ported | Static `Children` or recycled `ItemsSource` + `ItemTemplate` cells (only visible + neighbour slides realized, `ReleaseExcept` for the looped non-contiguous set); `IsVertical`, `SidesOffset`, `Spacing`, `IsLooped` (virtual anchors -1/-2, wrap by `GoNext`/`GoPrev`/swipe at the borders, unbounded offset along the axis, edge slides drawn on the far side, `FixIndex` teleport after the wrap, `InterruptSnapping` strip shift), `PreloadNeighboors` (default true), `DynamicSize` (auto-sized axis follows the selected slide, re-measured on index change), `SwipeSpeed` (velocity ×SwipeSpeed/2, spring stiffness 200·SwipeSpeed, linear cap 0.25/speedK s, `SinOut`), `LinearSpeedMs` (one slide = LinearSpeedMs), `SelectedIndex` + `SelectedIndexChanged`, `LastIndex`, `MaxIndex`, `ChildrenTotal`/`ChildrenCount`, `IsAtStart`/`IsAtEnd`, `ScrollProgress`, `ScrollAmount`, `TransitionProgress`, `ItemAppearing`/`ItemDisappearing`, `Stopped`, `GoNext`/`GoPrev`/`ScrollTo(index, animate)`, C# gesture rules (velocity dead zone 100, clamp 500, snap-if-no-pan on Up, only the slides drawn on screen receive gestures). `IsRightToLeft` accepted (C# TODO). Not ported: `TransitionDirection`, `SafeIndex`, `ScrolledCommand`/`SelectedIndexChangedCommand`, `SelectedItem`, `CheckConstraints` exception, `OnTemplatesAvailable` background init, hover, pinch. |
91
91
  | Templated `Row` / `Wrap` / `Grid`, `Split`, `SkiaDecoratedGrid` | ported | `ItemsSource` + `ItemTemplate` on any layout type: Column stays the virtualized list. Row / Wrap / Grid / a split Column follow `RecyclingTemplate` (drawnui-cross 6b): Enabled measures every item on pooled views (C# measures the structure on one template instance) and binds views only to the slots drawn, their views go back to the pool when the slot leaves the viewport (`VirtualisationInflated` widens it), every slot draws under a cache (C# `GetOnScreenVisibleArea`); Disabled keeps one view per item, never rebound. Changing `RecyclingTemplate` rebuilds the cells. `Split` (column count for Wrap and for a Column, which then lays out like a wrap with fixed slots; a templated Grid places item i at (i % Split, i / Split), `Invert` column-major), `SplitAlign` (true: fixed slot width), `DynamicColumns` (a short last row spreads over the width). `SkiaDecoratedGrid`: `HorizontalLine` / `VerticalLine` gradients painted in `RowSpacing` / `ColumnSpacing` under the children (C# defaults). Not ported: `SplitSpace` (C# TODO), `SplitMax`, `MeasureItemsStrategy` for non-Column templated layouts (every item is measured once per structure). |
92
- | `AccessibilityTextSelectable` (React extension) | ported | Opt-in per control, off by default: a `SkiaLabel` with it renders its laid-out lines as real, transparent DOM text in the accessibility overlay (one span per line at the drawn position, the registered font aliases are also installed as CSS `FontFace`s so glyphs line up), `pointer-events` on, so the browser selects, copies and reads it like HTML; the wheel over such text is re-dispatched to the canvas. Pointer input over the text never reaches the drawn control, hence opt-in. Not in DrawnUi.Net. |
92
+ | `AccessibilityTextSelectable` | ported | As DrawnUi.Net `SkiaLabel`: the label draws the selection (`TextSelectionColor`) and the Copy button of a touch selection (`CopyButtonText`); mouse drag, double click for a word, touch long press then drag, Ctrl+C / Ctrl+A, `SelectedText` / `SelectionStart` / `SelectionLength` / `Select` / `SelectAll` / `ClearSelection` / `CopySelection`; page selection across labels (`Canvas.SelectedText` / `CopyTextSelection` / `ClearTextSelection`, a drag held past a scroll's edge scrolls it); copies through `Super.SetClipboardText`. The overlay is for screen readers and the keyboard only. |
93
93
  | `SkiaShaderCarousel` | ported | Only the selected slide takes gestures (C# `IsSlideHitTestable`): every slide sits on the same rect, so the topmost on-screen one used to catch every tap. `TransitionShader` (url), `TransitionShaderCode`, `TransitionTemplate`, `InterruptedTransitionMs` (50), `TransitionEffect` (`CreateTransitionEffect` factory), `TransitionFromIndex` / `TransitionToIndex`, `FromToChanged`; slides never move (`SlideOffset` hook), looped wrap rules, one gesture = at most one slide, interrupted transition wrapped up first, `RecyclingTemplate` Disabled; the carousel is cached as Image by default (React only, so the overlapping slides are never blitted). Slides MUST use `UseCache="Image"`. |
94
94
  | `SkiaDrawer` | ported | `Direction` (FromBottom/Top/Left/Right), `HeaderSize`, `AmplitudeSize`, `AutoClose`, `IsOpen` + `IsOpenChanged`, `StateTransitionComplete`, `Open()`/`Close()`; moves itself with `TranslationX/Y` like C#, so it must be edge-aligned by the parent (`VerticalOptions="End"` for FromBottom); snap points `[open, hidden]` rebuilt on size change; gestures ported (children first, then vertical/horizontal drag, lock-bounce at the open edge, velocity clamp 3000, touches outside the box ignored / `AutoClose`). Not ported: `IsOpenCommand`, hover, the C# +1 px header quirk. |
95
95
  | Everything else (`SkiaSwitch`, `SkiaCheckbox`, `SkiaSlider`, `SkiaProgress`, `SkiaCamera`, `SkiaMauiElement`, ...) | skipped | |
@@ -87,7 +87,15 @@ export declare class SkiaGridStructure {
87
87
  private CompressStars;
88
88
  private static ExpandStarsInSpan;
89
89
  private static ZeroOutStars;
90
- /** Tracks are final only now: measure every child at its final cell so its internal layout matches the arranged box. */
90
+ /**
91
+ * Final measure pass (C# RemeasureChildrenAtFinalCells, 5acd8ae4), run once every track has its final size. Auto rows
92
+ * first, measured at their final width with the star rows yielding: an Auto column that got the grid's width only now
93
+ * (wrapped text, a wrap of buttons on several lines) can make its rows taller than the first pass did, and the star rows
94
+ * were already given the rest of the height. When an Auto row grew the star rows get what is left now, nothing when the
95
+ * Auto rows took it all. Then every visible child is measured at the cell it will be arranged in.
96
+ */
91
97
  RemeasureChildrenAtFinalCells(): void;
98
+ /** Measures the visible children at their cells (only those on single Auto rows when autoRowsOnly); true when an Auto row grew. */
99
+ private MeasureAtFinalCells;
92
100
  }
93
101
  export {};
@@ -417,15 +417,54 @@ export class SkiaGridStructure {
417
417
  static ZeroOutStars(defs) { for (const d of defs)
418
418
  if (d.IsStar)
419
419
  d.Size = 0; }
420
- /** Tracks are final only now: measure every child at its final cell so its internal layout matches the arranged box. */
420
+ /**
421
+ * Final measure pass (C# RemeasureChildrenAtFinalCells, 5acd8ae4), run once every track has its final size. Auto rows
422
+ * first, measured at their final width with the star rows yielding: an Auto column that got the grid's width only now
423
+ * (wrapped text, a wrap of buttons on several lines) can make its rows taller than the first pass did, and the star rows
424
+ * were already given the rest of the height. When an Auto row grew the star rows get what is left now, nothing when the
425
+ * Auto rows took it all. Then every visible child is measured at the cell it will be arranged in.
426
+ */
421
427
  RemeasureChildrenAtFinalCells() {
428
+ if (this.Rows.some((r) => r.IsStar) && isFinite(this.heightConstraint)) {
429
+ const starSizes = this.Rows.map((r) => r.Size);
430
+ SkiaGridStructure.ZeroOutStars(this.Rows);
431
+ if (this.MeasureAtFinalCells(true)) {
432
+ if (this.heightConstraint - this.GridHeight() > 0)
433
+ this.ResolveStarRows(this.heightConstraint);
434
+ }
435
+ else {
436
+ for (let n = 0; n < this.Rows.length; n++)
437
+ if (this.Rows[n].IsStar)
438
+ this.Rows[n].Size = starSizes[n];
439
+ }
440
+ }
441
+ this.MeasureAtFinalCells(false);
442
+ }
443
+ /** Measures the visible children at their cells (only those on single Auto rows when autoRowsOnly); true when an Auto row grew. */
444
+ MeasureAtFinalCells(autoRowsOnly) {
445
+ let autoRowGrew = false;
422
446
  for (const cell of this.cells) {
423
447
  const child = this.children[cell.ViewIndex];
424
448
  if (!child.IsVisible)
425
449
  continue;
450
+ if (autoRowsOnly && !this.SizesAutoRow(cell))
451
+ continue;
426
452
  const rect = this.GetCellBoundsFor(child);
427
453
  if (rect.Width <= 0 || rect.Height <= 0)
428
454
  continue;
455
+ if (autoRowsOnly) {
456
+ // the height the row can grow to, as in MeasureKnownCells: unbounded for a vertical Fill child (it would take the
457
+ // whole constraint), the result held to the space the row can have
458
+ let grown = this.MeasurePx(child, rect.Width, this.HeightOnAutoRow(cell, child)).Height;
459
+ const available = this.AvailableHeight(cell);
460
+ if (isFinite(available) && grown > available)
461
+ grown = available;
462
+ if (grown > this.Rows[cell.Row].Size) {
463
+ this.Rows[cell.Row].Update(grown);
464
+ autoRowGrew = true;
465
+ }
466
+ continue;
467
+ }
429
468
  // on an Auto row a child that is not Fill vertically keeps the height the row can grow to, as in
430
469
  // MeasureKnownCells: the same request returns at once, and wrapped text is not cut to the row
431
470
  const height = this.SizesAutoRow(cell) && !SkiaGridStructure.NeedFillY(child) ? Math.max(rect.Height, this.AvailableHeight(cell)) : rect.Height;
@@ -435,5 +474,6 @@ export class SkiaGridStructure {
435
474
  if (cell.RowSpan === 1 && this.Rows[cell.Row].IsAuto && m.Height > this.Rows[cell.Row].Size)
436
475
  this.Rows[cell.Row].Update(m.Height);
437
476
  }
477
+ return autoRowGrew;
438
478
  }
439
479
  }
@@ -1,4 +1,4 @@
1
- import { type DrawingContext, type SkiaControl } from "../core/SkiaControl";
1
+ import { type DrawingContext, SkiaControl } from "../core/SkiaControl";
2
2
  import { type GestureEventProcessingInfo, type SkiaGesturesParameters } from "../core/Gestures";
3
3
  import { type PrebuiltControlStyle } from "../core/ControlStyle";
4
4
  import { type Color, type DrawTextAlignment, type ReturnType, ScaledSize, type SkiaEditorKeyboard, type SkiaGradient, type TextAlignment } from "../core/Types";
@@ -154,6 +154,8 @@ export declare class SkiaEditor extends SkiaShape {
154
154
  private VisualTarget;
155
155
  private LabelPoint;
156
156
  protected Paint(ctx: DrawingContext): void;
157
+ /** The press now down is not the main button's. */
158
+ private otherButtonPress;
157
159
  ProcessGestures(args: SkiaGesturesParameters, apply: GestureEventProcessingInfo): SkiaControl | null;
158
160
  /** The canvas gives or takes the focus (a tap elsewhere): an editor always takes it. */
159
161
  SetFrameworkFocus(focus: boolean): boolean;
@@ -165,6 +167,7 @@ export declare class SkiaEditor extends SkiaShape {
165
167
  OnAccessibilityActivated(): void;
166
168
  /** While editing, arrows, Home / End and PageUp / PageDown belong to the text: they never move a surrounding group. */
167
169
  OnAccessibilityKey(_key: string): boolean;
170
+ /** The typed text, else the placeholder. A password field never exposes its text: only the placeholder (C# SkiaEditor). */
168
171
  protected DefaultAccessibilityLabel(): string | undefined;
169
172
  Submit(): void;
170
173
  private ExecuteSubmit;
@@ -1,4 +1,4 @@
1
- import { CanvasLeaveWatchers } from "../core/SkiaControl";
1
+ import { CanvasLeaveWatchers, SkiaControl } from "../core/SkiaControl";
2
2
  import { SKPoint } from "../core/Gestures";
3
3
  import { Super } from "../core/Super";
4
4
  import { DefaultAccent, ResolveControlStyle } from "../core/ControlStyle";
@@ -589,7 +589,21 @@ export class SkiaEditor extends SkiaShape {
589
589
  }
590
590
  }
591
591
  // ---- gestures (C# ProcessGestures: tap places the caret, drag selects, long press selects the word) ----
592
+ /** The press now down is not the main button's. */
593
+ otherButtonPress = false;
592
594
  ProcessGestures(args, apply) {
595
+ // a press with another mouse button (a right click for the context menu) leaves the caret and the selection as they
596
+ // are, also as it drags or is held; it still focuses the field (DrawnUi.Net b6d65b8b)
597
+ if (args.Type === "Down")
598
+ this.otherButtonPress = !SkiaControl.IsPrimaryPointer(args);
599
+ if (this.otherButtonPress && (args.Type === "Down" || args.Type === "Panning" || args.Type === "LongPressing")) {
600
+ if (args.Type === "Down") {
601
+ this.dragSelecting = false;
602
+ if (!this.isFocused)
603
+ this.IsFocused = true;
604
+ }
605
+ return this;
606
+ }
593
607
  switch (args.Type) {
594
608
  case "Down": {
595
609
  const p = this.LabelPoint(args, apply);
@@ -641,8 +655,11 @@ export class SkiaEditor extends SkiaShape {
641
655
  }
642
656
  case "Up":
643
657
  this.dragSelecting = false;
658
+ this.otherButtonPress = false;
644
659
  return this;
645
660
  case "Tapped": return this;
661
+ // the field scrolls its text only to follow the caret: the wheel is the page's, over the field too
662
+ case "Wheel": return null;
646
663
  }
647
664
  return this;
648
665
  }
@@ -657,7 +674,8 @@ export class SkiaEditor extends SkiaShape {
657
674
  this.OnAccessibilityFocused(true); }
658
675
  /** While editing, arrows, Home / End and PageUp / PageDown belong to the text: they never move a surrounding group. */
659
676
  OnAccessibilityKey(_key) { return this.IsFocused; }
660
- DefaultAccessibilityLabel() { return this.text || this.placeholderText || undefined; }
677
+ /** The typed text, else the placeholder. A password field never exposes its text: only the placeholder (C# SkiaEditor). */
678
+ DefaultAccessibilityLabel() { return (!this.isPassword && this.text) || this.placeholderText || undefined; }
661
679
  // ---- editing API (C# names) ----
662
680
  Submit() {
663
681
  if (this.IsMultiline && !this.ShouldSubmitOnEnter) {
@@ -55,6 +55,10 @@ export declare class SkiaLabel extends SkiaControl {
55
55
  readonly Spans: TextSpan[];
56
56
  /** Set to `Aria.RoleText` to expose every label to screen readers (React extension; C# is opt-in per control). */
57
57
  static DefaultAccessibilityRole?: string;
58
+ /** Highlight drawn over selected text (AccessibilityTextSelectable), for every label (C# SkiaLabel.TextSelectionColor). */
59
+ static TextSelectionColor: Color;
60
+ /** Caption of the Copy button shown over a touch selection (C# SkiaLabel.CopyButtonText). */
61
+ static CopyButtonText: string;
58
62
  /** Like C# OnTextInternalChanged: the spoken label is the text (or the joined spans) unless AccessibilityLabel is set. */
59
63
  protected DefaultAccessibilityLabel(): string | undefined;
60
64
  constructor();
@@ -249,8 +253,6 @@ export declare class SkiaLabel extends SkiaControl {
249
253
  get MeasuredLineHeight(): number;
250
254
  /** Line origins relative to DrawingRect, same alignment math as Paint. */
251
255
  private LineGeometry;
252
- /** Lines as CSS text for the accessibility overlay (AccessibilityTextSelectable): font alias chain, weight and px size. */
253
- GetAccessibilityTextLines(scale: number): import("../core/Accessibility").AccessibilityTextLine[];
254
256
  /** Laid-out lines with their text index range (a wrapped-away space or line break sits between two lines). */
255
257
  GetLineBoxes(): LineBox[];
256
258
  /** Every code point of the laid-out text with its box (editor caret / selection / hit testing). */
@@ -282,4 +284,68 @@ export declare class SkiaLabel extends SkiaControl {
282
284
  WantsPointerCursor(x: number, y: number): boolean;
283
285
  /** Return null to not consume the tap. */
284
286
  protected OnSpanTapped(span: TextSpan, args: SkiaGesturesParameters, apply: GestureEventProcessingInfo): SkiaControl | null;
287
+ get AccessibilityTextSelectable(): boolean;
288
+ /**
289
+ * The text can be selected and copied, drawn by the label (C# SkiaLabel.AccessibilityTextSelectable). Mouse: drag, double
290
+ * click for a word. Touch: long press picks a word, keep the finger down and drag to extend, a Copy button appears.
291
+ * Ctrl+C (Cmd+C) copies and Ctrl+A selects all while the label holds the selection; a click elsewhere drops it. The label
292
+ * takes the mouse press for this, so it no longer reaches controls under it. Free when off. Copies through
293
+ * Super.SetClipboardText.
294
+ */
295
+ set AccessibilityTextSelectable(v: boolean);
296
+ private selStart;
297
+ private selLength;
298
+ private anchorStart;
299
+ private anchorEnd;
300
+ private selecting;
301
+ private touchSelection;
302
+ private copyPressed;
303
+ private selectionKeysAttached;
304
+ private lastClickMs;
305
+ private lastClickX;
306
+ private lastClickY;
307
+ /** The drawn Copy button of a touch selection, relative to DrawingRect (pixels); empty when none. */
308
+ private copyButton;
309
+ private selectionMap?;
310
+ /** Start of the selection in the selection's source: the label's text when the lines are taken from it verbatim, else the drawn lines joined. */
311
+ get SelectionStart(): number;
312
+ /** Length of the selection, 0 when nothing is selected. */
313
+ get SelectionLength(): number;
314
+ /** The selected text, empty when nothing is selected. */
315
+ get SelectedText(): string;
316
+ /** Selects a range of the text (see SelectionStart for what the indexes count). */
317
+ Select(start: number, length: number): void;
318
+ /** Selects all of the text. */
319
+ SelectAll(): void;
320
+ /** Drops the selection. */
321
+ ClearSelection(): void;
322
+ /** The app showed its own context menu for a touch selection: the drawn Copy button steps aside, the selection stays. */
323
+ HideCopyButton(): void;
324
+ /** Puts the selected text on the clipboard through Super.SetClipboardText. False when nothing is selected. */
325
+ CopySelection(): boolean;
326
+ /** A selectable label takes the canvas focus while text is selected and drops the selection when the focus moves elsewhere. */
327
+ SetFrameworkFocus(focus: boolean): boolean;
328
+ protected OnDisposing(): void;
329
+ private AttachSelectionKeys;
330
+ private static readonly noChar;
331
+ private readonly onSelectionKey;
332
+ private ClaimSelectionFocus;
333
+ /**
334
+ * The drawn lines mapped onto a source string: the label's text when every line is found in it in order (spaces
335
+ * dropped at wraps are then copied too), else the lines joined, a new line between paragraphs. Each line keeps its
336
+ * caret slots (x of each text index, relative to DrawingRect) and its glyph boxes.
337
+ */
338
+ private SelectionMap;
339
+ /** Text index under a point relative to DrawingRect (pixels). */
340
+ private IndexAt;
341
+ private WordAt;
342
+ /** Text index under a canvas point (pixels), for a selection a page drag makes across labels. */
343
+ TextIndexAtCanvas(x: number, y: number): number;
344
+ /** Length of the text a selection counts in (see SelectionStart). */
345
+ get SelectableLength(): number;
346
+ private SelectBetween;
347
+ /** Pointer handling of AccessibilityTextSelectable; null lets the gesture go on as usual. */
348
+ protected ProcessTextSelection(args: SkiaGesturesParameters, apply: GestureEventProcessingInfo): SkiaControl | null;
349
+ /** Draws the selection over the lines just drawn, and the Copy button of a touch selection. */
350
+ protected DrawTextSelection(ctx: DrawingContext): void;
285
351
  }