drawnui-react 0.1.0-preview.4 → 0.1.0-preview.40
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 +119 -14
- package/SKIPPED.md +36 -26
- package/dist/controls/AnimatedFramesRenderer.d.ts +9 -0
- package/dist/controls/AnimatedFramesRenderer.js +18 -1
- package/dist/controls/DrawnGame.d.ts +44 -0
- package/dist/controls/DrawnGame.js +82 -0
- package/dist/controls/GridStructure.d.ts +16 -2
- package/dist/controls/GridStructure.js +40 -4
- package/dist/controls/SkiaBackdrop.d.ts +8 -2
- package/dist/controls/SkiaBackdrop.js +42 -14
- package/dist/controls/SkiaButton.d.ts +17 -3
- package/dist/controls/SkiaButton.js +26 -8
- package/dist/controls/SkiaCarousel.d.ts +22 -3
- package/dist/controls/SkiaCarousel.js +85 -9
- package/dist/controls/SkiaCheckbox.d.ts +0 -1
- package/dist/controls/SkiaCheckbox.js +2 -7
- package/dist/controls/SkiaDrawer.d.ts +15 -0
- package/dist/controls/SkiaDrawer.js +42 -7
- package/dist/controls/SkiaEditor.d.ts +48 -2
- package/dist/controls/SkiaEditor.js +268 -53
- package/dist/controls/SkiaGif.d.ts +7 -0
- package/dist/controls/SkiaGif.js +25 -4
- package/dist/controls/SkiaImage.d.ts +5 -0
- package/dist/controls/SkiaImage.js +48 -14
- package/dist/controls/SkiaLabel.d.ts +117 -9
- package/dist/controls/SkiaLabel.js +526 -80
- package/dist/controls/SkiaLabelFps.d.ts +16 -0
- package/dist/controls/SkiaLabelFps.js +41 -0
- package/dist/controls/SkiaLayout.d.ts +89 -9
- package/dist/controls/SkiaLayout.js +364 -21
- package/dist/controls/SkiaLottie.js +5 -3
- package/dist/controls/SkiaProgress.d.ts +2 -1
- package/dist/controls/SkiaProgress.js +8 -5
- package/dist/controls/SkiaRadioButton.d.ts +2 -0
- package/dist/controls/SkiaRadioButton.js +16 -4
- package/dist/controls/SkiaRichLabel.d.ts +1 -1
- package/dist/controls/SkiaRichLabel.js +11 -1
- package/dist/controls/SkiaScroll.d.ts +35 -5
- package/dist/controls/SkiaScroll.js +252 -32
- package/dist/controls/SkiaScrollBar.d.ts +27 -0
- package/dist/controls/SkiaScrollBar.js +51 -2
- package/dist/controls/SkiaShaderCarousel.d.ts +11 -1
- package/dist/controls/SkiaShaderCarousel.js +27 -5
- package/dist/controls/SkiaShape.d.ts +13 -2
- package/dist/controls/SkiaShape.js +50 -10
- package/dist/controls/SkiaSlider.d.ts +20 -2
- package/dist/controls/SkiaSlider.js +61 -7
- package/dist/controls/SkiaSprite.d.ts +4 -0
- package/dist/controls/SkiaSprite.js +22 -10
- package/dist/controls/SkiaSvg.d.ts +4 -0
- package/dist/controls/SkiaSvg.js +28 -4
- package/dist/controls/SkiaSwitch.d.ts +0 -1
- package/dist/controls/SkiaSwitch.js +4 -8
- package/dist/controls/SkiaToggle.d.ts +25 -5
- package/dist/controls/SkiaToggle.js +58 -5
- package/dist/controls/SnappingLayout.d.ts +12 -1
- package/dist/controls/SnappingLayout.js +21 -2
- package/dist/controls/TooltipStyle.d.ts +52 -0
- package/dist/controls/TooltipStyle.js +88 -0
- package/dist/core/Accessibility.d.ts +134 -0
- package/dist/core/Accessibility.js +675 -9
- package/dist/core/Animators.d.ts +37 -1
- package/dist/core/Animators.js +102 -9
- package/dist/core/Canvas.d.ts +222 -10
- package/dist/core/Canvas.js +698 -37
- package/dist/core/ControlStyle.d.ts +2 -0
- package/dist/core/ControlStyle.js +2 -0
- package/dist/core/Easing.d.ts +12 -1
- package/dist/core/Easing.js +25 -1
- package/dist/core/Gestures.d.ts +81 -2
- package/dist/core/Gestures.js +177 -3
- package/dist/core/Hover.d.ts +51 -0
- package/dist/core/Hover.js +140 -0
- package/dist/core/ImageEffects.d.ts +2 -0
- package/dist/core/ImageEffects.js +2 -0
- package/dist/core/KeyboardManager.d.ts +40 -0
- package/dist/core/KeyboardManager.js +98 -8
- package/dist/core/PopupWindows.d.ts +94 -0
- package/dist/core/PopupWindows.js +205 -0
- package/dist/core/ScrollAnimators.js +9 -0
- package/dist/core/Shaping.d.ts +40 -0
- package/dist/core/Shaping.js +224 -0
- package/dist/core/SkiaControl.d.ts +279 -10
- package/dist/core/SkiaControl.js +621 -64
- package/dist/core/SkiaEffect.d.ts +17 -0
- package/dist/core/SkiaEffect.js +43 -8
- package/dist/core/SkiaImageManager.js +1 -1
- package/dist/core/Super.d.ts +29 -2
- package/dist/core/Super.js +54 -3
- package/dist/core/Tooltips.d.ts +71 -0
- package/dist/core/Tooltips.js +205 -0
- package/dist/core/Types.d.ts +11 -1
- package/dist/core/Types.js +32 -1
- package/dist/core/ViewsAdapter.d.ts +7 -2
- package/dist/core/ViewsAdapter.js +10 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/react/SkiaShell.js +65 -26
- package/dist/react/index.d.ts +33 -4
- package/dist/react/index.js +157 -18
- package/dist/react/reconciler.d.ts +20 -0
- package/dist/react/reconciler.js +69 -14
- package/dist/vite/index.d.ts +9 -0
- package/dist/vite/index.js +36 -3
- package/package.json +61 -2
package/dist/react/index.js
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
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";
|
|
6
11
|
/** Typed JSX tags resolved by the reconciler Registry. */
|
|
7
12
|
export const SkiaLayout = "SkiaLayout";
|
|
8
13
|
export const SkiaStack = "SkiaStack";
|
|
9
14
|
export const SkiaRow = "SkiaRow";
|
|
10
15
|
export const SkiaLayer = "SkiaLayer";
|
|
11
16
|
export const SkiaWrap = "SkiaWrap";
|
|
17
|
+
export const SkiaMasonry = "SkiaMasonry";
|
|
12
18
|
export const SkiaGrid = "SkiaGrid";
|
|
13
19
|
/** Grid drawing gradient separator lines in its spacing (C# SkiaDecoratedGrid). */
|
|
14
20
|
export const SkiaDecoratedGrid = "SkiaDecoratedGrid";
|
|
15
21
|
export const SkiaLabel = "SkiaLabel";
|
|
22
|
+
/** Canvas FPS counter (C# SkiaLabelFps); its value changes only on frames running animators request anyway. */
|
|
23
|
+
export const SkiaLabelFps = "SkiaLabelFps";
|
|
16
24
|
/** Markdown label (C# SkiaRichLabel): Text is markdown, rendered as spans; LinkTapped for [text](url). */
|
|
17
25
|
export const SkiaRichLabel = "SkiaRichLabel";
|
|
18
26
|
/** Child of <SkiaLabel>: a styled fragment (C# TextSpan). */
|
|
@@ -62,19 +70,48 @@ function removeStaticContent() {
|
|
|
62
70
|
for (const el of document.querySelectorAll("[data-drawnui-static]"))
|
|
63
71
|
el.remove();
|
|
64
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Opens a popup window (drawnui-cross 6at) whose content is drawn elements, e.g. a menu:
|
|
75
|
+
* `OpenPopupWindow(canvas, <SkiaShape ...>...</SkiaShape>, e.Location)`. The elements are rendered at once in a React
|
|
76
|
+
* root of their own and unmounted when the popup closes; the anchor is a point (canvas points), a rect, a control or a
|
|
77
|
+
* `PopupAnchor`. Returns the popup's id (for `canvas.ClosePopupWindow`).
|
|
78
|
+
*/
|
|
79
|
+
export function OpenPopupWindow(canvas, content, anchor, options) {
|
|
80
|
+
const holder = { Content: undefined };
|
|
81
|
+
const root = createDrawnRoot(holder);
|
|
82
|
+
root.renderSync(content);
|
|
83
|
+
const control = holder.Content;
|
|
84
|
+
if (!control) {
|
|
85
|
+
root.unmount();
|
|
86
|
+
throw new Error("DrawnUi: OpenPopupWindow content rendered no control");
|
|
87
|
+
}
|
|
88
|
+
const id = canvas.OpenPopupWindow(control, anchor, options);
|
|
89
|
+
const closed = (which) => {
|
|
90
|
+
if (which !== id)
|
|
91
|
+
return;
|
|
92
|
+
canvas.PopupWindowClosed.delete(closed);
|
|
93
|
+
root.unmount();
|
|
94
|
+
};
|
|
95
|
+
canvas.PopupWindowClosed.add(closed);
|
|
96
|
+
return id;
|
|
97
|
+
}
|
|
65
98
|
/**
|
|
66
99
|
* Mirrors DrawnUi Canvas: the bridge between the DOM (react-dom) and the drawn tree (DrawnUi reconciler).
|
|
67
100
|
* Requires Super.UseDrawnUi()...BuildAsync() to have completed.
|
|
68
101
|
*/
|
|
69
|
-
export function Canvas({ BackgroundColor, RenderingMode, Gestures, children, style, className, ref: viewRef, ContextMenu }) {
|
|
102
|
+
export function Canvas({ BackgroundColor, RenderingMode, Gestures, ArrowsStartKeyboardNavigation, children, style, className, ref: viewRef, ContextMenu, WillFirstTimeDraw, WasDrawn }) {
|
|
70
103
|
const ref = useRef(null);
|
|
71
104
|
const view = useRef(null);
|
|
72
105
|
const root = useRef(null);
|
|
73
106
|
const [engine, setEngine] = useState(null);
|
|
74
107
|
useLayoutEffect(() => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
108
|
+
// the engine draws frame 1 inside its constructor: the draw events and the rendering mode must be on it before that
|
|
109
|
+
const v = new CanvasView(ref.current, (c) => {
|
|
110
|
+
if (RenderingMode)
|
|
111
|
+
c.RenderingMode = RenderingMode;
|
|
112
|
+
c.WillFirstTimeDraw = WillFirstTimeDraw;
|
|
113
|
+
c.WasDrawn = WasDrawn;
|
|
114
|
+
});
|
|
78
115
|
view.current = v;
|
|
79
116
|
root.current = createDrawnRoot(v);
|
|
80
117
|
setEngine(v);
|
|
@@ -92,11 +129,16 @@ export function Canvas({ BackgroundColor, RenderingMode, Gestures, children, sty
|
|
|
92
129
|
v.Update();
|
|
93
130
|
}
|
|
94
131
|
v.Gestures = Gestures ?? "Disabled";
|
|
132
|
+
v.ArrowsStartKeyboardNavigation = ArrowsStartKeyboardNavigation ?? false;
|
|
95
133
|
v.ContextMenu = ContextMenu;
|
|
134
|
+
v.WillFirstTimeDraw = WillFirstTimeDraw;
|
|
135
|
+
v.WasDrawn = WasDrawn;
|
|
96
136
|
root.current.render(children);
|
|
97
137
|
});
|
|
98
|
-
// The drawn surface is aria-hidden; the overlay is the accessibility tree (DrawnUi.Blazor pattern).
|
|
99
|
-
|
|
138
|
+
// The drawn surface is aria-hidden; the overlay is the accessibility tree (DrawnUi.Blazor pattern). The host takes the
|
|
139
|
+
// DOM focus (from code only, no ring) when the focused control leaves: no control is focused and the keys belong to the
|
|
140
|
+
// app, as in the other engines, while a screen reader stays at the canvas instead of the top of the page.
|
|
141
|
+
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
142
|
}
|
|
101
143
|
const A11Y_CSS = `
|
|
102
144
|
.drawnui-a11y-overlay{position:absolute;inset:0;overflow:hidden;pointer-events:none;user-select:none;-webkit-user-select:none}
|
|
@@ -108,19 +150,77 @@ const A11Y_CSS = `
|
|
|
108
150
|
.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
151
|
.drawnui-a11y-text>span::selection{background:rgba(110,168,254,.55);color:transparent}
|
|
110
152
|
`;
|
|
153
|
+
const NAVIGATION_KEYS = new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"]);
|
|
111
154
|
/**
|
|
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
|
|
114
|
-
*
|
|
155
|
+
* Invisible ARIA elements mirroring the accessible drawn controls, positioned over the canvas (the DrawnUi.Blazor
|
|
156
|
+
* overlay). Improvement over DrawnUi.Blazor: `pointer-events:none`, so hover and every pointer gesture still reach the
|
|
157
|
+
* canvas. Keyboard and screen-reader input arrive as DOM events: Enter / Space activate (a Tapped), the navigation keys
|
|
158
|
+
* go to the focused control and then to its arrow-key group; a group is one Tab stop (roving tabindex).
|
|
115
159
|
*/
|
|
160
|
+
/** aria-valuenow / min / max / valuetext of a range control (drawnui-cross 6c); a slider reads as horizontal. */
|
|
161
|
+
function valueAttributes(n) {
|
|
162
|
+
const v = n.Value;
|
|
163
|
+
if (!v)
|
|
164
|
+
return undefined;
|
|
165
|
+
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 };
|
|
166
|
+
}
|
|
116
167
|
function AccessibilityOverlay({ view }) {
|
|
117
168
|
const [nodes, setNodes] = useState(() => view.AccessibilityManager.Snapshot);
|
|
169
|
+
// keyboard focus moved by the manager (arrow keys in a group): focus that node's element once it is rendered
|
|
170
|
+
const [focusRequest, setFocusRequest] = useState();
|
|
171
|
+
// the Tab stop of a group moves with keyboard focus: re-render on focus
|
|
172
|
+
const [, setFocusTick] = useState(0);
|
|
118
173
|
useEffect(() => {
|
|
119
174
|
const mgr = view.AccessibilityManager;
|
|
120
175
|
setNodes(mgr.Snapshot);
|
|
121
176
|
const off = mgr.OnChanged(() => setNodes(mgr.Snapshot));
|
|
122
177
|
const offLive = mgr.OnLiveRegionUpdated(() => { mgr.ForceRebuildOnNextFrame(); view.Update(); });
|
|
123
|
-
|
|
178
|
+
const offFocus = mgr.OnKeyboardFocusRequested((node) => { setNodes(mgr.Snapshot); setFocusRequest({ id: node?.AccessibilityId ?? 0 }); });
|
|
179
|
+
return () => { off(); offLive(); offFocus(); };
|
|
180
|
+
}, [view]);
|
|
181
|
+
const elementOf = (id) => overlayRef.current?.querySelector(`[data-a11y-id="${id}"]`) ?? undefined;
|
|
182
|
+
useLayoutEffect(() => {
|
|
183
|
+
if (!focusRequest)
|
|
184
|
+
return;
|
|
185
|
+
setFocusRequest(undefined);
|
|
186
|
+
// no node: the app took the focus away (SetAccessibilityFocus()), the DOM focus goes back to the canvas host
|
|
187
|
+
if (!focusRequest.id)
|
|
188
|
+
overlayRef.current?.parentElement?.focus({ preventScroll: true });
|
|
189
|
+
else
|
|
190
|
+
elementOf(focusRequest.id)?.focus({ preventScroll: true });
|
|
191
|
+
}, [focusRequest]);
|
|
192
|
+
// the focused node went away (its page or popup closed): no control keeps the focus and its ring goes with it, the keys
|
|
193
|
+
// belong to the app again (as in the other engines); the DOM focus stays on the canvas host, so a screen reader is not
|
|
194
|
+
// thrown to the top of the page and the next Tab starts from the canvas. A focus the user moved away stays away.
|
|
195
|
+
const focusedId = useRef(0);
|
|
196
|
+
useLayoutEffect(() => {
|
|
197
|
+
const id = focusedId.current;
|
|
198
|
+
if (!id || nodes.some((n) => n.Id === id))
|
|
199
|
+
return;
|
|
200
|
+
focusedId.current = 0;
|
|
201
|
+
if (view.AccessibilityManager.FocusedNode?.AccessibilityId === id)
|
|
202
|
+
view.AccessibilityManager.NotifyFocused(undefined);
|
|
203
|
+
const active = document.activeElement;
|
|
204
|
+
if (active && active !== document.body)
|
|
205
|
+
return;
|
|
206
|
+
overlayRef.current?.parentElement?.focus({ preventScroll: true });
|
|
207
|
+
}, [nodes]);
|
|
208
|
+
// Tab / Shift+Tab in a text field leave it for the next node, also after a click into it: DOM focus goes to the
|
|
209
|
+
// field's own element (without taking the caret again) and the browser's Tab moves on from there
|
|
210
|
+
const tabbingOut = useRef(0);
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
const onKey = (e) => {
|
|
213
|
+
const editor = SkiaEditorCtrl.Focused;
|
|
214
|
+
if (e.key !== "Tab" || !editor || editor.Superview !== view || !TextInputProxy.IsProxyTarget(e.target))
|
|
215
|
+
return;
|
|
216
|
+
const el = elementOf(editor.AccessibilityId);
|
|
217
|
+
if (!el)
|
|
218
|
+
return;
|
|
219
|
+
tabbingOut.current = editor.AccessibilityId;
|
|
220
|
+
el.focus({ preventScroll: true });
|
|
221
|
+
};
|
|
222
|
+
document.addEventListener("keydown", onKey, true);
|
|
223
|
+
return () => document.removeEventListener("keydown", onKey, true);
|
|
124
224
|
}, [view]);
|
|
125
225
|
// selectable text spans take pointer events: the wheel over them is re-dispatched to the canvas so drawn scrolls keep working
|
|
126
226
|
const overlayRef = useRef(null);
|
|
@@ -153,17 +253,56 @@ function AccessibilityOverlay({ view }) {
|
|
|
153
253
|
return null;
|
|
154
254
|
// the browser scrolls an overflow:hidden container to reveal a focused child; the overlay must stay pinned to the canvas
|
|
155
255
|
const pin = (e) => { e.currentTarget.scrollTop = 0; e.currentTarget.scrollLeft = 0; };
|
|
156
|
-
|
|
256
|
+
// an active modal (drawnui-cross 6av): the overlay itself is the dialog (role, name, aria-modal) around the dialog's
|
|
257
|
+
// controls, which are its elements; aria-modal on a separate element of this flat overlay would hide them
|
|
258
|
+
const modal = view.AccessibilityManager.ActiveModal;
|
|
259
|
+
const modalNode = modal ? nodes.find((n) => n.Source === modal) : undefined;
|
|
260
|
+
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) => {
|
|
261
|
+
if (n === modalNode)
|
|
262
|
+
return null;
|
|
157
263
|
const pos = { left: n.Rect.Left, top: n.Rect.Top, width: n.Rect.Width, height: n.Rect.Height };
|
|
158
|
-
const activate = () => n.Source
|
|
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,
|
|
160
|
-
e.preventDefault();
|
|
161
|
-
|
|
162
|
-
|
|
264
|
+
const activate = () => SkiaAccessibilityManager.Activate(n.Source);
|
|
265
|
+
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))
|
|
266
|
+
e.preventDefault(); }, onKeyDown: (e) => {
|
|
267
|
+
// the canvas navigation gets the key first; the app's KeyDown runs after it with IsKeyHandled (6az)
|
|
268
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
269
|
+
e.preventDefault();
|
|
270
|
+
if (activate())
|
|
271
|
+
KeyboardManager.MarkKeyHandled(e.nativeEvent.code);
|
|
272
|
+
}
|
|
273
|
+
else if (e.key === "Tab" && view.AccessibilityManager.KeyboardScope) {
|
|
274
|
+
// an open popup window keeps the keyboard: Tab goes round its stops (a menu is one stop)
|
|
275
|
+
e.preventDefault();
|
|
276
|
+
const next = view.AccessibilityManager.NextTabStop(n.Source, !e.shiftKey);
|
|
277
|
+
if (next)
|
|
278
|
+
elementOf(next.AccessibilityId)?.focus({ preventScroll: true });
|
|
279
|
+
}
|
|
280
|
+
else if (NAVIGATION_KEYS.has(e.key) && SkiaAccessibilityManager.Key(n.Source, e.key)) {
|
|
281
|
+
e.preventDefault();
|
|
282
|
+
KeyboardManager.MarkKeyHandled(e.nativeEvent.code);
|
|
283
|
+
}
|
|
284
|
+
}, onFocus: (e) => {
|
|
285
|
+
focusedId.current = n.Id;
|
|
286
|
+
pin({ currentTarget: e.currentTarget.parentElement });
|
|
287
|
+
SkiaScrollCtrl.EnsureVisible(n.Source); // inside every enclosing scroll
|
|
288
|
+
if (tabbingOut.current === n.Id)
|
|
289
|
+
tabbingOut.current = 0; // leaving a text field: it keeps no caret
|
|
290
|
+
else
|
|
291
|
+
n.Source.OnAccessibilityFocused(true); // a text field takes the caret, as after a click
|
|
292
|
+
n.Source.NotifyAccessibilityFocused(true);
|
|
293
|
+
setFocusTick((t) => t + 1);
|
|
294
|
+
}, onBlur: (e) => {
|
|
295
|
+
if (e.currentTarget.isConnected && focusedId.current === n.Id)
|
|
296
|
+
focusedId.current = 0; // moved away on purpose
|
|
297
|
+
if (TextInputProxy.IsProxyTarget(e.relatedTarget))
|
|
298
|
+
return; // a text field moved DOM focus to its own input
|
|
299
|
+
n.Source.OnAccessibilityFocused(false);
|
|
300
|
+
n.Source.NotifyAccessibilityFocused(false);
|
|
301
|
+
}, children: n.Label }, n.Id)) : n.TextLines ? (
|
|
163
302
|
// 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)) : (
|
|
303
|
+
_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
304
|
// 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));
|
|
305
|
+
_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
306
|
})] }));
|
|
168
307
|
}
|
|
169
308
|
// 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 {};
|
package/dist/react/reconciler.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
97
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
}
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -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"...).
|
package/dist/vite/index.js
CHANGED
|
@@ -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 {
|
|
6
|
-
import {
|
|
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.
|
|
3
|
+
"version": "0.1.0-preview.40",
|
|
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,65 @@
|
|
|
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
|
+
"audit:a11y": "node dev/audit-a11y.mjs",
|
|
114
|
+
"bench:relayout": "node dev/check.mjs dev/bench-relayout.ts",
|
|
56
115
|
"site:extras": "node dev/site-extras.mjs dist/demo",
|
|
57
116
|
"build:lib": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
|
|
58
117
|
"prepublishOnly": "npm run build:lib",
|
|
@@ -86,6 +145,6 @@
|
|
|
86
145
|
"react": "^19.2.0",
|
|
87
146
|
"react-dom": "^19.2.0",
|
|
88
147
|
"typescript": "^5.9.0",
|
|
89
|
-
"vite": "^7.
|
|
148
|
+
"vite": "^7.3.7"
|
|
90
149
|
}
|
|
91
150
|
}
|