drawnui-react 0.1.0-preview.8 → 1.0.1

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