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,18 +1,47 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
3
+ import { SkiaAccessibilityManager } from "../core/Accessibility";
4
+ import { KeyboardManager } from "../core/KeyboardManager";
5
+ import { TextInputProxy } from "../core/TextInputProxy";
3
6
  import { Canvas as CanvasView } from "../core/Canvas";
7
+ import { SkiaEditor as SkiaEditorCtrl } from "../controls/SkiaEditor";
4
8
  import { SkiaScroll as SkiaScrollCtrl } from "../controls/SkiaScroll";
5
9
  import { createDrawnRoot } from "./reconciler";
10
+ export { DesignerSourceOf } from "./reconciler";
11
+ import { DesignerActions, designerAction } from "../core/DesignerActions";
12
+ export { DesignerActions, designerAction };
13
+ /**
14
+ * A Designer action that exists while the component is mounted (DesignerActions): `path` is its groups and name,
15
+ * slash-separated ("Levels/Level 3"); `run` is called when the designer runs it (always the latest `run` passed). It is
16
+ * registered again when the path or one of `deps` changes. Nothing runs without a designer attached.
17
+ */
18
+ export function useDesignerAction(path, run, deps = []) {
19
+ const latest = useRef(run);
20
+ latest.current = run;
21
+ // eslint-disable-next-line react-hooks/exhaustive-deps
22
+ useEffect(() => designerAction(path, () => latest.current()), [path, ...deps]);
23
+ }
24
+ /**
25
+ * A Designer action as an element (for JSX and NX): declared while it is mounted, `onRun` called when the designer runs
26
+ * it. Draws nothing. `<DesignerAction Name="Levels/Level 3" onRun={() => startLevel(3)} />`
27
+ */
28
+ export function DesignerAction({ Name, onRun }) {
29
+ useDesignerAction(Name, onRun);
30
+ return null;
31
+ }
6
32
  /** Typed JSX tags resolved by the reconciler Registry. */
7
33
  export const SkiaLayout = "SkiaLayout";
8
34
  export const SkiaStack = "SkiaStack";
9
35
  export const SkiaRow = "SkiaRow";
10
36
  export const SkiaLayer = "SkiaLayer";
11
37
  export const SkiaWrap = "SkiaWrap";
38
+ export const SkiaMasonry = "SkiaMasonry";
12
39
  export const SkiaGrid = "SkiaGrid";
13
40
  /** Grid drawing gradient separator lines in its spacing (C# SkiaDecoratedGrid). */
14
41
  export const SkiaDecoratedGrid = "SkiaDecoratedGrid";
15
42
  export const SkiaLabel = "SkiaLabel";
43
+ /** Canvas FPS counter (C# SkiaLabelFps); its value changes only on frames running animators request anyway. */
44
+ export const SkiaLabelFps = "SkiaLabelFps";
16
45
  /** Markdown label (C# SkiaRichLabel): Text is markdown, rendered as spans; LinkTapped for [text](url). */
17
46
  export const SkiaRichLabel = "SkiaRichLabel";
18
47
  /** Child of <SkiaLabel>: a styled fragment (C# TextSpan). */
@@ -62,19 +91,49 @@ function removeStaticContent() {
62
91
  for (const el of document.querySelectorAll("[data-drawnui-static]"))
63
92
  el.remove();
64
93
  }
94
+ /**
95
+ * Opens a popup window (drawnui-cross 6at) whose content is drawn elements, e.g. a menu:
96
+ * `OpenPopupWindow(canvas, <SkiaShape ...>...</SkiaShape>, e.Location)`. The elements are rendered at once in a React
97
+ * root of their own and unmounted when the popup closes; the anchor is a point (canvas points), a rect, a control or a
98
+ * `PopupAnchor`. Returns the popup's id (for `canvas.ClosePopupWindow`).
99
+ */
100
+ export function OpenPopupWindow(canvas, content, anchor, options) {
101
+ const holder = { Content: undefined };
102
+ const root = createDrawnRoot(holder);
103
+ root.renderSync(content);
104
+ const control = holder.Content;
105
+ if (!control) {
106
+ root.unmount();
107
+ throw new Error("DrawnUi: OpenPopupWindow content rendered no control");
108
+ }
109
+ const id = canvas.OpenPopupWindow(control, anchor, options);
110
+ const closed = (which) => {
111
+ if (which !== id)
112
+ return;
113
+ canvas.PopupWindowClosed.delete(closed);
114
+ root.unmount();
115
+ };
116
+ canvas.PopupWindowClosed.add(closed);
117
+ return id;
118
+ }
65
119
  /**
66
120
  * Mirrors DrawnUi Canvas: the bridge between the DOM (react-dom) and the drawn tree (DrawnUi reconciler).
67
121
  * Requires Super.UseDrawnUi()...BuildAsync() to have completed.
68
122
  */
69
- export function Canvas({ BackgroundColor, RenderingMode, Gestures, children, style, className, ref: viewRef, ContextMenu }) {
123
+ export function Canvas({ BackgroundColor, RenderingMode, Gestures, ArrowsStartKeyboardNavigation, children, style, className, ref: viewRef, ContextMenu, WillFirstTimeDraw, WasDrawn, SystemThemeChanged }) {
70
124
  const ref = useRef(null);
71
125
  const view = useRef(null);
72
126
  const root = useRef(null);
73
127
  const [engine, setEngine] = useState(null);
74
128
  useLayoutEffect(() => {
75
- const v = new CanvasView(ref.current);
76
- if (RenderingMode)
77
- v.RenderingMode = RenderingMode;
129
+ // the engine draws frame 1 inside its constructor: the draw events and the rendering mode must be on it before that
130
+ const v = new CanvasView(ref.current, (c) => {
131
+ if (RenderingMode)
132
+ c.RenderingMode = RenderingMode;
133
+ c.WillFirstTimeDraw = WillFirstTimeDraw;
134
+ c.WasDrawn = WasDrawn;
135
+ c.SystemThemeChanged = SystemThemeChanged;
136
+ });
78
137
  view.current = v;
79
138
  root.current = createDrawnRoot(v);
80
139
  setEngine(v);
@@ -92,11 +151,17 @@ export function Canvas({ BackgroundColor, RenderingMode, Gestures, children, sty
92
151
  v.Update();
93
152
  }
94
153
  v.Gestures = Gestures ?? "Disabled";
154
+ v.ArrowsStartKeyboardNavigation = ArrowsStartKeyboardNavigation ?? false;
95
155
  v.ContextMenu = ContextMenu;
156
+ v.WillFirstTimeDraw = WillFirstTimeDraw;
157
+ v.WasDrawn = WasDrawn;
158
+ v.SystemThemeChanged = SystemThemeChanged;
96
159
  root.current.render(children);
97
160
  });
98
- // The drawn surface is aria-hidden; the overlay is the accessibility tree (DrawnUi.Blazor pattern).
99
- return (_jsxs("div", { className: className, style: { position: "relative", ...style }, children: [_jsx("canvas", { ref: ref, "aria-hidden": true, style: { display: "block", width: "100%", height: "100%" } }), engine && _jsx(AccessibilityOverlay, { view: engine })] }));
161
+ // The drawn surface is aria-hidden; the overlay is the accessibility tree (DrawnUi.Blazor pattern). The host takes the
162
+ // DOM focus (from code only, no ring) when the focused control leaves: no control is focused and the keys belong to the
163
+ // app, as in the other engines, while a screen reader stays at the canvas instead of the top of the page.
164
+ return (_jsxs("div", { className: className, tabIndex: -1, "data-drawnui-host": "1", style: { position: "relative", outline: "none", ...style }, children: [_jsx("canvas", { ref: ref, "aria-hidden": true, style: { display: "block", width: "100%", height: "100%" } }), engine && _jsx(AccessibilityOverlay, { view: engine })] }));
100
165
  }
101
166
  const A11Y_CSS = `
102
167
  .drawnui-a11y-overlay{position:absolute;inset:0;overflow:hidden;pointer-events:none;user-select:none;-webkit-user-select:none}
@@ -108,19 +173,77 @@ const A11Y_CSS = `
108
173
  .drawnui-a11y-text>span{position:absolute;white-space:pre;color:transparent;user-select:text;-webkit-user-select:text;pointer-events:auto;cursor:text;line-height:1;font-kerning:none;font-feature-settings:"kern" 0,"liga" 0,"calt" 0;text-rendering:geometricPrecision}
109
174
  .drawnui-a11y-text>span::selection{background:rgba(110,168,254,.55);color:transparent}
110
175
  `;
176
+ const NAVIGATION_KEYS = new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"]);
111
177
  /**
112
- * Invisible ARIA elements mirroring the accessible drawn controls, positioned over the canvas.
113
- * Improvement over DrawnUi.Blazor: `pointer-events:none`, so hover and every pointer gesture still reach the canvas —
114
- * keyboard (Tab / Enter / Space) and screen-reader activation arrive as DOM events and are routed back as a Tapped.
178
+ * Invisible ARIA elements mirroring the accessible drawn controls, positioned over the canvas (the DrawnUi.Blazor
179
+ * overlay). Improvement over DrawnUi.Blazor: `pointer-events:none`, so hover and every pointer gesture still reach the
180
+ * canvas. Keyboard and screen-reader input arrive as DOM events: Enter / Space activate (a Tapped), the navigation keys
181
+ * go to the focused control and then to its arrow-key group; a group is one Tab stop (roving tabindex).
115
182
  */
183
+ /** aria-valuenow / min / max / valuetext of a range control (drawnui-cross 6c); a slider reads as horizontal. */
184
+ function valueAttributes(n) {
185
+ const v = n.Value;
186
+ if (!v)
187
+ return undefined;
188
+ return { "aria-valuenow": v.Now, "aria-valuemin": v.Min, "aria-valuemax": v.Max, "aria-valuetext": v.Text || undefined, "aria-orientation": n.Role === "slider" ? "horizontal" : undefined };
189
+ }
116
190
  function AccessibilityOverlay({ view }) {
117
191
  const [nodes, setNodes] = useState(() => view.AccessibilityManager.Snapshot);
192
+ // keyboard focus moved by the manager (arrow keys in a group): focus that node's element once it is rendered
193
+ const [focusRequest, setFocusRequest] = useState();
194
+ // the Tab stop of a group moves with keyboard focus: re-render on focus
195
+ const [, setFocusTick] = useState(0);
118
196
  useEffect(() => {
119
197
  const mgr = view.AccessibilityManager;
120
198
  setNodes(mgr.Snapshot);
121
199
  const off = mgr.OnChanged(() => setNodes(mgr.Snapshot));
122
200
  const offLive = mgr.OnLiveRegionUpdated(() => { mgr.ForceRebuildOnNextFrame(); view.Update(); });
123
- return () => { off(); offLive(); };
201
+ const offFocus = mgr.OnKeyboardFocusRequested((node) => { setNodes(mgr.Snapshot); setFocusRequest({ id: node?.AccessibilityId ?? 0 }); });
202
+ return () => { off(); offLive(); offFocus(); };
203
+ }, [view]);
204
+ const elementOf = (id) => overlayRef.current?.querySelector(`[data-a11y-id="${id}"]`) ?? undefined;
205
+ useLayoutEffect(() => {
206
+ if (!focusRequest)
207
+ return;
208
+ setFocusRequest(undefined);
209
+ // no node: the app took the focus away (SetAccessibilityFocus()), the DOM focus goes back to the canvas host
210
+ if (!focusRequest.id)
211
+ overlayRef.current?.parentElement?.focus({ preventScroll: true });
212
+ else
213
+ elementOf(focusRequest.id)?.focus({ preventScroll: true });
214
+ }, [focusRequest]);
215
+ // the focused node went away (its page or popup closed): no control keeps the focus and its ring goes with it, the keys
216
+ // belong to the app again (as in the other engines); the DOM focus stays on the canvas host, so a screen reader is not
217
+ // thrown to the top of the page and the next Tab starts from the canvas. A focus the user moved away stays away.
218
+ const focusedId = useRef(0);
219
+ useLayoutEffect(() => {
220
+ const id = focusedId.current;
221
+ if (!id || nodes.some((n) => n.Id === id))
222
+ return;
223
+ focusedId.current = 0;
224
+ if (view.AccessibilityManager.FocusedNode?.AccessibilityId === id)
225
+ view.AccessibilityManager.NotifyFocused(undefined);
226
+ const active = document.activeElement;
227
+ if (active && active !== document.body)
228
+ return;
229
+ overlayRef.current?.parentElement?.focus({ preventScroll: true });
230
+ }, [nodes]);
231
+ // Tab / Shift+Tab in a text field leave it for the next node, also after a click into it: DOM focus goes to the
232
+ // field's own element (without taking the caret again) and the browser's Tab moves on from there
233
+ const tabbingOut = useRef(0);
234
+ useEffect(() => {
235
+ const onKey = (e) => {
236
+ const editor = SkiaEditorCtrl.Focused;
237
+ if (e.key !== "Tab" || !editor || editor.Superview !== view || !TextInputProxy.IsProxyTarget(e.target))
238
+ return;
239
+ const el = elementOf(editor.AccessibilityId);
240
+ if (!el)
241
+ return;
242
+ tabbingOut.current = editor.AccessibilityId;
243
+ el.focus({ preventScroll: true });
244
+ };
245
+ document.addEventListener("keydown", onKey, true);
246
+ return () => document.removeEventListener("keydown", onKey, true);
124
247
  }, [view]);
125
248
  // selectable text spans take pointer events: the wheel over them is re-dispatched to the canvas so drawn scrolls keep working
126
249
  const overlayRef = useRef(null);
@@ -153,17 +276,56 @@ function AccessibilityOverlay({ view }) {
153
276
  return null;
154
277
  // the browser scrolls an overflow:hidden container to reveal a focused child; the overlay must stay pinned to the canvas
155
278
  const pin = (e) => { e.currentTarget.scrollTop = 0; e.currentTarget.scrollLeft = 0; };
156
- return (_jsxs("div", { className: "drawnui-a11y-overlay", onScroll: pin, ref: overlayRef, children: [_jsx("style", { children: A11Y_CSS }), nodes.map((n) => {
279
+ // an active modal (drawnui-cross 6av): the overlay itself is the dialog (role, name, aria-modal) around the dialog's
280
+ // controls, which are its elements; aria-modal on a separate element of this flat overlay would hide them
281
+ const modal = view.AccessibilityManager.ActiveModal;
282
+ const modalNode = modal ? nodes.find((n) => n.Source === modal) : undefined;
283
+ return (_jsxs("div", { className: "drawnui-a11y-overlay", onScroll: pin, ref: overlayRef, role: modal ? modalNode?.Role ?? "dialog" : undefined, "aria-label": modalNode?.Label, "aria-modal": modal ? true : undefined, children: [_jsx("style", { children: A11Y_CSS }), nodes.map((n) => {
284
+ if (n === modalNode)
285
+ return null;
157
286
  const pos = { left: n.Rect.Left, top: n.Rect.Top, width: n.Rect.Width, height: n.Rect.Height };
158
- const activate = () => n.Source.OnAccessibilityActivated();
159
- return n.CanInteract ? (_jsx("div", { role: n.Role, "aria-label": n.Label, title: n.Hint, "aria-pressed": n.Role === "button" ? n.IsPressed : undefined, "aria-checked": n.Role === "switch" || n.Role === "checkbox" || n.Role === "radio" ? n.IsPressed : undefined, "aria-live": n.Live, tabIndex: 0, className: "drawnui-a11y-node", style: { ...pos, fontSize: 0, userSelect: "none" }, onClick: activate, onKeyDown: (e) => { if (e.key === "Enter" || e.key === " ") {
160
- e.preventDefault();
161
- activate();
162
- } }, onFocus: (e) => { pin({ currentTarget: e.currentTarget.parentElement }); SkiaScrollCtrl.EnsureVisible(n.Source); n.Source.OnAccessibilityFocused(true); n.Source.NotifyAccessibilityFocused(true); }, onBlur: () => { n.Source.OnAccessibilityFocused(false); n.Source.NotifyAccessibilityFocused(false); }, children: n.Label }, n.Id)) : n.TextLines ? (
287
+ const activate = () => SkiaAccessibilityManager.Activate(n.Source);
288
+ return n.CanInteract ? (_jsx("div", { "data-a11y-id": n.Id, role: n.Role, "aria-label": n.Label, title: n.Hint, ...valueAttributes(n), "aria-pressed": n.Role === "button" ? n.IsPressed : undefined, "aria-expanded": n.Expanded, "aria-haspopup": n.Expanded !== undefined && n.Role === "menuitem" ? "menu" : undefined, "aria-checked": n.Role === "switch" || n.Role === "checkbox" || n.Role === "radio" ? n.IsPressed : undefined, "aria-live": n.Live, tabIndex: view.AccessibilityManager.IsTabStop(n.Source) ? 0 : -1, className: "drawnui-a11y-node", style: { ...pos, fontSize: 0, userSelect: "none" }, onClick: activate, onContextMenu: (e) => { if (view.OpenContextMenuFromKeyboard(n.Source, e.nativeEvent))
289
+ e.preventDefault(); }, onKeyDown: (e) => {
290
+ // the canvas navigation gets the key first; the app's KeyDown runs after it with IsKeyHandled (6az)
291
+ if (e.key === "Enter" || e.key === " ") {
292
+ e.preventDefault();
293
+ if (activate())
294
+ KeyboardManager.MarkKeyHandled(e.nativeEvent.code);
295
+ }
296
+ else if (e.key === "Tab" && view.AccessibilityManager.KeyboardScope) {
297
+ // an open popup window keeps the keyboard: Tab goes round its stops (a menu is one stop)
298
+ e.preventDefault();
299
+ const next = view.AccessibilityManager.NextTabStop(n.Source, !e.shiftKey);
300
+ if (next)
301
+ elementOf(next.AccessibilityId)?.focus({ preventScroll: true });
302
+ }
303
+ else if (NAVIGATION_KEYS.has(e.key) && SkiaAccessibilityManager.Key(n.Source, e.key)) {
304
+ e.preventDefault();
305
+ KeyboardManager.MarkKeyHandled(e.nativeEvent.code);
306
+ }
307
+ }, onFocus: (e) => {
308
+ focusedId.current = n.Id;
309
+ pin({ currentTarget: e.currentTarget.parentElement });
310
+ SkiaScrollCtrl.EnsureVisible(n.Source); // inside every enclosing scroll
311
+ if (tabbingOut.current === n.Id)
312
+ tabbingOut.current = 0; // leaving a text field: it keeps no caret
313
+ else
314
+ n.Source.OnAccessibilityFocused(true); // a text field takes the caret, as after a click
315
+ n.Source.NotifyAccessibilityFocused(true);
316
+ setFocusTick((t) => t + 1);
317
+ }, onBlur: (e) => {
318
+ if (e.currentTarget.isConnected && focusedId.current === n.Id)
319
+ focusedId.current = 0; // moved away on purpose
320
+ if (TextInputProxy.IsProxyTarget(e.relatedTarget))
321
+ return; // a text field moved DOM focus to its own input
322
+ n.Source.OnAccessibilityFocused(false);
323
+ n.Source.NotifyAccessibilityFocused(false);
324
+ }, children: n.Label }, n.Id)) : n.TextLines ? (
163
325
  // AccessibilityTextSelectable: one positioned span per drawn line, in the drawn font, so the browser selects and copies it like HTML
164
- _jsx("div", { role: n.Role, title: n.Hint, "aria-live": n.Live, className: "drawnui-a11y-node drawnui-a11y-text", style: pos, children: n.TextLines.map((l, i) => (_jsxs("span", { "data-w": l.Width, style: { left: l.Left, top: l.Top, height: l.Height, fontFamily: l.FontFamily, fontWeight: l.FontWeight, fontSize: l.FontSize, lineHeight: `${l.Height}px` }, children: [l.Text, i < n.TextLines.length - 1 ? "\n" : ""] }, i))) }, n.Id)) : (
326
+ _jsx("div", { role: n.Role, title: n.Hint, "aria-disabled": n.Disabled || undefined, "aria-live": n.Live, className: "drawnui-a11y-node drawnui-a11y-text", style: pos, children: n.TextLines.map((l, i) => (_jsxs("span", { "data-w": l.Width, style: { left: l.Left, top: l.Top, height: l.Height, fontFamily: l.FontFamily, fontWeight: l.FontWeight, fontSize: l.FontSize, lineHeight: `${l.Height}px` }, children: [l.Text, i < n.TextLines.length - 1 ? "\n" : ""] }, i))) }, n.Id)) : (
165
327
  // static text is exposed as real (transparent) text content; aria-label only for roles that need a name
166
- _jsx("div", { role: n.Role, "aria-label": n.Role === "text" ? undefined : n.Label, title: n.Hint, "aria-live": n.Live, className: "drawnui-a11y-node", style: pos, children: n.Label }, n.Id));
328
+ _jsx("div", { role: n.Role, "aria-label": n.Role === "text" ? undefined : n.Label, title: n.Hint, ...valueAttributes(n), "aria-disabled": n.Disabled || undefined, "aria-live": n.Live, className: "drawnui-a11y-node", style: pos, children: n.Label }, n.Id));
167
329
  })] }));
168
330
  }
169
331
  // One import for apps: React tags + every engine type (Colors, Thickness, Super, gestures, animators...).
@@ -6,9 +6,29 @@ import { TextSpan } from "../controls/TextSpan";
6
6
  type HostInstance = SkiaControl | TextSpan;
7
7
  /** JSX tag name -> engine class. Add a control here to expose it to React. */
8
8
  export declare const Registry: Record<string, new () => HostInstance>;
9
+ /** What DrawnUI Designer reads about the JSX element that created a control (dev builds; undefined in production). */
10
+ export interface DesignerSource {
11
+ /** The React fiber that created the control. */
12
+ Fiber: unknown;
13
+ /** The name of the component that rendered the element (the fiber's owner). */
14
+ Component?: string;
15
+ /** The raw stack captured where the element was created. */
16
+ Stack?: string;
17
+ /** The first app frame of that stack: positions in the served (transformed) module, map them through its source map. */
18
+ File?: string;
19
+ Line?: number;
20
+ Column?: number;
21
+ }
22
+ /**
23
+ * The JSX element that created `control`, for DrawnUI Designer: its fiber, owner component and source position (parsed
24
+ * from the fiber's stack only when asked). Undefined in production builds and for controls made outside React.
25
+ */
26
+ export declare function DesignerSourceOf(control: SkiaControl): DesignerSource | undefined;
9
27
  /** Creates a React root whose container is an engine Canvas. */
10
28
  export declare function createDrawnRoot(canvas: Canvas): {
11
29
  render(children: ReactNode): void;
30
+ /** Renders and commits now: the container holds the drawn controls when it returns. */
31
+ renderSync(children: ReactNode): void;
12
32
  unmount(): void;
13
33
  };
14
34
  export {};
@@ -1,9 +1,11 @@
1
1
  import { createContext } from "react";
2
2
  import Reconciler from "react-reconciler";
3
3
  import { ConcurrentRoot, DefaultEventPriority } from "react-reconciler/constants";
4
+ import { SkiaControl } from "../core/SkiaControl";
4
5
  import { SkiaLabel } from "../controls/SkiaLabel";
5
6
  import { TextSpan } from "../controls/TextSpan";
6
7
  import { SkiaRichLabel } from "../controls/SkiaRichLabel";
8
+ import { SkiaLabelFps } from "../controls/SkiaLabelFps";
7
9
  import { SkiaSwitch } from "../controls/SkiaSwitch";
8
10
  import { SkiaCheckbox } from "../controls/SkiaCheckbox";
9
11
  import { SkiaRadioButton } from "../controls/SkiaRadioButton";
@@ -12,7 +14,7 @@ import { SkiaSlider } from "../controls/SkiaSlider";
12
14
  import { SkiaCarousel } from "../controls/SkiaCarousel";
13
15
  import { SkiaShaderCarousel } from "../controls/SkiaShaderCarousel";
14
16
  import { SkiaDrawer } from "../controls/SkiaDrawer";
15
- import { SkiaGrid, SkiaLayer, SkiaLayout, SkiaRow, SkiaStack, SkiaWrap } from "../controls/SkiaLayout";
17
+ import { SkiaGrid, SkiaLayer, SkiaLayout, SkiaMasonry, SkiaRow, SkiaStack, SkiaWrap } from "../controls/SkiaLayout";
16
18
  import { SkiaHotspot } from "../controls/SkiaHotspot";
17
19
  import { SkiaButton } from "../controls/SkiaButton";
18
20
  import { SkiaImage } from "../controls/SkiaImage";
@@ -31,18 +33,20 @@ import { SkiaScroll } from "../controls/SkiaScroll";
31
33
  import { SkiaFrame, SkiaShape } from "../controls/SkiaShape";
32
34
  /** JSX tag name -> engine class. Add a control here to expose it to React. */
33
35
  export const Registry = {
34
- SkiaLayout, SkiaStack, SkiaRow, SkiaLayer, SkiaWrap, SkiaGrid, SkiaDecoratedGrid, SkiaBackdrop, SkiaEditor, SkiaSprite, SkiaSpriteSet, SkiaLabel, SkiaRichLabel, TextSpan, SkiaHotspot, SkiaButton, SkiaImage, SkiaImageTiles, SkiaSvg, SkiaLottie, SkiaGif, SkiaScroll, SkiaScrollBar, RefreshIndicator, SkiaShape, SkiaFrame,
36
+ SkiaLayout, SkiaStack, SkiaRow, SkiaLayer, SkiaWrap, SkiaMasonry, SkiaGrid, SkiaDecoratedGrid, SkiaBackdrop, SkiaEditor, SkiaSprite, SkiaSpriteSet, SkiaLabel, SkiaLabelFps, SkiaRichLabel, TextSpan, SkiaHotspot, SkiaButton, SkiaImage, SkiaImageTiles, SkiaSvg, SkiaLottie, SkiaGif, SkiaScroll, SkiaScrollBar, RefreshIndicator, SkiaShape, SkiaFrame,
35
37
  SkiaSwitch, SkiaCheckbox, SkiaRadioButton, SkiaProgress, SkiaSlider, SkiaCarousel, SkiaShaderCarousel, SkiaDrawer,
36
38
  };
37
39
  const SKIP = new Set(["children", "key", "ref"]);
38
40
  /** Props that change how the subtree is composited, not what it contains: repaint, keep caches (DrawnUi RedrawCanvas). */
39
- const REPAINT_ONLY = new Set(["TranslationX", "TranslationY", "Rotation", "ScaleX", "ScaleY", "Scale", "SkewX", "SkewY", "AnchorX", "AnchorY", "Opacity"]);
41
+ const REPAINT_ONLY = new Set(["TranslationX", "TranslationY", "TranslationZ", "Rotation", "RotationX", "RotationY", "RotationZ", "ScaleX", "ScaleY", "Scale", "SkewX", "SkewY", "AnchorX", "AnchorY", "Opacity"]);
42
+ /** Props that change only how a control looks, never its size (C# NeedDraw): an ImageComposite above redraws only its area. */
43
+ const isDrawOnly = (k) => k.endsWith("Color") || k === "FillGradient" || k === "StrokeGradient";
40
44
  /**
41
45
  * Assigns changed props straight onto the control (same names as the C# properties).
42
46
  * Handler props (functions) are swapped without invalidating: inline arrows change identity every render.
43
47
  */
44
48
  function applyProps(inst, prev, next) {
45
- let changed = false, repaint = false;
49
+ let changed = false, repaint = false, layout = false;
46
50
  for (const k in next) {
47
51
  if (SKIP.has(k) || (prev && prev[k] === next[k]))
48
52
  continue;
@@ -51,23 +55,64 @@ function applyProps(inst, prev, next) {
51
55
  continue;
52
56
  if (REPAINT_ONLY.has(k))
53
57
  repaint = true;
54
- else
58
+ else {
55
59
  changed = true;
60
+ if (!isDrawOnly(k))
61
+ layout = true;
62
+ }
56
63
  }
57
64
  if (prev)
58
65
  for (const k in prev)
59
66
  if (!SKIP.has(k) && !(k in next)) {
60
67
  inst[k] = new inst.constructor()[k];
61
- changed = true;
68
+ changed = layout = true;
62
69
  }
63
- if (changed && prev)
64
- inst.Update();
70
+ if (changed && prev) {
71
+ if (layout || !(inst instanceof SkiaControl))
72
+ inst.Update();
73
+ else
74
+ inst.UpdateDraw();
75
+ }
65
76
  else if (repaint && prev)
66
77
  inst.RepaintComposition?.();
67
78
  }
79
+ // DrawnUI Designer, dev builds only: the React fiber that created each control (DesignerSourceOf). Vite replaces
80
+ // import.meta.env.DEV, false in production builds, so the map and its use compile away; without Vite it is undefined
81
+ // and nothing is kept.
82
+ const designerSources = import.meta.env?.DEV ? new WeakMap() : undefined;
83
+ /**
84
+ * The JSX element that created `control`, for DrawnUI Designer: its fiber, owner component and source position (parsed
85
+ * from the fiber's stack only when asked). Undefined in production builds and for controls made outside React.
86
+ */
87
+ export function DesignerSourceOf(control) {
88
+ if (!import.meta.env?.DEV)
89
+ return undefined;
90
+ const fiber = designerSources?.get(control);
91
+ if (!fiber)
92
+ return undefined;
93
+ const owner = fiber._debugOwner?.type;
94
+ const stack = fiber._debugStack?.stack;
95
+ const source = { Fiber: fiber, Component: typeof owner === "string" ? owner : owner?.displayName ?? owner?.name, Stack: stack };
96
+ // React's stack: "Error: react-stack-top-frame", the jsx runtime's own frame, then the frame that wrote the JSX
97
+ // ("at Card (url-or-path:line:col)", or "at url-or-path:line:col" for an anonymous function)
98
+ const frames = stack?.split("\n").filter((l) => /^\s*at /.test(l)) ?? [];
99
+ const m = frames.length > 1 ? /^\s*at (?:.*? \()?(.+?):(\d+):(\d+)\)?\s*$/.exec(frames[1]) : null;
100
+ if (m) {
101
+ source.File = m[1];
102
+ source.Line = Number(m[2]);
103
+ source.Column = Number(m[3]);
104
+ }
105
+ return source;
106
+ }
68
107
  let currentUpdatePriority = DefaultEventPriority;
69
108
  const noop = () => { };
70
109
  const hostContext = {};
110
+ function appendChild(parent, child) {
111
+ if (parent instanceof SkiaLayout)
112
+ return parent.InsertChild(child);
113
+ child.IsChildrenItem = true;
114
+ parent.AddSubView(child);
115
+ }
71
116
  // Record<string, unknown> absorbs members that react-reconciler 0.33 reads but @types 0.32 does not declare yet.
72
117
  const hostConfig = {
73
118
  supportsMutation: true,
@@ -80,7 +125,7 @@ const hostConfig = {
80
125
  cancelTimeout: clearTimeout,
81
126
  supportsMicrotasks: true,
82
127
  scheduleMicrotask: queueMicrotask,
83
- createInstance(type, props) {
128
+ createInstance(type, props, _root, _host, fiber) {
84
129
  const ctor = Registry[type];
85
130
  if (!ctor)
86
131
  throw new Error(`DrawnUi: unknown control <${type}>`);
@@ -88,17 +133,22 @@ const hostConfig = {
88
133
  // ConfigureStyles defaults first, the JSX props below override them (a TextSpan is not a control, it has none)
89
134
  inst.ApplyInitialStyles?.(true);
90
135
  applyProps(inst, null, props);
136
+ if (import.meta.env?.DEV)
137
+ designerSources.set(inst, fiber);
91
138
  return inst;
92
139
  },
93
140
  createTextInstance(text) {
94
141
  throw new Error(`DrawnUi: raw text "${text}" is not allowed, use <SkiaLabel Text="..." />`);
95
142
  },
96
- appendInitialChild: (parent, child) => parent.AddSubView(child),
97
- appendChild: (parent, child) => parent.AddSubView(child),
143
+ // JSX children are the app's children (C# IsChildrenItem): a layout keeps them in JSX order inside the slots they
144
+ // occupy, so its own parts keep their place; an existing child passed again is a move
145
+ appendInitialChild: (parent, child) => appendChild(parent, child),
146
+ appendChild: (parent, child) => appendChild(parent, child),
98
147
  insertBefore: (parent, child, before) => {
99
- const index = parent instanceof SkiaLayout ? parent.Views.indexOf(before)
100
- : parent instanceof SkiaLabel ? parent.Spans.indexOf(before) : 0;
101
- parent.InsertSubView(index, child);
148
+ if (parent instanceof SkiaLayout)
149
+ return parent.InsertChild(child, before);
150
+ child.IsChildrenItem = true;
151
+ parent.InsertSubView(parent instanceof SkiaLabel ? parent.Spans.indexOf(before) : 0, child);
102
152
  },
103
153
  removeChild: (parent, child) => parent.RemoveSubView(child),
104
154
  appendChildToContainer: (canvas, child) => { canvas.Content = child; },
@@ -157,6 +207,11 @@ export function createDrawnRoot(canvas) {
157
207
  const container = reconciler.createContainer(canvas, ConcurrentRoot, null, false, null, "", onError, onError, onError, noop, null);
158
208
  return {
159
209
  render(children) { reconciler.updateContainer(children, container, null, null); },
210
+ /** Renders and commits now: the container holds the drawn controls when it returns. */
211
+ renderSync(children) {
212
+ const r = reconciler;
213
+ r.flushSyncFromReconciler(() => reconciler.updateContainer(children, container, null, null));
214
+ },
160
215
  unmount() { reconciler.updateContainer(null, container, null, null); },
161
216
  };
162
217
  }
@@ -1,4 +1,13 @@
1
1
  import type { Plugin } from "vite";
2
+ /**
3
+ * Versioned addresses for the files of the public folder (fonts, images, sprites, shaders, Lottie, favicon). Their
4
+ * names never change, and a browser or CDN may keep them for hours, so after a publish a returning visitor could
5
+ * get new code with an old file. On build every public file gets a short content hash: index.html receives the map
6
+ * as `globalThis.DrawnUiAssetStamps` (read by `Super.ResolveAssetUrl`, which every engine loader fetches through)
7
+ * and its own `href` / `src` links to public files get `?v=<hash>`. A changed file gets a new address, an unchanged
8
+ * one keeps its address and stays cached. Bundled files (hashed names) need nothing. The dev server is left alone.
9
+ */
10
+ export declare function drawnUiAssetStamps(): Plugin;
2
11
  export interface DrawnUiStaticOptions {
3
12
  /**
4
13
  * Pages to generate, as URL hashes / paths appended to the site root ("" = the root page, "#/shapes"...).
@@ -1,9 +1,42 @@
1
1
  /**
2
- * Vite helpers for DrawnUi.React apps: `import { drawnUiStatic } from "drawnui-react/vite"`.
2
+ * Vite helpers for DrawnUi.React apps: `import { drawnUiStatic, drawnUiAssetStamps } from "drawnui-react/vite"`.
3
3
  * Build-time only; the runtime bundle never imports this module and the frame loop knows nothing about it.
4
4
  */
5
- import { readFileSync, writeFileSync } from "node:fs";
6
- import { resolve } from "node:path";
5
+ import { createHash } from "node:crypto";
6
+ import { readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
7
+ import { join, resolve } from "node:path";
8
+ /**
9
+ * Versioned addresses for the files of the public folder (fonts, images, sprites, shaders, Lottie, favicon). Their
10
+ * names never change, and a browser or CDN may keep them for hours, so after a publish a returning visitor could
11
+ * get new code with an old file. On build every public file gets a short content hash: index.html receives the map
12
+ * as `globalThis.DrawnUiAssetStamps` (read by `Super.ResolveAssetUrl`, which every engine loader fetches through)
13
+ * and its own `href` / `src` links to public files get `?v=<hash>`. A changed file gets a new address, an unchanged
14
+ * one keeps its address and stays cached. Bundled files (hashed names) need nothing. The dev server is left alone.
15
+ */
16
+ export function drawnUiAssetStamps() {
17
+ let stamps = {};
18
+ return {
19
+ name: "drawnui-asset-stamps",
20
+ apply: "build",
21
+ configResolved(config) {
22
+ const dir = config.publicDir;
23
+ if (!dir)
24
+ return;
25
+ for (const rel of readdirSync(dir, { recursive: true })) {
26
+ const file = join(dir, rel);
27
+ if (statSync(file).isFile())
28
+ stamps[rel.replace(/\\/g, "/")] = createHash("sha256").update(readFileSync(file)).digest("hex").slice(0, 10);
29
+ }
30
+ },
31
+ transformIndexHtml(html) {
32
+ const stamped = html.replace(/\b(href|src)="([^"?#:]+)"/g, (m, attr, url) => {
33
+ const v = stamps[url.replace(/^\.?\//, "")];
34
+ return v ? `${attr}="${url}?v=${v}"` : m;
35
+ });
36
+ return { html: stamped, tags: [{ tag: "script", children: `globalThis.DrawnUiAssetStamps=${JSON.stringify(stamps)}`, injectTo: "head-prepend" }] };
37
+ },
38
+ };
39
+ }
7
40
  /**
8
41
  * Generates visible, semantic HTML for crawlers and AI agents from the app's own accessibility tree, at build time.
9
42
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drawnui-react",
3
- "version": "0.1.0-preview.4",
3
+ "version": "0.1.0-preview.41",
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)",
@@ -53,6 +53,70 @@
53
53
  "typecheck": "tsc --noEmit",
54
54
  "build": "tsc --noEmit && node dev/build-samples.mjs",
55
55
  "sync:skills": "node dev/sync-skills.mjs",
56
+ "check:recycling": "node dev/check.mjs dev/check-recycling.ts",
57
+ "check:keyboard": "node dev/check.mjs dev/check-keyboard.ts",
58
+ "check:wheel": "node dev/check.mjs dev/check-wheel.ts",
59
+ "check:children": "node dev/check.mjs dev/check-children.tsx",
60
+ "check:composite": "node dev/check.mjs dev/check-composite.tsx",
61
+ "check:hover": "node dev/check.mjs dev/check-hover.ts",
62
+ "check:grid-label": "node dev/check.mjs dev/check-grid-label.ts",
63
+ "check:snap": "node dev/check.mjs dev/check-snap.ts",
64
+ "check:game": "node dev/check.mjs dev/check-game.ts",
65
+ "check:animation": "node dev/check.mjs dev/check-animation.ts",
66
+ "check:shape": "node dev/check.mjs dev/check-shape.ts",
67
+ "check:label": "node dev/check.mjs dev/check-label.ts",
68
+ "check:image": "node dev/check.mjs dev/check-image.ts",
69
+ "check:longpress": "node dev/check.mjs dev/check-longpress.ts",
70
+ "check:hidden": "node dev/check.mjs dev/check-hidden.ts",
71
+ "check:shell": "node dev/check.mjs dev/check-shell.tsx",
72
+ "check:wheel-routing": "node dev/check.mjs dev/check-wheel-routing.ts",
73
+ "check:velocity": "node dev/check.mjs dev/check-velocity.ts",
74
+ "check:scroll-index": "node dev/check.mjs dev/check-scroll-index.ts",
75
+ "check:culling": "node dev/check.mjs dev/check-culling.ts",
76
+ "check:responds": "node dev/check.mjs dev/check-responds.ts",
77
+ "check:3d": "node dev/check.mjs dev/check-3d.ts",
78
+ "check:gesture-owner": "node dev/check.mjs dev/check-gesture-owner.ts",
79
+ "check:shader-cache": "node dev/check.mjs dev/check-shader-cache.ts",
80
+ "check:shader-content": "node dev/check.mjs dev/check-shader-content.ts",
81
+ "check:backdrop": "node dev/check.mjs dev/check-backdrop.ts",
82
+ "check:masonry": "node dev/check.mjs dev/check-masonry.ts",
83
+ "check:thickness": "node dev/check.mjs dev/check-thickness.ts",
84
+ "check:scroll-recycled": "node dev/check.mjs dev/check-scroll-recycled.ts",
85
+ "check:masonry-keys": "node dev/check.mjs dev/check-masonry-keys.ts",
86
+ "check:carousel-swipe": "node dev/check.mjs dev/check-carousel-swipe.ts",
87
+ "check:editor-focus": "node dev/check.mjs dev/check-editor-focus.ts",
88
+ "check:shaping": "node dev/check.mjs dev/check-shaping.ts",
89
+ "check:editor-rtl": "node dev/check.mjs dev/check-editor-rtl.ts",
90
+ "check:label-direction": "node dev/check.mjs dev/check-label-direction.ts",
91
+ "check:stack-fit": "node dev/check.mjs dev/check-stack-fit.ts",
92
+ "check:label-reuse": "node dev/check.mjs dev/check-label-reuse.ts",
93
+ "check:popups-tooltips": "node dev/check.mjs dev/check-popups-tooltips.ts",
94
+ "check:carousel-loop": "node dev/check.mjs dev/check-carousel-loop.ts",
95
+ "check:release": "node dev/check.mjs dev/check-release.tsx",
96
+ "check:designer-dev": "node dev/check.mjs dev/check-designer-dev.tsx",
97
+ "check:keyboard-wrap": "node dev/check.mjs dev/check-keyboard-wrap.ts",
98
+ "check:removed": "node dev/check.mjs dev/check-removed.ts",
99
+ "check:key-routing": "node dev/check.mjs dev/check-key-routing.ts",
100
+ "check:drawer-interrupted": "node dev/check.mjs dev/check-drawer-interrupted.ts",
101
+ "check:animated-frames": "node dev/check.mjs dev/check-animated-frames.ts",
102
+ "check:image-features": "node dev/check.mjs dev/check-image-features.ts",
103
+ "check:shader-carousel-interrupted": "node dev/check.mjs dev/check-shader-carousel-interrupted.ts",
104
+ "check:shell-modal": "node dev/check.mjs dev/check-shell-modal.tsx",
105
+ "check:multitouch": "node dev/check.mjs dev/check-multitouch.ts",
106
+ "check:scroll-size": "node dev/check.mjs dev/check-scroll-size.ts",
107
+ "check:ripple-primary": "node dev/check.mjs dev/check-ripple-primary.ts",
108
+ "check:stack-margins": "node dev/check.mjs dev/check-stack-margins.ts",
109
+ "check:fallback-single": "node dev/check.mjs dev/check-fallback-single.ts",
110
+ "check:composite-effect": "node dev/check.mjs dev/check-composite-effect.ts",
111
+ "check:keyboard-contextmenu": "node dev/check.mjs dev/check-keyboard-contextmenu.ts",
112
+ "check:editor-window": "node dev/check.mjs dev/check-editor-window.ts",
113
+ "check:system-theme": "node dev/check.mjs dev/check-system-theme.ts",
114
+ "check:designer-actions": "node dev/check.mjs dev/check-designer-actions.tsx",
115
+ "check:label-span-effects": "node dev/check.mjs dev/check-label-span-effects.ts",
116
+ "check:animator-isolation": "node dev/check.mjs dev/check-animator-isolation.ts",
117
+ "check:quiet-animations": "node dev/check.mjs dev/check-quiet-animations.ts",
118
+ "audit:a11y": "node dev/audit-a11y.mjs",
119
+ "bench:relayout": "node dev/check.mjs dev/bench-relayout.ts",
56
120
  "site:extras": "node dev/site-extras.mjs dist/demo",
57
121
  "build:lib": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
58
122
  "prepublishOnly": "npm run build:lib",
@@ -86,6 +150,6 @@
86
150
  "react": "^19.2.0",
87
151
  "react-dom": "^19.2.0",
88
152
  "typescript": "^5.9.0",
89
- "vite": "^7.0.0"
153
+ "vite": "^7.3.7"
90
154
  }
91
155
  }