monowind 0.2.5 → 0.2.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AA2IA,QAAA,MAAM,eAAe,EAEhB,OAAO,WAAW,CAAC;AAExB,qBAAa,eAAgB,SAAQ,eAAe;;IAClD,MAAM,CAAC,kBAAkB,WAAc;IA4GvC,cAsBC;IAED,iBAAiB,IAAI,IAAI,CAiGxB;IAED,oBAAoB,IAAI,IAAI,CAwC3B;IAkwBD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAkB1F;IAED;;;;0DAIsD;IACtD,WAAW,IAAI,MAAM,CAIpB;CA4QF;AAED;+DAC+D;AAC/D,wBAAgB,cAAc,IAAI,IAAI,CAIrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF;AA+CD;;;;;;;;;yDASyD;AACzD,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAMR"}
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAiKA,QAAA,MAAM,eAAe,EAEhB,OAAO,WAAW,CAAC;AAExB,qBAAa,eAAgB,SAAQ,eAAe;;IAClD,MAAM,CAAC,kBAAkB,WAAuB;IAqHhD,cAsBC;IAED,iBAAiB,IAAI,IAAI,CAmGxB;IAED,oBAAoB,IAAI,IAAI,CAyC3B;IAy6BD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CA+B1F;IAED;;;;0DAIsD;IACtD,WAAW,IAAI,MAAM,CAIpB;CA8OF;AAED;+DAC+D;AAC/D,wBAAgB,cAAc,IAAI,IAAI,CAIrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF;AA+CD;;;;;;;;;yDASyD;AACzD,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAMR"}
@@ -0,0 +1,39 @@
1
+ import type { LayoutNode, Rect } from "./types.ts";
2
+ /**
3
+ * Arrow-key focus navigation (specs/focus-navigation.md): the pure
4
+ * part. From the focused element's painted cells, an arrow moves to
5
+ * the nearest focusable element entirely beyond that edge; the element
6
+ * side (`focus="arrows"`) is plumbing around `nextFocus`.
7
+ */
8
+ export type Direction = "up" | "down" | "left" | "right";
9
+ export interface Focusable {
10
+ element: Element;
11
+ rect: Rect;
12
+ }
13
+ /** The direction an arrow key names; null for any other key. */
14
+ export declare function directionOf(key: string): Direction | null;
15
+ /** The candidate to focus for an arrow from `current`: entirely beyond
16
+ * the edge in that direction; one overlapping `current` across the
17
+ * other axis (aligned) before any that does not; then the nearest
18
+ * along the axis; then the smaller cross-axis gap; then the first in
19
+ * `candidates` (document order). null when nothing lies beyond the
20
+ * edge — no wrap. */
21
+ export declare function nextFocus(direction: Direction, current: Rect, candidates: Focusable[]): Element | null;
22
+ /** Every focusable element the layout knows, with its painted cells
23
+ * (ancestor scroll offsets applied, as the paint walk descends), in
24
+ * tree order: laid-out boxes and atomic inline boxes at their border
25
+ * boxes, a text leaf's inline elements one rect per line they cover
26
+ * (a wrapped link is reachable from each of its lines). The root
27
+ * itself — the host — is the navigation's container, never a
28
+ * candidate. */
29
+ export declare function focusableRects(root: LayoutNode): Focusable[];
30
+ /** An element's own extent: the union of its rects (a wrapped inline
31
+ * element has one per line); null when it has none. */
32
+ export declare function extentOf(rects: Focusable[], element: Element): Rect | null;
33
+ /** Whether an arrow key pressed on `element` belongs to the control:
34
+ * caret movement in text fields (Left/Right in a single-line input,
35
+ * all four in a textarea or contenteditable), a radio group's own
36
+ * selection, a listbox select's, a value change on a stepped input
37
+ * (number, range, dates, color), and a single select's open picker. */
38
+ export declare function arrowIsNative(element: Element, key: string, pickerOpen?: boolean): boolean;
39
+ //# sourceMappingURL=focus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../src/focus.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;GAKG;AAEH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;CACZ;AASD,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAEzD;AAED;;;;;qBAKqB;AACrB,wBAAgB,SAAS,CACvB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,IAAI,EACb,UAAU,EAAE,SAAS,EAAE,GACtB,OAAO,GAAG,IAAI,CAWhB;AA+BD;;;;;;gBAMgB;AAChB,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,CAqB5D;AAED;uDACuD;AACvD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAe1E;AAcD;;;;uEAIuE;AACvE,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,UAAQ,GAAG,OAAO,CAiBxF"}