@oh-just-another/state 0.57.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/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/actions/actionClipboard.d.ts +6 -0
- package/dist/actions/actionClipboard.d.ts.map +1 -0
- package/dist/actions/actionClipboard.js +26 -0
- package/dist/actions/actionClipboard.js.map +1 -0
- package/dist/actions/actionGrouping.d.ts +5 -0
- package/dist/actions/actionGrouping.d.ts.map +1 -0
- package/dist/actions/actionGrouping.js +26 -0
- package/dist/actions/actionGrouping.js.map +1 -0
- package/dist/actions/actionHistory.d.ts +5 -0
- package/dist/actions/actionHistory.d.ts.map +1 -0
- package/dist/actions/actionHistory.js +25 -0
- package/dist/actions/actionHistory.js.map +1 -0
- package/dist/actions/actionKeyboard.d.ts +3 -0
- package/dist/actions/actionKeyboard.d.ts.map +1 -0
- package/dist/actions/actionKeyboard.js +130 -0
- package/dist/actions/actionKeyboard.js.map +1 -0
- package/dist/actions/actionLayout.d.ts +3 -0
- package/dist/actions/actionLayout.d.ts.map +1 -0
- package/dist/actions/actionLayout.js +65 -0
- package/dist/actions/actionLayout.js.map +1 -0
- package/dist/actions/actionMode.d.ts +13 -0
- package/dist/actions/actionMode.d.ts.map +1 -0
- package/dist/actions/actionMode.js +116 -0
- package/dist/actions/actionMode.js.map +1 -0
- package/dist/actions/actionSelection.d.ts +9 -0
- package/dist/actions/actionSelection.d.ts.map +1 -0
- package/dist/actions/actionSelection.js +57 -0
- package/dist/actions/actionSelection.js.map +1 -0
- package/dist/actions/actionView.d.ts +7 -0
- package/dist/actions/actionView.d.ts.map +1 -0
- package/dist/actions/actionView.js +14 -0
- package/dist/actions/actionView.js.map +1 -0
- package/dist/actions/actionZOrder.d.ts +7 -0
- package/dist/actions/actionZOrder.d.ts.map +1 -0
- package/dist/actions/actionZOrder.js +42 -0
- package/dist/actions/actionZOrder.js.map +1 -0
- package/dist/actions/actionZoom.d.ts +8 -0
- package/dist/actions/actionZoom.d.ts.map +1 -0
- package/dist/actions/actionZoom.js +61 -0
- package/dist/actions/actionZoom.js.map +1 -0
- package/dist/actions/index.d.ts +12 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +11 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/registry.d.ts +68 -0
- package/dist/actions/registry.d.ts.map +1 -0
- package/dist/actions/registry.js +300 -0
- package/dist/actions/registry.js.map +1 -0
- package/dist/actions/types.d.ts +103 -0
- package/dist/actions/types.d.ts.map +1 -0
- package/dist/actions/types.js +10 -0
- package/dist/actions/types.js.map +1 -0
- package/dist/animation-tick.d.ts +28 -0
- package/dist/animation-tick.d.ts.map +1 -0
- package/dist/animation-tick.js +50 -0
- package/dist/animation-tick.js.map +1 -0
- package/dist/auto-compact.d.ts +27 -0
- package/dist/auto-compact.d.ts.map +1 -0
- package/dist/auto-compact.js +46 -0
- package/dist/auto-compact.js.map +1 -0
- package/dist/auto-layout-scheduler.d.ts +50 -0
- package/dist/auto-layout-scheduler.d.ts.map +1 -0
- package/dist/auto-layout-scheduler.js +94 -0
- package/dist/auto-layout-scheduler.js.map +1 -0
- package/dist/built-in-handlers.d.ts +24 -0
- package/dist/built-in-handlers.d.ts.map +1 -0
- package/dist/built-in-handlers.js +210 -0
- package/dist/built-in-handlers.js.map +1 -0
- package/dist/clipboard.d.ts +51 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +105 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/constants.d.ts +544 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +537 -0
- package/dist/constants.js.map +1 -0
- package/dist/dom-events.d.ts +13 -0
- package/dist/dom-events.d.ts.map +1 -0
- package/dist/dom-events.js +70 -0
- package/dist/dom-events.js.map +1 -0
- package/dist/editor/anchor-points.d.ts +22 -0
- package/dist/editor/anchor-points.d.ts.map +1 -0
- package/dist/editor/anchor-points.js +28 -0
- package/dist/editor/anchor-points.js.map +1 -0
- package/dist/editor/applies/create.d.ts +60 -0
- package/dist/editor/applies/create.d.ts.map +1 -0
- package/dist/editor/applies/create.js +107 -0
- package/dist/editor/applies/create.js.map +1 -0
- package/dist/editor/applies/edge.d.ts +32 -0
- package/dist/editor/applies/edge.d.ts.map +1 -0
- package/dist/editor/applies/edge.js +44 -0
- package/dist/editor/applies/edge.js.map +1 -0
- package/dist/editor/applies/link-move.d.ts +53 -0
- package/dist/editor/applies/link-move.d.ts.map +1 -0
- package/dist/editor/applies/link-move.js +160 -0
- package/dist/editor/applies/link-move.js.map +1 -0
- package/dist/editor/applies/move.d.ts +38 -0
- package/dist/editor/applies/move.d.ts.map +1 -0
- package/dist/editor/applies/move.js +83 -0
- package/dist/editor/applies/move.js.map +1 -0
- package/dist/editor/applies/resize.d.ts +68 -0
- package/dist/editor/applies/resize.d.ts.map +1 -0
- package/dist/editor/applies/resize.js +199 -0
- package/dist/editor/applies/resize.js.map +1 -0
- package/dist/editor/applies/selection.d.ts +34 -0
- package/dist/editor/applies/selection.d.ts.map +1 -0
- package/dist/editor/applies/selection.js +65 -0
- package/dist/editor/applies/selection.js.map +1 -0
- package/dist/editor/applies/snap-grid.d.ts +45 -0
- package/dist/editor/applies/snap-grid.d.ts.map +1 -0
- package/dist/editor/applies/snap-grid.js +90 -0
- package/dist/editor/applies/snap-grid.js.map +1 -0
- package/dist/editor/container-ops.d.ts +74 -0
- package/dist/editor/container-ops.d.ts.map +1 -0
- package/dist/editor/container-ops.js +262 -0
- package/dist/editor/container-ops.js.map +1 -0
- package/dist/editor/event-fanout.d.ts +48 -0
- package/dist/editor/event-fanout.d.ts.map +1 -0
- package/dist/editor/event-fanout.js +53 -0
- package/dist/editor/event-fanout.js.map +1 -0
- package/dist/editor/gesture-tx.d.ts +77 -0
- package/dist/editor/gesture-tx.d.ts.map +1 -0
- package/dist/editor/gesture-tx.js +93 -0
- package/dist/editor/gesture-tx.js.map +1 -0
- package/dist/editor/hit-test.d.ts +178 -0
- package/dist/editor/hit-test.d.ts.map +1 -0
- package/dist/editor/hit-test.js +460 -0
- package/dist/editor/hit-test.js.map +1 -0
- package/dist/editor/long-press.d.ts +34 -0
- package/dist/editor/long-press.d.ts.map +1 -0
- package/dist/editor/long-press.js +58 -0
- package/dist/editor/long-press.js.map +1 -0
- package/dist/editor/pinch.d.ts +37 -0
- package/dist/editor/pinch.d.ts.map +1 -0
- package/dist/editor/pinch.js +90 -0
- package/dist/editor/pinch.js.map +1 -0
- package/dist/editor/pointer-binding.d.ts +18 -0
- package/dist/editor/pointer-binding.d.ts.map +1 -0
- package/dist/editor/pointer-binding.js +1087 -0
- package/dist/editor/pointer-binding.js.map +1 -0
- package/dist/editor/public/annotations.d.ts +54 -0
- package/dist/editor/public/annotations.d.ts.map +1 -0
- package/dist/editor/public/annotations.js +106 -0
- package/dist/editor/public/annotations.js.map +1 -0
- package/dist/editor/public/arrange-group.d.ts +81 -0
- package/dist/editor/public/arrange-group.d.ts.map +1 -0
- package/dist/editor/public/arrange-group.js +193 -0
- package/dist/editor/public/arrange-group.js.map +1 -0
- package/dist/editor/public/brush.d.ts +33 -0
- package/dist/editor/public/brush.d.ts.map +1 -0
- package/dist/editor/public/brush.js +54 -0
- package/dist/editor/public/brush.js.map +1 -0
- package/dist/editor/public/clipboard.d.ts +31 -0
- package/dist/editor/public/clipboard.d.ts.map +1 -0
- package/dist/editor/public/clipboard.js +35 -0
- package/dist/editor/public/clipboard.js.map +1 -0
- package/dist/editor/public/image-insert.d.ts +30 -0
- package/dist/editor/public/image-insert.d.ts.map +1 -0
- package/dist/editor/public/image-insert.js +57 -0
- package/dist/editor/public/image-insert.js.map +1 -0
- package/dist/editor/public/layers.d.ts +56 -0
- package/dist/editor/public/layers.d.ts.map +1 -0
- package/dist/editor/public/layers.js +104 -0
- package/dist/editor/public/layers.js.map +1 -0
- package/dist/editor/public/link.d.ts +25 -0
- package/dist/editor/public/link.d.ts.map +1 -0
- package/dist/editor/public/link.js +74 -0
- package/dist/editor/public/link.js.map +1 -0
- package/dist/editor/public/placement.d.ts +60 -0
- package/dist/editor/public/placement.d.ts.map +1 -0
- package/dist/editor/public/placement.js +111 -0
- package/dist/editor/public/placement.js.map +1 -0
- package/dist/editor/public/selection-ops.d.ts +78 -0
- package/dist/editor/public/selection-ops.d.ts.map +1 -0
- package/dist/editor/public/selection-ops.js +226 -0
- package/dist/editor/public/selection-ops.js.map +1 -0
- package/dist/editor/public/text-edit.d.ts +17 -0
- package/dist/editor/public/text-edit.d.ts.map +1 -0
- package/dist/editor/public/text-edit.js +28 -0
- package/dist/editor/public/text-edit.js.map +1 -0
- package/dist/editor/public/z-order.d.ts +47 -0
- package/dist/editor/public/z-order.d.ts.map +1 -0
- package/dist/editor/public/z-order.js +151 -0
- package/dist/editor/public/z-order.js.map +1 -0
- package/dist/editor/public/zoom-pan.d.ts +44 -0
- package/dist/editor/public/zoom-pan.d.ts.map +1 -0
- package/dist/editor/public/zoom-pan.js +116 -0
- package/dist/editor/public/zoom-pan.js.map +1 -0
- package/dist/editor/render-orchestrator.d.ts +11 -0
- package/dist/editor/render-orchestrator.d.ts.map +1 -0
- package/dist/editor/render-orchestrator.js +473 -0
- package/dist/editor/render-orchestrator.js.map +1 -0
- package/dist/editor/resize-helpers.d.ts +30 -0
- package/dist/editor/resize-helpers.d.ts.map +1 -0
- package/dist/editor/resize-helpers.js +121 -0
- package/dist/editor/resize-helpers.js.map +1 -0
- package/dist/editor/shape-filters.d.ts +11 -0
- package/dist/editor/shape-filters.d.ts.map +1 -0
- package/dist/editor/shape-filters.js +19 -0
- package/dist/editor/shape-filters.js.map +1 -0
- package/dist/editor/shape-traits.d.ts +16 -0
- package/dist/editor/shape-traits.d.ts.map +1 -0
- package/dist/editor/shape-traits.js +29 -0
- package/dist/editor/shape-traits.js.map +1 -0
- package/dist/editor/viewport-helpers.d.ts +24 -0
- package/dist/editor/viewport-helpers.d.ts.map +1 -0
- package/dist/editor/viewport-helpers.js +63 -0
- package/dist/editor/viewport-helpers.js.map +1 -0
- package/dist/editor-events.d.ts +33 -0
- package/dist/editor-events.d.ts.map +1 -0
- package/dist/editor-events.js +2 -0
- package/dist/editor-events.js.map +1 -0
- package/dist/editor.d.ts +1841 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +4803 -0
- package/dist/editor.js.map +1 -0
- package/dist/file-drop.d.ts +99 -0
- package/dist/file-drop.d.ts.map +1 -0
- package/dist/file-drop.js +198 -0
- package/dist/file-drop.js.map +1 -0
- package/dist/frame-helpers.d.ts +30 -0
- package/dist/frame-helpers.d.ts.map +1 -0
- package/dist/frame-helpers.js +105 -0
- package/dist/frame-helpers.js.map +1 -0
- package/dist/group-helpers.d.ts +39 -0
- package/dist/group-helpers.d.ts.map +1 -0
- package/dist/group-helpers.js +116 -0
- package/dist/group-helpers.js.map +1 -0
- package/dist/handle.d.ts +73 -0
- package/dist/handle.d.ts.map +1 -0
- package/dist/handle.js +184 -0
- package/dist/handle.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive.d.ts +21 -0
- package/dist/interactive.d.ts.map +1 -0
- package/dist/interactive.js +11 -0
- package/dist/interactive.js.map +1 -0
- package/dist/link-selection.d.ts +21 -0
- package/dist/link-selection.d.ts.map +1 -0
- package/dist/link-selection.js +37 -0
- package/dist/link-selection.js.map +1 -0
- package/dist/machine.d.ts +322 -0
- package/dist/machine.d.ts.map +1 -0
- package/dist/machine.js +568 -0
- package/dist/machine.js.map +1 -0
- package/dist/modes.d.ts +24 -0
- package/dist/modes.d.ts.map +1 -0
- package/dist/modes.js +2 -0
- package/dist/modes.js.map +1 -0
- package/dist/overlay.d.ts +262 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +673 -0
- package/dist/overlay.js.map +1 -0
- package/dist/platform.d.ts +70 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +115 -0
- package/dist/platform.js.map +1 -0
- package/dist/selection.d.ts +18 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/selection.js +31 -0
- package/dist/selection.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import type { AnnotationId, Bounds, Transform, Vec2 } from "@oh-just-another/types";
|
|
2
|
+
import { type Annotation, type Element, type Scene } from "@oh-just-another/scene";
|
|
3
|
+
import { type RenderTarget } from "@oh-just-another/renderer-core";
|
|
4
|
+
import { type HitZoneAttach, type HitZoneContainers, type HitZoneVisibility } from "./editor/hit-test.js";
|
|
5
|
+
import type { Selection } from "./selection.js";
|
|
6
|
+
export interface OverlayStyle {
|
|
7
|
+
readonly selectionStroke: string;
|
|
8
|
+
readonly selectionStrokeWidth: number;
|
|
9
|
+
readonly handleFill: string;
|
|
10
|
+
readonly handleStroke: string;
|
|
11
|
+
readonly drawingStroke: string;
|
|
12
|
+
readonly drawingDash: readonly number[];
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_OVERLAY_STYLE: OverlayStyle;
|
|
15
|
+
/**
|
|
16
|
+
* One selected element's contour halo: its outline loop(s) plus `outsetWorld`
|
|
17
|
+
* — how far the element's own border extends OUTSIDE the contour (world
|
|
18
|
+
* units; see `strokeOutsideExtent`). The halo is sized so it peeks exactly
|
|
19
|
+
* `SELECTION_HALO_PEEK_PX` screen px beyond contour + outset.
|
|
20
|
+
*/
|
|
21
|
+
export interface ElementHalo {
|
|
22
|
+
readonly loops: readonly (readonly Vec2[])[];
|
|
23
|
+
readonly outsetWorld: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Paint the contour selection halo for elements — a translucent stroke
|
|
27
|
+
* hugging each world-space outline loop. Drawn on the dedicated background
|
|
28
|
+
* layer (under the shapes) so it peeks out from behind them. The stroke is
|
|
29
|
+
* centred on the contour with width `2 × (outset + peek/zoom)`, so its outer
|
|
30
|
+
* edge lands exactly `peek` screen px beyond the element's VISIBLE edge
|
|
31
|
+
* (contour + border outset) at every zoom and border thickness. Sets the
|
|
32
|
+
* world transform itself; resets to identity at the end.
|
|
33
|
+
*/
|
|
34
|
+
export declare const paintElementSelectionHalo: (target: RenderTarget, w2s: Transform, halos: readonly ElementHalo[], zoom: number, style?: OverlayStyle) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Draws selection outlines, resize handles, and the rubber-band rectangle on
|
|
37
|
+
* the overlay layer. Pure draw — does not alter scene or state.
|
|
38
|
+
*
|
|
39
|
+
* Handles are sized in *screen* pixels regardless of zoom (4 × 4 CSS px) — the
|
|
40
|
+
* caller passes the viewport so this function can compensate.
|
|
41
|
+
*/
|
|
42
|
+
export interface LinkPreview {
|
|
43
|
+
/** World-space anchor on the source shape, or null for a free point. */
|
|
44
|
+
readonly from: Vec2;
|
|
45
|
+
readonly to: Vec2;
|
|
46
|
+
/**
|
|
47
|
+
* Optional full polyline (world) for an elbow preview — `[from, ...corners,
|
|
48
|
+
* to]`. When present it is drawn instead of the straight `from→to` line so
|
|
49
|
+
* the preview matches the orthogonal connector that will be committed.
|
|
50
|
+
*/
|
|
51
|
+
readonly points?: readonly Vec2[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Set of world-space points to render as port dots — used when the editor
|
|
55
|
+
* wants to show "you can attach here" affordances on a hovered shape in
|
|
56
|
+
* draw-edge mode.
|
|
57
|
+
*/
|
|
58
|
+
export interface PortOverlay {
|
|
59
|
+
readonly worldPoints: readonly Vec2[];
|
|
60
|
+
/** Highlight one of the points (the snap target). Optional. */
|
|
61
|
+
readonly activeIndex?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Screen-px radius to draw the active dot at — lets the host scale it
|
|
64
|
+
* smoothly by cursor proximity (link-start grow). Falls back to
|
|
65
|
+
* `ANCHOR_DOT_ACTIVE_RADIUS` when unset.
|
|
66
|
+
*/
|
|
67
|
+
readonly activeRadius?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Visual role (standard model).
|
|
70
|
+
* - link-start: shown on selection (where to drag from).
|
|
71
|
+
* - link-attach: shown on hover / proximity (where to land).
|
|
72
|
+
*/
|
|
73
|
+
readonly role?: "link-start" | "link-attach";
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Selected edge with endpoint world positions. Renderer paints small
|
|
77
|
+
* handles on each end so the user can grab and re-bind them.
|
|
78
|
+
*/
|
|
79
|
+
export interface LinkSelection {
|
|
80
|
+
readonly from: Vec2;
|
|
81
|
+
readonly to: Vec2;
|
|
82
|
+
/** Existing bend points (world) — solid grab handles. */
|
|
83
|
+
readonly waypoints?: readonly Vec2[];
|
|
84
|
+
/** Segment midpoints (world) — smaller "add waypoint" handles. */
|
|
85
|
+
readonly midpoints?: readonly Vec2[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Remote peer's cursor — world-space position plus identity. Rendered
|
|
89
|
+
* as a coloured arrow + name chip so the user can see who's pointing
|
|
90
|
+
* where. The local user's cursor is never in this list (the host
|
|
91
|
+
* filters by `clientId !== localId` before passing).
|
|
92
|
+
*/
|
|
93
|
+
export interface PeerCursor {
|
|
94
|
+
readonly position: Vec2;
|
|
95
|
+
readonly color: string;
|
|
96
|
+
readonly name: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Remote peer's selection — world-space bounding boxes that draw a
|
|
100
|
+
* dashed outline in the peer's colour. Computed by the host from the
|
|
101
|
+
* peer's `selection: ElementId[]` and the current scene shapes.
|
|
102
|
+
*/
|
|
103
|
+
export interface PeerSelection {
|
|
104
|
+
readonly color: string;
|
|
105
|
+
readonly bounds: readonly Bounds[];
|
|
106
|
+
}
|
|
107
|
+
export declare const renderOverlay: (scene: Scene, selection: Selection, target: RenderTarget, options?: {
|
|
108
|
+
drawingPreview?: Bounds;
|
|
109
|
+
/**
|
|
110
|
+
* WYSIWYG preview of the shape being drawn by drag (rect / ellipse):
|
|
111
|
+
* the would-be `Element` rendered through its real renderer so the
|
|
112
|
+
* user sees exactly the shape + default style they'll get on release
|
|
113
|
+
* (modern-style), instead of only a dashed rubber-band rect. Mutually
|
|
114
|
+
* exclusive with `drawingPreview` — the orchestrator sets one or the
|
|
115
|
+
* other (dashed only for the lasso / select rubber-band).
|
|
116
|
+
*/
|
|
117
|
+
drawingPreviewElement?: Element;
|
|
118
|
+
edgePreview?: LinkPreview;
|
|
119
|
+
/**
|
|
120
|
+
* Port-dot affordances to paint. A single set (one shape's anchors)
|
|
121
|
+
* or several sets at once — e.g. the source's link-start dots AND the
|
|
122
|
+
* target's link-attach dots simultaneously while a link is dragged
|
|
123
|
+
* from a start anchor.
|
|
124
|
+
*/
|
|
125
|
+
ports?: PortOverlay | readonly PortOverlay[];
|
|
126
|
+
edgeSelection?: LinkSelection;
|
|
127
|
+
/**
|
|
128
|
+
* World-space polylines (+ visual width) of every SELECTED link, painted
|
|
129
|
+
* as a persistent selection halo. Multi-select shows N halos; the sole-
|
|
130
|
+
* link endpoint/bend handles are still driven by `edgeSelection`.
|
|
131
|
+
*/
|
|
132
|
+
selectedLinkPaths?: readonly {
|
|
133
|
+
readonly path: readonly Vec2[];
|
|
134
|
+
readonly width: number;
|
|
135
|
+
}[];
|
|
136
|
+
/**
|
|
137
|
+
* World-space bounds of the element a connector endpoint will FLOAT-attach
|
|
138
|
+
* to (drop on the body, not a dot). Painted as a brand outline so the user
|
|
139
|
+
* sees "this whole object" vs a specific point.
|
|
140
|
+
*/
|
|
141
|
+
linkAttachHighlight?: Bounds;
|
|
142
|
+
/**
|
|
143
|
+
* Fallback bounds for the click-create ghost when no `ghostElementShape`
|
|
144
|
+
* is available — painted as a faded brand rect outline. Prefer
|
|
145
|
+
* `ghostElementShape` (the real shape). The connector is drawn separately
|
|
146
|
+
* by the orchestrator through the real link renderer.
|
|
147
|
+
*/
|
|
148
|
+
ghostElement?: Bounds;
|
|
149
|
+
/**
|
|
150
|
+
* The would-be element itself (same-kind clone of the source) for the
|
|
151
|
+
* click-create ghost. When set it is rendered through its real renderer
|
|
152
|
+
* so the ghost looks like the actual shape (an ellipse ghosts as an
|
|
153
|
+
* ellipse), not a bounding rect. Falls back to a rect outline of
|
|
154
|
+
* `ghostElement` when absent.
|
|
155
|
+
*/
|
|
156
|
+
ghostElementShape?: Element;
|
|
157
|
+
/**
|
|
158
|
+
* Combined world-space bounding box of a multi-selection (or a
|
|
159
|
+
* single group-typed shape's children union). When set the overlay
|
|
160
|
+
* paints a 1-px outline and resize handles on top of the per-shape
|
|
161
|
+
* selection outlines so the user can grab a group handle.
|
|
162
|
+
*/
|
|
163
|
+
groupBounds?: Bounds;
|
|
164
|
+
/**
|
|
165
|
+
* Restrict the group-bounds handles to the four corners (aspect-
|
|
166
|
+
* locked resize) instead of the default 8 corner+midpoint set.
|
|
167
|
+
* Used by group-typed shapes which cannot be stretched
|
|
168
|
+
* independently along one axis.
|
|
169
|
+
*/
|
|
170
|
+
groupAspectLocked?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Drop-zone of the container currently under the dragged shape.
|
|
173
|
+
* Drawn as a dashed accent rect so the user sees where the element
|
|
174
|
+
* will be nested after release.
|
|
175
|
+
*/
|
|
176
|
+
containerDropZone?: Bounds;
|
|
177
|
+
/**
|
|
178
|
+
* Live brush stroke preview during a `brush`-mode drag. Drawn as a
|
|
179
|
+
* variable-width fill so the user sees pressure modulation as they
|
|
180
|
+
* stroke. `origin` is in world coords; `points` are local-to-origin
|
|
181
|
+
* (matches the BrushElement memory layout).
|
|
182
|
+
*/
|
|
183
|
+
brushPreview?: {
|
|
184
|
+
readonly origin: {
|
|
185
|
+
readonly x: number;
|
|
186
|
+
readonly y: number;
|
|
187
|
+
};
|
|
188
|
+
readonly points: readonly {
|
|
189
|
+
x: number;
|
|
190
|
+
y: number;
|
|
191
|
+
width: number;
|
|
192
|
+
}[];
|
|
193
|
+
readonly fill: string;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Remote peer cursors. Each one renders as a small coloured arrow
|
|
197
|
+
* with a name chip in the peer's colour, anchored at the world-
|
|
198
|
+
* space position. The local cursor never appears here.
|
|
199
|
+
*/
|
|
200
|
+
peerCursors?: readonly PeerCursor[];
|
|
201
|
+
/**
|
|
202
|
+
* Remote peer selections. Each entry paints a dashed outline in
|
|
203
|
+
* the peer's colour around every world-space bbox in `bounds`.
|
|
204
|
+
*/
|
|
205
|
+
peerSelections?: readonly PeerSelection[];
|
|
206
|
+
/**
|
|
207
|
+
* Annotation pins to render on the overlay. Each pin is a small
|
|
208
|
+
* circle anchored at the annotation's world position; resolved
|
|
209
|
+
* annotations get a muted colour. Highlighted pin (the one in
|
|
210
|
+
* `selectedAnnotation`) gets an accent ring.
|
|
211
|
+
*/
|
|
212
|
+
annotations?: readonly Annotation[];
|
|
213
|
+
selectedAnnotation?: AnnotationId | null;
|
|
214
|
+
/**
|
|
215
|
+
* World bboxes of animated (GIF) shapes whose playback is paused
|
|
216
|
+
* (auto-stopped or held under prefers-reduced-motion). Each draws a
|
|
217
|
+
* small "play" chip so the user knows a click resumes it.
|
|
218
|
+
*/
|
|
219
|
+
gifBadges?: readonly Bounds[];
|
|
220
|
+
/**
|
|
221
|
+
* In-canvas text editing chrome for the shape under edit. All rects
|
|
222
|
+
* are WORLD-space; the overlay projects them to screen. `caret` is
|
|
223
|
+
* `null` while blinked off. Selection rects render as a translucent
|
|
224
|
+
* highlight under the caret.
|
|
225
|
+
*/
|
|
226
|
+
editingText?: {
|
|
227
|
+
readonly caret: {
|
|
228
|
+
readonly x: number;
|
|
229
|
+
readonly y: number;
|
|
230
|
+
readonly height: number;
|
|
231
|
+
} | null;
|
|
232
|
+
readonly caretColor: string;
|
|
233
|
+
readonly selectionRects: readonly Bounds[];
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Debug: paint the mouse hit-zones (resize-handle slop, edge-
|
|
237
|
+
* endpoint radius, edge-body threshold) for **every** element, so
|
|
238
|
+
* the tuned values can be eyeballed. Off by default; toggled via
|
|
239
|
+
* the debug panel. Drawn first, under the real selection chrome.
|
|
240
|
+
*/
|
|
241
|
+
debugHitZones?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Debug: link-attach drop-zones (anchor catchment circles + edge bands)
|
|
244
|
+
* to paint while a link endpoint is being placed. Only meaningful with
|
|
245
|
+
* `debugHitZones` on; supplied by the orchestrator during a link drag.
|
|
246
|
+
*/
|
|
247
|
+
debugAttachZones?: HitZoneAttach;
|
|
248
|
+
/**
|
|
249
|
+
* Debug: element drop-zones (frames + containers) to paint while an
|
|
250
|
+
* element is being dragged. Only meaningful with `debugHitZones` on;
|
|
251
|
+
* supplied by the orchestrator during an element drag.
|
|
252
|
+
*/
|
|
253
|
+
debugContainerZones?: HitZoneContainers;
|
|
254
|
+
/**
|
|
255
|
+
* Which hit-zone categories are actionable right now (from
|
|
256
|
+
* `hitZoneVisibility`). Gates `drawHitZones` so it only paints the
|
|
257
|
+
* targets the user can act on. Defaults to the at-rest set when omitted.
|
|
258
|
+
*/
|
|
259
|
+
debugHitZoneVisibility?: HitZoneVisibility;
|
|
260
|
+
style?: Partial<OverlayStyle>;
|
|
261
|
+
}) => void;
|
|
262
|
+
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAa,SAAS,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,KAAK,EACX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AAqCxC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM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