@grida/hud 0.2.0 → 0.2.2

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 (38) hide show
  1. package/README.md +562 -37
  2. package/dist/core/index.d.mts +181 -0
  3. package/dist/core/index.d.ts +181 -0
  4. package/dist/core/index.js +301 -0
  5. package/dist/core/index.mjs +291 -0
  6. package/dist/cursors/index.d.mts +1 -1
  7. package/dist/cursors/index.d.ts +1 -1
  8. package/dist/cursors/index.js +1 -1
  9. package/dist/cursors/index.mjs +1 -1
  10. package/dist/index-BQtDtpHM.d.mts +3215 -0
  11. package/dist/index-BlfZbeEJ.d.ts +3215 -0
  12. package/dist/index.d.mts +4 -3
  13. package/dist/index.d.ts +4 -3
  14. package/dist/index.js +55 -2
  15. package/dist/index.mjs +3 -3
  16. package/dist/overlay-CVV4s3IL.d.ts +241 -0
  17. package/dist/overlay-dsG32baA.d.mts +241 -0
  18. package/dist/primitives/bedrock.d.mts +47 -0
  19. package/dist/primitives/bedrock.d.ts +47 -0
  20. package/dist/primitives/bedrock.js +71 -0
  21. package/dist/primitives/bedrock.mjs +65 -0
  22. package/dist/react.d.mts +3 -2
  23. package/dist/react.d.ts +2 -1
  24. package/dist/react.js +4 -1
  25. package/dist/react.mjs +4 -1
  26. package/dist/surface-BHDH6P6p.js +7383 -0
  27. package/dist/surface-B_8w6VWG.mjs +6929 -0
  28. package/dist/types-3wwFisZs.d.mts +296 -0
  29. package/dist/types-3wwFisZs.d.ts +296 -0
  30. package/package.json +16 -3
  31. package/dist/index-Cp0X4SV7.d.ts +0 -947
  32. package/dist/index-DhGdcuQz.d.mts +0 -947
  33. package/dist/surface-BvMmXoEl.mjs +0 -2471
  34. package/dist/surface-ofSNTJ8H.js +0 -2607
  35. /package/dist/{cursor-BFGUuD2M.d.mts → cursor-CxS8EMvm.d.mts} +0 -0
  36. /package/dist/{cursor-CIYvFshz.d.ts → cursor-CxS8EMvm.d.ts} +0 -0
  37. /package/dist/{cursor-BieMVb71.mjs → cursor-DW-uAPVE.mjs} +0 -0
  38. /package/dist/{cursor-DsP9qtN2.js → cursor-FGiJBdU-.js} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
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";
1
+ import { a as HUDPaintStripes, c as HUDRect, d as HUDSemantic, f as HUDSemanticGroup, i as HUDPaintSolid, l as HUDRule, n as HUDLine, o as HUDPoint, r as HUDPaint, s as HUDPolyline, t as HUDDraw, u as HUDScreenRect } from "./types-3wwFisZs.mjs";
2
+ import { a as cursorEquals, i as RotationCorner, n as CursorRenderer, o as cursorToCss, r as ResizeDirection, t as CursorIcon } from "./cursor-CxS8EMvm.mjs";
3
+ import { $ as ResolvedPaint, $t as DEFAULT_RULER_OVERLAP_THRESHOLD, A as TransformBoxHover, At as cornerRadiusLayoutGroups, B as Modifiers, Bt as TransformBoxCorners, C as MIN_CHROME_VISIBLE_SIZE, Ct as DEFAULT_CORNER_RADIUS_HANDLE_SIZE, D as VectorHover, Dt as cornerRadiusAnchorSign, E as RenderShape, Et as computeCornerRadiusLayout, F as TapHandler, Ft as SurfaceGesture, G as lassoToHUDDraw, Gt as getTransformBoxCorners, H as PointerButton, Ht as compose, I as TapOutcome, It as SelectionGroup, J as snapGuideToHUDDraw, Jt as DEFAULT_RULER_ACCENT_COLOR, K as marqueeToHUDDraw, Kt as reduceTransformBox, L as Intent, Lt as SelectionShape, M as PaddingHover, Mt as resolveCenterDragAnchor, N as PaddingOverlayInput, Nt as resolveCornerDragAnchor, O as VectorSubSelection, Ot as cornerRadiusHandlePosLine, P as HUDStyle, Pt as Rect, Q as DEFAULT_STRIPES_THICKNESS_PX, Qt as DEFAULT_RULER_FONT, R as IntentPhase, Rt as AffineTransform, S as HitShape, St as DEFAULT_CORNER_RADIUS_HANDLE_INSET, T as OverlayElement, Tt as DrawCornerRadiusParams, U as SurfaceEvent, Ut as cornersToBoxTransform, V as NO_MODS, Vt as TransformBoxOptions, W as SurfaceResponse, Wt as decompose, X as DEFAULT_STRIPES_ANGLE_DEG, Xt as DEFAULT_RULER_COLOR, Y as filterHUDDrawByGroup, Yt as DEFAULT_RULER_BACKGROUND, Z as DEFAULT_STRIPES_SPACING_PX, Zt as DEFAULT_RULER_DRAG_THRESHOLD, _ as PADDING_HANDLE_PRIORITY, _t as resolveParametricHandleByDirection, a as SurfaceVisibilityPolicy, an as RulerAxis, at as DEFAULT_PARAMETRIC_HANDLE_INSET, b as VectorOverlay, bt as CornerRadiusInput, c as VectorSelectionMode, cn as RulerRange, ct as DrawParametricHandlesParams, d as TRANSFORM_BOX_CORNER_HIT_SIZE, dn as DEFAULT_PIXEL_GRID_STEPS, dt as ParametricHandleInput, en as DEFAULT_RULER_STEPS, et as buildStripesTile, f as TRANSFORM_BOX_CORNER_PRIORITY, fn as DrawPixelGridParams, ft as ParametricHandleLayout, g as PADDING_HANDLE_LENGTH, gt as projectParametricHandleValue, h as buildPaddingOverlay, ht as parametricHandleLayoutGroups, i as SurfaceVisibilityContext, in as DrawRulerParams, it as HUDCanvasOptions, j as TransformBoxInput, jt as drawCornerRadius, k as TransformBoxActiveOp, kt as cornerRadiusHandlePosRect, l as buildTransformBox, ln as drawRuler, lt as ParametricHandle, m as TRANSFORM_BOX_SIDE_PRIORITY, mn as drawPixelGrid, mt as drawParametricHandles, n as SurfaceOptions, nn as DEFAULT_RULER_TEXT_SIDE_OFFSET, nt as resolvePaint, o as VectorBendMode, on as RulerConfig, ot as DEFAULT_PARAMETRIC_HANDLE_SIZE, p as TRANSFORM_BOX_SIDE_HIT_THICKNESS, pn as PixelGridConfig, pt as computeParametricHandleLayout, q as measurementToHUDDraw, qt as DEFAULT_RULER_ACCENT_BACKGROUND, r as SurfaceVisibility, rn as DEFAULT_RULER_TICK_HEIGHT, rt as HUDCanvas, s as VectorInsertionMode, sn as RulerMark, st as DEFAULT_PARAMETRIC_HIT_SIZE, t as Surface, tn as DEFAULT_RULER_STRIP, tt as computeStripesTileGeometry, u as TRANSFORM_BOX_BODY_PRIORITY, un as DEFAULT_PIXEL_GRID_COLOR, ut as ParametricHandleGroup, v as PADDING_HANDLE_THICKNESS, vt as CornerRadiusAnchor, w as MIN_HIT_SIZE, wt as DEFAULT_CORNER_RADIUS_HIT_SIZE, x as SurfaceChromeGroups, xt as CornerRadiusRectangular, y as PADDING_REGION_PRIORITY, yt as CornerRadiusHandleLayout, z as SelectMode, zt as TransformBoxAction } from "./index-BQtDtpHM.mjs";
3
4
 
4
5
  //#region event/selection-controls.d.ts
5
6
  declare const HUDHitPriority: {
@@ -103,4 +104,4 @@ declare function computeSelectionControlLayout(rect_screen: Rect, opts: {
103
104
  show_rotation: boolean;
104
105
  }): SelectionControlLayout;
105
106
  //#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 };
107
+ export { type AffineTransform, BODY_FLIP_THRESHOLD, type CornerRadiusAnchor, type CornerRadiusHandleLayout, type CornerRadiusInput, type CornerRadiusRectangular, type CursorIcon, type CursorRenderer, DEFAULT_CORNER_RADIUS_HANDLE_INSET, DEFAULT_CORNER_RADIUS_HANDLE_SIZE, DEFAULT_CORNER_RADIUS_HIT_SIZE, DEFAULT_PARAMETRIC_HANDLE_INSET, DEFAULT_PARAMETRIC_HANDLE_SIZE, DEFAULT_PARAMETRIC_HIT_SIZE, DEFAULT_PIXEL_GRID_COLOR, DEFAULT_PIXEL_GRID_STEPS, DEFAULT_RULER_ACCENT_BACKGROUND, DEFAULT_RULER_ACCENT_COLOR, DEFAULT_RULER_BACKGROUND, DEFAULT_RULER_COLOR, DEFAULT_RULER_DRAG_THRESHOLD, DEFAULT_RULER_FONT, DEFAULT_RULER_OVERLAP_THRESHOLD, DEFAULT_RULER_STEPS, DEFAULT_RULER_STRIP, DEFAULT_RULER_TEXT_SIDE_OFFSET, DEFAULT_RULER_TICK_HEIGHT, DEFAULT_STRIPES_ANGLE_DEG, DEFAULT_STRIPES_SPACING_PX, DEFAULT_STRIPES_THICKNESS_PX, type DrawCornerRadiusParams, type DrawParametricHandlesParams, type DrawPixelGridParams, type DrawRulerParams, HUDCanvas, type HUDCanvasOptions, type HUDDraw, HUDHitPriority, type HUDLine, type HUDPaint, type HUDPaintSolid, type HUDPaintStripes, type HUDPoint, 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, PADDING_HANDLE_LENGTH, PADDING_HANDLE_PRIORITY, PADDING_HANDLE_THICKNESS, PADDING_REGION_PRIORITY, type PaddingHover, type PaddingOverlayInput, type ParametricHandle, type ParametricHandleGroup, type ParametricHandleInput, type ParametricHandleLayout, type PixelGridConfig, type PointerButton, type RenderShape, type ResizeDirection, type ResolvedPaint, type RotationCorner, type RulerAxis, type RulerConfig, type RulerMark, type RulerRange, 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, TRANSFORM_BOX_BODY_PRIORITY, TRANSFORM_BOX_CORNER_HIT_SIZE, TRANSFORM_BOX_CORNER_PRIORITY, TRANSFORM_BOX_SIDE_HIT_THICKNESS, TRANSFORM_BOX_SIDE_PRIORITY, type TapHandler, type TapOutcome, type TransformBoxAction, type TransformBoxActiveOp, type TransformBoxCorners, type TransformBoxHover, type TransformBoxInput, type TransformBoxOptions, type VectorBendMode, type VectorHover, type VectorInsertionMode, type VectorOverlay, type VectorSelectionMode, type VectorSubSelection, buildPaddingOverlay, buildStripesTile, buildTransformBox, compose as composeTransformBox, computeCornerRadiusLayout, computeParametricHandleLayout, computeSelectionControlLayout, computeStripesTileGeometry, cornerRadiusAnchorSign, cornerRadiusHandlePosLine, cornerRadiusHandlePosRect, cornerRadiusLayoutGroups, cornersToBoxTransform, cursorEquals, cursorToCss, decompose as decomposeTransformBox, drawCornerRadius, drawParametricHandles, drawPixelGrid, drawRuler, filterHUDDrawByGroup, getTransformBoxCorners, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, negotiateAxis, parametricHandleLayoutGroups, projectParametricHandleValue, reduceTransformBox, resolveCenterDragAnchor, resolveCornerDragAnchor, resolvePaint, resolveParametricHandleByDirection, snapGuideToHUDDraw };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
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";
1
+ import { a as HUDPaintStripes, c as HUDRect, d as HUDSemantic, f as HUDSemanticGroup, i as HUDPaintSolid, l as HUDRule, n as HUDLine, o as HUDPoint, r as HUDPaint, s as HUDPolyline, t as HUDDraw, u as HUDScreenRect } from "./types-3wwFisZs.js";
2
+ import { a as cursorEquals, i as RotationCorner, n as CursorRenderer, o as cursorToCss, r as ResizeDirection, t as CursorIcon } from "./cursor-CxS8EMvm.js";
3
+ import { $ as ResolvedPaint, $t as DEFAULT_RULER_OVERLAP_THRESHOLD, A as TransformBoxHover, At as cornerRadiusLayoutGroups, B as Modifiers, Bt as TransformBoxCorners, C as MIN_CHROME_VISIBLE_SIZE, Ct as DEFAULT_CORNER_RADIUS_HANDLE_SIZE, D as VectorHover, Dt as cornerRadiusAnchorSign, E as RenderShape, Et as computeCornerRadiusLayout, F as TapHandler, Ft as SurfaceGesture, G as lassoToHUDDraw, Gt as getTransformBoxCorners, H as PointerButton, Ht as compose, I as TapOutcome, It as SelectionGroup, J as snapGuideToHUDDraw, Jt as DEFAULT_RULER_ACCENT_COLOR, K as marqueeToHUDDraw, Kt as reduceTransformBox, L as Intent, Lt as SelectionShape, M as PaddingHover, Mt as resolveCenterDragAnchor, N as PaddingOverlayInput, Nt as resolveCornerDragAnchor, O as VectorSubSelection, Ot as cornerRadiusHandlePosLine, P as HUDStyle, Pt as Rect, Q as DEFAULT_STRIPES_THICKNESS_PX, Qt as DEFAULT_RULER_FONT, R as IntentPhase, Rt as AffineTransform, S as HitShape, St as DEFAULT_CORNER_RADIUS_HANDLE_INSET, T as OverlayElement, Tt as DrawCornerRadiusParams, U as SurfaceEvent, Ut as cornersToBoxTransform, V as NO_MODS, Vt as TransformBoxOptions, W as SurfaceResponse, Wt as decompose, X as DEFAULT_STRIPES_ANGLE_DEG, Xt as DEFAULT_RULER_COLOR, Y as filterHUDDrawByGroup, Yt as DEFAULT_RULER_BACKGROUND, Z as DEFAULT_STRIPES_SPACING_PX, Zt as DEFAULT_RULER_DRAG_THRESHOLD, _ as PADDING_HANDLE_PRIORITY, _t as resolveParametricHandleByDirection, a as SurfaceVisibilityPolicy, an as RulerAxis, at as DEFAULT_PARAMETRIC_HANDLE_INSET, b as VectorOverlay, bt as CornerRadiusInput, c as VectorSelectionMode, cn as RulerRange, ct as DrawParametricHandlesParams, d as TRANSFORM_BOX_CORNER_HIT_SIZE, dn as DEFAULT_PIXEL_GRID_STEPS, dt as ParametricHandleInput, en as DEFAULT_RULER_STEPS, et as buildStripesTile, f as TRANSFORM_BOX_CORNER_PRIORITY, fn as DrawPixelGridParams, ft as ParametricHandleLayout, g as PADDING_HANDLE_LENGTH, gt as projectParametricHandleValue, h as buildPaddingOverlay, ht as parametricHandleLayoutGroups, i as SurfaceVisibilityContext, in as DrawRulerParams, it as HUDCanvasOptions, j as TransformBoxInput, jt as drawCornerRadius, k as TransformBoxActiveOp, kt as cornerRadiusHandlePosRect, l as buildTransformBox, ln as drawRuler, lt as ParametricHandle, m as TRANSFORM_BOX_SIDE_PRIORITY, mn as drawPixelGrid, mt as drawParametricHandles, n as SurfaceOptions, nn as DEFAULT_RULER_TEXT_SIDE_OFFSET, nt as resolvePaint, o as VectorBendMode, on as RulerConfig, ot as DEFAULT_PARAMETRIC_HANDLE_SIZE, p as TRANSFORM_BOX_SIDE_HIT_THICKNESS, pn as PixelGridConfig, pt as computeParametricHandleLayout, q as measurementToHUDDraw, qt as DEFAULT_RULER_ACCENT_BACKGROUND, r as SurfaceVisibility, rn as DEFAULT_RULER_TICK_HEIGHT, rt as HUDCanvas, s as VectorInsertionMode, sn as RulerMark, st as DEFAULT_PARAMETRIC_HIT_SIZE, t as Surface, tn as DEFAULT_RULER_STRIP, tt as computeStripesTileGeometry, u as TRANSFORM_BOX_BODY_PRIORITY, un as DEFAULT_PIXEL_GRID_COLOR, ut as ParametricHandleGroup, v as PADDING_HANDLE_THICKNESS, vt as CornerRadiusAnchor, w as MIN_HIT_SIZE, wt as DEFAULT_CORNER_RADIUS_HIT_SIZE, x as SurfaceChromeGroups, xt as CornerRadiusRectangular, y as PADDING_REGION_PRIORITY, yt as CornerRadiusHandleLayout, z as SelectMode, zt as TransformBoxAction } from "./index-BlfZbeEJ.js";
3
4
 
4
5
  //#region event/selection-controls.d.ts
5
6
  declare const HUDHitPriority: {
@@ -103,4 +104,4 @@ declare function computeSelectionControlLayout(rect_screen: Rect, opts: {
103
104
  show_rotation: boolean;
104
105
  }): SelectionControlLayout;
105
106
  //#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 };
107
+ export { type AffineTransform, BODY_FLIP_THRESHOLD, type CornerRadiusAnchor, type CornerRadiusHandleLayout, type CornerRadiusInput, type CornerRadiusRectangular, type CursorIcon, type CursorRenderer, DEFAULT_CORNER_RADIUS_HANDLE_INSET, DEFAULT_CORNER_RADIUS_HANDLE_SIZE, DEFAULT_CORNER_RADIUS_HIT_SIZE, DEFAULT_PARAMETRIC_HANDLE_INSET, DEFAULT_PARAMETRIC_HANDLE_SIZE, DEFAULT_PARAMETRIC_HIT_SIZE, DEFAULT_PIXEL_GRID_COLOR, DEFAULT_PIXEL_GRID_STEPS, DEFAULT_RULER_ACCENT_BACKGROUND, DEFAULT_RULER_ACCENT_COLOR, DEFAULT_RULER_BACKGROUND, DEFAULT_RULER_COLOR, DEFAULT_RULER_DRAG_THRESHOLD, DEFAULT_RULER_FONT, DEFAULT_RULER_OVERLAP_THRESHOLD, DEFAULT_RULER_STEPS, DEFAULT_RULER_STRIP, DEFAULT_RULER_TEXT_SIDE_OFFSET, DEFAULT_RULER_TICK_HEIGHT, DEFAULT_STRIPES_ANGLE_DEG, DEFAULT_STRIPES_SPACING_PX, DEFAULT_STRIPES_THICKNESS_PX, type DrawCornerRadiusParams, type DrawParametricHandlesParams, type DrawPixelGridParams, type DrawRulerParams, HUDCanvas, type HUDCanvasOptions, type HUDDraw, HUDHitPriority, type HUDLine, type HUDPaint, type HUDPaintSolid, type HUDPaintStripes, type HUDPoint, 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, PADDING_HANDLE_LENGTH, PADDING_HANDLE_PRIORITY, PADDING_HANDLE_THICKNESS, PADDING_REGION_PRIORITY, type PaddingHover, type PaddingOverlayInput, type ParametricHandle, type ParametricHandleGroup, type ParametricHandleInput, type ParametricHandleLayout, type PixelGridConfig, type PointerButton, type RenderShape, type ResizeDirection, type ResolvedPaint, type RotationCorner, type RulerAxis, type RulerConfig, type RulerMark, type RulerRange, 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, TRANSFORM_BOX_BODY_PRIORITY, TRANSFORM_BOX_CORNER_HIT_SIZE, TRANSFORM_BOX_CORNER_PRIORITY, TRANSFORM_BOX_SIDE_HIT_THICKNESS, TRANSFORM_BOX_SIDE_PRIORITY, type TapHandler, type TapOutcome, type TransformBoxAction, type TransformBoxActiveOp, type TransformBoxCorners, type TransformBoxHover, type TransformBoxInput, type TransformBoxOptions, type VectorBendMode, type VectorHover, type VectorInsertionMode, type VectorOverlay, type VectorSelectionMode, type VectorSubSelection, buildPaddingOverlay, buildStripesTile, buildTransformBox, compose as composeTransformBox, computeCornerRadiusLayout, computeParametricHandleLayout, computeSelectionControlLayout, computeStripesTileGeometry, cornerRadiusAnchorSign, cornerRadiusHandlePosLine, cornerRadiusHandlePosRect, cornerRadiusLayoutGroups, cornersToBoxTransform, cursorEquals, cursorToCss, decompose as decomposeTransformBox, drawCornerRadius, drawParametricHandles, drawPixelGrid, drawRuler, filterHUDDrawByGroup, getTransformBoxCorners, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, negotiateAxis, parametricHandleLayoutGroups, projectParametricHandleValue, reduceTransformBox, resolveCenterDragAnchor, resolveCornerDragAnchor, resolvePaint, resolveParametricHandleByDirection, snapGuideToHUDDraw };
package/dist/index.js CHANGED
@@ -1,23 +1,76 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_surface = require("./surface-ofSNTJ8H.js");
3
- const require_cursor = require("./cursor-DsP9qtN2.js");
2
+ const require_surface = require("./surface-BHDH6P6p.js");
3
+ const require_cursor = require("./cursor-FGiJBdU-.js");
4
4
  exports.BODY_FLIP_THRESHOLD = require_surface.BODY_FLIP_THRESHOLD;
5
+ exports.DEFAULT_CORNER_RADIUS_HANDLE_INSET = require_surface.DEFAULT_CORNER_RADIUS_HANDLE_INSET;
6
+ exports.DEFAULT_CORNER_RADIUS_HANDLE_SIZE = require_surface.DEFAULT_CORNER_RADIUS_HANDLE_SIZE;
7
+ exports.DEFAULT_CORNER_RADIUS_HIT_SIZE = require_surface.DEFAULT_CORNER_RADIUS_HIT_SIZE;
8
+ exports.DEFAULT_PARAMETRIC_HANDLE_INSET = require_surface.DEFAULT_PARAMETRIC_HANDLE_INSET;
9
+ exports.DEFAULT_PARAMETRIC_HANDLE_SIZE = require_surface.DEFAULT_PARAMETRIC_HANDLE_SIZE;
10
+ exports.DEFAULT_PARAMETRIC_HIT_SIZE = require_surface.DEFAULT_PARAMETRIC_HIT_SIZE;
5
11
  exports.DEFAULT_PIXEL_GRID_COLOR = require_surface.DEFAULT_PIXEL_GRID_COLOR;
6
12
  exports.DEFAULT_PIXEL_GRID_STEPS = require_surface.DEFAULT_PIXEL_GRID_STEPS;
13
+ exports.DEFAULT_RULER_ACCENT_BACKGROUND = require_surface.DEFAULT_RULER_ACCENT_BACKGROUND;
14
+ exports.DEFAULT_RULER_ACCENT_COLOR = require_surface.DEFAULT_RULER_ACCENT_COLOR;
15
+ exports.DEFAULT_RULER_BACKGROUND = require_surface.DEFAULT_RULER_BACKGROUND;
16
+ exports.DEFAULT_RULER_COLOR = require_surface.DEFAULT_RULER_COLOR;
17
+ exports.DEFAULT_RULER_DRAG_THRESHOLD = require_surface.DEFAULT_RULER_DRAG_THRESHOLD;
18
+ exports.DEFAULT_RULER_FONT = require_surface.DEFAULT_RULER_FONT;
19
+ exports.DEFAULT_RULER_OVERLAP_THRESHOLD = require_surface.DEFAULT_RULER_OVERLAP_THRESHOLD;
20
+ exports.DEFAULT_RULER_STEPS = require_surface.DEFAULT_RULER_STEPS;
21
+ exports.DEFAULT_RULER_STRIP = require_surface.DEFAULT_RULER_STRIP;
22
+ exports.DEFAULT_RULER_TEXT_SIDE_OFFSET = require_surface.DEFAULT_RULER_TEXT_SIDE_OFFSET;
23
+ exports.DEFAULT_RULER_TICK_HEIGHT = require_surface.DEFAULT_RULER_TICK_HEIGHT;
24
+ exports.DEFAULT_STRIPES_ANGLE_DEG = require_surface.DEFAULT_STRIPES_ANGLE_DEG;
25
+ exports.DEFAULT_STRIPES_SPACING_PX = require_surface.DEFAULT_STRIPES_SPACING_PX;
26
+ exports.DEFAULT_STRIPES_THICKNESS_PX = require_surface.DEFAULT_STRIPES_THICKNESS_PX;
7
27
  exports.HUDCanvas = require_surface.HUDCanvas;
8
28
  exports.HUDHitPriority = require_surface.HUDHitPriority;
9
29
  exports.MIN_CHROME_VISIBLE_SIZE = require_surface.MIN_CHROME_VISIBLE_SIZE;
10
30
  exports.MIN_GUARANTEED_INTERACTIVE_DIM = require_surface.MIN_GUARANTEED_INTERACTIVE_DIM;
11
31
  exports.MIN_HIT_SIZE = require_surface.MIN_HIT_SIZE;
12
32
  exports.NO_MODS = require_surface.NO_MODS;
33
+ exports.PADDING_HANDLE_LENGTH = require_surface.PADDING_HANDLE_LENGTH;
34
+ exports.PADDING_HANDLE_PRIORITY = require_surface.PADDING_HANDLE_PRIORITY;
35
+ exports.PADDING_HANDLE_THICKNESS = require_surface.PADDING_HANDLE_THICKNESS;
36
+ exports.PADDING_REGION_PRIORITY = require_surface.PADDING_REGION_PRIORITY;
13
37
  exports.Surface = require_surface.Surface;
38
+ exports.TRANSFORM_BOX_BODY_PRIORITY = require_surface.TRANSFORM_BOX_BODY_PRIORITY;
39
+ exports.TRANSFORM_BOX_CORNER_HIT_SIZE = require_surface.TRANSFORM_BOX_CORNER_HIT_SIZE;
40
+ exports.TRANSFORM_BOX_CORNER_PRIORITY = require_surface.TRANSFORM_BOX_CORNER_PRIORITY;
41
+ exports.TRANSFORM_BOX_SIDE_HIT_THICKNESS = require_surface.TRANSFORM_BOX_SIDE_HIT_THICKNESS;
42
+ exports.TRANSFORM_BOX_SIDE_PRIORITY = require_surface.TRANSFORM_BOX_SIDE_PRIORITY;
43
+ exports.buildPaddingOverlay = require_surface.buildPaddingOverlay;
44
+ exports.buildStripesTile = require_surface.buildStripesTile;
45
+ exports.buildTransformBox = require_surface.buildTransformBox;
46
+ exports.composeTransformBox = require_surface.compose;
47
+ exports.computeCornerRadiusLayout = require_surface.computeCornerRadiusLayout;
48
+ exports.computeParametricHandleLayout = require_surface.computeParametricHandleLayout;
14
49
  exports.computeSelectionControlLayout = require_surface.computeSelectionControlLayout;
50
+ exports.computeStripesTileGeometry = require_surface.computeStripesTileGeometry;
51
+ exports.cornerRadiusAnchorSign = require_surface.cornerRadiusAnchorSign;
52
+ exports.cornerRadiusHandlePosLine = require_surface.cornerRadiusHandlePosLine;
53
+ exports.cornerRadiusHandlePosRect = require_surface.cornerRadiusHandlePosRect;
54
+ exports.cornerRadiusLayoutGroups = require_surface.cornerRadiusLayoutGroups;
55
+ exports.cornersToBoxTransform = require_surface.cornersToBoxTransform;
15
56
  exports.cursorEquals = require_cursor.cursorEquals;
16
57
  exports.cursorToCss = require_cursor.cursorToCss;
58
+ exports.decomposeTransformBox = require_surface.decompose;
59
+ exports.drawCornerRadius = require_surface.drawCornerRadius;
60
+ exports.drawParametricHandles = require_surface.drawParametricHandles;
17
61
  exports.drawPixelGrid = require_surface.drawPixelGrid;
62
+ exports.drawRuler = require_surface.drawRuler;
18
63
  exports.filterHUDDrawByGroup = require_surface.filterHUDDrawByGroup;
64
+ exports.getTransformBoxCorners = require_surface.getTransformBoxCorners;
19
65
  exports.lassoToHUDDraw = require_surface.lassoToHUDDraw;
20
66
  exports.marqueeToHUDDraw = require_surface.marqueeToHUDDraw;
21
67
  exports.measurementToHUDDraw = require_surface.measurementToHUDDraw;
22
68
  exports.negotiateAxis = require_surface.negotiateAxis;
69
+ exports.parametricHandleLayoutGroups = require_surface.parametricHandleLayoutGroups;
70
+ exports.projectParametricHandleValue = require_surface.projectParametricHandleValue;
71
+ exports.reduceTransformBox = require_surface.reduceTransformBox;
72
+ exports.resolveCenterDragAnchor = require_surface.resolveCenterDragAnchor;
73
+ exports.resolveCornerDragAnchor = require_surface.resolveCornerDragAnchor;
74
+ exports.resolvePaint = require_surface.resolvePaint;
75
+ exports.resolveParametricHandleByDirection = require_surface.resolveParametricHandleByDirection;
23
76
  exports.snapGuideToHUDDraw = require_surface.snapGuideToHUDDraw;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
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 };
1
+ import { $ as DEFAULT_RULER_BACKGROUND, A as filterHUDDrawByGroup, B as drawCornerRadius, C as PADDING_REGION_PRIORITY, D as marqueeToHUDDraw, E as lassoToHUDDraw, F as computeCornerRadiusLayout, G as DEFAULT_PARAMETRIC_HIT_SIZE, H as resolveCornerDragAnchor, I as cornerRadiusAnchorSign, J as parametricHandleLayoutGroups, K as computeParametricHandleLayout, L as cornerRadiusHandlePosLine, M as DEFAULT_CORNER_RADIUS_HANDLE_INSET, N as DEFAULT_CORNER_RADIUS_HANDLE_SIZE, O as measurementToHUDDraw, P as DEFAULT_CORNER_RADIUS_HIT_SIZE, Q as DEFAULT_RULER_ACCENT_COLOR, R as cornerRadiusHandlePosRect, S as PADDING_HANDLE_THICKNESS, T as MIN_HIT_SIZE, U as DEFAULT_PARAMETRIC_HANDLE_INSET, V as resolveCenterDragAnchor, W as DEFAULT_PARAMETRIC_HANDLE_SIZE, X as resolveParametricHandleByDirection, Y as projectParametricHandleValue, Z as DEFAULT_RULER_ACCENT_BACKGROUND, _ as getTransformBoxCorners, _t as resolvePaint, a as computeSelectionControlLayout, at as DEFAULT_RULER_STRIP, b as PADDING_HANDLE_LENGTH, c as buildTransformBox, ct as drawRuler, d as TRANSFORM_BOX_CORNER_PRIORITY, dt as drawPixelGrid, et as DEFAULT_RULER_COLOR, f as TRANSFORM_BOX_SIDE_HIT_THICKNESS, ft as DEFAULT_STRIPES_ANGLE_DEG, g as decompose, gt as computeStripesTileGeometry, h as cornersToBoxTransform, ht as buildStripesTile, i as MIN_GUARANTEED_INTERACTIVE_DIM, it as DEFAULT_RULER_STEPS, j as HUDCanvas, k as snapGuideToHUDDraw, l as TRANSFORM_BOX_BODY_PRIORITY, lt as DEFAULT_PIXEL_GRID_COLOR, m as compose, mt as DEFAULT_STRIPES_THICKNESS_PX, n as BODY_FLIP_THRESHOLD, nt as DEFAULT_RULER_FONT, o as negotiateAxis, ot as DEFAULT_RULER_TEXT_SIDE_OFFSET, p as TRANSFORM_BOX_SIDE_PRIORITY, pt as DEFAULT_STRIPES_SPACING_PX, q as drawParametricHandles, r as HUDHitPriority, rt as DEFAULT_RULER_OVERLAP_THRESHOLD, s as NO_MODS, st as DEFAULT_RULER_TICK_HEIGHT, t as Surface, tt as DEFAULT_RULER_DRAG_THRESHOLD, u as TRANSFORM_BOX_CORNER_HIT_SIZE, ut as DEFAULT_PIXEL_GRID_STEPS, v as reduceTransformBox, w as MIN_CHROME_VISIBLE_SIZE, x as PADDING_HANDLE_PRIORITY, y as buildPaddingOverlay, z as cornerRadiusLayoutGroups } from "./surface-B_8w6VWG.mjs";
2
+ import { i as cursorToCss, r as cursorEquals } from "./cursor-DW-uAPVE.mjs";
3
+ export { BODY_FLIP_THRESHOLD, DEFAULT_CORNER_RADIUS_HANDLE_INSET, DEFAULT_CORNER_RADIUS_HANDLE_SIZE, DEFAULT_CORNER_RADIUS_HIT_SIZE, DEFAULT_PARAMETRIC_HANDLE_INSET, DEFAULT_PARAMETRIC_HANDLE_SIZE, DEFAULT_PARAMETRIC_HIT_SIZE, DEFAULT_PIXEL_GRID_COLOR, DEFAULT_PIXEL_GRID_STEPS, DEFAULT_RULER_ACCENT_BACKGROUND, DEFAULT_RULER_ACCENT_COLOR, DEFAULT_RULER_BACKGROUND, DEFAULT_RULER_COLOR, DEFAULT_RULER_DRAG_THRESHOLD, DEFAULT_RULER_FONT, DEFAULT_RULER_OVERLAP_THRESHOLD, DEFAULT_RULER_STEPS, DEFAULT_RULER_STRIP, DEFAULT_RULER_TEXT_SIDE_OFFSET, DEFAULT_RULER_TICK_HEIGHT, DEFAULT_STRIPES_ANGLE_DEG, DEFAULT_STRIPES_SPACING_PX, DEFAULT_STRIPES_THICKNESS_PX, HUDCanvas, HUDHitPriority, MIN_CHROME_VISIBLE_SIZE, MIN_GUARANTEED_INTERACTIVE_DIM, MIN_HIT_SIZE, NO_MODS, PADDING_HANDLE_LENGTH, PADDING_HANDLE_PRIORITY, PADDING_HANDLE_THICKNESS, PADDING_REGION_PRIORITY, Surface, TRANSFORM_BOX_BODY_PRIORITY, TRANSFORM_BOX_CORNER_HIT_SIZE, TRANSFORM_BOX_CORNER_PRIORITY, TRANSFORM_BOX_SIDE_HIT_THICKNESS, TRANSFORM_BOX_SIDE_PRIORITY, buildPaddingOverlay, buildStripesTile, buildTransformBox, compose as composeTransformBox, computeCornerRadiusLayout, computeParametricHandleLayout, computeSelectionControlLayout, computeStripesTileGeometry, cornerRadiusAnchorSign, cornerRadiusHandlePosLine, cornerRadiusHandlePosRect, cornerRadiusLayoutGroups, cornersToBoxTransform, cursorEquals, cursorToCss, decompose as decomposeTransformBox, drawCornerRadius, drawParametricHandles, drawPixelGrid, drawRuler, filterHUDDrawByGroup, getTransformBoxCorners, lassoToHUDDraw, marqueeToHUDDraw, measurementToHUDDraw, negotiateAxis, parametricHandleLayoutGroups, projectParametricHandleValue, reduceTransformBox, resolveCenterDragAnchor, resolveCornerDragAnchor, resolvePaint, resolveParametricHandleByDirection, snapGuideToHUDDraw };
@@ -0,0 +1,241 @@
1
+ import { f as HUDSemanticGroup, r as HUDPaint } from "./types-3wwFisZs.js";
2
+ import cmath from "@grida/cmath";
3
+
4
+ //#region primitives/cursor.d.ts
5
+ /** 8 cardinal/diagonal resize directions. */
6
+ type ResizeDirection = "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
7
+ /** 4 corner positions for rotation handles. */
8
+ type RotationCorner = "nw" | "ne" | "se" | "sw";
9
+ /**
10
+ * Logical cursor icon names.
11
+ *
12
+ * `baseAngle` (radians) tilts the rendered arrow by an additional
13
+ * amount on top of the variant's canonical orientation; the
14
+ * orchestrator sets it when a gesture rotates a selection so the
15
+ * cursor tracks live rotation.
16
+ */
17
+ type CursorIcon = "default" | "pointer" | "move" | "crosshair" | "grab" | "grabbing" | "text" | {
18
+ kind: "resize";
19
+ direction: ResizeDirection;
20
+ baseAngle?: number;
21
+ } | {
22
+ kind: "rotate";
23
+ corner: RotationCorner;
24
+ baseAngle?: number;
25
+ };
26
+ /**
27
+ * Angle quantization bucket — 0.5° in radians. Two rotated cursors
28
+ * compare equal when their `baseAngle`s round to the same bucket.
29
+ *
30
+ * 0.5° is below human perception for cursor orientation, so the
31
+ * quantization is visually free.
32
+ */
33
+ declare const CURSOR_ANGLE_BUCKET_RAD: number;
34
+ /** Quantize an angle (radians) to its `CURSOR_ANGLE_BUCKET_RAD` bucket. */
35
+ declare function angleBucket(rad: number | undefined): number;
36
+ /**
37
+ * Pluggable cursor renderer — maps a logical `CursorIcon` to a CSS
38
+ * `cursor:` value. Bedrock ships {@link cursorToCss} as the default;
39
+ * hosts compose their own to substitute SVG data-URLs or platform
40
+ * extensions.
41
+ */
42
+ type CursorRenderer = (icon: CursorIcon) => string;
43
+ /**
44
+ * Default mapping from `CursorIcon` to CSS `cursor` value.
45
+ */
46
+ declare function cursorToCss(c: CursorIcon): string;
47
+ /**
48
+ * Cursor equality with `baseAngle` bucketing.
49
+ *
50
+ * Lets a hot path (a rotate-in-progress gesture's per-frame setCursor)
51
+ * emit `cursorChanged` only on visible motion (≥ one bucket of
52
+ * rotation).
53
+ */
54
+ declare function cursorEquals(a: CursorIcon, b: CursorIcon): boolean;
55
+ //#endregion
56
+ //#region primitives/overlay.d.ts
57
+ /**
58
+ * Minimum hit-target size in screen-px.
59
+ *
60
+ * Visual knobs are typically 8px; the hit region is 16px so the user
61
+ * does not need pixel-perfect aim (Fitts'). Bedrock constant — value
62
+ * mirrors the legacy `event/overlay.ts` constant during the additive
63
+ * migration.
64
+ */
65
+ declare const MIN_HIT_SIZE = 16;
66
+ /**
67
+ * Below this selection size (in screen-px on either axis), chrome is
68
+ * suppressed — both the visual handles AND the hit regions. The
69
+ * consumer enforces this when computing per-frame `HUDObject`s.
70
+ */
71
+ declare const MIN_CHROME_VISIBLE_SIZE = 12;
72
+ /**
73
+ * The hit region of a `HUDObject`. Always screen-space; the variants
74
+ * differ on how the region is anchored.
75
+ *
76
+ * **Variants** (closed taxonomy — no host extension):
77
+ *
78
+ * - `screen_rect_at_doc` — fixed screen-pixel rect, anchored to a
79
+ * doc-space point. The hit region tracks the document under camera
80
+ * changes; dimensions stay constant in CSS px. Used by handles.
81
+ *
82
+ * - `screen_aabb` — pre-projected screen-space AABB. Used for
83
+ * overlays whose layout is already screen-space (edge strips).
84
+ *
85
+ * - `screen_obb` — oriented bounding box. `rect` is axis-aligned in
86
+ * a shadow space; `inverse_transform` maps screen → shadow. Lets
87
+ * rotated chrome stay exact without AABB inflation.
88
+ *
89
+ * - `screen_circle_at_doc` — fixed screen-pixel circle, anchored to a
90
+ * doc-space point. Used by vector-handle dots and parametric-handle
91
+ * knobs where a square hit region would feel wrong at the corners.
92
+ *
93
+ * - `screen_polygon` — pre-projected screen-space polygon. Used by
94
+ * curved zones (variable-width controls, lasso previews) where AABB
95
+ * plus a `customHitTest` callback would otherwise leak host code
96
+ * into bedrock.
97
+ */
98
+ type HitShape = {
99
+ readonly kind: "screen_rect_at_doc";
100
+ readonly anchor_doc: cmath.Vector2; /** Screen-space size in CSS px. */
101
+ readonly width: number;
102
+ readonly height: number; /** Which point of the rect sits on the anchor. Default: "center". */
103
+ readonly placement?: "center" | "tl" | "tr" | "bl" | "br";
104
+ } | {
105
+ readonly kind: "screen_aabb";
106
+ readonly rect: cmath.Rectangle;
107
+ } | {
108
+ readonly kind: "screen_obb"; /** Axis-aligned rect in shadow space. */
109
+ readonly rect: cmath.Rectangle; /** screen → shadow. Applied to the pointer before AABB containment. */
110
+ readonly inverse_transform: cmath.Transform;
111
+ } | {
112
+ readonly kind: "screen_circle_at_doc";
113
+ readonly anchor_doc: cmath.Vector2; /** Radius in screen CSS px. */
114
+ readonly radius: number;
115
+ } | {
116
+ readonly kind: "screen_polygon"; /** Pre-projected screen-space polygon vertices. */
117
+ readonly points: ReadonlyArray<readonly [number, number]>;
118
+ };
119
+ /**
120
+ * The visual representation of a `HUDObject`. Maps directly onto the
121
+ * primitive layer's `HUDDraw` entries; the consumer (or the deferred
122
+ * orchestrator) fans these into one merged `HUDDraw` per frame.
123
+ *
124
+ * Closed taxonomy — same set as the legacy `OverlayElement.render`
125
+ * union (`screen_rect`, `doc_rect`, `doc_line`, `doc_polyline`). No
126
+ * new variants in bedrock; new render kinds land here only with ≥2
127
+ * internal consumers shaped (sdk-design promotion bar).
128
+ */
129
+ type RenderShape = {
130
+ readonly kind: "screen_rect";
131
+ readonly anchor_doc: cmath.Vector2;
132
+ readonly width: number;
133
+ readonly height: number;
134
+ readonly placement?: "center" | "tl" | "tr" | "bl" | "br";
135
+ readonly fill?: boolean;
136
+ readonly stroke?: boolean;
137
+ readonly fillColor?: string;
138
+ readonly strokeColor?: string;
139
+ readonly angle?: number;
140
+ readonly shape?: "rect" | "circle";
141
+ } | {
142
+ readonly kind: "doc_rect";
143
+ readonly x: number;
144
+ readonly y: number;
145
+ readonly width: number;
146
+ readonly height: number;
147
+ readonly stroke?: boolean;
148
+ readonly fill?: boolean;
149
+ readonly fillOpacity?: number;
150
+ readonly dashed?: boolean;
151
+ } | {
152
+ readonly kind: "doc_line";
153
+ readonly x1: number;
154
+ readonly y1: number;
155
+ readonly x2: number;
156
+ readonly y2: number;
157
+ readonly dashed?: boolean;
158
+ readonly strokeWidth?: number;
159
+ readonly color?: string;
160
+ } | {
161
+ readonly kind: "doc_polyline";
162
+ readonly points: ReadonlyArray<readonly [number, number]>;
163
+ readonly stroke?: boolean;
164
+ readonly fill?: boolean;
165
+ readonly fillOpacity?: number;
166
+ readonly strokeOpacity?: number;
167
+ readonly strokeWidth?: number;
168
+ readonly dashed?: boolean;
169
+ readonly color?: string;
170
+ readonly fillPaint?: HUDPaint;
171
+ };
172
+ /**
173
+ * Fields common to every `HUDObject` variant.
174
+ */
175
+ interface HUDObjectCommon {
176
+ /** Optional debug label. Stable semantic identifier, e.g.
177
+ * `"resize_handle:nw"`, `"my-class:knob"`. */
178
+ readonly label?: string;
179
+ /** Semantic group, used by the consumer for visibility filtering. */
180
+ readonly group?: HUDSemanticGroup;
181
+ /** Lower wins on overlap. The consumer assigns the integer; bedrock
182
+ * treats it opaquely (sort key only). */
183
+ readonly priority: number;
184
+ }
185
+ /**
186
+ * Paint-only object: visual chrome that is never hit-tested.
187
+ * `render` is required; `hit`, `intent`, `cursor` are forbidden.
188
+ */
189
+ interface HUDObjectPaintOnly extends HUDObjectCommon {
190
+ readonly render: RenderShape;
191
+ readonly hit?: never;
192
+ readonly intent?: never;
193
+ readonly cursor?: never;
194
+ }
195
+ /**
196
+ * Interactive object: hit-testable; may also paint, carry an intent,
197
+ * and a cursor. `hit` is required; the rest are optional.
198
+ *
199
+ * Sub-states (none enforced; documented for readers):
200
+ * - `intent` absent → silent / hover-only.
201
+ * - `intent` present → fully interactive.
202
+ * - `render` absent → silent affordance (invisible hit padding around
203
+ * a pre-painted target).
204
+ */
205
+ interface HUDObjectInteractive<I = unknown> extends HUDObjectCommon {
206
+ readonly hit: HitShape;
207
+ readonly render?: RenderShape;
208
+ readonly intent?: I;
209
+ readonly cursor?: CursorIcon;
210
+ /**
211
+ * Optional refinement applied AFTER `hit` containment passes. Return
212
+ * `false` to reject the hit even though the shape contained the point.
213
+ *
214
+ * The point passed is the same screen-space point handed to
215
+ * `HitRegistry.queryPoint`. Used by curve-shaped affordances (a path
216
+ * segment's hit region is the bezier's bbox; the refinement asks "are
217
+ * you actually near the curve in screen-px?") — the one real case that
218
+ * an AABB/circle/polygon cannot express on its own.
219
+ *
220
+ * This is a deliberate, narrow escape hatch, restored after the
221
+ * vector-path consumer proved an AABB-only hit model drops the
222
+ * curve-near refinement. It is NOT a general "host runs arbitrary code
223
+ * in the hit loop" door: it only *narrows* a shape that already
224
+ * matched; it cannot widen one.
225
+ */
226
+ readonly refine?: (p: cmath.Vector2) => boolean;
227
+ }
228
+ /**
229
+ * The canonical bedrock primitive — the value type a consumer
230
+ * constructs to participate in HUD.
231
+ *
232
+ * Generic over the opaque intent type `I` the consumer supplies; both
233
+ * bedrock and `HitRegistry<I>` propagate `I` unchanged.
234
+ *
235
+ * The discriminated union enforces the (`render` ∨ `hit`) invariant
236
+ * at compile time: an object with neither field is not assignable to
237
+ * either variant.
238
+ */
239
+ type HUDObject<I = unknown> = HUDObjectPaintOnly | HUDObjectInteractive<I>;
240
+ //#endregion
241
+ export { MIN_CHROME_VISIBLE_SIZE as a, CURSOR_ANGLE_BUCKET_RAD as c, ResizeDirection as d, RotationCorner as f, cursorToCss as h, HitShape as i, CursorIcon as l, cursorEquals as m, HUDObjectInteractive as n, MIN_HIT_SIZE as o, angleBucket as p, HUDObjectPaintOnly as r, RenderShape as s, HUDObject as t, CursorRenderer as u };
@@ -0,0 +1,241 @@
1
+ import { f as HUDSemanticGroup, r as HUDPaint } from "./types-3wwFisZs.mjs";
2
+ import cmath from "@grida/cmath";
3
+
4
+ //#region primitives/cursor.d.ts
5
+ /** 8 cardinal/diagonal resize directions. */
6
+ type ResizeDirection = "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
7
+ /** 4 corner positions for rotation handles. */
8
+ type RotationCorner = "nw" | "ne" | "se" | "sw";
9
+ /**
10
+ * Logical cursor icon names.
11
+ *
12
+ * `baseAngle` (radians) tilts the rendered arrow by an additional
13
+ * amount on top of the variant's canonical orientation; the
14
+ * orchestrator sets it when a gesture rotates a selection so the
15
+ * cursor tracks live rotation.
16
+ */
17
+ type CursorIcon = "default" | "pointer" | "move" | "crosshair" | "grab" | "grabbing" | "text" | {
18
+ kind: "resize";
19
+ direction: ResizeDirection;
20
+ baseAngle?: number;
21
+ } | {
22
+ kind: "rotate";
23
+ corner: RotationCorner;
24
+ baseAngle?: number;
25
+ };
26
+ /**
27
+ * Angle quantization bucket — 0.5° in radians. Two rotated cursors
28
+ * compare equal when their `baseAngle`s round to the same bucket.
29
+ *
30
+ * 0.5° is below human perception for cursor orientation, so the
31
+ * quantization is visually free.
32
+ */
33
+ declare const CURSOR_ANGLE_BUCKET_RAD: number;
34
+ /** Quantize an angle (radians) to its `CURSOR_ANGLE_BUCKET_RAD` bucket. */
35
+ declare function angleBucket(rad: number | undefined): number;
36
+ /**
37
+ * Pluggable cursor renderer — maps a logical `CursorIcon` to a CSS
38
+ * `cursor:` value. Bedrock ships {@link cursorToCss} as the default;
39
+ * hosts compose their own to substitute SVG data-URLs or platform
40
+ * extensions.
41
+ */
42
+ type CursorRenderer = (icon: CursorIcon) => string;
43
+ /**
44
+ * Default mapping from `CursorIcon` to CSS `cursor` value.
45
+ */
46
+ declare function cursorToCss(c: CursorIcon): string;
47
+ /**
48
+ * Cursor equality with `baseAngle` bucketing.
49
+ *
50
+ * Lets a hot path (a rotate-in-progress gesture's per-frame setCursor)
51
+ * emit `cursorChanged` only on visible motion (≥ one bucket of
52
+ * rotation).
53
+ */
54
+ declare function cursorEquals(a: CursorIcon, b: CursorIcon): boolean;
55
+ //#endregion
56
+ //#region primitives/overlay.d.ts
57
+ /**
58
+ * Minimum hit-target size in screen-px.
59
+ *
60
+ * Visual knobs are typically 8px; the hit region is 16px so the user
61
+ * does not need pixel-perfect aim (Fitts'). Bedrock constant — value
62
+ * mirrors the legacy `event/overlay.ts` constant during the additive
63
+ * migration.
64
+ */
65
+ declare const MIN_HIT_SIZE = 16;
66
+ /**
67
+ * Below this selection size (in screen-px on either axis), chrome is
68
+ * suppressed — both the visual handles AND the hit regions. The
69
+ * consumer enforces this when computing per-frame `HUDObject`s.
70
+ */
71
+ declare const MIN_CHROME_VISIBLE_SIZE = 12;
72
+ /**
73
+ * The hit region of a `HUDObject`. Always screen-space; the variants
74
+ * differ on how the region is anchored.
75
+ *
76
+ * **Variants** (closed taxonomy — no host extension):
77
+ *
78
+ * - `screen_rect_at_doc` — fixed screen-pixel rect, anchored to a
79
+ * doc-space point. The hit region tracks the document under camera
80
+ * changes; dimensions stay constant in CSS px. Used by handles.
81
+ *
82
+ * - `screen_aabb` — pre-projected screen-space AABB. Used for
83
+ * overlays whose layout is already screen-space (edge strips).
84
+ *
85
+ * - `screen_obb` — oriented bounding box. `rect` is axis-aligned in
86
+ * a shadow space; `inverse_transform` maps screen → shadow. Lets
87
+ * rotated chrome stay exact without AABB inflation.
88
+ *
89
+ * - `screen_circle_at_doc` — fixed screen-pixel circle, anchored to a
90
+ * doc-space point. Used by vector-handle dots and parametric-handle
91
+ * knobs where a square hit region would feel wrong at the corners.
92
+ *
93
+ * - `screen_polygon` — pre-projected screen-space polygon. Used by
94
+ * curved zones (variable-width controls, lasso previews) where AABB
95
+ * plus a `customHitTest` callback would otherwise leak host code
96
+ * into bedrock.
97
+ */
98
+ type HitShape = {
99
+ readonly kind: "screen_rect_at_doc";
100
+ readonly anchor_doc: cmath.Vector2; /** Screen-space size in CSS px. */
101
+ readonly width: number;
102
+ readonly height: number; /** Which point of the rect sits on the anchor. Default: "center". */
103
+ readonly placement?: "center" | "tl" | "tr" | "bl" | "br";
104
+ } | {
105
+ readonly kind: "screen_aabb";
106
+ readonly rect: cmath.Rectangle;
107
+ } | {
108
+ readonly kind: "screen_obb"; /** Axis-aligned rect in shadow space. */
109
+ readonly rect: cmath.Rectangle; /** screen → shadow. Applied to the pointer before AABB containment. */
110
+ readonly inverse_transform: cmath.Transform;
111
+ } | {
112
+ readonly kind: "screen_circle_at_doc";
113
+ readonly anchor_doc: cmath.Vector2; /** Radius in screen CSS px. */
114
+ readonly radius: number;
115
+ } | {
116
+ readonly kind: "screen_polygon"; /** Pre-projected screen-space polygon vertices. */
117
+ readonly points: ReadonlyArray<readonly [number, number]>;
118
+ };
119
+ /**
120
+ * The visual representation of a `HUDObject`. Maps directly onto the
121
+ * primitive layer's `HUDDraw` entries; the consumer (or the deferred
122
+ * orchestrator) fans these into one merged `HUDDraw` per frame.
123
+ *
124
+ * Closed taxonomy — same set as the legacy `OverlayElement.render`
125
+ * union (`screen_rect`, `doc_rect`, `doc_line`, `doc_polyline`). No
126
+ * new variants in bedrock; new render kinds land here only with ≥2
127
+ * internal consumers shaped (sdk-design promotion bar).
128
+ */
129
+ type RenderShape = {
130
+ readonly kind: "screen_rect";
131
+ readonly anchor_doc: cmath.Vector2;
132
+ readonly width: number;
133
+ readonly height: number;
134
+ readonly placement?: "center" | "tl" | "tr" | "bl" | "br";
135
+ readonly fill?: boolean;
136
+ readonly stroke?: boolean;
137
+ readonly fillColor?: string;
138
+ readonly strokeColor?: string;
139
+ readonly angle?: number;
140
+ readonly shape?: "rect" | "circle";
141
+ } | {
142
+ readonly kind: "doc_rect";
143
+ readonly x: number;
144
+ readonly y: number;
145
+ readonly width: number;
146
+ readonly height: number;
147
+ readonly stroke?: boolean;
148
+ readonly fill?: boolean;
149
+ readonly fillOpacity?: number;
150
+ readonly dashed?: boolean;
151
+ } | {
152
+ readonly kind: "doc_line";
153
+ readonly x1: number;
154
+ readonly y1: number;
155
+ readonly x2: number;
156
+ readonly y2: number;
157
+ readonly dashed?: boolean;
158
+ readonly strokeWidth?: number;
159
+ readonly color?: string;
160
+ } | {
161
+ readonly kind: "doc_polyline";
162
+ readonly points: ReadonlyArray<readonly [number, number]>;
163
+ readonly stroke?: boolean;
164
+ readonly fill?: boolean;
165
+ readonly fillOpacity?: number;
166
+ readonly strokeOpacity?: number;
167
+ readonly strokeWidth?: number;
168
+ readonly dashed?: boolean;
169
+ readonly color?: string;
170
+ readonly fillPaint?: HUDPaint;
171
+ };
172
+ /**
173
+ * Fields common to every `HUDObject` variant.
174
+ */
175
+ interface HUDObjectCommon {
176
+ /** Optional debug label. Stable semantic identifier, e.g.
177
+ * `"resize_handle:nw"`, `"my-class:knob"`. */
178
+ readonly label?: string;
179
+ /** Semantic group, used by the consumer for visibility filtering. */
180
+ readonly group?: HUDSemanticGroup;
181
+ /** Lower wins on overlap. The consumer assigns the integer; bedrock
182
+ * treats it opaquely (sort key only). */
183
+ readonly priority: number;
184
+ }
185
+ /**
186
+ * Paint-only object: visual chrome that is never hit-tested.
187
+ * `render` is required; `hit`, `intent`, `cursor` are forbidden.
188
+ */
189
+ interface HUDObjectPaintOnly extends HUDObjectCommon {
190
+ readonly render: RenderShape;
191
+ readonly hit?: never;
192
+ readonly intent?: never;
193
+ readonly cursor?: never;
194
+ }
195
+ /**
196
+ * Interactive object: hit-testable; may also paint, carry an intent,
197
+ * and a cursor. `hit` is required; the rest are optional.
198
+ *
199
+ * Sub-states (none enforced; documented for readers):
200
+ * - `intent` absent → silent / hover-only.
201
+ * - `intent` present → fully interactive.
202
+ * - `render` absent → silent affordance (invisible hit padding around
203
+ * a pre-painted target).
204
+ */
205
+ interface HUDObjectInteractive<I = unknown> extends HUDObjectCommon {
206
+ readonly hit: HitShape;
207
+ readonly render?: RenderShape;
208
+ readonly intent?: I;
209
+ readonly cursor?: CursorIcon;
210
+ /**
211
+ * Optional refinement applied AFTER `hit` containment passes. Return
212
+ * `false` to reject the hit even though the shape contained the point.
213
+ *
214
+ * The point passed is the same screen-space point handed to
215
+ * `HitRegistry.queryPoint`. Used by curve-shaped affordances (a path
216
+ * segment's hit region is the bezier's bbox; the refinement asks "are
217
+ * you actually near the curve in screen-px?") — the one real case that
218
+ * an AABB/circle/polygon cannot express on its own.
219
+ *
220
+ * This is a deliberate, narrow escape hatch, restored after the
221
+ * vector-path consumer proved an AABB-only hit model drops the
222
+ * curve-near refinement. It is NOT a general "host runs arbitrary code
223
+ * in the hit loop" door: it only *narrows* a shape that already
224
+ * matched; it cannot widen one.
225
+ */
226
+ readonly refine?: (p: cmath.Vector2) => boolean;
227
+ }
228
+ /**
229
+ * The canonical bedrock primitive — the value type a consumer
230
+ * constructs to participate in HUD.
231
+ *
232
+ * Generic over the opaque intent type `I` the consumer supplies; both
233
+ * bedrock and `HitRegistry<I>` propagate `I` unchanged.
234
+ *
235
+ * The discriminated union enforces the (`render` ∨ `hit`) invariant
236
+ * at compile time: an object with neither field is not assignable to
237
+ * either variant.
238
+ */
239
+ type HUDObject<I = unknown> = HUDObjectPaintOnly | HUDObjectInteractive<I>;
240
+ //#endregion
241
+ export { MIN_CHROME_VISIBLE_SIZE as a, CURSOR_ANGLE_BUCKET_RAD as c, ResizeDirection as d, RotationCorner as f, cursorToCss as h, HitShape as i, CursorIcon as l, cursorEquals as m, HUDObjectInteractive as n, MIN_HIT_SIZE as o, angleBucket as p, HUDObjectPaintOnly as r, RenderShape as s, HUDObject as t, CursorRenderer as u };