drawnui-react 0.1.0-preview.4 → 0.1.0-preview.41

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.
Files changed (107) hide show
  1. package/README.md +129 -14
  2. package/SKIPPED.md +36 -26
  3. package/dist/controls/AnimatedFramesRenderer.d.ts +9 -0
  4. package/dist/controls/AnimatedFramesRenderer.js +18 -1
  5. package/dist/controls/DrawnGame.d.ts +44 -0
  6. package/dist/controls/DrawnGame.js +82 -0
  7. package/dist/controls/GridStructure.d.ts +16 -2
  8. package/dist/controls/GridStructure.js +40 -4
  9. package/dist/controls/SkiaBackdrop.d.ts +8 -2
  10. package/dist/controls/SkiaBackdrop.js +42 -14
  11. package/dist/controls/SkiaButton.d.ts +17 -3
  12. package/dist/controls/SkiaButton.js +26 -8
  13. package/dist/controls/SkiaCarousel.d.ts +22 -3
  14. package/dist/controls/SkiaCarousel.js +85 -9
  15. package/dist/controls/SkiaCheckbox.d.ts +0 -1
  16. package/dist/controls/SkiaCheckbox.js +2 -7
  17. package/dist/controls/SkiaDrawer.d.ts +15 -0
  18. package/dist/controls/SkiaDrawer.js +42 -7
  19. package/dist/controls/SkiaEditor.d.ts +48 -2
  20. package/dist/controls/SkiaEditor.js +268 -53
  21. package/dist/controls/SkiaGif.d.ts +7 -0
  22. package/dist/controls/SkiaGif.js +25 -4
  23. package/dist/controls/SkiaImage.d.ts +5 -0
  24. package/dist/controls/SkiaImage.js +48 -14
  25. package/dist/controls/SkiaLabel.d.ts +117 -9
  26. package/dist/controls/SkiaLabel.js +526 -80
  27. package/dist/controls/SkiaLabelFps.d.ts +16 -0
  28. package/dist/controls/SkiaLabelFps.js +41 -0
  29. package/dist/controls/SkiaLayout.d.ts +89 -9
  30. package/dist/controls/SkiaLayout.js +364 -21
  31. package/dist/controls/SkiaLottie.js +5 -3
  32. package/dist/controls/SkiaProgress.d.ts +2 -1
  33. package/dist/controls/SkiaProgress.js +8 -5
  34. package/dist/controls/SkiaRadioButton.d.ts +2 -0
  35. package/dist/controls/SkiaRadioButton.js +16 -4
  36. package/dist/controls/SkiaRichLabel.d.ts +1 -1
  37. package/dist/controls/SkiaRichLabel.js +11 -1
  38. package/dist/controls/SkiaScroll.d.ts +35 -5
  39. package/dist/controls/SkiaScroll.js +252 -32
  40. package/dist/controls/SkiaScrollBar.d.ts +27 -0
  41. package/dist/controls/SkiaScrollBar.js +51 -2
  42. package/dist/controls/SkiaShaderCarousel.d.ts +11 -1
  43. package/dist/controls/SkiaShaderCarousel.js +27 -5
  44. package/dist/controls/SkiaShape.d.ts +13 -2
  45. package/dist/controls/SkiaShape.js +50 -10
  46. package/dist/controls/SkiaSlider.d.ts +20 -2
  47. package/dist/controls/SkiaSlider.js +61 -7
  48. package/dist/controls/SkiaSprite.d.ts +4 -0
  49. package/dist/controls/SkiaSprite.js +22 -10
  50. package/dist/controls/SkiaSvg.d.ts +4 -0
  51. package/dist/controls/SkiaSvg.js +28 -4
  52. package/dist/controls/SkiaSwitch.d.ts +0 -1
  53. package/dist/controls/SkiaSwitch.js +4 -8
  54. package/dist/controls/SkiaToggle.d.ts +25 -5
  55. package/dist/controls/SkiaToggle.js +58 -5
  56. package/dist/controls/SnappingLayout.d.ts +12 -1
  57. package/dist/controls/SnappingLayout.js +21 -2
  58. package/dist/controls/TooltipStyle.d.ts +52 -0
  59. package/dist/controls/TooltipStyle.js +88 -0
  60. package/dist/core/Accessibility.d.ts +134 -0
  61. package/dist/core/Accessibility.js +675 -9
  62. package/dist/core/Animators.d.ts +37 -1
  63. package/dist/core/Animators.js +102 -9
  64. package/dist/core/Canvas.d.ts +241 -10
  65. package/dist/core/Canvas.js +739 -44
  66. package/dist/core/ControlStyle.d.ts +2 -0
  67. package/dist/core/ControlStyle.js +2 -0
  68. package/dist/core/DesignerActions.d.ts +32 -0
  69. package/dist/core/DesignerActions.js +68 -0
  70. package/dist/core/Easing.d.ts +12 -1
  71. package/dist/core/Easing.js +25 -1
  72. package/dist/core/Gestures.d.ts +81 -2
  73. package/dist/core/Gestures.js +177 -3
  74. package/dist/core/Hover.d.ts +51 -0
  75. package/dist/core/Hover.js +140 -0
  76. package/dist/core/ImageEffects.d.ts +2 -0
  77. package/dist/core/ImageEffects.js +2 -0
  78. package/dist/core/KeyboardManager.d.ts +40 -0
  79. package/dist/core/KeyboardManager.js +98 -8
  80. package/dist/core/PopupWindows.d.ts +94 -0
  81. package/dist/core/PopupWindows.js +205 -0
  82. package/dist/core/ScrollAnimators.js +9 -0
  83. package/dist/core/Shaping.d.ts +40 -0
  84. package/dist/core/Shaping.js +224 -0
  85. package/dist/core/SkiaControl.d.ts +284 -11
  86. package/dist/core/SkiaControl.js +630 -66
  87. package/dist/core/SkiaEffect.d.ts +17 -0
  88. package/dist/core/SkiaEffect.js +43 -8
  89. package/dist/core/SkiaImageManager.js +1 -1
  90. package/dist/core/Super.d.ts +29 -2
  91. package/dist/core/Super.js +54 -3
  92. package/dist/core/Tooltips.d.ts +71 -0
  93. package/dist/core/Tooltips.js +205 -0
  94. package/dist/core/Types.d.ts +11 -1
  95. package/dist/core/Types.js +32 -1
  96. package/dist/core/ViewsAdapter.d.ts +7 -2
  97. package/dist/core/ViewsAdapter.js +10 -3
  98. package/dist/index.d.ts +7 -0
  99. package/dist/index.js +7 -0
  100. package/dist/react/SkiaShell.js +65 -26
  101. package/dist/react/index.d.ts +51 -4
  102. package/dist/react/index.js +180 -18
  103. package/dist/react/reconciler.d.ts +20 -0
  104. package/dist/react/reconciler.js +69 -14
  105. package/dist/vite/index.d.ts +9 -0
  106. package/dist/vite/index.js +36 -3
  107. package/package.json +66 -2
@@ -1,8 +1,9 @@
1
1
  import type { Canvas as SkCanvas, Image, Path, SkPicture, Surface } from "canvaskit-wasm";
2
- import { type Color, type LayoutOptions, SKRect, ScaledSize, type SkiaCacheType, type SkiaGradient, type SkiaTouchAnimation, Thickness } from "./Types";
3
- import { type IOverlayEffect } from "./Animators";
2
+ import { type Color, type LayoutOptions, SKRect, ScaledSize, type SkiaCacheType, type SkiaGradient, type SkiaTouchAnimation, Thickness, type ThicknessValue } from "./Types";
3
+ import { type AnimatorBase, type IOverlayEffect } from "./Animators";
4
4
  import { Easing } from "./Easing";
5
5
  import type { Canvas } from "./Canvas";
6
+ import type { InputKey } from "./KeyboardManager";
6
7
  import { ContextMenuEventArgs, ControlTappedEventArgs, GestureEventProcessingInfo, type LockTouch, SKPoint, SkiaGesturesInfo, SkiaGesturesParameters } from "./Gestures";
7
8
  import { type CachedTexture, type IPostRendererEffect, type SkiaEffect } from "./SkiaEffect";
8
9
  /** Mirrors DrawnUi DrawingContext: ctx.Context.Canvas / Surface, ctx.Destination (pixels), ctx.Scale. */
@@ -20,6 +21,10 @@ export interface DrawingContext {
20
21
  Y: number;
21
22
  };
22
23
  Recording?: boolean;
24
+ /** The picture being recorded is drawn scaled, turned, skewed or projected: images blitted into it sample smoothly (C#). */
25
+ PlaybackDistorted?: boolean;
26
+ /** An image cache (or a picture holding one) was blitted here (C#): the picture is recorded again when its playback distortion changes. */
27
+ HasImageBlits?: boolean;
23
28
  };
24
29
  Destination: SKRect;
25
30
  Scale: number;
@@ -35,8 +40,27 @@ export declare class CachedObject {
35
40
  constructor(Type: SkiaCacheType,
36
41
  /** Rect the content was recorded for, canvas pixels at recording time. */
37
42
  Bounds: SKRect, Scale: number, Picture?: SkPicture | undefined, Image?: Image | undefined);
38
- /** Replays the cache with its top-left moved to (left, top). */
39
- Draw(canvas: SkCanvas, left: number, top: number): void;
43
+ /** Canvas.GpuEpoch it was made in: after a WebGL context restore it is remade (a picture may replay old GPU images). */
44
+ Epoch: number;
45
+ /** A picture recorded to be drawn distorted: the images in it sample smoothly (C# CachedObject.PlaybackDistorted). */
46
+ PlaybackDistorted: boolean;
47
+ /** A picture holding image blits, whose sampling was fixed when it was recorded (C# CachedObject.HasImageBlits). */
48
+ HasImageBlits: boolean;
49
+ /** C# PaintRenderObject: the blit paint is antialiased (else a turned bitmap keeps stair steps along its own border), dithered when distorted. */
50
+ private static blitPaint?;
51
+ private static blitPaintDithered?;
52
+ private static BlitPaint;
53
+ /** Replays the cache with its top-left moved to (left, top); `smooth` = an image drawn distorted (linear + mipmaps). */
54
+ Draw(canvas: SkCanvas, left: number, top: number, smooth?: boolean): void;
55
+ /**
56
+ * C# GetPictureImage: the picture of a picture cache (Operations, OperationsFull) drawn into an image, made on the
57
+ * first call (on `main`'s GPU context when given) and kept as long as this cache lives. Shader effects read it as
58
+ * their input, so on such a control they work on its own content, as on an Image cache.
59
+ */
60
+ GetPictureImage(main?: Surface): Image | undefined;
61
+ private pictureImage?;
62
+ /** The picture drawn into an image, once GetPictureImage made it. */
63
+ get PictureImage(): Image | undefined;
40
64
  Dispose(): void;
41
65
  }
42
66
  /**
@@ -46,6 +70,11 @@ export declare class CachedObject {
46
70
  * Render(ctx) -> background + Paint(ctx),
47
71
  * ProcessGestures(args, apply) -> consumer or null.
48
72
  */
73
+ /**
74
+ * Controls holding something outside the tree while they are on a canvas (a focused editor's keys and caret timer, a
75
+ * game's keys): the canvas calls their OnLeftCanvas when they leave it with a removed or disposed subtree.
76
+ */
77
+ export declare const CanvasLeaveWatchers: Set<SkiaControl>;
49
78
  export declare class SkiaControl {
50
79
  HorizontalOptions: LayoutOptions;
51
80
  VerticalOptions: LayoutOptions;
@@ -63,7 +92,10 @@ export declare class SkiaControl {
63
92
  Row: number;
64
93
  ColumnSpan: number;
65
94
  RowSpan: number;
66
- Margin: Thickness;
95
+ private margin;
96
+ /** Space around the control (points); a number is the same on every side, as C# XAML (`Thickness.From`). */
97
+ get Margin(): Thickness;
98
+ set Margin(v: ThicknessValue);
67
99
  /**
68
100
  * DrawnUi LockRatio: 0 = off; positive = square of the LARGER of the two sizes (requests or constraints),
69
101
  * negative = square of the SMALLER one. Infinite sides are ignored, so WidthRequest=150 + LockRatio=1 = 150x150.
@@ -83,6 +115,14 @@ export declare class SkiaControl {
83
115
  /** Degrees. */
84
116
  SkewX: number;
85
117
  SkewY: number;
118
+ /** Degrees, a 3D turn around the horizontal axis through the pivot, seen with perspective (C# RotationX). */
119
+ RotationX: number;
120
+ /** Degrees, a 3D turn around the vertical axis through the pivot (C# RotationY). */
121
+ RotationY: number;
122
+ /** Degrees, a 3D turn around the axis facing the viewer, after RotationX and RotationY (C# RotationZ). */
123
+ RotationZ: number;
124
+ /** Depth: toward the viewer (+, bigger) or away (−, smaller), turned or flat; draws at 576 / (576 − TranslationZ) (C# TranslationZ). */
125
+ TranslationZ: number;
86
126
  /** Pivot for Rotation/Scale/Skew as a fraction of the box (MAUI default 0.5). */
87
127
  AnchorX: number;
88
128
  AnchorY: number;
@@ -106,6 +146,7 @@ export declare class SkiaControl {
106
146
  get Scale(): number;
107
147
  set Scale(v: number);
108
148
  get HasTransform(): boolean;
149
+ private get Has3d();
109
150
  /** Matrix applied at the last render (canvas space), undefined when none; gestures map through its inverse. */
110
151
  RenderTransformMatrix?: number[];
111
152
  /** Generic numeric parameters (DrawnUi Value1/Value2): SkiaShape Arc uses start angle / sweep angle in degrees. */
@@ -135,18 +176,43 @@ export declare class SkiaControl {
135
176
  private compositeSurface?;
136
177
  /** Own content or structure changed: the next composite record is a full one. */
137
178
  private compositeFull;
179
+ /** Where the kept composite surface starts relative to DrawingRect (the effects margin it was laid out with). */
180
+ private compositeInsetX;
181
+ private compositeInsetY;
138
182
  /** Canvas-pixel bounds this control covered when its parent last recorded it (composite erase region). */
139
183
  private lastCompositeBounds?;
140
- /** What the last composite record did (diagnostics): "full" or "partial", the number of children re-recorded and which ones. */
184
+ /**
185
+ * What the last composite record did (diagnostics): "full" or "partial", the number of children re-recorded and which
186
+ * ones; Areas: the pixels erased and drawn again for changes deeper than a child (C# Areas), Changed: the controls
187
+ * those areas belong to (C# Changed).
188
+ */
141
189
  LastCompositeRecord: {
142
190
  Mode: "full" | "partial";
143
191
  Children: number;
144
192
  Dirty: readonly SkiaControl[];
193
+ Areas: readonly SKRect[];
194
+ Changed: readonly SkiaControl[];
145
195
  };
196
+ /** C# MaxCompositionAreas: more areas than this in one composite record draw it whole instead. */
197
+ static MaxCompositionAreas: number;
198
+ /** C# MaxCompositionShare: areas covering more than this share of a composite draw it whole instead. */
199
+ static MaxCompositionShare: number;
200
+ /**
201
+ * Changes deeper than a direct child since the last composite record (drawnui-cross 6m): the control, the direct child
202
+ * it is in, where it was drawn before the change (its own drawn bounds, as drawn) and its rect then.
203
+ */
204
+ private compositeDeep?;
205
+ /** Set while an UpdateDraw climbs: the ancestors re-measure but an ImageComposite among them keeps its partial record. */
206
+ private static drawOrigin;
146
207
  /** The children a composite record can re-record individually; layouts return their views. */
147
208
  protected GetCompositeChildren(): readonly SkiaControl[];
148
209
  /** C# TrackChildAsDirty (DirtyChildrenTracker): the child changed without a remeasure of this control. */
149
210
  TrackChildAsDirty(child: SkiaControl): void;
211
+ private static readonly rejectRect;
212
+ /** Its cache must be recorded before it can be drawn (none, dirty, another type, scale, size or GPU context). */
213
+ private CacheStale;
214
+ /** Its rect grown by its effects margin, through the matrix it is drawn with, lies outside the canvas clip. */
215
+ private OutsideClip;
150
216
  /** Drawn bounds in canvas pixels including transforms and effects margins (C# GetTransformedDirtyBounds). */
151
217
  GetTransformedDirtyBounds(): SKRect;
152
218
  /** Current cache, if any. */
@@ -157,6 +223,45 @@ export declare class SkiaControl {
157
223
  /** Consume every gesture that lands on this control so nothing below (z-order) receives it. */
158
224
  BlockGesturesBelow: boolean;
159
225
  LockChildrenGestures: LockTouch;
226
+ /**
227
+ * A tap this control takes moves the canvas focus to it, and whatever had it (an editor) lets it go. Default false: a
228
+ * plain control declines the focus, so tapping it (a Send button) leaves the current focus alone.
229
+ */
230
+ CanBeFocused: boolean;
231
+ /** While this control has the canvas focus, taps elsewhere do not move it. */
232
+ LockFocus: boolean;
233
+ /** The canvas gives (true) or takes (false) the focus; returns whether the control takes it. */
234
+ SetFrameworkFocus(_focus: boolean): boolean;
235
+ private receivesHover?;
236
+ /**
237
+ * Whether this control takes mouse hover: the canvas sets IsHovered while the mouse is over it. Opt-in: false by
238
+ * default, true by default only in the controls that always had hover (SkiaButton, SkiaSlider, the toggles,
239
+ * SkiaRadioButton, SkiaCarousel, SkiaDrawer), never because a control has a tap handler. A HoverChanged handler turns
240
+ * it on (C# fluent OnHovered) unless it is set.
241
+ */
242
+ get ReceivesHover(): boolean;
243
+ set ReceivesHover(value: boolean);
244
+ /** The value of ReceivesHover until it is set. */
245
+ protected ReceivesHoverByDefault(): boolean;
246
+ private isHovered;
247
+ /**
248
+ * True while the mouse is over this control and it takes hover. Every such control under the pointer is hovered at
249
+ * once (a card and the button inside it, as CSS :hover); it stays as it is while content moves under the pointer and
250
+ * is checked again when that stops. Touch never hovers.
251
+ */
252
+ get IsHovered(): boolean;
253
+ /** IsHovered changed: true when the mouse came over this control, false when it left (C# HoverChanged / OnHovered). */
254
+ HoverChanged?: (sender: SkiaControl, hovered: boolean) => void;
255
+ /** Set by the canvas's HoverManager. */
256
+ ApplyHover(on: boolean): void;
257
+ /** A scroll, carousel or drawer moving its content right now: hover waits until it stops (C# IsScrolling / InTransition). */
258
+ MovesContent(): boolean;
259
+ /**
260
+ * Hover hit path (HoverManager): this control is under the point (in its own space), its children under it follow,
261
+ * top-most first, by the routing rules of ProcessGestures. True when this subtree blocks gestures below it, so the
262
+ * controls under it get no hover (a popup over a list).
263
+ */
264
+ CollectHovered(point: SKPoint, into: SkiaControl[], xs?: number[], ys?: number[]): boolean;
160
265
  TouchEffectColor: Color;
161
266
  /** Plays a ripple (from the tap point) when Tapped fires. */
162
267
  AnimationTapped: SkiaTouchAnimation;
@@ -164,6 +269,11 @@ export declare class SkiaControl {
164
269
  AnimationTappedSpeed: number;
165
270
  /** Overlay effects drawn above this control's content every frame (ripple etc). */
166
271
  readonly PostAnimators: IOverlayEffect[];
272
+ /**
273
+ * C# PendingUnattachedAnimators: animators started while no Canvas was above this control yet (e.g. a game loop
274
+ * started in a constructor). They start on the control's first arrange, where C# starts them in SuperViewChanged.
275
+ */
276
+ PendingUnattachedAnimators?: AnimatorBase[];
167
277
  private visualEffects;
168
278
  /** Post-renderer effects among VisualEffects (C# EffectPostRenderers). */
169
279
  EffectPostRenderers: (SkiaEffect & IPostRendererEffect)[];
@@ -175,7 +285,12 @@ export declare class SkiaControl {
175
285
  protected OnVisualEffectsChanged(): void;
176
286
  /** Post renderers that can render this frame (compiled shaders); an unready effect leaves the control drawn plainly. */
177
287
  private ActivePostRenderers;
178
- /** C# CachedImage: the cached texture and the canvas rect it was rasterized over (Image caches only). */
288
+ /**
289
+ * C# CachedImage: the cached texture (Image caches only) and the canvas rect it covers NOW. Scrolled content is
290
+ * re-arranged here, not drawn through a translated canvas, so a cache recorded before its control moved is blitted
291
+ * at the control's current aligned rect (RenderContent) and its record-time Bounds are stale: an effect sampling it
292
+ * there (the slides of a SkiaShaderCarousel after the page scrolled) was off by the scroll amount.
293
+ */
179
294
  get CachedImage(): CachedTexture | undefined;
180
295
  /** Clip overlay effects to the control's shape (CreateClip). */
181
296
  ClipEffects: boolean;
@@ -198,6 +313,11 @@ export declare class SkiaControl {
198
313
  * built in code-behind is styled on its first measure and keeps whatever the code already set.
199
314
  */
200
315
  ApplyInitialStyles(atConstruction?: boolean): void;
316
+ /**
317
+ * C# IsChildrenItem: added by the app (JSX children or the `Children` list), not a part the control made itself. A new
318
+ * `Children` list drops only these, so a control's own parts keep their place.
319
+ */
320
+ IsChildrenItem: boolean;
201
321
  AddSubView(_control: SkiaControl): void;
202
322
  InsertSubView(_index: number, control: SkiaControl): void;
203
323
  RemoveSubView(_control: SkiaControl): void;
@@ -205,6 +325,20 @@ export declare class SkiaControl {
205
325
  _superview?: Canvas;
206
326
  get Superview(): Canvas | undefined;
207
327
  MeasuredSize: ScaledSize;
328
+ /**
329
+ * The size the control's content needs, in pixels with its margins, after the last measure: as MeasuredSize but a Fill
330
+ * axis keeps the content's size instead of taking the whole constraint (fit-content: requests, min / max applied). A
331
+ * stack that sizes itself to its children on the cross axis reads it (drawnui-cross 6an).
332
+ */
333
+ FitPixels: {
334
+ Width: number;
335
+ Height: number;
336
+ };
337
+ /** Set by MeasureAbsolute when the content's fit size differs from the size it returns (a layout with Fill children). */
338
+ protected fitContentPixels?: {
339
+ Width: number;
340
+ Height: number;
341
+ };
208
342
  DrawingRect: SKRect;
209
343
  RenderingScale: number;
210
344
  NeedMeasure: boolean;
@@ -220,6 +354,14 @@ export declare class SkiaControl {
220
354
  protected MeasureAbsolute(_widthConstraint: number, _heightConstraint: number, scale: number): ScaledSize;
221
355
  /** Places MeasuredSize inside destination per Margin + Horizontal/VerticalOptions -> DrawingRect. */
222
356
  Arrange(destination: SKRect, _widthRequest: number, _heightRequest: number, scale: number): void;
357
+ /**
358
+ * A cached ancestor replays its picture where a re-arrange moved it (a scroll) without rendering this control again,
359
+ * so the matrix made at its last Render moves with its rect: taps, hover and the accessibility rect stay on what is
360
+ * drawn (C# offsets the cached render tree instead). A control that renders again gets a fresh matrix there.
361
+ */
362
+ private FollowMatrix;
363
+ /** C# SuperViewChanged: starts the animators queued before this control was attached. */
364
+ private StartPendingAnimators;
223
365
  private static nextAccessibilityId;
224
366
  /** Stable identity for the DOM overlay. */
225
367
  readonly AccessibilityId: number;
@@ -236,6 +378,22 @@ export declare class SkiaControl {
236
378
  */
237
379
  get AccessibilityRole(): string | undefined;
238
380
  set AccessibilityRole(v: string | undefined);
381
+ /**
382
+ * On an arrow-key group (a container with a composite role such as `Aria.RoleMenu` or `Aria.RoleList`): the arrows go
383
+ * round, from the last item to the first and back, instead of stopping at the ends, as in desktop menus. Home / End
384
+ * unchanged. Default false (C# KeyboardWrap, Rust keyboard_wrap).
385
+ */
386
+ KeyboardWrap: boolean;
387
+ private accessibilityModal;
388
+ /**
389
+ * A modal overlay, such as a dialog drawn over the screen (C# AccessibilityModal, drawnui-cross 6av): while it shows,
390
+ * screen readers and Tab reach only its controls (and open popup windows); the content around it leaves accessibility
391
+ * until it goes. With several, the one drawn on top wins. The keyboard moves into it when it appears while the
392
+ * keyboard is in use, and back when it goes. Taps are not affected: blocking them is the backdrop's job. Without a role
393
+ * of its own it reads as a dialog. Default false: nothing changes unless an app sets it.
394
+ */
395
+ get AccessibilityModal(): boolean;
396
+ set AccessibilityModal(v: boolean);
239
397
  /** Per-class default role (React extension): e.g. `SkiaLabel.DefaultAccessibilityRole = Aria.RoleText` reads every label. */
240
398
  static DefaultAccessibilityRole?: string;
241
399
  /** Spoken label; unset = the control's own text (SkiaLabel.Text, SkiaButton.Text). */
@@ -244,7 +402,22 @@ export declare class SkiaControl {
244
402
  protected DefaultAccessibilityLabel(): string | undefined;
245
403
  get AccessibilityHint(): string | undefined;
246
404
  set AccessibilityHint(v: string | undefined);
247
- /** Tab stop + activation; unset = true when the control handles Tapped. */
405
+ /** Text of the tooltip shown when the mouse rests on the control (drawnui-cross 6ar); undefined = none. */
406
+ Tooltip?: string;
407
+ /** The control may have tooltip text: the cheap check made on every mouse move. */
408
+ get MayHaveTooltip(): boolean;
409
+ /**
410
+ * The text of this control's tooltip, undefined for none: `Tooltip`, else with `Super.TooltipsFromAccessibility` its
411
+ * `AccessibilityHint`, else its own `AccessibilityLabel` when it shows no text of its own (icon buttons).
412
+ */
413
+ GetTooltipText(): string | undefined;
414
+ /** The control shows text of its own (a label with text, spans included, inside it). */
415
+ ShowsText(): boolean;
416
+ /**
417
+ * Whether keyboard navigation and assistive technology may focus and use this node: the explicit value, else the class
418
+ * default (true when the control handles Tapped), and in both cases only while a tap could reach the control
419
+ * (CanReceiveGesture), so Tab, Enter / Space and screen-reader activation never use a control the pointer cannot.
420
+ */
248
421
  get AccessibilityCanInteract(): boolean;
249
422
  set AccessibilityCanInteract(v: boolean);
250
423
  protected DefaultAccessibilityCanInteract(): boolean;
@@ -253,9 +426,15 @@ export declare class SkiaControl {
253
426
  * host's pointer cursor. Default: the control as a whole (AccessibilityCanInteract); SkiaLabel adds its tappable spans.
254
427
  */
255
428
  WantsPointerCursor(_x: number, _y: number): boolean;
429
+ /** A range control's value for screen readers (slider, progress); undefined for everything else (drawnui-cross 6c). */
430
+ get AccessibilityValue(): import("./Accessibility").AccessibilityValue | undefined;
256
431
  /** aria-pressed for toggles; undefined = not a toggle. */
257
432
  get AccessibilityIsPressed(): boolean | undefined;
258
433
  set AccessibilityIsPressed(v: boolean | undefined);
434
+ private accessibilityExpanded?;
435
+ /** A control that opens something, such as a menu title: whether it is open now (aria-expanded). Unset: it opens nothing. */
436
+ get AccessibilityExpanded(): boolean | undefined;
437
+ set AccessibilityExpanded(v: boolean | undefined);
259
438
  /** aria-live: `Aria.LivePolite` / `Aria.LiveAssertive`; changes are announced immediately. */
260
439
  get AccessibilityLive(): string | undefined;
261
440
  set AccessibilityLive(v: string | undefined);
@@ -281,6 +460,30 @@ export declare class SkiaControl {
281
460
  OnAccessibilityActivated(): void;
282
461
  /** Overlay focus arrives on / leaves this node (inputs may activate their sink here). */
283
462
  OnAccessibilityFocused(_focused: boolean): void;
463
+ /**
464
+ * Keyboard navigation hands this control the keys it may use while it holds keyboard focus (ArrowLeft / Right / Up /
465
+ * Down, Home, End, PageUp, PageDown, DOM `event.code` names). Return true when the key was used; the default uses none,
466
+ * so the key moves focus inside the arrow-key group around the control.
467
+ */
468
+ OnAccessibilityKey(_key: InputKey): boolean;
469
+ /**
470
+ * Whether a pointer gesture of this kind would reach this control, by the rules the gesture dispatch applies: the
471
+ * control and every ancestor draw, none of them is InputTransparent, no ancestor keeps this gesture from its children
472
+ * (LockChildrenGestures, PassNone included) and the control accepts input (AcceptsInput). Opacity does not count, as
473
+ * for the pointer. Keyboard navigation uses it: Tapped for Tab and Enter / Space, Panning for the arrow keys.
474
+ */
475
+ CanReceiveGesture(gesture: SkiaGesturesParameters["Type"]): boolean;
476
+ /**
477
+ * False while the control ignores input itself: RespondsToGestures = false on a button, toggle, slider, scroll...
478
+ * Taps, keyboard and the accessibility state (reported disabled) all follow it (drawnui-cross 6w). Default true.
479
+ */
480
+ protected AcceptsInput(): boolean;
481
+ /**
482
+ * What a control that takes no input returns for a gesture that reached it (C# BlockedGestureResult): it keeps a
483
+ * press, tap or long press, so nothing under it reacts to them, and lets moves and wheel go on to the controls around
484
+ * it (a scroll behind it still scrolls).
485
+ */
486
+ protected BlockedGestureResult(args: SkiaGesturesParameters): SkiaControl | null;
284
487
  NotifyAccessibilityFocused(focused: boolean): void;
285
488
  /** DrawnUi SmartMax: larger of two sizes, an infinite one loses. */
286
489
  protected static SmartMax(a: number, b: number): number;
@@ -289,6 +492,8 @@ export declare class SkiaControl {
289
492
  private static Align;
290
493
  /** Called after DrawingRect changed; layouts arrange children here. */
291
494
  protected OnLayoutChanged(): void;
495
+ /** A control in CanvasLeaveWatchers left its canvas (removed or disposed): it lets go of what it held there. */
496
+ OnLeftCanvas(): void;
292
497
  /** Part of DrawingRect that can actually be seen: intersected with every ancestor (a scroll's box clips its content). */
293
498
  GetVisibleViewport(): SKRect;
294
499
  /** Draws the control: from its cache when it has one, else background + Paint(); overlays always live. */
@@ -303,8 +508,22 @@ export declare class SkiaControl {
303
508
  /** DrawingRect grown by the effects margin, in pixels — the rect a cache is recorded for. */
304
509
  protected ExpandedCacheRect(scale: number): SKRect;
305
510
  Render(ctx: DrawingContext): void;
306
- /** Port of DrawnUi ApplyTransforms: T(-pivot) · rotation · scale/skew · T(pivot) · translation, in canvas pixels. */
511
+ /** Port of DrawnUi ApplyTransforms: T(-pivot) · rotation · scale/skew · 3D · T(pivot) · translation, in canvas pixels. */
307
512
  protected CreateRenderTransformMatrix(destination: SKRect, scale: number): number[];
513
+ /** C# camera distance of the 3D transforms (Sk3dView.CameraDistance): 8 inches at 72 dpi, in canvas pixels. */
514
+ static readonly CameraDistance = 576;
515
+ /**
516
+ * C# Create3dMatrix (Sk3dView): RotationX, then RotationY, then RotationZ (negated) around the pivot, projected from
517
+ * the camera; TranslationZ is depth, a flat control at depth z draws at camera / (camera − z).
518
+ */
519
+ static Create3dMatrix(rotationX: number, rotationY: number, rotationZ: number, translationZ: number): number[];
520
+ /** C# SkiaSamplingOptions.IsMoveOnly: the matrix only moves (or mirrors), so a bitmap keeps its pixels 1:1. */
521
+ static IsMoveOnly(m: ArrayLike<number>): boolean;
522
+ /**
523
+ * C# WillDrawDistorted: what this control draws here ends up scaled, turned, skewed or projected, by its own transforms
524
+ * or a live ancestor's (both in the canvas matrix) or by the picture it is recorded into. Images then sample smoothly.
525
+ */
526
+ protected WillDrawDistorted(ctx: DrawingContext): boolean;
308
527
  /** Maps a point given in the parent's space into this control's untransformed space (DrawnUi TransformPointToLocalSpace). */
309
528
  TransformPointToLocalSpace(point: SKPoint): SKPoint;
310
529
  /**
@@ -314,6 +533,8 @@ export declare class SkiaControl {
314
533
  private AlignedCacheRect;
315
534
  /** Cache blit or live paint, then post animators — the part a transform/opacity layer wraps. */
316
535
  private RenderContent;
536
+ /** Blits a cache: an image samples smoothly when drawn distorted; a picture being recorded learns it holds image blits. */
537
+ private DrawCache;
317
538
  /** Background + Paint(): the part of the control that a cache captures. */
318
539
  protected PaintContent(ctx: DrawingContext): void;
319
540
  /** Subclasses whose PaintBackground has something to draw without a BackgroundColor (shape shadows). */
@@ -359,7 +580,10 @@ export declare class SkiaControl {
359
580
  CreateGradient(rect: SKRect, g: SkiaGradient): import("canvaskit-wasm").Shader | null;
360
581
  /** C# SkiaGradient.LinearGradientAngleToPoints (CSS angle -> start/end ratios). */
361
582
  static LinearGradientAngleToPoints(direction: number): [number, number, number, number];
362
- /** C# MakeDarker / MakeLighter: HSL lightness scaled down (light < 1) or pushed toward white (light > 1). */
583
+ /**
584
+ * A gradient's Light: below 1 red, green and blue multiplied by Light (C# MakeDarker, as Rust); above 1 the HSL
585
+ * lightness multiplied by Light, clamped to 1, hue and saturation kept (.NET MAUI Color.AddLuminosity, C# f77136c4).
586
+ */
363
587
  static AdjustLightness(rgb: [number, number, number], light: number): [number, number, number];
364
588
  /** Override to draw own content into ctx.Destination. */
365
589
  protected Paint(_ctx: DrawingContext): void;
@@ -377,11 +601,51 @@ export declare class SkiaControl {
377
601
  Update(): void;
378
602
  /** Redraw without remeasure and WITHOUT dropping caches (position/overlay changes). */
379
603
  Repaint(): void;
604
+ /**
605
+ * A parent (not the control itself) is hidden: a change here asks for no frame and the latest state shows when the
606
+ * parent is shown again (C# 329f6c44 HiddenUpdateTests, DrawnUi.Rust hidden_updates). The control's own visibility
607
+ * change still draws: it is the one that hides or shows it.
608
+ */
609
+ UnderHiddenParent(): boolean;
610
+ /** The control or a parent is hidden: its animators pause until it shows again. */
611
+ HiddenInTree(): boolean;
612
+ /** The control an invalidation started at while it climbs (InvalidateMeasure): a hidden parent of it wakes no frame. */
613
+ private static invalidateOrigin;
380
614
  /**
381
615
  * Transform / Opacity changed: this control's own cache is still valid (content unchanged) but every ancestor
382
616
  * cache holds its composited output, so those are staled before redrawing (DrawnUi RedrawCanvas + parent invalidation).
383
617
  */
384
618
  RepaintComposition(): void;
619
+ /**
620
+ * Update() for a change of how this control looks, not of its size (a color set through props, C# NeedDraw): the same
621
+ * re-measure and cache invalidation, but an ImageComposite above redraws only this control's area instead of
622
+ * recording whole (drawnui-cross 6m). The record still goes whole when the control's rect changed after all.
623
+ */
624
+ UpdateDraw(): void;
625
+ /**
626
+ * A change of this control that keeps its layout, to every ImageComposite above: a direct child is drawn again whole
627
+ * (C# TrackChildAsDirty), a deeper control by its area, read now as it was drawn (its last matrix and effects margin).
628
+ */
629
+ private ReportToComposites;
630
+ /** The matrix this control will be drawn with (Render), from its current properties; undefined when none. */
631
+ private CurrentMatrix;
632
+ /** Where this control will be drawn: its rect grown by its effects margin, through its current matrix. */
633
+ private DrawnBoundsNow;
634
+ private static MapRect;
635
+ /** Its output depends on all of its content (a visual effect; a backdrop samples below): a change inside redraws it whole. */
636
+ protected get SamplesContent(): boolean;
637
+ /**
638
+ * Where a deep change shows inside the composite (drawnui-cross 6m rule b): the control as drawn before and as drawn
639
+ * now, then through the transform of every ancestor up to the composite. undefined: draw the child whole (an effect
640
+ * or a backdrop on the way, the control gone from the child); null: the layout changed, record whole.
641
+ */
642
+ private static DeepArea;
643
+ /**
644
+ * DrawnUi IsParentIndependent: this control's size never changes the layout around it, so its own invalidation
645
+ * stops here (ancestors composite again, nothing above re-measures). The parent re-measures it on draw when
646
+ * NeedMeasure is set. Used by SkiaScroll for its scroll bars.
647
+ */
648
+ IsParentIndependent: boolean;
385
649
  /** Size or content may have changed: this control and all ancestors remeasure and re-record. */
386
650
  InvalidateMeasure(): void;
387
651
  /** Hit rect in pixels (no transforms in this port, so it is DrawingRect). */
@@ -404,6 +668,11 @@ export declare class SkiaControl {
404
668
  * ConsumeGestures hook -> children top-most first -> own Tapped. Returns the consumer or null.
405
669
  */
406
670
  ProcessGestures(args: SkiaGesturesParameters, apply: GestureEventProcessingInfo): SkiaControl | null;
671
+ /**
672
+ * The gesture comes from a finger, a pen or the primary (left) mouse button (C# IsPrimaryPointer). Tap and press
673
+ * animations (Ripple) play only for those: a right or middle click raises its events but shows no tap feedback.
674
+ */
675
+ static IsPrimaryPointer(args: SkiaGesturesParameters): boolean;
407
676
  /** Fires Tapped (after AnimationTapped feedback); true when a handler existed (= consumed), like DrawnUi SendTapped. */
408
677
  protected SendTapped(args: SkiaGesturesParameters, apply: GestureEventProcessingInfo): boolean;
409
678
  /** Canvas-pixel touch location -> points relative to this control's top-left. */
@@ -413,7 +682,11 @@ export declare class SkiaControl {
413
682
  AnimateAsync(callback: (value: number) => void, onCancel?: () => void, ms?: number, easing?: Easing, cancel?: AbortSignal): Promise<void>;
414
683
  /** callback(start..end) over ms. */
415
684
  AnimateRangeAsync(callback: (value: number) => void, start: number, end: number, ms?: number, easing?: Easing, cancel?: AbortSignal): Promise<void>;
416
- /** One running animation per kind, like the per-property CancellationTokenSources in C#. */
685
+ /**
686
+ * One running animation per kind, like the per-property CancellationTokenSources in C#. A replaced animation rejects
687
+ * with an AbortError for code that awaits it, and is quiet otherwise (as a cancelled, unobserved Task in .NET): no
688
+ * "Uncaught (in promise)" in the console for fire-and-forget calls.
689
+ */
417
690
  private RunOwnAnimation;
418
691
  FadeToAsync(end: number, ms?: number, easing?: Easing, cancel?: AbortSignal): Promise<void>;
419
692
  ScaleToAsync(x: number, y: number, ms?: number, easing?: Easing, cancel?: AbortSignal): Promise<void>;