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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -49,6 +49,13 @@ property names, layout and drawing rules. What you learn here works there, and s
49
49
 
50
50
  DrawnUI is MIT licensed in every language and on every platform: desktop, mobile, web and embedded devices. Ship it in commercial products with no attribution badge, no about screen and no per-device royalty.
51
51
 
52
+ ## What's new in 0.1.0-preview.44
53
+
54
+ - **3D add-on 0.1.0-preview.44:** pictures on 3D models are drawn smooth, with their mipmaps and anisotropic
55
+ filtering (images on materials, the product box of the [demo](https://add3dreact.drawnui.net)).
56
+ - **FPS counter:** the FPS counter shows the real frame rate: `SkiaLabelFps` keeps the canvas drawing while it is
57
+ shown, as in DrawnUI for .NET and Rust.
58
+
52
59
  ## What's new in 0.1.0-preview.43
53
60
 
54
61
  - **3D add-on:** [`drawnui-react-add3d`](https://www.npmjs.com/package/drawnui-react-add3d) puts real 3D inside the
package/SKIPPED.md CHANGED
@@ -58,7 +58,7 @@ DrawnUi name and semantics; nothing here is a redesign, only an omission.
58
58
  | `AccessibilityModal`, `Canvas.ArrowsStartKeyboardNavigation` | ported | drawnui-cross 6av, C# 6e87c9ae / 914428d2 / 981ff09e / 86467ece / 77d1dca4 / 6aee5c51: a shown modal limits screen readers and Tab to its subtree plus popup windows (topmost wins), reads as a dialog with its name, takes the keyboard when it appears with the keyboard in use and gives it back when it goes; the flat overlay's container is the dialog (role, name, aria-modal). With nothing focused (or only a control behind the modal) and the canvas option on, an arrow starts keyboard navigation. SkiaShell popups and modals are such dialogs (the popup wrapper is no Tab stop). Live regions are read on the next frame. |
59
59
  | Keyboard navigation (drawnui-cross 6c) | ported | Through the accessibility overlay, the DrawnUi.Blazor way: Tab / Shift+Tab walk the interactive nodes in reading order, Enter / Space activate (`SkiaAccessibilityManager.Activate`), ArrowLeft / Right / Up / Down, Home / End, PageUp / PageDown go to the focused control first (`OnAccessibilityKey`, `SkiaAccessibilityManager.Key`: `SkiaSlider` steps, `SkiaEditor` keeps them while editing), then to its arrow-key group (`MoveInGroup`). A container with a composite role (`Aria.IsCompositeRole`: list, listbox, grid, toolbar, radiogroup, tablist, menu, menubar) is one Tab stop (roving tabindex, `IsTabStop`, entered on the item focused last); the arrows move by item index (Column: Up / Down, Row: Left / Right, Wrap / Grid / Split: all four, Up / Down by a row), no wrap, items not realized are scrolled in with `ScrollToIndex` and focused once drawn (`OnKeyboardFocusRequested`). `SkiaEditor` is a Tab stop: Tab in takes the caret, Tab / Shift+Tab leave it for the next node (also after a click into it). Focus ring = the overlay element's `:focus-visible` outline; focus scrolls the node into view in every enclosing scroll. Not ported: `FocusedChild` / canvas `KeyboardFocusNode`, Escape leaving the drawn nodes, a canvas-drawn focus ring. |
60
60
  | Canvas draw events | ported | `WillFirstTimeDraw` (once, right before the first frame drawn on a ready surface, with that frame's `{ Canvas, Surface }`), `WasDrawn` (after every frame, no context, like the C# `null`), `WasRendered` (set after the first frame completes, so the first `WasDrawn` still sees `false`, C# order), `CanRender` (surface ready). JSX: `<Canvas WillFirstTimeDraw WasDrawn>`; the engine draws frame 1 in its constructor, so the component hands both callbacks to the constructor's `init`. Not ported: `WillDraw`. |
61
- | Rendering stats | partial | `Canvas.FPS` (frames drawn over the last second) and `Canvas.FrameTime` (ms of the last measure + arrange + render, GPU flush excluded) are computed every frame and reachable from React through the `<Canvas>` ref. `SkiaLabelFps` ported (label on top, input-transparent, parent-independent, re-measures itself on draw; its value changes only on frames that running animators request, see PARITY). Not ported: `SkiaLabelFps.ForceRefresh` / `Format` / `MonoForDigits`, `Super.EnableRenderingStats`. |
61
+ | Rendering stats | partial | `Canvas.FPS` (frames drawn over the last second) and `Canvas.FrameTime` (ms of the last measure + arrange + render, GPU flush excluded) are computed every frame and reachable from React through the `<Canvas>` ref. `SkiaLabelFps` ported (label on top, input-transparent, parent-independent, re-measures itself on draw; it shows the value on every frame it draws and asks for the next one, so the canvas keeps drawing while it is shown, as DrawnUi.Net and Rust). Not ported: `SkiaLabelFps.ForceRefresh` / `Format` / `MonoForDigits`, `Super.EnableRenderingStats`. |
62
62
  | Insets / safe areas | ported | `Super.Insets` measures `env(safe-area-inset-*)` off a probe element (once, and again on resize / orientation), `Super.OnInsetsChanged` notifies; `SkiaShell` pads its nav and tab bars with them. Not ported: the C# per-page `IgnoreSafeArea` / MAUI inset plumbing. |
63
63
 
64
64
  ## Controls
@@ -2,10 +2,9 @@ import type { DrawingContext } from "../core/SkiaControl";
2
2
  import { SkiaLabel } from "./SkiaLabel";
3
3
  /**
4
4
  * Mirrors DrawnUi SkiaLabelFps: a label showing the canvas FPS, drawn above its siblings, input-transparent, never
5
- * re-laying out its parent. Divergence: C# sets Text on every draw, and each new value asks for another frame, so
6
- * the counter keeps an idle canvas redrawing. Here the value changes only on frames that running animators already
7
- * request (scroll inertia, transitions, Lottie, game loops): the counter never asks for a frame itself, and an idle
8
- * canvas keeps the last value measured. Not ported: ForceRefresh, Format, MonoForDigits.
5
+ * re-laying out its parent. It shows the value on every frame it draws and asks for the next one, so while it is on
6
+ * screen the canvas keeps drawing and the number is the frame rate the canvas reaches (as DrawnUi.Net and Rust). Not
7
+ * ported: ForceRefresh, Format, MonoForDigits.
9
8
  */
10
9
  export declare class SkiaLabelFps extends SkiaLabel {
11
10
  constructor();
@@ -2,10 +2,9 @@ import { Aria } from "../core/Accessibility";
2
2
  import { SkiaLabel } from "./SkiaLabel";
3
3
  /**
4
4
  * Mirrors DrawnUi SkiaLabelFps: a label showing the canvas FPS, drawn above its siblings, input-transparent, never
5
- * re-laying out its parent. Divergence: C# sets Text on every draw, and each new value asks for another frame, so
6
- * the counter keeps an idle canvas redrawing. Here the value changes only on frames that running animators already
7
- * request (scroll inertia, transitions, Lottie, game loops): the counter never asks for a frame itself, and an idle
8
- * canvas keeps the last value measured. Not ported: ForceRefresh, Format, MonoForDigits.
5
+ * re-laying out its parent. It shows the value on every frame it draws and asks for the next one, so while it is on
6
+ * screen the canvas keeps drawing and the number is the frame rate the canvas reaches (as DrawnUi.Net and Rust). Not
7
+ * ported: ForceRefresh, Format, MonoForDigits.
9
8
  */
10
9
  export class SkiaLabelFps extends SkiaLabel {
11
10
  constructor() {
@@ -22,9 +21,14 @@ export class SkiaLabelFps extends SkiaLabel {
22
21
  }
23
22
  Render(ctx) {
24
23
  const view = this.Superview;
25
- // the frame this asks for is requested anyway by the running animators
26
- if (view && view.AnimatingControls.size > 0)
27
- this.Text = `FPS ${view.FPS.toFixed(1).padStart(4, "0")}`;
24
+ // as SkiaControl.Render: a hidden or transparent label draws nothing and asks for nothing
25
+ if (view && this.IsVisible && this.Opacity > 0 && !this.IsDisposed) {
26
+ const shown = `FPS ${view.FPS.toFixed(1).padStart(4, "0")}`;
27
+ if (shown !== this.Text)
28
+ this.Text = shown;
29
+ // the next frame (C#'s ever-changing value asks for it the same way): the counter shows what the canvas reaches
30
+ view.Update();
31
+ }
28
32
  // parent-independent: it measures itself again in its slot as it draws (SkiaControl.Render)
29
33
  super.Render(ctx);
30
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drawnui-react",
3
- "version": "0.1.0-preview.43",
3
+ "version": "0.1.0-preview.44",
4
4
  "description": "DrawnUi for React: the DrawnUi (.NET) drawn-UI engine in TypeScript on CanvasKit (Skia WASM). Same controls, same PascalCase API as DrawnUi.Net.",
5
5
  "license": "MIT",
6
6
  "author": "Nick Kovalsky (AppoMobi)",
@@ -125,6 +125,7 @@
125
125
  "check:a11y-opacity": "node dev/check.mjs dev/check-a11y-opacity.ts",
126
126
  "check:a11y-presentational": "node dev/check.mjs dev/check-a11y-presentational.ts",
127
127
  "check:password-a11y": "node dev/check.mjs dev/check-password-a11y.ts",
128
+ "check:fps-label": "node dev/check.mjs dev/check-fps-label.ts",
128
129
  "check:release-velocity": "node dev/check.mjs dev/check-release-velocity.ts",
129
130
  "check:quiet-animations": "node dev/check.mjs dev/check-quiet-animations.ts",
130
131
  "check:skew-sign": "node dev/check.mjs dev/check-skew-sign.ts",