drawnui-react 0.1.0-preview.2 → 0.1.0-preview.21

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 (87) hide show
  1. package/README.md +17 -4
  2. package/SKIPPED.md +33 -27
  3. package/dist/controls/AnimatedFramesRenderer.d.ts +7 -0
  4. package/dist/controls/AnimatedFramesRenderer.js +16 -1
  5. package/dist/controls/DrawnGame.d.ts +40 -0
  6. package/dist/controls/DrawnGame.js +64 -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 +48 -8
  11. package/dist/controls/SkiaButton.d.ts +19 -2
  12. package/dist/controls/SkiaButton.js +41 -11
  13. package/dist/controls/SkiaCarousel.d.ts +9 -1
  14. package/dist/controls/SkiaCarousel.js +16 -3
  15. package/dist/controls/SkiaCheckbox.d.ts +0 -1
  16. package/dist/controls/SkiaCheckbox.js +0 -6
  17. package/dist/controls/SkiaDrawer.d.ts +2 -0
  18. package/dist/controls/SkiaDrawer.js +2 -0
  19. package/dist/controls/SkiaEditor.d.ts +12 -1
  20. package/dist/controls/SkiaEditor.js +46 -19
  21. package/dist/controls/SkiaGif.d.ts +3 -0
  22. package/dist/controls/SkiaGif.js +12 -2
  23. package/dist/controls/SkiaImage.js +15 -10
  24. package/dist/controls/SkiaLabel.d.ts +54 -3
  25. package/dist/controls/SkiaLabel.js +235 -52
  26. package/dist/controls/SkiaLabelFps.d.ts +16 -0
  27. package/dist/controls/SkiaLabelFps.js +41 -0
  28. package/dist/controls/SkiaLayout.d.ts +64 -7
  29. package/dist/controls/SkiaLayout.js +316 -19
  30. package/dist/controls/SkiaLottie.js +4 -2
  31. package/dist/controls/SkiaProgress.d.ts +2 -1
  32. package/dist/controls/SkiaProgress.js +6 -3
  33. package/dist/controls/SkiaRadioButton.js +4 -3
  34. package/dist/controls/SkiaScroll.d.ts +35 -5
  35. package/dist/controls/SkiaScroll.js +233 -23
  36. package/dist/controls/SkiaScrollBar.d.ts +27 -0
  37. package/dist/controls/SkiaScrollBar.js +51 -2
  38. package/dist/controls/SkiaShaderCarousel.d.ts +5 -0
  39. package/dist/controls/SkiaShaderCarousel.js +5 -0
  40. package/dist/controls/SkiaShape.d.ts +13 -2
  41. package/dist/controls/SkiaShape.js +50 -10
  42. package/dist/controls/SkiaSlider.d.ts +20 -2
  43. package/dist/controls/SkiaSlider.js +59 -5
  44. package/dist/controls/SkiaSprite.d.ts +1 -0
  45. package/dist/controls/SkiaSprite.js +4 -0
  46. package/dist/controls/SkiaSvg.js +1 -1
  47. package/dist/controls/SkiaSwitch.d.ts +0 -1
  48. package/dist/controls/SkiaSwitch.js +0 -6
  49. package/dist/controls/SkiaToggle.d.ts +25 -5
  50. package/dist/controls/SkiaToggle.js +58 -5
  51. package/dist/controls/SnappingLayout.d.ts +12 -1
  52. package/dist/controls/SnappingLayout.js +19 -1
  53. package/dist/core/Accessibility.d.ts +80 -0
  54. package/dist/core/Accessibility.js +365 -8
  55. package/dist/core/Animators.d.ts +37 -1
  56. package/dist/core/Animators.js +102 -9
  57. package/dist/core/Canvas.d.ts +108 -7
  58. package/dist/core/Canvas.js +363 -35
  59. package/dist/core/Easing.d.ts +12 -1
  60. package/dist/core/Easing.js +25 -1
  61. package/dist/core/Gestures.d.ts +48 -2
  62. package/dist/core/Gestures.js +95 -3
  63. package/dist/core/Hover.d.ts +47 -0
  64. package/dist/core/Hover.js +134 -0
  65. package/dist/core/KeyboardManager.d.ts +13 -0
  66. package/dist/core/KeyboardManager.js +18 -0
  67. package/dist/core/ScrollAnimators.js +9 -0
  68. package/dist/core/SkiaControl.d.ts +216 -7
  69. package/dist/core/SkiaControl.js +516 -59
  70. package/dist/core/SkiaEffect.d.ts +17 -0
  71. package/dist/core/SkiaEffect.js +43 -8
  72. package/dist/core/SkiaImageManager.js +1 -1
  73. package/dist/core/Styles.d.ts +51 -0
  74. package/dist/core/Styles.js +92 -0
  75. package/dist/core/Super.d.ts +17 -1
  76. package/dist/core/Super.js +35 -4
  77. package/dist/core/ViewsAdapter.d.ts +7 -2
  78. package/dist/core/ViewsAdapter.js +10 -3
  79. package/dist/index.d.ts +4 -0
  80. package/dist/index.js +4 -0
  81. package/dist/react/SkiaShell.js +33 -14
  82. package/dist/react/index.d.ts +15 -4
  83. package/dist/react/index.js +102 -15
  84. package/dist/react/reconciler.js +34 -12
  85. package/dist/vite/index.d.ts +9 -0
  86. package/dist/vite/index.js +36 -3
  87. package/package.json +33 -3
@@ -1,8 +1,9 @@
1
1
  import type { Canvas as SkCanvas, Image, Path, SkPicture, Surface } from "canvaskit-wasm";
2
2
  import { type Color, type LayoutOptions, SKRect, ScaledSize, type SkiaCacheType, type SkiaGradient, type SkiaTouchAnimation, Thickness } from "./Types";
3
- import { type IOverlayEffect } from "./Animators";
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
  /**
@@ -83,6 +107,14 @@ export declare class SkiaControl {
83
107
  /** Degrees. */
84
108
  SkewX: number;
85
109
  SkewY: number;
110
+ /** Degrees, a 3D turn around the horizontal axis through the pivot, seen with perspective (C# RotationX). */
111
+ RotationX: number;
112
+ /** Degrees, a 3D turn around the vertical axis through the pivot (C# RotationY). */
113
+ RotationY: number;
114
+ /** Degrees, a 3D turn around the axis facing the viewer, after RotationX and RotationY (C# RotationZ). */
115
+ RotationZ: number;
116
+ /** Depth: toward the viewer (+, bigger) or away (−, smaller), turned or flat; draws at 576 / (576 − TranslationZ) (C# TranslationZ). */
117
+ TranslationZ: number;
86
118
  /** Pivot for Rotation/Scale/Skew as a fraction of the box (MAUI default 0.5). */
87
119
  AnchorX: number;
88
120
  AnchorY: number;
@@ -106,6 +138,7 @@ export declare class SkiaControl {
106
138
  get Scale(): number;
107
139
  set Scale(v: number);
108
140
  get HasTransform(): boolean;
141
+ private get Has3d();
109
142
  /** Matrix applied at the last render (canvas space), undefined when none; gestures map through its inverse. */
110
143
  RenderTransformMatrix?: number[];
111
144
  /** Generic numeric parameters (DrawnUi Value1/Value2): SkiaShape Arc uses start angle / sweep angle in degrees. */
@@ -124,6 +157,11 @@ export declare class SkiaControl {
124
157
  /** What to cache for this subtree; see SkiaCacheType. Layouts default to None, SkiaLabel/SkiaSvg to Operations. */
125
158
  UseCache: SkiaCacheType;
126
159
  /** The cache type actually applied (None while caching is disabled globally). */
160
+ /**
161
+ * C# HostsBackdrop: a SkiaBackdrop inside asked this picture-cached control to draw live (a picture would replay
162
+ * the backdrop's screen copy frozen). Stays set after the backdrop is removed: the control just keeps drawing live.
163
+ */
164
+ HostsBackdrop: boolean;
127
165
  get UsingCacheType(): SkiaCacheType;
128
166
  /** C# IsCacheComposite: the offscreen surface is kept and only the changed children are re-recorded. */
129
167
  get IsCacheComposite(): boolean;
@@ -135,18 +173,43 @@ export declare class SkiaControl {
135
173
  private compositeSurface?;
136
174
  /** Own content or structure changed: the next composite record is a full one. */
137
175
  private compositeFull;
176
+ /** Where the kept composite surface starts relative to DrawingRect (the effects margin it was laid out with). */
177
+ private compositeInsetX;
178
+ private compositeInsetY;
138
179
  /** Canvas-pixel bounds this control covered when its parent last recorded it (composite erase region). */
139
180
  private lastCompositeBounds?;
140
- /** What the last composite record did (diagnostics): "full" or "partial", the number of children re-recorded and which ones. */
181
+ /**
182
+ * What the last composite record did (diagnostics): "full" or "partial", the number of children re-recorded and which
183
+ * ones; Areas: the pixels erased and drawn again for changes deeper than a child (C# Areas), Changed: the controls
184
+ * those areas belong to (C# Changed).
185
+ */
141
186
  LastCompositeRecord: {
142
187
  Mode: "full" | "partial";
143
188
  Children: number;
144
189
  Dirty: readonly SkiaControl[];
190
+ Areas: readonly SKRect[];
191
+ Changed: readonly SkiaControl[];
145
192
  };
193
+ /** C# MaxCompositionAreas: more areas than this in one composite record draw it whole instead. */
194
+ static MaxCompositionAreas: number;
195
+ /** C# MaxCompositionShare: areas covering more than this share of a composite draw it whole instead. */
196
+ static MaxCompositionShare: number;
197
+ /**
198
+ * Changes deeper than a direct child since the last composite record (drawnui-cross 6m): the control, the direct child
199
+ * it is in, where it was drawn before the change (its own drawn bounds, as drawn) and its rect then.
200
+ */
201
+ private compositeDeep?;
202
+ /** Set while an UpdateDraw climbs: the ancestors re-measure but an ImageComposite among them keeps its partial record. */
203
+ private static drawOrigin;
146
204
  /** The children a composite record can re-record individually; layouts return their views. */
147
205
  protected GetCompositeChildren(): readonly SkiaControl[];
148
206
  /** C# TrackChildAsDirty (DirtyChildrenTracker): the child changed without a remeasure of this control. */
149
207
  TrackChildAsDirty(child: SkiaControl): void;
208
+ private static readonly rejectRect;
209
+ /** Its cache must be recorded before it can be drawn (none, dirty, another type, scale, size or GPU context). */
210
+ private CacheStale;
211
+ /** Its rect grown by its effects margin, through the matrix it is drawn with, lies outside the canvas clip. */
212
+ private OutsideClip;
150
213
  /** Drawn bounds in canvas pixels including transforms and effects margins (C# GetTransformedDirtyBounds). */
151
214
  GetTransformedDirtyBounds(): SKRect;
152
215
  /** Current cache, if any. */
@@ -157,6 +220,36 @@ export declare class SkiaControl {
157
220
  /** Consume every gesture that lands on this control so nothing below (z-order) receives it. */
158
221
  BlockGesturesBelow: boolean;
159
222
  LockChildrenGestures: LockTouch;
223
+ private receivesHover?;
224
+ /**
225
+ * Whether this control takes mouse hover: the canvas sets IsHovered while the mouse is over it. Opt-in: false by
226
+ * default, true by default only in the controls that always had hover (SkiaButton, SkiaSlider, the toggles,
227
+ * SkiaRadioButton, SkiaCarousel, SkiaDrawer), never because a control has a tap handler. A HoverChanged handler turns
228
+ * it on (C# fluent OnHovered) unless it is set.
229
+ */
230
+ get ReceivesHover(): boolean;
231
+ set ReceivesHover(value: boolean);
232
+ /** The value of ReceivesHover until it is set. */
233
+ protected ReceivesHoverByDefault(): boolean;
234
+ private isHovered;
235
+ /**
236
+ * True while the mouse is over this control and it takes hover. Every such control under the pointer is hovered at
237
+ * once (a card and the button inside it, as CSS :hover); it stays as it is while content moves under the pointer and
238
+ * is checked again when that stops. Touch never hovers.
239
+ */
240
+ get IsHovered(): boolean;
241
+ /** IsHovered changed: true when the mouse came over this control, false when it left (C# HoverChanged / OnHovered). */
242
+ HoverChanged?: (sender: SkiaControl, hovered: boolean) => void;
243
+ /** Set by the canvas's HoverManager. */
244
+ ApplyHover(on: boolean): void;
245
+ /** A scroll, carousel or drawer moving its content right now: hover waits until it stops (C# IsScrolling / InTransition). */
246
+ MovesContent(): boolean;
247
+ /**
248
+ * Hover hit path (HoverManager): this control is under the point (in its own space), its children under it follow,
249
+ * top-most first, by the routing rules of ProcessGestures. True when this subtree blocks gestures below it, so the
250
+ * controls under it get no hover (a popup over a list).
251
+ */
252
+ CollectHovered(point: SKPoint, into: SkiaControl[], xs?: number[], ys?: number[]): boolean;
160
253
  TouchEffectColor: Color;
161
254
  /** Plays a ripple (from the tap point) when Tapped fires. */
162
255
  AnimationTapped: SkiaTouchAnimation;
@@ -164,6 +257,11 @@ export declare class SkiaControl {
164
257
  AnimationTappedSpeed: number;
165
258
  /** Overlay effects drawn above this control's content every frame (ripple etc). */
166
259
  readonly PostAnimators: IOverlayEffect[];
260
+ /**
261
+ * C# PendingUnattachedAnimators: animators started while no Canvas was above this control yet (e.g. a game loop
262
+ * started in a constructor). They start on the control's first arrange, where C# starts them in SuperViewChanged.
263
+ */
264
+ PendingUnattachedAnimators?: AnimatorBase[];
167
265
  private visualEffects;
168
266
  /** Post-renderer effects among VisualEffects (C# EffectPostRenderers). */
169
267
  EffectPostRenderers: (SkiaEffect & IPostRendererEffect)[];
@@ -175,7 +273,12 @@ export declare class SkiaControl {
175
273
  protected OnVisualEffectsChanged(): void;
176
274
  /** Post renderers that can render this frame (compiled shaders); an unready effect leaves the control drawn plainly. */
177
275
  private ActivePostRenderers;
178
- /** C# CachedImage: the cached texture and the canvas rect it was rasterized over (Image caches only). */
276
+ /**
277
+ * C# CachedImage: the cached texture (Image caches only) and the canvas rect it covers NOW. Scrolled content is
278
+ * re-arranged here, not drawn through a translated canvas, so a cache recorded before its control moved is blitted
279
+ * at the control's current aligned rect (RenderContent) and its record-time Bounds are stale: an effect sampling it
280
+ * there (the slides of a SkiaShaderCarousel after the page scrolled) was off by the scroll amount.
281
+ */
179
282
  get CachedImage(): CachedTexture | undefined;
180
283
  /** Clip overlay effects to the control's shape (CreateClip). */
181
284
  ClipEffects: boolean;
@@ -191,6 +294,18 @@ export declare class SkiaControl {
191
294
  ConsumeGestures?: (sender: SkiaControl, e: SkiaGesturesInfo) => void;
192
295
  Parent?: SkiaControl;
193
296
  /** Containers override; a leaf control cannot host children. */
297
+ private styledInitially;
298
+ /**
299
+ * C# ApplyInitialStyles: takes the property defaults registered with `ConfigureStyles` for this control's class.
300
+ * The reconciler calls it with `atConstruction` right after `new`, before the JSX props, so props win; a control
301
+ * built in code-behind is styled on its first measure and keeps whatever the code already set.
302
+ */
303
+ ApplyInitialStyles(atConstruction?: boolean): void;
304
+ /**
305
+ * C# IsChildrenItem: added by the app (JSX children or the `Children` list), not a part the control made itself. A new
306
+ * `Children` list drops only these, so a control's own parts keep their place.
307
+ */
308
+ IsChildrenItem: boolean;
194
309
  AddSubView(_control: SkiaControl): void;
195
310
  InsertSubView(_index: number, control: SkiaControl): void;
196
311
  RemoveSubView(_control: SkiaControl): void;
@@ -213,6 +328,14 @@ export declare class SkiaControl {
213
328
  protected MeasureAbsolute(_widthConstraint: number, _heightConstraint: number, scale: number): ScaledSize;
214
329
  /** Places MeasuredSize inside destination per Margin + Horizontal/VerticalOptions -> DrawingRect. */
215
330
  Arrange(destination: SKRect, _widthRequest: number, _heightRequest: number, scale: number): void;
331
+ /**
332
+ * A cached ancestor replays its picture where a re-arrange moved it (a scroll) without rendering this control again,
333
+ * so the matrix made at its last Render moves with its rect: taps, hover and the accessibility rect stay on what is
334
+ * drawn (C# offsets the cached render tree instead). A control that renders again gets a fresh matrix there.
335
+ */
336
+ private FollowMatrix;
337
+ /** C# SuperViewChanged: starts the animators queued before this control was attached. */
338
+ private StartPendingAnimators;
216
339
  private static nextAccessibilityId;
217
340
  /** Stable identity for the DOM overlay. */
218
341
  readonly AccessibilityId: number;
@@ -237,7 +360,11 @@ export declare class SkiaControl {
237
360
  protected DefaultAccessibilityLabel(): string | undefined;
238
361
  get AccessibilityHint(): string | undefined;
239
362
  set AccessibilityHint(v: string | undefined);
240
- /** Tab stop + activation; unset = true when the control handles Tapped. */
363
+ /**
364
+ * Whether keyboard navigation and assistive technology may focus and use this node: the explicit value, else the class
365
+ * default (true when the control handles Tapped), and in both cases only while a tap could reach the control
366
+ * (CanReceiveGesture), so Tab, Enter / Space and screen-reader activation never use a control the pointer cannot.
367
+ */
241
368
  get AccessibilityCanInteract(): boolean;
242
369
  set AccessibilityCanInteract(v: boolean);
243
370
  protected DefaultAccessibilityCanInteract(): boolean;
@@ -246,6 +373,8 @@ export declare class SkiaControl {
246
373
  * host's pointer cursor. Default: the control as a whole (AccessibilityCanInteract); SkiaLabel adds its tappable spans.
247
374
  */
248
375
  WantsPointerCursor(_x: number, _y: number): boolean;
376
+ /** A range control's value for screen readers (slider, progress); undefined for everything else (drawnui-cross 6c). */
377
+ get AccessibilityValue(): import("./Accessibility").AccessibilityValue | undefined;
249
378
  /** aria-pressed for toggles; undefined = not a toggle. */
250
379
  get AccessibilityIsPressed(): boolean | undefined;
251
380
  set AccessibilityIsPressed(v: boolean | undefined);
@@ -274,6 +403,30 @@ export declare class SkiaControl {
274
403
  OnAccessibilityActivated(): void;
275
404
  /** Overlay focus arrives on / leaves this node (inputs may activate their sink here). */
276
405
  OnAccessibilityFocused(_focused: boolean): void;
406
+ /**
407
+ * Keyboard navigation hands this control the keys it may use while it holds keyboard focus (ArrowLeft / Right / Up /
408
+ * Down, Home, End, PageUp, PageDown, DOM `event.code` names). Return true when the key was used; the default uses none,
409
+ * so the key moves focus inside the arrow-key group around the control.
410
+ */
411
+ OnAccessibilityKey(_key: InputKey): boolean;
412
+ /**
413
+ * Whether a pointer gesture of this kind would reach this control, by the rules the gesture dispatch applies: the
414
+ * control and every ancestor draw, none of them is InputTransparent, no ancestor keeps this gesture from its children
415
+ * (LockChildrenGestures, PassNone included) and the control accepts input (AcceptsInput). Opacity does not count, as
416
+ * for the pointer. Keyboard navigation uses it: Tapped for Tab and Enter / Space, Panning for the arrow keys.
417
+ */
418
+ CanReceiveGesture(gesture: SkiaGesturesParameters["Type"]): boolean;
419
+ /**
420
+ * False while the control ignores input itself: RespondsToGestures = false on a button, toggle, slider, scroll...
421
+ * Taps, keyboard and the accessibility state (reported disabled) all follow it (drawnui-cross 6w). Default true.
422
+ */
423
+ protected AcceptsInput(): boolean;
424
+ /**
425
+ * What a control that takes no input returns for a gesture that reached it (C# BlockedGestureResult): it keeps a
426
+ * press, tap or long press, so nothing under it reacts to them, and lets moves and wheel go on to the controls around
427
+ * it (a scroll behind it still scrolls).
428
+ */
429
+ protected BlockedGestureResult(args: SkiaGesturesParameters): SkiaControl | null;
277
430
  NotifyAccessibilityFocused(focused: boolean): void;
278
431
  /** DrawnUi SmartMax: larger of two sizes, an infinite one loses. */
279
432
  protected static SmartMax(a: number, b: number): number;
@@ -296,8 +449,22 @@ export declare class SkiaControl {
296
449
  /** DrawingRect grown by the effects margin, in pixels — the rect a cache is recorded for. */
297
450
  protected ExpandedCacheRect(scale: number): SKRect;
298
451
  Render(ctx: DrawingContext): void;
299
- /** Port of DrawnUi ApplyTransforms: T(-pivot) · rotation · scale/skew · T(pivot) · translation, in canvas pixels. */
452
+ /** Port of DrawnUi ApplyTransforms: T(-pivot) · rotation · scale/skew · 3D · T(pivot) · translation, in canvas pixels. */
300
453
  protected CreateRenderTransformMatrix(destination: SKRect, scale: number): number[];
454
+ /** C# camera distance of the 3D transforms (Sk3dView.CameraDistance): 8 inches at 72 dpi, in canvas pixels. */
455
+ static readonly CameraDistance = 576;
456
+ /**
457
+ * C# Create3dMatrix (Sk3dView): RotationX, then RotationY, then RotationZ (negated) around the pivot, projected from
458
+ * the camera; TranslationZ is depth, a flat control at depth z draws at camera / (camera − z).
459
+ */
460
+ static Create3dMatrix(rotationX: number, rotationY: number, rotationZ: number, translationZ: number): number[];
461
+ /** C# SkiaSamplingOptions.IsMoveOnly: the matrix only moves (or mirrors), so a bitmap keeps its pixels 1:1. */
462
+ static IsMoveOnly(m: ArrayLike<number>): boolean;
463
+ /**
464
+ * C# WillDrawDistorted: what this control draws here ends up scaled, turned, skewed or projected, by its own transforms
465
+ * or a live ancestor's (both in the canvas matrix) or by the picture it is recorded into. Images then sample smoothly.
466
+ */
467
+ protected WillDrawDistorted(ctx: DrawingContext): boolean;
301
468
  /** Maps a point given in the parent's space into this control's untransformed space (DrawnUi TransformPointToLocalSpace). */
302
469
  TransformPointToLocalSpace(point: SKPoint): SKPoint;
303
470
  /**
@@ -307,6 +474,8 @@ export declare class SkiaControl {
307
474
  private AlignedCacheRect;
308
475
  /** Cache blit or live paint, then post animators — the part a transform/opacity layer wraps. */
309
476
  private RenderContent;
477
+ /** Blits a cache: an image samples smoothly when drawn distorted; a picture being recorded learns it holds image blits. */
478
+ private DrawCache;
310
479
  /** Background + Paint(): the part of the control that a cache captures. */
311
480
  protected PaintContent(ctx: DrawingContext): void;
312
481
  /** Subclasses whose PaintBackground has something to draw without a BackgroundColor (shape shadows). */
@@ -370,11 +539,51 @@ export declare class SkiaControl {
370
539
  Update(): void;
371
540
  /** Redraw without remeasure and WITHOUT dropping caches (position/overlay changes). */
372
541
  Repaint(): void;
542
+ /**
543
+ * A parent (not the control itself) is hidden: a change here asks for no frame and the latest state shows when the
544
+ * parent is shown again (C# 329f6c44 HiddenUpdateTests, DrawnUi.Rust hidden_updates). The control's own visibility
545
+ * change still draws: it is the one that hides or shows it.
546
+ */
547
+ UnderHiddenParent(): boolean;
548
+ /** The control or a parent is hidden: its animators pause until it shows again. */
549
+ HiddenInTree(): boolean;
550
+ /** The control an invalidation started at while it climbs (InvalidateMeasure): a hidden parent of it wakes no frame. */
551
+ private static invalidateOrigin;
373
552
  /**
374
553
  * Transform / Opacity changed: this control's own cache is still valid (content unchanged) but every ancestor
375
554
  * cache holds its composited output, so those are staled before redrawing (DrawnUi RedrawCanvas + parent invalidation).
376
555
  */
377
556
  RepaintComposition(): void;
557
+ /**
558
+ * Update() for a change of how this control looks, not of its size (a color set through props, C# NeedDraw): the same
559
+ * re-measure and cache invalidation, but an ImageComposite above redraws only this control's area instead of
560
+ * recording whole (drawnui-cross 6m). The record still goes whole when the control's rect changed after all.
561
+ */
562
+ UpdateDraw(): void;
563
+ /**
564
+ * A change of this control that keeps its layout, to every ImageComposite above: a direct child is drawn again whole
565
+ * (C# TrackChildAsDirty), a deeper control by its area, read now as it was drawn (its last matrix and effects margin).
566
+ */
567
+ private ReportToComposites;
568
+ /** The matrix this control will be drawn with (Render), from its current properties; undefined when none. */
569
+ private CurrentMatrix;
570
+ /** Where this control will be drawn: its rect grown by its effects margin, through its current matrix. */
571
+ private DrawnBoundsNow;
572
+ private static MapRect;
573
+ /** Its output depends on all of its content (a visual effect; a backdrop samples below): a change inside redraws it whole. */
574
+ protected get SamplesContent(): boolean;
575
+ /**
576
+ * Where a deep change shows inside the composite (drawnui-cross 6m rule b): the control as drawn before and as drawn
577
+ * now, then through the transform of every ancestor up to the composite. undefined: draw the child whole (an effect
578
+ * or a backdrop on the way, the control gone from the child); null: the layout changed, record whole.
579
+ */
580
+ private static DeepArea;
581
+ /**
582
+ * DrawnUi IsParentIndependent: this control's size never changes the layout around it, so its own invalidation
583
+ * stops here (ancestors composite again, nothing above re-measures). The parent re-measures it on draw when
584
+ * NeedMeasure is set. Used by SkiaScroll for its scroll bars.
585
+ */
586
+ IsParentIndependent: boolean;
378
587
  /** Size or content may have changed: this control and all ancestors remeasure and re-record. */
379
588
  InvalidateMeasure(): void;
380
589
  /** Hit rect in pixels (no transforms in this port, so it is DrawingRect). */