@oh-just-another/state 0.58.0 → 0.60.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.
Files changed (272) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +78 -27
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/actions/actionArrange.d.ts +13 -0
  5. package/dist/actions/actionArrange.d.ts.map +1 -0
  6. package/dist/actions/actionArrange.js +130 -0
  7. package/dist/actions/actionArrange.js.map +1 -0
  8. package/dist/actions/actionClipboard.d.ts +2 -0
  9. package/dist/actions/actionClipboard.d.ts.map +1 -1
  10. package/dist/actions/actionClipboard.js +32 -1
  11. package/dist/actions/actionClipboard.js.map +1 -1
  12. package/dist/actions/actionKeyboard.d.ts.map +1 -1
  13. package/dist/actions/actionKeyboard.js +77 -9
  14. package/dist/actions/actionKeyboard.js.map +1 -1
  15. package/dist/actions/actionMode.d.ts +4 -0
  16. package/dist/actions/actionMode.d.ts.map +1 -1
  17. package/dist/actions/actionMode.js +54 -0
  18. package/dist/actions/actionMode.js.map +1 -1
  19. package/dist/actions/actionSelection.d.ts.map +1 -1
  20. package/dist/actions/actionSelection.js +1 -0
  21. package/dist/actions/actionSelection.js.map +1 -1
  22. package/dist/actions/actionText.d.ts +5 -0
  23. package/dist/actions/actionText.d.ts.map +1 -0
  24. package/dist/actions/actionText.js +37 -0
  25. package/dist/actions/actionText.js.map +1 -0
  26. package/dist/actions/actionView.d.ts +6 -0
  27. package/dist/actions/actionView.d.ts.map +1 -1
  28. package/dist/actions/actionView.js +20 -2
  29. package/dist/actions/actionView.js.map +1 -1
  30. package/dist/actions/actionZoom.d.ts.map +1 -1
  31. package/dist/actions/actionZoom.js +5 -0
  32. package/dist/actions/actionZoom.js.map +1 -1
  33. package/dist/actions/index.d.ts +6 -4
  34. package/dist/actions/index.d.ts.map +1 -1
  35. package/dist/actions/index.js +6 -4
  36. package/dist/actions/index.js.map +1 -1
  37. package/dist/actions/registry.d.ts.map +1 -1
  38. package/dist/actions/registry.js +17 -0
  39. package/dist/actions/registry.js.map +1 -1
  40. package/dist/actions/types.d.ts +10 -1
  41. package/dist/actions/types.d.ts.map +1 -1
  42. package/dist/actions/types.js.map +1 -1
  43. package/dist/auto-layout-scheduler.d.ts +1 -3
  44. package/dist/auto-layout-scheduler.d.ts.map +1 -1
  45. package/dist/auto-layout-scheduler.js +1 -2
  46. package/dist/auto-layout-scheduler.js.map +1 -1
  47. package/dist/built-in-handlers.d.ts.map +1 -1
  48. package/dist/built-in-handlers.js +14 -1
  49. package/dist/built-in-handlers.js.map +1 -1
  50. package/dist/clipboard.d.ts +0 -14
  51. package/dist/clipboard.d.ts.map +1 -1
  52. package/dist/clipboard.js +1 -1
  53. package/dist/clipboard.js.map +1 -1
  54. package/dist/constants.d.ts +208 -41
  55. package/dist/constants.d.ts.map +1 -1
  56. package/dist/constants.js +210 -25
  57. package/dist/constants.js.map +1 -1
  58. package/dist/dom-events.d.ts +8 -2
  59. package/dist/dom-events.d.ts.map +1 -1
  60. package/dist/dom-events.js +12 -0
  61. package/dist/dom-events.js.map +1 -1
  62. package/dist/editor/animation-scene.d.ts +36 -0
  63. package/dist/editor/animation-scene.d.ts.map +1 -0
  64. package/dist/editor/animation-scene.js +194 -0
  65. package/dist/editor/animation-scene.js.map +1 -0
  66. package/dist/editor/animation.d.ts +43 -0
  67. package/dist/editor/animation.d.ts.map +1 -0
  68. package/dist/editor/animation.js +80 -0
  69. package/dist/editor/animation.js.map +1 -0
  70. package/dist/editor/applies/arrange.d.ts +46 -0
  71. package/dist/editor/applies/arrange.d.ts.map +1 -0
  72. package/dist/editor/applies/arrange.js +162 -0
  73. package/dist/editor/applies/arrange.js.map +1 -0
  74. package/dist/editor/applies/create.d.ts +0 -6
  75. package/dist/editor/applies/create.d.ts.map +1 -1
  76. package/dist/editor/applies/create.js +1 -1
  77. package/dist/editor/applies/create.js.map +1 -1
  78. package/dist/editor/applies/edge.d.ts +8 -1
  79. package/dist/editor/applies/edge.d.ts.map +1 -1
  80. package/dist/editor/applies/edge.js +31 -1
  81. package/dist/editor/applies/edge.js.map +1 -1
  82. package/dist/editor/applies/link-move.d.ts +0 -8
  83. package/dist/editor/applies/link-move.d.ts.map +1 -1
  84. package/dist/editor/applies/link-move.js +1 -1
  85. package/dist/editor/applies/link-move.js.map +1 -1
  86. package/dist/editor/applies/move.d.ts +6 -0
  87. package/dist/editor/applies/move.d.ts.map +1 -1
  88. package/dist/editor/applies/move.js +6 -0
  89. package/dist/editor/applies/move.js.map +1 -1
  90. package/dist/editor/applies/resize.d.ts +26 -5
  91. package/dist/editor/applies/resize.d.ts.map +1 -1
  92. package/dist/editor/applies/resize.js +91 -13
  93. package/dist/editor/applies/resize.js.map +1 -1
  94. package/dist/editor/caret-blink.d.ts +18 -0
  95. package/dist/editor/caret-blink.d.ts.map +1 -0
  96. package/dist/editor/caret-blink.js +42 -0
  97. package/dist/editor/caret-blink.js.map +1 -0
  98. package/dist/editor/container-ops.d.ts.map +1 -1
  99. package/dist/editor/container-ops.js +2 -2
  100. package/dist/editor/container-ops.js.map +1 -1
  101. package/dist/editor/dirty-rect.d.ts +23 -0
  102. package/dist/editor/dirty-rect.d.ts.map +1 -0
  103. package/dist/editor/dirty-rect.js +115 -0
  104. package/dist/editor/dirty-rect.js.map +1 -0
  105. package/dist/editor/gif-playback.d.ts +45 -0
  106. package/dist/editor/gif-playback.d.ts.map +1 -0
  107. package/dist/editor/gif-playback.js +125 -0
  108. package/dist/editor/gif-playback.js.map +1 -0
  109. package/dist/editor/hit-test.d.ts +3 -3
  110. package/dist/editor/hit-test.d.ts.map +1 -1
  111. package/dist/editor/hit-test.js +40 -15
  112. package/dist/editor/hit-test.js.map +1 -1
  113. package/dist/editor/interaction-state.d.ts +184 -0
  114. package/dist/editor/interaction-state.d.ts.map +1 -0
  115. package/dist/editor/interaction-state.js +139 -0
  116. package/dist/editor/interaction-state.js.map +1 -0
  117. package/dist/editor/link-handle-drag.d.ts +152 -0
  118. package/dist/editor/link-handle-drag.d.ts.map +1 -0
  119. package/dist/editor/link-handle-drag.js +300 -0
  120. package/dist/editor/link-handle-drag.js.map +1 -0
  121. package/dist/editor/long-press.d.ts.map +1 -1
  122. package/dist/editor/long-press.js +2 -2
  123. package/dist/editor/long-press.js.map +1 -1
  124. package/dist/editor/pinch.d.ts.map +1 -1
  125. package/dist/editor/pinch.js +6 -6
  126. package/dist/editor/pinch.js.map +1 -1
  127. package/dist/editor/pointer-binding.d.ts +9 -11
  128. package/dist/editor/pointer-binding.d.ts.map +1 -1
  129. package/dist/editor/pointer-binding.js +1191 -890
  130. package/dist/editor/pointer-binding.js.map +1 -1
  131. package/dist/editor/public/arrange-group.d.ts +3 -9
  132. package/dist/editor/public/arrange-group.d.ts.map +1 -1
  133. package/dist/editor/public/arrange-group.js +4 -6
  134. package/dist/editor/public/arrange-group.js.map +1 -1
  135. package/dist/editor/public/brush.d.ts +31 -12
  136. package/dist/editor/public/brush.d.ts.map +1 -1
  137. package/dist/editor/public/brush.js +66 -17
  138. package/dist/editor/public/brush.js.map +1 -1
  139. package/dist/editor/public/clipboard.d.ts +2 -4
  140. package/dist/editor/public/clipboard.d.ts.map +1 -1
  141. package/dist/editor/public/clipboard.js +2 -4
  142. package/dist/editor/public/clipboard.js.map +1 -1
  143. package/dist/editor/public/cursor.d.ts +29 -0
  144. package/dist/editor/public/cursor.d.ts.map +1 -0
  145. package/dist/editor/public/cursor.js +146 -0
  146. package/dist/editor/public/cursor.js.map +1 -0
  147. package/dist/editor/public/eraser.d.ts +55 -0
  148. package/dist/editor/public/eraser.d.ts.map +1 -0
  149. package/dist/editor/public/eraser.js +65 -0
  150. package/dist/editor/public/eraser.js.map +1 -0
  151. package/dist/editor/public/frame-name.d.ts +20 -0
  152. package/dist/editor/public/frame-name.d.ts.map +1 -0
  153. package/dist/editor/public/frame-name.js +54 -0
  154. package/dist/editor/public/frame-name.js.map +1 -0
  155. package/dist/editor/public/image-insert.d.ts +1 -1
  156. package/dist/editor/public/image-insert.d.ts.map +1 -1
  157. package/dist/editor/public/laser.d.ts +38 -0
  158. package/dist/editor/public/laser.d.ts.map +1 -0
  159. package/dist/editor/public/laser.js +42 -0
  160. package/dist/editor/public/laser.js.map +1 -0
  161. package/dist/editor/public/layers.d.ts.map +1 -1
  162. package/dist/editor/public/layers.js +2 -2
  163. package/dist/editor/public/layers.js.map +1 -1
  164. package/dist/editor/public/link.d.ts +11 -2
  165. package/dist/editor/public/link.d.ts.map +1 -1
  166. package/dist/editor/public/link.js +70 -2
  167. package/dist/editor/public/link.js.map +1 -1
  168. package/dist/editor/public/placement.d.ts +60 -2
  169. package/dist/editor/public/placement.d.ts.map +1 -1
  170. package/dist/editor/public/placement.js +193 -2
  171. package/dist/editor/public/placement.js.map +1 -1
  172. package/dist/editor/public/selection-ops.d.ts +35 -1
  173. package/dist/editor/public/selection-ops.d.ts.map +1 -1
  174. package/dist/editor/public/selection-ops.js +97 -2
  175. package/dist/editor/public/selection-ops.js.map +1 -1
  176. package/dist/editor/public/stroke-eraser-coverage.d.ts +37 -0
  177. package/dist/editor/public/stroke-eraser-coverage.d.ts.map +1 -0
  178. package/dist/editor/public/stroke-eraser-coverage.js +168 -0
  179. package/dist/editor/public/stroke-eraser-coverage.js.map +1 -0
  180. package/dist/editor/public/stroke-eraser.d.ts +50 -0
  181. package/dist/editor/public/stroke-eraser.d.ts.map +1 -0
  182. package/dist/editor/public/stroke-eraser.js +176 -0
  183. package/dist/editor/public/stroke-eraser.js.map +1 -0
  184. package/dist/editor/public/stroke-smoothing.d.ts +21 -0
  185. package/dist/editor/public/stroke-smoothing.d.ts.map +1 -0
  186. package/dist/editor/public/stroke-smoothing.js +37 -0
  187. package/dist/editor/public/stroke-smoothing.js.map +1 -0
  188. package/dist/editor/public/text-edit.d.ts +1 -10
  189. package/dist/editor/public/text-edit.d.ts.map +1 -1
  190. package/dist/editor/public/text-edit.js +2 -16
  191. package/dist/editor/public/text-edit.js.map +1 -1
  192. package/dist/editor/public/tool-ops.d.ts +130 -0
  193. package/dist/editor/public/tool-ops.d.ts.map +1 -0
  194. package/dist/editor/public/tool-ops.js +392 -0
  195. package/dist/editor/public/tool-ops.js.map +1 -0
  196. package/dist/editor/public/z-order.d.ts +1 -12
  197. package/dist/editor/public/z-order.d.ts.map +1 -1
  198. package/dist/editor/public/z-order.js +5 -5
  199. package/dist/editor/public/z-order.js.map +1 -1
  200. package/dist/editor/public/zoom-pan.d.ts +15 -4
  201. package/dist/editor/public/zoom-pan.d.ts.map +1 -1
  202. package/dist/editor/public/zoom-pan.js +39 -7
  203. package/dist/editor/public/zoom-pan.js.map +1 -1
  204. package/dist/editor/render-orchestrator.d.ts +177 -5
  205. package/dist/editor/render-orchestrator.d.ts.map +1 -1
  206. package/dist/editor/render-orchestrator.js +519 -358
  207. package/dist/editor/render-orchestrator.js.map +1 -1
  208. package/dist/editor/resize-helpers.d.ts +21 -5
  209. package/dist/editor/resize-helpers.d.ts.map +1 -1
  210. package/dist/editor/resize-helpers.js +59 -19
  211. package/dist/editor/resize-helpers.js.map +1 -1
  212. package/dist/editor/text-edit.d.ts +136 -0
  213. package/dist/editor/text-edit.d.ts.map +1 -0
  214. package/dist/editor/text-edit.js +328 -0
  215. package/dist/editor/text-edit.js.map +1 -0
  216. package/dist/editor/viewport-helpers.d.ts.map +1 -1
  217. package/dist/editor/viewport-helpers.js +3 -3
  218. package/dist/editor/viewport-helpers.js.map +1 -1
  219. package/dist/editor-events.d.ts +1 -1
  220. package/dist/editor-events.d.ts.map +1 -1
  221. package/dist/editor.d.ts +603 -346
  222. package/dist/editor.d.ts.map +1 -1
  223. package/dist/editor.js +1843 -1630
  224. package/dist/editor.js.map +1 -1
  225. package/dist/file-drop.d.ts.map +1 -1
  226. package/dist/file-drop.js +1 -2
  227. package/dist/file-drop.js.map +1 -1
  228. package/dist/frame-helpers.d.ts.map +1 -1
  229. package/dist/frame-helpers.js +5 -5
  230. package/dist/frame-helpers.js.map +1 -1
  231. package/dist/group-helpers.d.ts.map +1 -1
  232. package/dist/group-helpers.js +4 -4
  233. package/dist/group-helpers.js.map +1 -1
  234. package/dist/handle.d.ts +59 -6
  235. package/dist/handle.d.ts.map +1 -1
  236. package/dist/handle.js +99 -7
  237. package/dist/handle.js.map +1 -1
  238. package/dist/hotkeys-binding.d.ts +26 -0
  239. package/dist/hotkeys-binding.d.ts.map +1 -0
  240. package/dist/hotkeys-binding.js +35 -0
  241. package/dist/hotkeys-binding.js.map +1 -0
  242. package/dist/index.d.ts +9 -3
  243. package/dist/index.d.ts.map +1 -1
  244. package/dist/index.js +10 -3
  245. package/dist/index.js.map +1 -1
  246. package/dist/link-selection.d.ts +3 -5
  247. package/dist/link-selection.d.ts.map +1 -1
  248. package/dist/link-selection.js +3 -12
  249. package/dist/link-selection.js.map +1 -1
  250. package/dist/machine.d.ts +27 -1
  251. package/dist/machine.d.ts.map +1 -1
  252. package/dist/machine.js +38 -0
  253. package/dist/machine.js.map +1 -1
  254. package/dist/modes.d.ts +15 -1
  255. package/dist/modes.d.ts.map +1 -1
  256. package/dist/modes.js.map +1 -1
  257. package/dist/overlay.d.ts +92 -6
  258. package/dist/overlay.d.ts.map +1 -1
  259. package/dist/overlay.js +582 -125
  260. package/dist/overlay.js.map +1 -1
  261. package/dist/search.d.ts +37 -0
  262. package/dist/search.d.ts.map +1 -0
  263. package/dist/search.js +45 -0
  264. package/dist/search.js.map +1 -0
  265. package/dist/selection.d.ts.map +1 -1
  266. package/dist/selection.js +2 -10
  267. package/dist/selection.js.map +1 -1
  268. package/dist/util.d.ts +8 -0
  269. package/dist/util.d.ts.map +1 -0
  270. package/dist/util.js +17 -0
  271. package/dist/util.js.map +1 -0
  272. package/package.json +7 -7
@@ -53,6 +53,23 @@ export declare const HANDLE_OUTSET = 3;
53
53
  * eating the body-move target on small shapes).
54
54
  */
55
55
  export declare const HANDLE_HIT_SLOP = 11;
56
+ /**
57
+ * Screen-pixel gap between the shape's rotate anchor (default bottom-left
58
+ * corner) and the rotate grip that floats just outside it. Far enough to clear
59
+ * the corner resize handle. Range: 20–32.
60
+ */
61
+ export declare const ROTATE_HANDLE_OFFSET = 26;
62
+ /**
63
+ * Screen-pixel radius of the rotate grip's circular-arrow glyph (a clockwise
64
+ * rotate icon). Slightly larger than `HANDLE_SIZE` so the icon reads as an
65
+ * affordance, not a plain resize dot. Range: 6–9.
66
+ */
67
+ export declare const ROTATE_ICON_RADIUS = 7;
68
+ /**
69
+ * Angle step (radians) the rotate gesture snaps to while Shift is held — 15°
70
+ * (π/12), the common increment for diagram alignment. Range: π/24–π/6.
71
+ */
72
+ export declare const ROTATE_SNAP_RADIANS: number;
56
73
  /**
57
74
  * Screen-pixel hit-test slop for grabbing an edge endpoint handle.
58
75
  * Larger than `LINK_ENDPOINT_HANDLE_DRAW_RADIUS` so the handle is
@@ -78,12 +95,6 @@ export declare const LINK_MIDPOINT_HANDLE_DRAW_RADIUS = 4;
78
95
  * delete". Kept near the handle hit radius. Range: 8–16.
79
96
  */
80
97
  export declare const WAYPOINT_COLLAPSE_RADIUS = 12;
81
- /**
82
- * Upper bound on how many candidate obstacles the A*-based "route around
83
- * shapes" command will consider. Above this the command bails (returns the
84
- * link unchanged) rather than spending the A* cost. Range: 100–1000.
85
- */
86
- export declare const AUTO_ROUTE_MAX_OBSTACLES = 400;
87
98
  /**
88
99
  * Screen-pixel tolerance for edge hit-testing. Cursors within this
89
100
  * distance of an edge polyline segment register a hit. Should stay
@@ -101,31 +112,6 @@ export declare const LINK_HIT_THRESHOLD = 9;
101
112
  * thickness. Range: 3–8.
102
113
  */
103
114
  export declare const SELECTION_HALO_PEEK_PX = 4;
104
- /**
105
- * Screen-pixel radius of the inactive port dot rendered on a hovered
106
- * shape in draw-edge mode. `PORT_DOT_ACTIVE_RADIUS` is used for the
107
- * snap target so the user sees which one will catch.
108
- */
109
- export declare const PORT_DOT_RADIUS = 3.5;
110
- export declare const PORT_DOT_ACTIVE_RADIUS = 5;
111
- /**
112
- * Connection anchors.
113
- *
114
- * Two visual roles, shown at different times:
115
- *
116
- * - **link-start** anchors — shown when an element is SELECTED. The user
117
- * drags from one to begin a link. Filled brand centre + neutral ring.
118
- * - **link-attach** anchors — shown when the cursor HOVERS / nears an
119
- * element (including while dragging a link). Where a link can land.
120
- * The inverse fill/ring of link-start, so the two roles read
121
- * differently at a glance.
122
- *
123
- * Radii are screen px (zoom-independent). Colours reuse the selection
124
- * brand blue / handle white so anchors share the resize-handle visual
125
- * language (they equal `DEFAULT_OVERLAY_STYLE.selectionStroke` / `.handleFill`).
126
- */
127
- export declare const ANCHOR_BRAND_COLOR = "#1a73e8";
128
- export declare const ANCHOR_NEUTRAL_COLOR = "#fff";
129
115
  /** Resting anchor-dot radius (screen px). */
130
116
  export declare const ANCHOR_DOT_RADIUS = 3.5;
131
117
  /** Highlighted radius for the hovered / snap-target anchor (screen px). */
@@ -212,11 +198,7 @@ export declare const ANCHOR_CLICK_NEW_ELEMENT_GAP = 40;
212
198
  *
213
199
  * Shared opacities; per-category colours below so different hit-target kinds
214
200
  * are visually distinguishable (point vs edge vs body vs container vs frame).
215
- * Kept generic (`DEBUG_HIT_ZONE_FILL`/`STROKE`) as the alias for the
216
- * resize-handle category and any uncoloured fallback.
217
201
  */
218
- export declare const DEBUG_HIT_ZONE_FILL = "#e8118c";
219
- export declare const DEBUG_HIT_ZONE_STROKE = "#e8118c";
220
202
  export declare const DEBUG_HIT_ZONE_FILL_OPACITY = 0.16;
221
203
  export declare const DEBUG_HIT_ZONE_STROKE_OPACITY = 0.7;
222
204
  /**
@@ -284,8 +266,7 @@ export declare const PEER_CURSOR_BROADCAST_INTERVAL_MS = 33;
284
266
  * programmatic button-style zoom (`Editor.zoomIn` / `zoomOut`).
285
267
  * `1.6 = +60% per call` — punchy single-step zoom.
286
268
  * - `WHEEL_ZOOM_MAX_STEP` / `WHEEL_ZOOM_SPEED` — wheel-zoom
287
- * normalisation (`packages/editor/.../normalizeWheel.ts`).
288
- * Per event:
269
+ * normalisation. Per event:
289
270
  *
290
271
  * delta = clamp(|deltaY|, WHEEL_ZOOM_MAX_STEP) * sign(deltaY)
291
272
  * factor = 1 − (delta * WHEEL_ZOOM_SPEED) / 100
@@ -346,6 +327,13 @@ export declare const DOUBLE_CLICK_TOLERANCE_PX = 8;
346
327
  * context.
347
328
  */
348
329
  export declare const ISOLATION_DIM_OPACITY = 0.6;
330
+ /**
331
+ * Opacity of an element MARKED for erasing while the eraser is swept over it
332
+ * (before the delete commits on pointer-up). Much lower than
333
+ * {@link ISOLATION_DIM_OPACITY} so "about to be deleted" reads clearly at a
334
+ * glance — matches the Excalidraw eraser's ~20% preview. Range: 0.15–0.4.
335
+ */
336
+ export declare const ERASE_DIM_OPACITY = 0.2;
349
337
  /**
350
338
  * Opacity of the WYSIWYG shape-draw preview (the live rect / ellipse drawn
351
339
  * through its real renderer while dragging out a new shape). Slightly below
@@ -456,6 +444,114 @@ export declare const MAX_BRUSH_WIDTH = 6;
456
444
  * Chromium) so a click-drag still produces a visible stroke.
457
445
  */
458
446
  export declare const DEFAULT_BRUSH_WIDTH = 2;
447
+ /**
448
+ * Default brush line colour — the paint a fresh stroke is committed with when
449
+ * the host hasn't changed the drawing panel. A dark neutral that reads on a
450
+ * light canvas (matches the pre-settings hard-coded value).
451
+ */
452
+ export declare const DEFAULT_BRUSH_COLOR = "#222222";
453
+ /**
454
+ * Default brush opacity (0–1) for a fresh stroke. 1 = fully opaque.
455
+ */
456
+ export declare const DEFAULT_BRUSH_OPACITY = 1;
457
+ /**
458
+ * Samples per Catmull-Rom span when smoothing a committed brush stroke. Brush
459
+ * points are captured sparsely (one per pointer-move), so the raw polyline is
460
+ * angular; on commit each span is resampled into this many sub-points along a
461
+ * Catmull-Rom curve through the captured points (interpolating per-point width
462
+ * too), baking a smooth stroke into the scene. Higher = smoother but more stored
463
+ * vertices per stroke. Range: 2–8.
464
+ */
465
+ export declare const BRUSH_SMOOTH_SEGMENTS = 4;
466
+ /**
467
+ * World-pixel distance under which a brush stroke's last point is treated as
468
+ * meeting its first — the trigger for auto-closing (and filling) a stroke on
469
+ * commit. Only applies when a fill colour is set and the stroke has ≥3 points.
470
+ * Scaled to the max stroke width so a thick stroke closes as forgivingly as it
471
+ * looks. Range: 6–30; larger closes more eagerly. Default: `MAX_BRUSH_WIDTH * 3`.
472
+ */
473
+ export declare const BRUSH_CLOSE_DISTANCE: number;
474
+ /**
475
+ * Eraser sampling step in WORLD units. While the eraser is dragged the host
476
+ * hit-tests points spaced this far apart along the pointer path so a fast
477
+ * swipe doesn't skip over small shapes between two move events. Smaller →
478
+ * more hit-tests per move (safer, costlier); larger → cheaper but can jump a
479
+ * thin shape. 6 px matches the default brush width so nothing narrower than a
480
+ * stroke slips through. Range: 3–12.
481
+ */
482
+ export declare const ERASER_SAMPLE_STEP = 6;
483
+ /**
484
+ * Stroke colour of the eraser cursor ring (and its fading drag trail). A neutral
485
+ * mid-grey so it reads on both light and dark canvases without looking like a
486
+ * tool accent. Range: any mid-luminance grey (#666–#aaa).
487
+ */
488
+ export declare const ERASER_CURSOR_STROKE = "#888888";
489
+ /**
490
+ * Screen-pixel line width of the eraser cursor ring. Constant on screen (the
491
+ * ring is drawn in screen space) so it stays crisp at any zoom. Range: 1–3.
492
+ */
493
+ export declare const ERASER_CURSOR_LINE_WIDTH = 1.5;
494
+ /**
495
+ * Lifetime (ms) of an eraser drag-trail point before it fully fades — the knob
496
+ * for how LONG the eraser wake is. Much shorter than {@link LASER_TRAIL_TTL_MS}
497
+ * (the laser comet) so the eraser leaves only a tight, brief wake behind the
498
+ * cursor, matching Excalidraw. Lower = shorter/snappier. Range: 100–400.
499
+ */
500
+ export declare const ERASER_TRAIL_TTL_MS = 120;
501
+ /**
502
+ * Stroke-eraser (Shift) samples a brush polyline this densely — as a FRACTION of
503
+ * the eraser radius — when computing which arc-length spans fall under the disc.
504
+ * The eraser cuts the line's GEOMETRY (segments), not just its vertices, so a big
505
+ * disc merely grazing a sparsely-sampled stroke still removes the covered span.
506
+ * Smaller = finer edges / more samples per move; larger = coarser / cheaper. The
507
+ * covered-span endpoints are refined by bisection ({@link ERASE_BOUNDARY_BISECT_ITERS})
508
+ * regardless, so this mainly bounds the miss-a-tiny-dip risk. Range: 0.15–0.5.
509
+ */
510
+ export declare const ERASE_COVERAGE_SAMPLE_FRACTION = 0.25;
511
+ /**
512
+ * Floor (world units) for the stroke-eraser sample step, so a tiny eraser radius
513
+ * doesn't explode the sample count on a long stroke. Range: 0.25–2.
514
+ */
515
+ export declare const ERASE_COVERAGE_MIN_SAMPLE_STEP = 0.5;
516
+ /**
517
+ * Bisection iterations used to pin each covered-span endpoint to the eraser ring
518
+ * (where the brush polyline crosses distance = radius). Each iteration halves the
519
+ * error, so 10 ≈ step/1024 — visually exact. Range: 6–14.
520
+ */
521
+ export declare const ERASE_BOUNDARY_BISECT_ITERS = 10;
522
+ /**
523
+ * A surviving stroke-eraser fragment shorter than this arc length (world units)
524
+ * is dropped as litter — an isolated nub reads as a stray dot, not a line. Range:
525
+ * 0.5–3.
526
+ */
527
+ export declare const ERASE_FRAGMENT_MIN_ARC = 1;
528
+ /**
529
+ * Lifetime (ms) of a laser-pointer trail point before it fully fades. Each
530
+ * point stores its birth time; the overlay ramps its opacity from 1 → 0 over
531
+ * this window and the editor prunes points older than it, so a stroke trails
532
+ * the cursor like a comet and vanishes ~this long after the pointer stops.
533
+ * "A couple of seconds" — range 800–3000.
534
+ */
535
+ export declare const LASER_TRAIL_TTL_MS = 1400;
536
+ /**
537
+ * Stroke colour of the laser-pointer trail. A saturated red reads as a
538
+ * presentation laser and stands out over any diagram fill.
539
+ */
540
+ export declare const LASER_COLOR = "#ff2d2d";
541
+ /**
542
+ * Screen-pixel stroke width of the laser trail. Constant on screen (drawn in
543
+ * screen space, not world) so the beam stays the same thickness at every zoom.
544
+ * Range: 2–6.
545
+ */
546
+ export declare const LASER_WIDTH = 4;
547
+ /**
548
+ * Samples per Catmull-Rom span when smoothing a laser trail for rendering.
549
+ * Laser points are collected sparsely (one per pointer-move), so the raw
550
+ * polyline looks angular; the overlay resamples each span into this many
551
+ * sub-points along a Catmull-Rom curve through the captured points, keeping the
552
+ * beam smooth. Higher = smoother but more segments per frame. Range: 4–16.
553
+ */
554
+ export declare const LASER_SMOOTH_SEGMENTS = 8;
459
555
  /**
460
556
  * Default upper bound on the longer edge of a freshly-inserted
461
557
  * image (CSS pixels). Larger images get downscaled proportionally
@@ -501,14 +597,10 @@ export declare const GIF_AUTOSTOP_MS = 30000;
501
597
  * - `TEXT_DEFAULT_FONT_SIZE` — initial font size in world units.
502
598
  * - `TEXT_DEFAULT_FONT_FAMILY` — initial font stack.
503
599
  * - `TEXT_DEFAULT_FILL` — initial text colour (near-black).
504
- * - `TEXT_FONT_SIZE_MIN` / `TEXT_FONT_SIZE_MAX` — clamp range for the
505
- * font-size control in the contextual panel.
506
600
  */
507
601
  export declare const TEXT_DEFAULT_FONT_SIZE = 24;
508
602
  export declare const TEXT_DEFAULT_FONT_FAMILY = "system-ui, sans-serif";
509
603
  export declare const TEXT_DEFAULT_FILL = "#1a1a1a";
510
- export declare const TEXT_FONT_SIZE_MIN = 8;
511
- export declare const TEXT_FONT_SIZE_MAX = 256;
512
604
  /**
513
605
  * In-canvas text editing.
514
606
  *
@@ -541,4 +633,79 @@ export declare const TEXT_SELECTION_FILL = "#1a73e8";
541
633
  export declare const TEXT_SELECTION_OPACITY = 0.25;
542
634
  export declare const TEXT_CARET_WIDTH_PX = 1.5;
543
635
  export declare const TEXT_RESIZE_MIN_FONT_SIZE = 4;
636
+ /**
637
+ * Multiplicative step for the increase/decrease-font-size shortcuts: each
638
+ * press scales the current size by this factor (min ±1 px so small sizes still
639
+ * move), clamped to {@link TEXT_RESIZE_MIN_FONT_SIZE}…{@link TEXT_MAX_FONT_SIZE}.
640
+ * 1.1 ≈ a gentle 10 % step. Range: 1.05–1.5.
641
+ */
642
+ export declare const TEXT_FONT_SIZE_STEP = 1.1;
643
+ /**
644
+ * Gap (world px) between a source node and the connected node spawned by the
645
+ * flowchart create shortcut (`Cmd/Ctrl+Arrow`). Measured from the source's
646
+ * edge to the new node's edge along the spawn direction. Range: 40–160 —
647
+ * enough that the connecting link is clearly visible.
648
+ */
649
+ export declare const SPAWN_CONNECTED_GAP_PX = 80;
650
+ /**
651
+ * Upper cap on how many sibling nodes a single flowchart create session
652
+ * (`Cmd/Ctrl+Arrow` held, tapped an arrow repeatedly) can pending-grow before
653
+ * commit. Guards against an accidental key-repeat spraying dozens of nodes.
654
+ * Range: 4–16.
655
+ */
656
+ export declare const FLOWCHART_MAX_SIBLINGS = 8;
657
+ /**
658
+ * Opacity of the pending flowchart-create preview (the not-yet-committed
659
+ * nodes + links drawn on the overlay while `Cmd/Ctrl` is held). Below 1 so the
660
+ * preview reads as provisional, high enough to judge placement. Range:
661
+ * 0.35–0.65.
662
+ */
663
+ export declare const FLOWCHART_PREVIEW_OPACITY = 0.5;
664
+ /**
665
+ * Upper clamp (world px) for font size — matches the property panel's slider
666
+ * ceiling so the keyboard and the panel agree on the maximum.
667
+ */
668
+ export declare const TEXT_MAX_FONT_SIZE = 256;
669
+ /**
670
+ * Paused-GIF chip drawn in a shape's top-left corner — signals a GIF the
671
+ * user can click / hover to resume. Dimensions in screen px; the scrim is
672
+ * a translucent black so the "gif" label stays legible over any artwork.
673
+ */
674
+ export declare const GIF_BADGE_W = 30;
675
+ export declare const GIF_BADGE_H = 16;
676
+ export declare const GIF_BADGE_PAD = 4;
677
+ export declare const GIF_BADGE_RADIUS = 4;
678
+ export declare const GIF_BADGE_BG_COLOR = "rgba(0,0,0,0.65)";
679
+ /**
680
+ * Padlock badge at a selected locked element's top-right corner. `SIZE` is
681
+ * the icon edge in screen px; the body uses the accent colour, the keyhole
682
+ * a contrasting fill.
683
+ */
684
+ export declare const LOCK_BADGE_SIZE = 16;
685
+ export declare const LOCK_BADGE_COLOR = "#1a73e8";
686
+ export declare const LOCK_BADGE_KEYHOLE_COLOR = "#fff";
687
+ /**
688
+ * Image-crop UX (Excalidraw-style handle cropping).
689
+ *
690
+ * - `CROP_MIN_SIZE` — smallest allowed crop window edge, in element-LOCAL
691
+ * units (unscaled). Dragging an edge handle inward stops here so the window
692
+ * can never collapse to zero. Range: 4–24.
693
+ * - `CROP_HANDLE_HIT_RADIUS` — screen-pixel grab radius around each of the 8
694
+ * crop handles. Divided by zoom before hit-testing so the effective screen
695
+ * target stays constant. Mirrors {@link HANDLE_HIT_SLOP}. Range: 8–14.
696
+ * - `CROP_GHOST_OPACITY` — alpha of the faint full-image "ghost" painted over
697
+ * the virtual full-image rect while cropping, so the user sees the hidden
698
+ * parts of the source. Low so the real (cropped) pixels stay dominant.
699
+ * Range: 0.08–0.2.
700
+ * - `CROP_BRACKET_LEN` — arm length (screen px) of the L-shaped corner brackets
701
+ * that mark the crop frame (Excalidraw-style), drawn instead of round nubs.
702
+ * Range: 10–20.
703
+ * - `CROP_BRACKET_WIDTH` — stroke width (screen px) of those brackets. Thicker
704
+ * than the frame outline so the corners read as grabbable. Range: 2–4.
705
+ */
706
+ export declare const CROP_MIN_SIZE = 10;
707
+ export declare const CROP_HANDLE_HIT_RADIUS = 11;
708
+ export declare const CROP_GHOST_OPACITY = 0.12;
709
+ export declare const CROP_BRACKET_LEN = 14;
710
+ export declare const CROP_BRACKET_WIDTH = 3;
544
711
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAA0B,CAAC;AAE9D,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,EAAE,cAA2B,CAAC;AAEjE;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;;;;GAKG;AACH,eAA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MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,kBAAkB,IAAI,CAAC"}
package/dist/constants.js CHANGED
@@ -46,6 +46,23 @@ export const HANDLE_OUTSET = 3;
46
46
  * eating the body-move target on small shapes).
47
47
  */
48
48
  export const HANDLE_HIT_SLOP = 11;
49
+ /**
50
+ * Screen-pixel gap between the shape's rotate anchor (default bottom-left
51
+ * corner) and the rotate grip that floats just outside it. Far enough to clear
52
+ * the corner resize handle. Range: 20–32.
53
+ */
54
+ export const ROTATE_HANDLE_OFFSET = 26;
55
+ /**
56
+ * Screen-pixel radius of the rotate grip's circular-arrow glyph (a clockwise
57
+ * rotate icon). Slightly larger than `HANDLE_SIZE` so the icon reads as an
58
+ * affordance, not a plain resize dot. Range: 6–9.
59
+ */
60
+ export const ROTATE_ICON_RADIUS = 7;
61
+ /**
62
+ * Angle step (radians) the rotate gesture snaps to while Shift is held — 15°
63
+ * (π/12), the common increment for diagram alignment. Range: π/24–π/6.
64
+ */
65
+ export const ROTATE_SNAP_RADIANS = Math.PI / 12;
49
66
  /**
50
67
  * Screen-pixel hit-test slop for grabbing an edge endpoint handle.
51
68
  * Larger than `LINK_ENDPOINT_HANDLE_DRAW_RADIUS` so the handle is
@@ -71,12 +88,6 @@ export const LINK_MIDPOINT_HANDLE_DRAW_RADIUS = 4;
71
88
  * delete". Kept near the handle hit radius. Range: 8–16.
72
89
  */
73
90
  export const WAYPOINT_COLLAPSE_RADIUS = 12;
74
- /**
75
- * Upper bound on how many candidate obstacles the A*-based "route around
76
- * shapes" command will consider. Above this the command bails (returns the
77
- * link unchanged) rather than spending the A* cost. Range: 100–1000.
78
- */
79
- export const AUTO_ROUTE_MAX_OBSTACLES = 400;
80
91
  /**
81
92
  * Screen-pixel tolerance for edge hit-testing. Cursors within this
82
93
  * distance of an edge polyline segment register a hit. Should stay
@@ -94,13 +105,6 @@ export const LINK_HIT_THRESHOLD = 9;
94
105
  * thickness. Range: 3–8.
95
106
  */
96
107
  export const SELECTION_HALO_PEEK_PX = 4;
97
- /**
98
- * Screen-pixel radius of the inactive port dot rendered on a hovered
99
- * shape in draw-edge mode. `PORT_DOT_ACTIVE_RADIUS` is used for the
100
- * snap target so the user sees which one will catch.
101
- */
102
- export const PORT_DOT_RADIUS = 3.5;
103
- export const PORT_DOT_ACTIVE_RADIUS = 5;
104
108
  /**
105
109
  * Connection anchors.
106
110
  *
@@ -117,8 +121,8 @@ export const PORT_DOT_ACTIVE_RADIUS = 5;
117
121
  * brand blue / handle white so anchors share the resize-handle visual
118
122
  * language (they equal `DEFAULT_OVERLAY_STYLE.selectionStroke` / `.handleFill`).
119
123
  */
120
- export const ANCHOR_BRAND_COLOR = "#1a73e8";
121
- export const ANCHOR_NEUTRAL_COLOR = "#fff";
124
+ const ANCHOR_BRAND_COLOR = "#1a73e8";
125
+ const ANCHOR_NEUTRAL_COLOR = "#fff";
122
126
  /** Resting anchor-dot radius (screen px). */
123
127
  export const ANCHOR_DOT_RADIUS = 3.5;
124
128
  /** Highlighted radius for the hovered / snap-target anchor (screen px). */
@@ -205,11 +209,7 @@ export const ANCHOR_CLICK_NEW_ELEMENT_GAP = 40;
205
209
  *
206
210
  * Shared opacities; per-category colours below so different hit-target kinds
207
211
  * are visually distinguishable (point vs edge vs body vs container vs frame).
208
- * Kept generic (`DEBUG_HIT_ZONE_FILL`/`STROKE`) as the alias for the
209
- * resize-handle category and any uncoloured fallback.
210
212
  */
211
- export const DEBUG_HIT_ZONE_FILL = "#e8118c";
212
- export const DEBUG_HIT_ZONE_STROKE = "#e8118c";
213
213
  export const DEBUG_HIT_ZONE_FILL_OPACITY = 0.16;
214
214
  export const DEBUG_HIT_ZONE_STROKE_OPACITY = 0.7;
215
215
  /**
@@ -277,8 +277,7 @@ export const PEER_CURSOR_BROADCAST_INTERVAL_MS = 33;
277
277
  * programmatic button-style zoom (`Editor.zoomIn` / `zoomOut`).
278
278
  * `1.6 = +60% per call` — punchy single-step zoom.
279
279
  * - `WHEEL_ZOOM_MAX_STEP` / `WHEEL_ZOOM_SPEED` — wheel-zoom
280
- * normalisation (`packages/editor/.../normalizeWheel.ts`).
281
- * Per event:
280
+ * normalisation. Per event:
282
281
  *
283
282
  * delta = clamp(|deltaY|, WHEEL_ZOOM_MAX_STEP) * sign(deltaY)
284
283
  * factor = 1 − (delta * WHEEL_ZOOM_SPEED) / 100
@@ -339,6 +338,13 @@ export const DOUBLE_CLICK_TOLERANCE_PX = 8;
339
338
  * context.
340
339
  */
341
340
  export const ISOLATION_DIM_OPACITY = 0.6;
341
+ /**
342
+ * Opacity of an element MARKED for erasing while the eraser is swept over it
343
+ * (before the delete commits on pointer-up). Much lower than
344
+ * {@link ISOLATION_DIM_OPACITY} so "about to be deleted" reads clearly at a
345
+ * glance — matches the Excalidraw eraser's ~20% preview. Range: 0.15–0.4.
346
+ */
347
+ export const ERASE_DIM_OPACITY = 0.2;
342
348
  /**
343
349
  * Opacity of the WYSIWYG shape-draw preview (the live rect / ellipse drawn
344
350
  * through its real renderer while dragging out a new shape). Slightly below
@@ -449,6 +455,114 @@ export const MAX_BRUSH_WIDTH = 6;
449
455
  * Chromium) so a click-drag still produces a visible stroke.
450
456
  */
451
457
  export const DEFAULT_BRUSH_WIDTH = 2;
458
+ /**
459
+ * Default brush line colour — the paint a fresh stroke is committed with when
460
+ * the host hasn't changed the drawing panel. A dark neutral that reads on a
461
+ * light canvas (matches the pre-settings hard-coded value).
462
+ */
463
+ export const DEFAULT_BRUSH_COLOR = "#222222";
464
+ /**
465
+ * Default brush opacity (0–1) for a fresh stroke. 1 = fully opaque.
466
+ */
467
+ export const DEFAULT_BRUSH_OPACITY = 1;
468
+ /**
469
+ * Samples per Catmull-Rom span when smoothing a committed brush stroke. Brush
470
+ * points are captured sparsely (one per pointer-move), so the raw polyline is
471
+ * angular; on commit each span is resampled into this many sub-points along a
472
+ * Catmull-Rom curve through the captured points (interpolating per-point width
473
+ * too), baking a smooth stroke into the scene. Higher = smoother but more stored
474
+ * vertices per stroke. Range: 2–8.
475
+ */
476
+ export const BRUSH_SMOOTH_SEGMENTS = 4;
477
+ /**
478
+ * World-pixel distance under which a brush stroke's last point is treated as
479
+ * meeting its first — the trigger for auto-closing (and filling) a stroke on
480
+ * commit. Only applies when a fill colour is set and the stroke has ≥3 points.
481
+ * Scaled to the max stroke width so a thick stroke closes as forgivingly as it
482
+ * looks. Range: 6–30; larger closes more eagerly. Default: `MAX_BRUSH_WIDTH * 3`.
483
+ */
484
+ export const BRUSH_CLOSE_DISTANCE = MAX_BRUSH_WIDTH * 3;
485
+ /**
486
+ * Eraser sampling step in WORLD units. While the eraser is dragged the host
487
+ * hit-tests points spaced this far apart along the pointer path so a fast
488
+ * swipe doesn't skip over small shapes between two move events. Smaller →
489
+ * more hit-tests per move (safer, costlier); larger → cheaper but can jump a
490
+ * thin shape. 6 px matches the default brush width so nothing narrower than a
491
+ * stroke slips through. Range: 3–12.
492
+ */
493
+ export const ERASER_SAMPLE_STEP = 6;
494
+ /**
495
+ * Stroke colour of the eraser cursor ring (and its fading drag trail). A neutral
496
+ * mid-grey so it reads on both light and dark canvases without looking like a
497
+ * tool accent. Range: any mid-luminance grey (#666–#aaa).
498
+ */
499
+ export const ERASER_CURSOR_STROKE = "#888888";
500
+ /**
501
+ * Screen-pixel line width of the eraser cursor ring. Constant on screen (the
502
+ * ring is drawn in screen space) so it stays crisp at any zoom. Range: 1–3.
503
+ */
504
+ export const ERASER_CURSOR_LINE_WIDTH = 1.5;
505
+ /**
506
+ * Lifetime (ms) of an eraser drag-trail point before it fully fades — the knob
507
+ * for how LONG the eraser wake is. Much shorter than {@link LASER_TRAIL_TTL_MS}
508
+ * (the laser comet) so the eraser leaves only a tight, brief wake behind the
509
+ * cursor, matching Excalidraw. Lower = shorter/snappier. Range: 100–400.
510
+ */
511
+ export const ERASER_TRAIL_TTL_MS = 120;
512
+ /**
513
+ * Stroke-eraser (Shift) samples a brush polyline this densely — as a FRACTION of
514
+ * the eraser radius — when computing which arc-length spans fall under the disc.
515
+ * The eraser cuts the line's GEOMETRY (segments), not just its vertices, so a big
516
+ * disc merely grazing a sparsely-sampled stroke still removes the covered span.
517
+ * Smaller = finer edges / more samples per move; larger = coarser / cheaper. The
518
+ * covered-span endpoints are refined by bisection ({@link ERASE_BOUNDARY_BISECT_ITERS})
519
+ * regardless, so this mainly bounds the miss-a-tiny-dip risk. Range: 0.15–0.5.
520
+ */
521
+ export const ERASE_COVERAGE_SAMPLE_FRACTION = 0.25;
522
+ /**
523
+ * Floor (world units) for the stroke-eraser sample step, so a tiny eraser radius
524
+ * doesn't explode the sample count on a long stroke. Range: 0.25–2.
525
+ */
526
+ export const ERASE_COVERAGE_MIN_SAMPLE_STEP = 0.5;
527
+ /**
528
+ * Bisection iterations used to pin each covered-span endpoint to the eraser ring
529
+ * (where the brush polyline crosses distance = radius). Each iteration halves the
530
+ * error, so 10 ≈ step/1024 — visually exact. Range: 6–14.
531
+ */
532
+ export const ERASE_BOUNDARY_BISECT_ITERS = 10;
533
+ /**
534
+ * A surviving stroke-eraser fragment shorter than this arc length (world units)
535
+ * is dropped as litter — an isolated nub reads as a stray dot, not a line. Range:
536
+ * 0.5–3.
537
+ */
538
+ export const ERASE_FRAGMENT_MIN_ARC = 1;
539
+ /**
540
+ * Lifetime (ms) of a laser-pointer trail point before it fully fades. Each
541
+ * point stores its birth time; the overlay ramps its opacity from 1 → 0 over
542
+ * this window and the editor prunes points older than it, so a stroke trails
543
+ * the cursor like a comet and vanishes ~this long after the pointer stops.
544
+ * "A couple of seconds" — range 800–3000.
545
+ */
546
+ export const LASER_TRAIL_TTL_MS = 1400;
547
+ /**
548
+ * Stroke colour of the laser-pointer trail. A saturated red reads as a
549
+ * presentation laser and stands out over any diagram fill.
550
+ */
551
+ export const LASER_COLOR = "#ff2d2d";
552
+ /**
553
+ * Screen-pixel stroke width of the laser trail. Constant on screen (drawn in
554
+ * screen space, not world) so the beam stays the same thickness at every zoom.
555
+ * Range: 2–6.
556
+ */
557
+ export const LASER_WIDTH = 4;
558
+ /**
559
+ * Samples per Catmull-Rom span when smoothing a laser trail for rendering.
560
+ * Laser points are collected sparsely (one per pointer-move), so the raw
561
+ * polyline looks angular; the overlay resamples each span into this many
562
+ * sub-points along a Catmull-Rom curve through the captured points, keeping the
563
+ * beam smooth. Higher = smoother but more segments per frame. Range: 4–16.
564
+ */
565
+ export const LASER_SMOOTH_SEGMENTS = 8;
452
566
  /**
453
567
  * Default upper bound on the longer edge of a freshly-inserted
454
568
  * image (CSS pixels). Larger images get downscaled proportionally
@@ -494,14 +608,10 @@ export const GIF_AUTOSTOP_MS = 30_000;
494
608
  * - `TEXT_DEFAULT_FONT_SIZE` — initial font size in world units.
495
609
  * - `TEXT_DEFAULT_FONT_FAMILY` — initial font stack.
496
610
  * - `TEXT_DEFAULT_FILL` — initial text colour (near-black).
497
- * - `TEXT_FONT_SIZE_MIN` / `TEXT_FONT_SIZE_MAX` — clamp range for the
498
- * font-size control in the contextual panel.
499
611
  */
500
612
  export const TEXT_DEFAULT_FONT_SIZE = 24;
501
613
  export const TEXT_DEFAULT_FONT_FAMILY = "system-ui, sans-serif";
502
614
  export const TEXT_DEFAULT_FILL = "#1a1a1a";
503
- export const TEXT_FONT_SIZE_MIN = 8;
504
- export const TEXT_FONT_SIZE_MAX = 256;
505
615
  /**
506
616
  * In-canvas text editing.
507
617
  *
@@ -534,4 +644,79 @@ export const TEXT_SELECTION_FILL = "#1a73e8";
534
644
  export const TEXT_SELECTION_OPACITY = 0.25;
535
645
  export const TEXT_CARET_WIDTH_PX = 1.5;
536
646
  export const TEXT_RESIZE_MIN_FONT_SIZE = 4;
647
+ /**
648
+ * Multiplicative step for the increase/decrease-font-size shortcuts: each
649
+ * press scales the current size by this factor (min ±1 px so small sizes still
650
+ * move), clamped to {@link TEXT_RESIZE_MIN_FONT_SIZE}…{@link TEXT_MAX_FONT_SIZE}.
651
+ * 1.1 ≈ a gentle 10 % step. Range: 1.05–1.5.
652
+ */
653
+ export const TEXT_FONT_SIZE_STEP = 1.1;
654
+ /**
655
+ * Gap (world px) between a source node and the connected node spawned by the
656
+ * flowchart create shortcut (`Cmd/Ctrl+Arrow`). Measured from the source's
657
+ * edge to the new node's edge along the spawn direction. Range: 40–160 —
658
+ * enough that the connecting link is clearly visible.
659
+ */
660
+ export const SPAWN_CONNECTED_GAP_PX = 80;
661
+ /**
662
+ * Upper cap on how many sibling nodes a single flowchart create session
663
+ * (`Cmd/Ctrl+Arrow` held, tapped an arrow repeatedly) can pending-grow before
664
+ * commit. Guards against an accidental key-repeat spraying dozens of nodes.
665
+ * Range: 4–16.
666
+ */
667
+ export const FLOWCHART_MAX_SIBLINGS = 8;
668
+ /**
669
+ * Opacity of the pending flowchart-create preview (the not-yet-committed
670
+ * nodes + links drawn on the overlay while `Cmd/Ctrl` is held). Below 1 so the
671
+ * preview reads as provisional, high enough to judge placement. Range:
672
+ * 0.35–0.65.
673
+ */
674
+ export const FLOWCHART_PREVIEW_OPACITY = 0.5;
675
+ /**
676
+ * Upper clamp (world px) for font size — matches the property panel's slider
677
+ * ceiling so the keyboard and the panel agree on the maximum.
678
+ */
679
+ export const TEXT_MAX_FONT_SIZE = 256;
680
+ /**
681
+ * Paused-GIF chip drawn in a shape's top-left corner — signals a GIF the
682
+ * user can click / hover to resume. Dimensions in screen px; the scrim is
683
+ * a translucent black so the "gif" label stays legible over any artwork.
684
+ */
685
+ export const GIF_BADGE_W = 30;
686
+ export const GIF_BADGE_H = 16;
687
+ export const GIF_BADGE_PAD = 4;
688
+ export const GIF_BADGE_RADIUS = 4;
689
+ export const GIF_BADGE_BG_COLOR = "rgba(0,0,0,0.65)";
690
+ /**
691
+ * Padlock badge at a selected locked element's top-right corner. `SIZE` is
692
+ * the icon edge in screen px; the body uses the accent colour, the keyhole
693
+ * a contrasting fill.
694
+ */
695
+ export const LOCK_BADGE_SIZE = 16;
696
+ export const LOCK_BADGE_COLOR = "#1a73e8";
697
+ export const LOCK_BADGE_KEYHOLE_COLOR = "#fff";
698
+ /**
699
+ * Image-crop UX (Excalidraw-style handle cropping).
700
+ *
701
+ * - `CROP_MIN_SIZE` — smallest allowed crop window edge, in element-LOCAL
702
+ * units (unscaled). Dragging an edge handle inward stops here so the window
703
+ * can never collapse to zero. Range: 4–24.
704
+ * - `CROP_HANDLE_HIT_RADIUS` — screen-pixel grab radius around each of the 8
705
+ * crop handles. Divided by zoom before hit-testing so the effective screen
706
+ * target stays constant. Mirrors {@link HANDLE_HIT_SLOP}. Range: 8–14.
707
+ * - `CROP_GHOST_OPACITY` — alpha of the faint full-image "ghost" painted over
708
+ * the virtual full-image rect while cropping, so the user sees the hidden
709
+ * parts of the source. Low so the real (cropped) pixels stay dominant.
710
+ * Range: 0.08–0.2.
711
+ * - `CROP_BRACKET_LEN` — arm length (screen px) of the L-shaped corner brackets
712
+ * that mark the crop frame (Excalidraw-style), drawn instead of round nubs.
713
+ * Range: 10–20.
714
+ * - `CROP_BRACKET_WIDTH` — stroke width (screen px) of those brackets. Thicker
715
+ * than the frame outline so the corners read as grabbable. Range: 2–4.
716
+ */
717
+ export const CROP_MIN_SIZE = 10;
718
+ export const CROP_HANDLE_HIT_RADIUS = 11;
719
+ export const CROP_GHOST_OPACITY = 0.12;
720
+ export const CROP_BRACKET_LEN = 14;
721
+ export const CROP_BRACKET_WIDTH = 3;
537
722
  //# sourceMappingURL=constants.js.map