@grida/hud 0.1.0 → 0.2.0

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/dist/index.d.mts CHANGED
@@ -1,2 +1,106 @@
1
- import { A as HUDPolyline, C as marqueeToHUDDraw, D as HUDCanvasOptions, E as HUDCanvas, M as HUDRule, N as HUDScreenRect, O as HUDDraw, S as lassoToHUDDraw, T as snapGuideToHUDDraw, _ as Modifiers, a as RenderShape, b as SurfaceEvent, c as HUDStyle, d as Intent, f as IntentPhase, g as RotationCorner, h as ResizeDirection, i as OverlayElement, j as HUDRect, k as HUDLine, l as SelectionGroup, m as CursorIcon, n as MIN_CHROME_VISIBLE_SIZE, o as Surface, p as SurfaceGesture, r as MIN_HIT_SIZE, s as SurfaceOptions, t as HitShape, u as SelectionShape, v as NO_MODS, w as measurementToHUDDraw, x as SurfaceResponse, y as PointerButton } from "./index-CBqCh-ZM.mjs";
2
- export { type CursorIcon, HUDCanvas, type HUDCanvasOptions, type HUDDraw, type HUDLine, type HUDPolyline, type HUDRect, type HUDRule, type HUDScreenRect, type HUDStyle, type HitShape, type Intent, type IntentPhase, MIN_CHROME_VISIBLE_SIZE, MIN_HIT_SIZE, type Modifiers, NO_MODS, type OverlayElement, type PointerButton, type RenderShape, type ResizeDirection, type RotationCorner, type SelectionGroup, type SelectionShape, Surface, type SurfaceEvent, type SurfaceGesture, type SurfaceOptions, type SurfaceResponse, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, snapGuideToHUDDraw };
1
+ import { a as cursorEquals, i as RotationCorner, n as CursorRenderer, o as cursorToCss, r as ResizeDirection, t as CursorIcon } from "./cursor-BFGUuD2M.mjs";
2
+ import { A as HUDCanvas, B as HUDRect, C as SurfaceEvent, D as measurementToHUDDraw, E as marqueeToHUDDraw, F as PixelGridConfig, H as HUDScreenRect, I as drawPixelGrid, L as HUDDraw, M as DEFAULT_PIXEL_GRID_COLOR, N as DEFAULT_PIXEL_GRID_STEPS, O as snapGuideToHUDDraw, P as DrawPixelGridParams, R as HUDLine, S as PointerButton, T as lassoToHUDDraw, U as HUDSemantic, V as HUDRule, W as HUDSemanticGroup, _ as SurfaceGesture, a as SurfaceVisibilityPolicy, b as Modifiers, c as MIN_CHROME_VISIBLE_SIZE, d as RenderShape, f as HUDStyle, g as Rect, h as SelectMode, i as SurfaceVisibilityContext, j as HUDCanvasOptions, k as filterHUDDrawByGroup, l as MIN_HIT_SIZE, m as IntentPhase, n as SurfaceOptions, o as SurfaceChromeGroups, p as Intent, r as SurfaceVisibility, s as HitShape, t as Surface, u as OverlayElement, v as SelectionGroup, w as SurfaceResponse, x as NO_MODS, y as SelectionShape, z as HUDPolyline } from "./index-DhGdcuQz.mjs";
3
+
4
+ //#region event/selection-controls.d.ts
5
+ declare const HUDHitPriority: {
6
+ /** Line endpoints — sole resize affordance on lines; nothing outranks them. */readonly ENDPOINT_HANDLE: 10;
7
+ /** Edge priority when promoted (parallel axis violated). Edge strip
8
+ * extends into the body interior on the perpendicular axis when that
9
+ * axis is comfortable; in that case the edge must outrank the
10
+ * (also-promoted) body to keep the resize affordance. */
11
+ readonly RESIZE_HANDLE_EDGE_SMALL: 22;
12
+ /** Body priority when promoted (any axis violated). Lets the user drag
13
+ * from anywhere inside small selections (instead of the corner
14
+ * extension stealing the interior). */
15
+ readonly TRANSLATE_BODY_SMALL: 25;
16
+ /** Side resize handles (N/S/W/E). Lower than corner so that on the 1-px
17
+ * shared boundary between an edge strip and an adjacent corner slot,
18
+ * edge wins ("sides take priority over corners"). */
19
+ readonly RESIZE_HANDLE_EDGE: 30; /** Corner resize handles (NW/NE/SE/SW). */
20
+ readonly RESIZE_HANDLE_CORNER: 31; /** Translate-body — default value. */
21
+ readonly TRANSLATE_BODY: 40;
22
+ /** Rotation halo wraps each resize corner — the rotation hit rect
23
+ * overlaps body, edges, and the resize corner itself, but has the
24
+ * LOWEST priority of any selection-control zone. It only "wins"
25
+ * (becomes the topmost hit) where no other affordance claims the
26
+ * pixel: the L-strip immediately outside the resize-corner outer
27
+ * edges. This is what gives rotation a gap-free wrap around the
28
+ * corner with zero pixel-overlap on the cursor, without ever
29
+ * intruding on the body, the edge resize strips, or the corner
30
+ * resize knob. Do not place anything below this. */
31
+ readonly ROTATE_HANDLE: 50;
32
+ };
33
+ /** The principle constant — the minimum guaranteed length for the body
34
+ * interior on each axis AND for each side strip along its parallel
35
+ * axis. Tunable; everything else derives. */
36
+ declare const MIN_GUARANTEED_INTERACTIVE_DIM = 20;
37
+ /** Below this axis dim, body promotes above corner. Derived from the
38
+ * principle. */
39
+ declare const BODY_FLIP_THRESHOLD: number;
40
+ type SelectionControlRole = {
41
+ kind: "translate";
42
+ } | {
43
+ kind: "resize_corner";
44
+ direction: "nw" | "ne" | "se" | "sw";
45
+ } | {
46
+ kind: "resize_edge";
47
+ direction: "n" | "e" | "s" | "w";
48
+ } | {
49
+ kind: "rotate";
50
+ corner: RotationCorner;
51
+ };
52
+ interface SelectionControlZone {
53
+ rect: Rect;
54
+ priority: number;
55
+ role: SelectionControlRole;
56
+ /** Stable semantic identifier; matches the OverlayElement.label that
57
+ * the chrome builder forwards downstream. */
58
+ label: string;
59
+ }
60
+ interface SelectionControlLayout {
61
+ /** Zones in declaration order. Hit-test resolution is by priority; order
62
+ * serves as tie-break only. */
63
+ zones: SelectionControlZone[];
64
+ /** Whether knobs render visually. False below MIN_CHROME_VISIBLE_SIZE.
65
+ * The body zone exists and is hit-able regardless. */
66
+ controls_visible: boolean;
67
+ /** True when at least one axis is shorter than BODY_FLIP_THRESHOLD,
68
+ * promoting body above corner. */
69
+ small_mode: boolean;
70
+ }
71
+ /**
72
+ * @returns { corner, edge } — lengths in screen-px summing to `total`
73
+ * (corner * 2 + edge === total). Each is `>= 0`.
74
+ *
75
+ * Three phases:
76
+ * - **comfortable** (`total >= 2 * corner_preferred + edge_min`):
77
+ * corners at preferred, edge takes the surplus.
78
+ * - **squeezed** (`total >= edge_min`): edge at its min, corners share
79
+ * the remainder.
80
+ * - **tiny** (`total < edge_min`): edge takes everything, corners 0.
81
+ */
82
+ declare function negotiateAxis(total: number, corner_preferred: number, edge_min: number): {
83
+ corner: number;
84
+ edge: number;
85
+ };
86
+ /**
87
+ * Compute the selection control layout for a screen-space rect.
88
+ *
89
+ * Pure: no DOM, no global state. Same inputs → same zones.
90
+ *
91
+ * The perimeter ring straddles the bbox edge with `extension =
92
+ * hit_size / 2` overhang outside. Along each axis the run of length
93
+ * `axis_dim + 2 * extension` is split via {@link negotiateAxis} into
94
+ * `[corner | edge | corner]`. The 4 corners and 4 edges in 2D then tile
95
+ * the ring as a strict 3×3 grid of cells — **non-overlapping**. Body
96
+ * sits at rect_screen and may overlap with the ring's inside-bbox half
97
+ * in comfortable mode; priority resolves those overlaps.
98
+ *
99
+ * See the comment block in this file for the full principle.
100
+ */
101
+ declare function computeSelectionControlLayout(rect_screen: Rect, opts: {
102
+ handle_size: number;
103
+ show_rotation: boolean;
104
+ }): SelectionControlLayout;
105
+ //#endregion
106
+ export { BODY_FLIP_THRESHOLD, type CursorIcon, type CursorRenderer, DEFAULT_PIXEL_GRID_COLOR, DEFAULT_PIXEL_GRID_STEPS, type DrawPixelGridParams, HUDCanvas, type HUDCanvasOptions, type HUDDraw, HUDHitPriority, type HUDLine, type HUDPolyline, type HUDRect, type HUDRule, type HUDScreenRect, type HUDSemantic, type HUDSemanticGroup, type HUDStyle, type HitShape, type Intent, type IntentPhase, MIN_CHROME_VISIBLE_SIZE, MIN_GUARANTEED_INTERACTIVE_DIM, MIN_HIT_SIZE, type Modifiers, NO_MODS, type OverlayElement, type PixelGridConfig, type PointerButton, type RenderShape, type ResizeDirection, type RotationCorner, type SelectMode, type SelectionControlLayout, type SelectionControlRole, type SelectionControlZone, type SelectionGroup, type SelectionShape, Surface, type SurfaceChromeGroups, type SurfaceEvent, type SurfaceGesture, type SurfaceOptions, type SurfaceResponse, type SurfaceVisibility, type SurfaceVisibilityContext, type SurfaceVisibilityPolicy, computeSelectionControlLayout, cursorEquals, cursorToCss, drawPixelGrid, filterHUDDrawByGroup, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, negotiateAxis, snapGuideToHUDDraw };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,106 @@
1
- import { A as HUDPolyline, C as marqueeToHUDDraw, D as HUDCanvasOptions, E as HUDCanvas, M as HUDRule, N as HUDScreenRect, O as HUDDraw, S as lassoToHUDDraw, T as snapGuideToHUDDraw, _ as Modifiers, a as RenderShape, b as SurfaceEvent, c as HUDStyle, d as Intent, f as IntentPhase, g as RotationCorner, h as ResizeDirection, i as OverlayElement, j as HUDRect, k as HUDLine, l as SelectionGroup, m as CursorIcon, n as MIN_CHROME_VISIBLE_SIZE, o as Surface, p as SurfaceGesture, r as MIN_HIT_SIZE, s as SurfaceOptions, t as HitShape, u as SelectionShape, v as NO_MODS, w as measurementToHUDDraw, x as SurfaceResponse, y as PointerButton } from "./index-DRBeSiI2.js";
2
- export { type CursorIcon, HUDCanvas, type HUDCanvasOptions, type HUDDraw, type HUDLine, type HUDPolyline, type HUDRect, type HUDRule, type HUDScreenRect, type HUDStyle, type HitShape, type Intent, type IntentPhase, MIN_CHROME_VISIBLE_SIZE, MIN_HIT_SIZE, type Modifiers, NO_MODS, type OverlayElement, type PointerButton, type RenderShape, type ResizeDirection, type RotationCorner, type SelectionGroup, type SelectionShape, Surface, type SurfaceEvent, type SurfaceGesture, type SurfaceOptions, type SurfaceResponse, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, snapGuideToHUDDraw };
1
+ import { a as cursorEquals, i as RotationCorner, n as CursorRenderer, o as cursorToCss, r as ResizeDirection, t as CursorIcon } from "./cursor-CIYvFshz.js";
2
+ import { A as HUDCanvas, B as HUDRect, C as SurfaceEvent, D as measurementToHUDDraw, E as marqueeToHUDDraw, F as PixelGridConfig, H as HUDScreenRect, I as drawPixelGrid, L as HUDDraw, M as DEFAULT_PIXEL_GRID_COLOR, N as DEFAULT_PIXEL_GRID_STEPS, O as snapGuideToHUDDraw, P as DrawPixelGridParams, R as HUDLine, S as PointerButton, T as lassoToHUDDraw, U as HUDSemantic, V as HUDRule, W as HUDSemanticGroup, _ as SurfaceGesture, a as SurfaceVisibilityPolicy, b as Modifiers, c as MIN_CHROME_VISIBLE_SIZE, d as RenderShape, f as HUDStyle, g as Rect, h as SelectMode, i as SurfaceVisibilityContext, j as HUDCanvasOptions, k as filterHUDDrawByGroup, l as MIN_HIT_SIZE, m as IntentPhase, n as SurfaceOptions, o as SurfaceChromeGroups, p as Intent, r as SurfaceVisibility, s as HitShape, t as Surface, u as OverlayElement, v as SelectionGroup, w as SurfaceResponse, x as NO_MODS, y as SelectionShape, z as HUDPolyline } from "./index-Cp0X4SV7.js";
3
+
4
+ //#region event/selection-controls.d.ts
5
+ declare const HUDHitPriority: {
6
+ /** Line endpoints — sole resize affordance on lines; nothing outranks them. */readonly ENDPOINT_HANDLE: 10;
7
+ /** Edge priority when promoted (parallel axis violated). Edge strip
8
+ * extends into the body interior on the perpendicular axis when that
9
+ * axis is comfortable; in that case the edge must outrank the
10
+ * (also-promoted) body to keep the resize affordance. */
11
+ readonly RESIZE_HANDLE_EDGE_SMALL: 22;
12
+ /** Body priority when promoted (any axis violated). Lets the user drag
13
+ * from anywhere inside small selections (instead of the corner
14
+ * extension stealing the interior). */
15
+ readonly TRANSLATE_BODY_SMALL: 25;
16
+ /** Side resize handles (N/S/W/E). Lower than corner so that on the 1-px
17
+ * shared boundary between an edge strip and an adjacent corner slot,
18
+ * edge wins ("sides take priority over corners"). */
19
+ readonly RESIZE_HANDLE_EDGE: 30; /** Corner resize handles (NW/NE/SE/SW). */
20
+ readonly RESIZE_HANDLE_CORNER: 31; /** Translate-body — default value. */
21
+ readonly TRANSLATE_BODY: 40;
22
+ /** Rotation halo wraps each resize corner — the rotation hit rect
23
+ * overlaps body, edges, and the resize corner itself, but has the
24
+ * LOWEST priority of any selection-control zone. It only "wins"
25
+ * (becomes the topmost hit) where no other affordance claims the
26
+ * pixel: the L-strip immediately outside the resize-corner outer
27
+ * edges. This is what gives rotation a gap-free wrap around the
28
+ * corner with zero pixel-overlap on the cursor, without ever
29
+ * intruding on the body, the edge resize strips, or the corner
30
+ * resize knob. Do not place anything below this. */
31
+ readonly ROTATE_HANDLE: 50;
32
+ };
33
+ /** The principle constant — the minimum guaranteed length for the body
34
+ * interior on each axis AND for each side strip along its parallel
35
+ * axis. Tunable; everything else derives. */
36
+ declare const MIN_GUARANTEED_INTERACTIVE_DIM = 20;
37
+ /** Below this axis dim, body promotes above corner. Derived from the
38
+ * principle. */
39
+ declare const BODY_FLIP_THRESHOLD: number;
40
+ type SelectionControlRole = {
41
+ kind: "translate";
42
+ } | {
43
+ kind: "resize_corner";
44
+ direction: "nw" | "ne" | "se" | "sw";
45
+ } | {
46
+ kind: "resize_edge";
47
+ direction: "n" | "e" | "s" | "w";
48
+ } | {
49
+ kind: "rotate";
50
+ corner: RotationCorner;
51
+ };
52
+ interface SelectionControlZone {
53
+ rect: Rect;
54
+ priority: number;
55
+ role: SelectionControlRole;
56
+ /** Stable semantic identifier; matches the OverlayElement.label that
57
+ * the chrome builder forwards downstream. */
58
+ label: string;
59
+ }
60
+ interface SelectionControlLayout {
61
+ /** Zones in declaration order. Hit-test resolution is by priority; order
62
+ * serves as tie-break only. */
63
+ zones: SelectionControlZone[];
64
+ /** Whether knobs render visually. False below MIN_CHROME_VISIBLE_SIZE.
65
+ * The body zone exists and is hit-able regardless. */
66
+ controls_visible: boolean;
67
+ /** True when at least one axis is shorter than BODY_FLIP_THRESHOLD,
68
+ * promoting body above corner. */
69
+ small_mode: boolean;
70
+ }
71
+ /**
72
+ * @returns { corner, edge } — lengths in screen-px summing to `total`
73
+ * (corner * 2 + edge === total). Each is `>= 0`.
74
+ *
75
+ * Three phases:
76
+ * - **comfortable** (`total >= 2 * corner_preferred + edge_min`):
77
+ * corners at preferred, edge takes the surplus.
78
+ * - **squeezed** (`total >= edge_min`): edge at its min, corners share
79
+ * the remainder.
80
+ * - **tiny** (`total < edge_min`): edge takes everything, corners 0.
81
+ */
82
+ declare function negotiateAxis(total: number, corner_preferred: number, edge_min: number): {
83
+ corner: number;
84
+ edge: number;
85
+ };
86
+ /**
87
+ * Compute the selection control layout for a screen-space rect.
88
+ *
89
+ * Pure: no DOM, no global state. Same inputs → same zones.
90
+ *
91
+ * The perimeter ring straddles the bbox edge with `extension =
92
+ * hit_size / 2` overhang outside. Along each axis the run of length
93
+ * `axis_dim + 2 * extension` is split via {@link negotiateAxis} into
94
+ * `[corner | edge | corner]`. The 4 corners and 4 edges in 2D then tile
95
+ * the ring as a strict 3×3 grid of cells — **non-overlapping**. Body
96
+ * sits at rect_screen and may overlap with the ring's inside-bbox half
97
+ * in comfortable mode; priority resolves those overlaps.
98
+ *
99
+ * See the comment block in this file for the full principle.
100
+ */
101
+ declare function computeSelectionControlLayout(rect_screen: Rect, opts: {
102
+ handle_size: number;
103
+ show_rotation: boolean;
104
+ }): SelectionControlLayout;
105
+ //#endregion
106
+ export { BODY_FLIP_THRESHOLD, type CursorIcon, type CursorRenderer, DEFAULT_PIXEL_GRID_COLOR, DEFAULT_PIXEL_GRID_STEPS, type DrawPixelGridParams, HUDCanvas, type HUDCanvasOptions, type HUDDraw, HUDHitPriority, type HUDLine, type HUDPolyline, type HUDRect, type HUDRule, type HUDScreenRect, type HUDSemantic, type HUDSemanticGroup, type HUDStyle, type HitShape, type Intent, type IntentPhase, MIN_CHROME_VISIBLE_SIZE, MIN_GUARANTEED_INTERACTIVE_DIM, MIN_HIT_SIZE, type Modifiers, NO_MODS, type OverlayElement, type PixelGridConfig, type PointerButton, type RenderShape, type ResizeDirection, type RotationCorner, type SelectMode, type SelectionControlLayout, type SelectionControlRole, type SelectionControlZone, type SelectionGroup, type SelectionShape, Surface, type SurfaceChromeGroups, type SurfaceEvent, type SurfaceGesture, type SurfaceOptions, type SurfaceResponse, type SurfaceVisibility, type SurfaceVisibilityContext, type SurfaceVisibilityPolicy, computeSelectionControlLayout, cursorEquals, cursorToCss, drawPixelGrid, filterHUDDrawByGroup, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, negotiateAxis, snapGuideToHUDDraw };
package/dist/index.js CHANGED
@@ -1,11 +1,23 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_surface = require("./surface-CNlBaEXn.js");
2
+ const require_surface = require("./surface-ofSNTJ8H.js");
3
+ const require_cursor = require("./cursor-DsP9qtN2.js");
4
+ exports.BODY_FLIP_THRESHOLD = require_surface.BODY_FLIP_THRESHOLD;
5
+ exports.DEFAULT_PIXEL_GRID_COLOR = require_surface.DEFAULT_PIXEL_GRID_COLOR;
6
+ exports.DEFAULT_PIXEL_GRID_STEPS = require_surface.DEFAULT_PIXEL_GRID_STEPS;
3
7
  exports.HUDCanvas = require_surface.HUDCanvas;
8
+ exports.HUDHitPriority = require_surface.HUDHitPriority;
4
9
  exports.MIN_CHROME_VISIBLE_SIZE = require_surface.MIN_CHROME_VISIBLE_SIZE;
10
+ exports.MIN_GUARANTEED_INTERACTIVE_DIM = require_surface.MIN_GUARANTEED_INTERACTIVE_DIM;
5
11
  exports.MIN_HIT_SIZE = require_surface.MIN_HIT_SIZE;
6
12
  exports.NO_MODS = require_surface.NO_MODS;
7
13
  exports.Surface = require_surface.Surface;
14
+ exports.computeSelectionControlLayout = require_surface.computeSelectionControlLayout;
15
+ exports.cursorEquals = require_cursor.cursorEquals;
16
+ exports.cursorToCss = require_cursor.cursorToCss;
17
+ exports.drawPixelGrid = require_surface.drawPixelGrid;
18
+ exports.filterHUDDrawByGroup = require_surface.filterHUDDrawByGroup;
8
19
  exports.lassoToHUDDraw = require_surface.lassoToHUDDraw;
9
20
  exports.marqueeToHUDDraw = require_surface.marqueeToHUDDraw;
10
21
  exports.measurementToHUDDraw = require_surface.measurementToHUDDraw;
22
+ exports.negotiateAxis = require_surface.negotiateAxis;
11
23
  exports.snapGuideToHUDDraw = require_surface.snapGuideToHUDDraw;
package/dist/index.mjs CHANGED
@@ -1,2 +1,3 @@
1
- import { a as lassoToHUDDraw, c as snapGuideToHUDDraw, i as NO_MODS, l as HUDCanvas, n as MIN_CHROME_VISIBLE_SIZE, o as marqueeToHUDDraw, r as MIN_HIT_SIZE, s as measurementToHUDDraw, t as Surface } from "./surface-hUEeEVdL.mjs";
2
- export { HUDCanvas, MIN_CHROME_VISIBLE_SIZE, MIN_HIT_SIZE, NO_MODS, Surface, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, snapGuideToHUDDraw };
1
+ import { _ as DEFAULT_PIXEL_GRID_STEPS, a as computeSelectionControlLayout, c as MIN_HIT_SIZE, d as marqueeToHUDDraw, f as measurementToHUDDraw, g as DEFAULT_PIXEL_GRID_COLOR, h as HUDCanvas, i as MIN_GUARANTEED_INTERACTIVE_DIM, l as NO_MODS, m as filterHUDDrawByGroup, n as BODY_FLIP_THRESHOLD, o as negotiateAxis, p as snapGuideToHUDDraw, r as HUDHitPriority, s as MIN_CHROME_VISIBLE_SIZE, t as Surface, u as lassoToHUDDraw, v as drawPixelGrid } from "./surface-BvMmXoEl.mjs";
2
+ import { i as cursorToCss, r as cursorEquals } from "./cursor-BieMVb71.mjs";
3
+ export { BODY_FLIP_THRESHOLD, DEFAULT_PIXEL_GRID_COLOR, DEFAULT_PIXEL_GRID_STEPS, HUDCanvas, HUDHitPriority, MIN_CHROME_VISIBLE_SIZE, MIN_GUARANTEED_INTERACTIVE_DIM, MIN_HIT_SIZE, NO_MODS, Surface, computeSelectionControlLayout, cursorEquals, cursorToCss, drawPixelGrid, filterHUDDrawByGroup, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, negotiateAxis, snapGuideToHUDDraw };
package/dist/react.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as HUDDraw, o as Surface, s as SurfaceOptions } from "./index-CBqCh-ZM.mjs";
1
+ import { L as HUDDraw, n as SurfaceOptions, t as Surface } from "./index-DhGdcuQz.mjs";
2
2
  import { Measurement } from "@grida/cmath/_measurement";
3
3
  import cmath from "@grida/cmath";
4
4
  import * as React from "react";
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as HUDDraw, o as Surface, s as SurfaceOptions } from "./index-DRBeSiI2.js";
1
+ import { L as HUDDraw, n as SurfaceOptions, t as Surface } from "./index-Cp0X4SV7.js";
2
2
  import cmath from "@grida/cmath";
3
3
  import { SnapResult } from "@grida/cmath/_snap";
4
4
  import { Measurement } from "@grida/cmath/_measurement";
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_surface = require("./surface-CNlBaEXn.js");
3
+ const require_surface = require("./surface-ofSNTJ8H.js");
4
4
  let react = require("react");
5
5
  react = require_surface.__toESM(react);
6
6
  let _grida_cmath__snap = require("@grida/cmath/_snap");
@@ -33,7 +33,10 @@ function useHUDSurface(canvasRef, options) {
33
33
  onIntent: (i) => onIntentRef.current(i),
34
34
  style: options.style,
35
35
  readonly: options.readonly,
36
- color: options.color
36
+ color: options.color,
37
+ pixelGrid: options.pixelGrid,
38
+ groups: options.groups,
39
+ visibility: options.visibility
37
40
  });
38
41
  setSurface(s);
39
42
  return () => {
@@ -45,10 +48,12 @@ function useHUDSurface(canvasRef, options) {
45
48
  if (!surface) return;
46
49
  if (options.style) surface.setStyle(options.style);
47
50
  if (options.readonly !== void 0) surface.setReadonly(options.readonly);
51
+ surface.setColor(options.color ?? null);
48
52
  }, [
49
53
  surface,
50
54
  options.style,
51
- options.readonly
55
+ options.readonly,
56
+ options.color
52
57
  ]);
53
58
  return surface;
54
59
  }
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a as lassoToHUDDraw, c as snapGuideToHUDDraw, l as HUDCanvas, o as marqueeToHUDDraw, s as measurementToHUDDraw, t as Surface } from "./surface-hUEeEVdL.mjs";
2
+ import { d as marqueeToHUDDraw, f as measurementToHUDDraw, h as HUDCanvas, p as snapGuideToHUDDraw, t as Surface, u as lassoToHUDDraw } from "./surface-BvMmXoEl.mjs";
3
3
  import * as React from "react";
4
4
  import { guide } from "@grida/cmath/_snap";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -31,7 +31,10 @@ function useHUDSurface(canvasRef, options) {
31
31
  onIntent: (i) => onIntentRef.current(i),
32
32
  style: options.style,
33
33
  readonly: options.readonly,
34
- color: options.color
34
+ color: options.color,
35
+ pixelGrid: options.pixelGrid,
36
+ groups: options.groups,
37
+ visibility: options.visibility
35
38
  });
36
39
  setSurface(s);
37
40
  return () => {
@@ -43,10 +46,12 @@ function useHUDSurface(canvasRef, options) {
43
46
  if (!surface) return;
44
47
  if (options.style) surface.setStyle(options.style);
45
48
  if (options.readonly !== void 0) surface.setReadonly(options.readonly);
49
+ surface.setColor(options.color ?? null);
46
50
  }, [
47
51
  surface,
48
52
  options.style,
49
- options.readonly
53
+ options.readonly,
54
+ options.color
50
55
  ]);
51
56
  return surface;
52
57
  }