@docmentis/udoc-editor 0.0.1 → 0.8.1

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 (207) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +48 -0
  4. package/dist/arrange.d.ts +37 -0
  5. package/dist/arrange.d.ts.map +1 -0
  6. package/dist/arrange.js +431 -0
  7. package/dist/arrange.js.map +1 -0
  8. package/dist/clipboard.d.ts +12 -0
  9. package/dist/clipboard.d.ts.map +1 -0
  10. package/dist/clipboard.js +101 -0
  11. package/dist/clipboard.js.map +1 -0
  12. package/dist/commands.d.ts +12 -0
  13. package/dist/commands.d.ts.map +1 -0
  14. package/dist/commands.js +225 -0
  15. package/dist/commands.js.map +1 -0
  16. package/dist/components/ComboBox.d.ts +38 -0
  17. package/dist/components/ComboBox.d.ts.map +1 -0
  18. package/dist/components/ComboBox.js +57 -0
  19. package/dist/components/ComboBox.js.map +1 -0
  20. package/dist/components/ModeSwitch.d.ts +15 -0
  21. package/dist/components/ModeSwitch.d.ts.map +1 -0
  22. package/dist/components/ModeSwitch.js +94 -0
  23. package/dist/components/ModeSwitch.js.map +1 -0
  24. package/dist/components/NewSlideModal.d.ts +41 -0
  25. package/dist/components/NewSlideModal.d.ts.map +1 -0
  26. package/dist/components/NewSlideModal.js +136 -0
  27. package/dist/components/NewSlideModal.js.map +1 -0
  28. package/dist/components/PageControls.d.ts +78 -0
  29. package/dist/components/PageControls.d.ts.map +1 -0
  30. package/dist/components/PageControls.js +201 -0
  31. package/dist/components/PageControls.js.map +1 -0
  32. package/dist/components/PageSettingsModal.d.ts +27 -0
  33. package/dist/components/PageSettingsModal.d.ts.map +1 -0
  34. package/dist/components/PageSettingsModal.js +273 -0
  35. package/dist/components/PageSettingsModal.js.map +1 -0
  36. package/dist/components/PaintOptionsModal.d.ts +19 -0
  37. package/dist/components/PaintOptionsModal.d.ts.map +1 -0
  38. package/dist/components/PaintOptionsModal.js +103 -0
  39. package/dist/components/PaintOptionsModal.js.map +1 -0
  40. package/dist/components/TextControls.d.ts +49 -0
  41. package/dist/components/TextControls.d.ts.map +1 -0
  42. package/dist/components/TextControls.js +452 -0
  43. package/dist/components/TextControls.js.map +1 -0
  44. package/dist/context-menu.d.ts +46 -0
  45. package/dist/context-menu.d.ts.map +1 -0
  46. package/dist/context-menu.js +144 -0
  47. package/dist/context-menu.js.map +1 -0
  48. package/dist/edit-client.d.ts +121 -0
  49. package/dist/edit-client.d.ts.map +1 -0
  50. package/dist/edit-client.js +154 -0
  51. package/dist/edit-client.js.map +1 -0
  52. package/dist/edit-command.d.ts +7 -0
  53. package/dist/edit-command.d.ts.map +1 -0
  54. package/dist/edit-command.js +18 -0
  55. package/dist/edit-command.js.map +1 -0
  56. package/dist/edit-mode.d.ts +19 -0
  57. package/dist/edit-mode.d.ts.map +1 -0
  58. package/dist/edit-mode.js +214 -0
  59. package/dist/edit-mode.js.map +1 -0
  60. package/dist/editor.d.ts +101 -0
  61. package/dist/editor.d.ts.map +1 -0
  62. package/dist/editor.js +101 -0
  63. package/dist/editor.js.map +1 -0
  64. package/dist/fonts/faces.d.ts +28 -0
  65. package/dist/fonts/faces.d.ts.map +1 -0
  66. package/dist/fonts/faces.js +38 -0
  67. package/dist/fonts/faces.js.map +1 -0
  68. package/dist/fonts/preview.d.ts +98 -0
  69. package/dist/fonts/preview.d.ts.map +1 -0
  70. package/dist/fonts/preview.js +149 -0
  71. package/dist/fonts/preview.js.map +1 -0
  72. package/dist/formatting-marks.d.ts +23 -0
  73. package/dist/formatting-marks.d.ts.map +1 -0
  74. package/dist/formatting-marks.js +55 -0
  75. package/dist/formatting-marks.js.map +1 -0
  76. package/dist/grips.d.ts +14 -0
  77. package/dist/grips.d.ts.map +1 -0
  78. package/dist/grips.js +459 -0
  79. package/dist/grips.js.map +1 -0
  80. package/dist/i18n/ar.d.ts +4 -0
  81. package/dist/i18n/ar.d.ts.map +1 -0
  82. package/dist/i18n/ar.js +175 -0
  83. package/dist/i18n/ar.js.map +1 -0
  84. package/dist/i18n/de.d.ts +4 -0
  85. package/dist/i18n/de.d.ts.map +1 -0
  86. package/dist/i18n/de.js +175 -0
  87. package/dist/i18n/de.js.map +1 -0
  88. package/dist/i18n/en.d.ts +5 -0
  89. package/dist/i18n/en.d.ts.map +1 -0
  90. package/dist/i18n/en.js +176 -0
  91. package/dist/i18n/en.js.map +1 -0
  92. package/dist/i18n/es.d.ts +4 -0
  93. package/dist/i18n/es.d.ts.map +1 -0
  94. package/dist/i18n/es.js +175 -0
  95. package/dist/i18n/es.js.map +1 -0
  96. package/dist/i18n/fr.d.ts +4 -0
  97. package/dist/i18n/fr.d.ts.map +1 -0
  98. package/dist/i18n/fr.js +175 -0
  99. package/dist/i18n/fr.js.map +1 -0
  100. package/dist/i18n/index.d.ts +21 -0
  101. package/dist/i18n/index.d.ts.map +1 -0
  102. package/dist/i18n/index.js +42 -0
  103. package/dist/i18n/index.js.map +1 -0
  104. package/dist/i18n/ja.d.ts +4 -0
  105. package/dist/i18n/ja.d.ts.map +1 -0
  106. package/dist/i18n/ja.js +175 -0
  107. package/dist/i18n/ja.js.map +1 -0
  108. package/dist/i18n/ko.d.ts +4 -0
  109. package/dist/i18n/ko.d.ts.map +1 -0
  110. package/dist/i18n/ko.js +175 -0
  111. package/dist/i18n/ko.js.map +1 -0
  112. package/dist/i18n/messages.d.ts +316 -0
  113. package/dist/i18n/messages.d.ts.map +1 -0
  114. package/dist/i18n/messages.js +2 -0
  115. package/dist/i18n/messages.js.map +1 -0
  116. package/dist/i18n/pt-BR.d.ts +4 -0
  117. package/dist/i18n/pt-BR.d.ts.map +1 -0
  118. package/dist/i18n/pt-BR.js +175 -0
  119. package/dist/i18n/pt-BR.js.map +1 -0
  120. package/dist/i18n/ru.d.ts +4 -0
  121. package/dist/i18n/ru.d.ts.map +1 -0
  122. package/dist/i18n/ru.js +175 -0
  123. package/dist/i18n/ru.js.map +1 -0
  124. package/dist/i18n/zh-CN.d.ts +4 -0
  125. package/dist/i18n/zh-CN.d.ts.map +1 -0
  126. package/dist/i18n/zh-CN.js +175 -0
  127. package/dist/i18n/zh-CN.js.map +1 -0
  128. package/dist/i18n/zh-TW.d.ts +4 -0
  129. package/dist/i18n/zh-TW.d.ts.map +1 -0
  130. package/dist/i18n/zh-TW.js +175 -0
  131. package/dist/i18n/zh-TW.js.map +1 -0
  132. package/dist/icons.d.ts +97 -0
  133. package/dist/icons.d.ts.map +1 -0
  134. package/dist/icons.js +103 -0
  135. package/dist/icons.js.map +1 -0
  136. package/dist/index.d.ts +9 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.js +14 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/insert.d.ts +21 -0
  141. package/dist/insert.d.ts.map +1 -0
  142. package/dist/insert.js +129 -0
  143. package/dist/insert.js.map +1 -0
  144. package/dist/menu-action.d.ts +73 -0
  145. package/dist/menu-action.d.ts.map +1 -0
  146. package/dist/menu-action.js +89 -0
  147. package/dist/menu-action.js.map +1 -0
  148. package/dist/mode.d.ts +21 -0
  149. package/dist/mode.d.ts.map +1 -0
  150. package/dist/mode.js +17 -0
  151. package/dist/mode.js.map +1 -0
  152. package/dist/new-slide.d.ts +21 -0
  153. package/dist/new-slide.d.ts.map +1 -0
  154. package/dist/new-slide.js +63 -0
  155. package/dist/new-slide.js.map +1 -0
  156. package/dist/page-controls.d.ts +20 -0
  157. package/dist/page-controls.d.ts.map +1 -0
  158. package/dist/page-controls.js +99 -0
  159. package/dist/page-controls.js.map +1 -0
  160. package/dist/paint.d.ts +52 -0
  161. package/dist/paint.d.ts.map +1 -0
  162. package/dist/paint.js +262 -0
  163. package/dist/paint.js.map +1 -0
  164. package/dist/ruler.d.ts +10 -0
  165. package/dist/ruler.d.ts.map +1 -0
  166. package/dist/ruler.js +97 -0
  167. package/dist/ruler.js.map +1 -0
  168. package/dist/state.d.ts +85 -0
  169. package/dist/state.d.ts.map +1 -0
  170. package/dist/state.js +28 -0
  171. package/dist/state.js.map +1 -0
  172. package/dist/styles.d.ts +2 -0
  173. package/dist/styles.d.ts.map +1 -0
  174. package/dist/styles.js +758 -0
  175. package/dist/styles.js.map +1 -0
  176. package/dist/tabs.d.ts +11 -0
  177. package/dist/tabs.d.ts.map +1 -0
  178. package/dist/tabs.js +153 -0
  179. package/dist/tabs.js.map +1 -0
  180. package/dist/text-format.d.ts +114 -0
  181. package/dist/text-format.d.ts.map +1 -0
  182. package/dist/text-format.js +315 -0
  183. package/dist/text-format.js.map +1 -0
  184. package/dist/tools.d.ts +35 -0
  185. package/dist/tools.d.ts.map +1 -0
  186. package/dist/tools.js +41 -0
  187. package/dist/tools.js.map +1 -0
  188. package/dist/version.d.ts +2 -0
  189. package/dist/version.d.ts.map +1 -0
  190. package/dist/version.js +7 -0
  191. package/dist/version.js.map +1 -0
  192. package/dist/worker/handlers.d.ts +11 -0
  193. package/dist/worker/handlers.d.ts.map +1 -0
  194. package/dist/worker/handlers.js +127 -0
  195. package/dist/worker/handlers.js.map +1 -0
  196. package/dist/worker/protocol.d.ts +190 -0
  197. package/dist/worker/protocol.d.ts.map +1 -0
  198. package/dist/worker/protocol.js +2 -0
  199. package/dist/worker/protocol.js.map +1 -0
  200. package/dist/worker/worker-source.d.ts +3 -0
  201. package/dist/worker/worker-source.d.ts.map +1 -0
  202. package/dist/worker/worker-source.js +11 -0
  203. package/dist/worker/worker.d.ts +2 -0
  204. package/dist/worker/worker.d.ts.map +1 -0
  205. package/dist/worker/worker.js +6 -0
  206. package/dist/worker/worker.js.map +1 -0
  207. package/package.json +68 -5
package/dist/grips.js ADDED
@@ -0,0 +1,459 @@
1
+ // Edit mode's grips on the selection: a rotation grip above each selected box,
2
+ // and the geometry grips (yellow diamonds) a lone shape offers — a rounded
3
+ // rectangle's corner, an arrow's head. udoc-ui's selection layer draws them
4
+ // beside its resize handles (`SelectionChrome`), and the canvas hands a press on
5
+ // one to the gesture this runs (`UIExtension.pressCanvas`).
6
+ import { allowsEdit, applyPoint, DRAG_THRESHOLD, fromComponents, invert } from "@docmentis/udoc-ui/internal";
7
+ const SVG_NS = "http://www.w3.org/2000/svg";
8
+ /** Adjust-handle diamond size (CSS px) — keep in sync with the stylesheet. */
9
+ const ADJUST_HANDLE_SIZE = 9;
10
+ /** Adjust-handle hit half-extent (CSS px) — a touch larger than the diamond, as
11
+ * it sits inside the box where a miss reads as a move. */
12
+ const ADJUST_HIT = 7;
13
+ /** Rotation-handle diameter (CSS px) — keep in sync with the stylesheet. */
14
+ const ROTATE_HANDLE_SIZE = 10;
15
+ /** Rotation-handle hit radius (CSS px). */
16
+ const ROTATE_HIT = 8;
17
+ /** Gap (CSS px) from the box's top edge out to the rotation handle's center. */
18
+ const ROTATE_GAP = 18;
19
+ /** Rotation-snap increment (radians) the Shift modifier locks to — 15°, the
20
+ * step PowerPoint/Figma/Illustrator use for constrained rotation. */
21
+ const ROTATE_SNAP = Math.PI / 12;
22
+ /** Cardinal rotation step (radians) the *default* (no-modifier) rotate snaps
23
+ * to — 0/90/180/270°. Unlike the Shift step this is magnetic, not absolute:
24
+ * it only pulls when within {@link ROTATE_CARDINAL_TOLERANCE} of a cardinal,
25
+ * so the object turns freely between them. Alt suppresses it entirely. */
26
+ const ROTATE_CARDINAL = Math.PI / 2;
27
+ /** Half-width (radians) of the magnetic zone around each cardinal angle —
28
+ * ~2.75°, matching PowerPoint's barely-there cardinal pull. */
29
+ const ROTATE_CARDINAL_TOLERANCE = (2.75 * Math.PI) / 180;
30
+ /**
31
+ * The rotation cursor: a curved arrow (PowerPoint/Figma style), far clearer than
32
+ * the `grab` hand — which reads as "pan". A shallow 135° arc capped by a filled
33
+ * triangle head at each end, drawn dark over a white halo so it stays legible on
34
+ * any page color, in a 32×32 box with the hotspot on the arc's circle center
35
+ * (16, 15). `deg` rotates the glyph about that center so it stays tangent to the
36
+ * box's on-screen pose, like the resize cursors track the box's edges.
37
+ */
38
+ const ROTATE_ARC = "M7.69 11.56 A9 9 0 0 1 24.31 11.56";
39
+ const ROTATE_HEAD_L = "M5.58 16.64 L4.36 10.18 L11.01 12.93 Z";
40
+ const ROTATE_HEAD_R = "M26.42 16.64 L20.99 12.93 L27.64 10.18 Z";
41
+ function rotateCursorSvg(deg) {
42
+ // One pass per color: a thicker white pass lays the halo, the dark pass sits
43
+ // on top. The arc is stroked (no fill); the heads are filled triangles whose
44
+ // matching stroke fattens the white pass into the halo outline.
45
+ const layer = (color, width) => `<path d="${ROTATE_ARC}" fill="none" stroke="${color}" stroke-width="${width}" stroke-linecap="round"/>` +
46
+ `<path d="${ROTATE_HEAD_L}" fill="${color}" stroke="${color}" stroke-width="${width}" stroke-linejoin="round"/>` +
47
+ `<path d="${ROTATE_HEAD_R}" fill="${color}" stroke="${color}" stroke-width="${width}" stroke-linejoin="round"/>`;
48
+ return (`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">` +
49
+ `<g transform="rotate(${deg} 16 15)">${layer("#fff", 4.5)}${layer("#111", 2.2)}</g></svg>`);
50
+ }
51
+ /** Cached `cursor` declarations by 15° bucket — a slow drag/hover reuses the
52
+ * data-URI instead of re-encoding the SVG every pixel. */
53
+ const ROTATE_CURSORS = new Map();
54
+ /** The rotation `cursor` value (a data-URI curved arrow) for an on-screen box
55
+ * angle in radians, oriented to that pose. `grab` is the fallback. */
56
+ function rotateCursorForAngle(angle) {
57
+ const bucket = ((Math.round((angle * 180) / Math.PI / 15) % 24) + 24) % 24;
58
+ let css = ROTATE_CURSORS.get(bucket);
59
+ if (css === undefined) {
60
+ const svg = encodeURIComponent(rotateCursorSvg(bucket * 15));
61
+ css = `url("data:image/svg+xml,${svg}") 16 15, grab`;
62
+ ROTATE_CURSORS.set(bucket, css);
63
+ }
64
+ return css;
65
+ }
66
+ /**
67
+ * The rotation grip's viewport position for a placement projected by `lv`
68
+ * (local→viewport): out from the box's top-edge midpoint, away from the center,
69
+ * by {@link ROTATE_GAP}. Also returns the projected top-mid (stem near end) and
70
+ * center, so the caller can draw the stem and use the center as the pivot.
71
+ */
72
+ function rotateGripPos(p, lv) {
73
+ const top = applyPoint(lv, p.x + p.width / 2, p.y);
74
+ const center = applyPoint(lv, p.x + p.width / 2, p.y + p.height / 2);
75
+ let dx = top.x - center.x;
76
+ let dy = top.y - center.y;
77
+ const len = Math.hypot(dx, dy) || 1;
78
+ dx /= len;
79
+ dy /= len;
80
+ return { x: top.x + dx * ROTATE_GAP, y: top.y + dy * ROTATE_GAP, top, center };
81
+ }
82
+ /** Whether the selection in `frame` rotates — each box then carries a grip. */
83
+ function rotates(frame) {
84
+ return allowsEdit(frame.state.capabilities, "rotateEachObject", "rotateEachShape");
85
+ }
86
+ /** The grips, editing through `tools` — null until edit mode is mounted. */
87
+ export function createGrips(tools) {
88
+ /** Pooled rotation stems (one line per selected box: top edge → grip). */
89
+ const stems = [];
90
+ /** Pooled rotation grips (one circle per selected box). */
91
+ const rotateGrips = [];
92
+ /** Pooled adjust-handle diamonds — the geometry grips a shape offers. Only a
93
+ * single-shape selection reports any. */
94
+ const diamonds = [];
95
+ /** The frame last drawn — what a hover or a press hit-tests. */
96
+ let frame = null;
97
+ /**
98
+ * The grip a live adjust drag is moving, as the engine reports it will land
99
+ * — substituted for the streamed handle of the same index until the
100
+ * committed geometry arrives. Not a transform preview: an adjust drag
101
+ * reshapes the geometry through a guide, which no affine can stand in for,
102
+ * so the box and the other handles hold their last drawn positions while
103
+ * this one moves.
104
+ *
105
+ * A geometry handle can't be previewed by an affine the way a move / resize
106
+ * can: it drives a guide, and where that guide puts it is the geometry's
107
+ * business (a corner radius runs along one edge, a callout's tail swings on
108
+ * an arc, both stop at the ends of their range). So each pointer move asks
109
+ * the engine and this draws the answer, rather than pinning the diamond to
110
+ * the cursor and letting it jump on release.
111
+ */
112
+ let handlePreview = null;
113
+ /** The adjust handles in `f`, or none when the engine reports no
114
+ * reshapeable geometry (a multi-shape selection, a doc type with none).
115
+ * While a drag is in flight the grabbed one is replaced by the engine's
116
+ * preview of where it has been dragged to. */
117
+ function adjustItems(f) {
118
+ if (f.boxes.length === 0)
119
+ return [];
120
+ const handles = f.state.local.handles ?? [];
121
+ const preview = handlePreview;
122
+ if (!preview)
123
+ return handles;
124
+ return handles.map((handle) => (handle.index === preview.index ? preview : handle));
125
+ }
126
+ /**
127
+ * The grabbed adjust handle if `(x, y)` (viewport CSS px, canvas-relative)
128
+ * falls on one, else null.
129
+ *
130
+ * Tested **first** — ahead of the rotation grip, the resize handles, and the
131
+ * box. A grip can land on any of them (a rounded rectangle at its maximum
132
+ * radius parks its diamond on the top edge's midpoint, right under the `n`
133
+ * handle), and it is the only one of the four with no second grab point, so
134
+ * anything that outranked it would leave that shape's geometry uneditable.
135
+ * It is drawn last for the same reason, so what the user sees on top is what
136
+ * a press takes.
137
+ */
138
+ function adjustHandleAt(x, y) {
139
+ if (!frame)
140
+ return null;
141
+ for (const handle of adjustItems(frame)) {
142
+ const transform = fromComponents(handle.transform);
143
+ const lv = frame.project(handle.page, transform);
144
+ if (!lv)
145
+ continue;
146
+ const c = applyPoint(lv, handle.point.x, handle.point.y);
147
+ if (Math.abs(x - c.x) <= ADJUST_HIT && Math.abs(y - c.y) <= ADJUST_HIT) {
148
+ return { index: handle.index, page: handle.page, transform };
149
+ }
150
+ }
151
+ return null;
152
+ }
153
+ /**
154
+ * Where `(x, y)` (viewport CSS px) lands in the grabbed shape's **own local
155
+ * space** — the space an `adjustShapeHandle` edit names its target in.
156
+ *
157
+ * The projection the diamond was drawn through, run backwards: the drag is
158
+ * expressed where the geometry is defined, so the engine solves against the
159
+ * shape's own axes and the host never reasons about rotation. Null when the
160
+ * page has scrolled off, or the transform is degenerate (a zero-scale object
161
+ * has no local space to speak of).
162
+ */
163
+ function adjustHandleLocal(grab, x, y) {
164
+ const lv = frame?.project(grab.page, grab.transform);
165
+ const back = lv ? invert(lv) : null;
166
+ return back ? applyPoint(back, x, y) : null;
167
+ }
168
+ /**
169
+ * The rotation seed if `(x, y)` falls on any selected box's rotation grip,
170
+ * else null. Every selected box shows a grip when the selection rotates
171
+ * (each about its own center); the seed carries the grabbed box's viewport
172
+ * center, about which the drag angle is measured.
173
+ */
174
+ function rotateHitTest(x, y) {
175
+ if (!frame || !rotates(frame))
176
+ return null;
177
+ for (const { place, onScreen: lv } of frame.boxes) {
178
+ const grip = rotateGripPos(place, lv);
179
+ if (Math.hypot(x - grip.x, y - grip.y) <= ROTATE_HIT) {
180
+ // On-screen orientation = angle of the local +x axis under the
181
+ // local→viewport transform (carries the object + page rotation).
182
+ return { pivotX: grip.center.x, pivotY: grip.center.y, baseAngle: Math.atan2(lv[1], lv[0]) };
183
+ }
184
+ }
185
+ return null;
186
+ }
187
+ /** A pooled element at slot `i` of `pool`, made by `make` on first use. */
188
+ function pooled(pool, i, parent, make) {
189
+ let el = pool[i];
190
+ if (!el) {
191
+ el = make();
192
+ parent.appendChild(el);
193
+ pool.push(el);
194
+ }
195
+ return el;
196
+ }
197
+ /** Drop the pooled chrome past `rot` grips + stems / `adjust` diamonds. */
198
+ function trim(rot, adjust) {
199
+ while (rotateGrips.length > rot)
200
+ rotateGrips.pop().remove();
201
+ while (stems.length > rot)
202
+ stems.pop().remove();
203
+ while (diamonds.length > adjust)
204
+ diamonds.pop().remove();
205
+ }
206
+ const chrome = {
207
+ hitPad: ROTATE_HIT,
208
+ render(f, group, svg) {
209
+ frame = f;
210
+ // Each box's rotation stem (behind the resize handles) + grip,
211
+ // riding the box's (preview-applied) transform.
212
+ let usedRot = 0;
213
+ if (rotates(f)) {
214
+ const rHalf = ROTATE_HANDLE_SIZE / 2;
215
+ for (const { place, onScreen } of f.boxes) {
216
+ const grip = rotateGripPos(place, onScreen);
217
+ const stem = pooled(stems, usedRot, svg, () => {
218
+ const line = document.createElementNS(SVG_NS, "line");
219
+ line.setAttribute("class", "udoc-ui__rotate-stem");
220
+ return line;
221
+ });
222
+ stem.setAttribute("x1", `${grip.top.x}`);
223
+ stem.setAttribute("y1", `${grip.top.y}`);
224
+ stem.setAttribute("x2", `${grip.x}`);
225
+ stem.setAttribute("y2", `${grip.y}`);
226
+ const rot = pooled(rotateGrips, usedRot, group, () => {
227
+ const el = document.createElement("div");
228
+ el.className = "udoc-ui__rotate-handle";
229
+ return el;
230
+ });
231
+ rot.style.transform = `translate(${grip.x - rHalf}px, ${grip.y - rHalf}px)`;
232
+ usedRot++;
233
+ }
234
+ }
235
+ // The geometry grips, drawn after the box chrome so they sit above
236
+ // it — matching the hit order, which tests them first (see
237
+ // `adjustHandleAt`), so an overlapping grip both looks and acts like
238
+ // the top control. They ride their own `local → page` transform,
239
+ // not the box's, and carry no rotation of their own — a diamond
240
+ // reads the same at any angle.
241
+ let usedAdjust = 0;
242
+ const aHalf = ADJUST_HANDLE_SIZE / 2;
243
+ for (const handle of adjustItems(f)) {
244
+ const lv = f.project(handle.page, fromComponents(handle.transform));
245
+ if (!lv)
246
+ continue;
247
+ const c = applyPoint(lv, handle.point.x, handle.point.y);
248
+ const el = pooled(diamonds, usedAdjust++, group, () => {
249
+ const diamond = document.createElement("div");
250
+ diamond.className = "udoc-ui__adjust-handle";
251
+ return diamond;
252
+ });
253
+ el.style.transform = `translate(${c.x - aHalf}px, ${c.y - aHalf}px) rotate(45deg)`;
254
+ }
255
+ trim(usedRot, usedAdjust);
256
+ },
257
+ reach(f) {
258
+ if (!rotates(f) || f.boxes.length === 0)
259
+ return null;
260
+ let left = Infinity;
261
+ let top = Infinity;
262
+ let right = -Infinity;
263
+ let bottom = -Infinity;
264
+ for (const { place, onScreen } of f.boxes) {
265
+ const grip = rotateGripPos(place, onScreen);
266
+ left = Math.min(left, grip.x);
267
+ top = Math.min(top, grip.y);
268
+ right = Math.max(right, grip.x);
269
+ bottom = Math.max(bottom, grip.y);
270
+ }
271
+ return { left, top, right, bottom };
272
+ },
273
+ reset() {
274
+ handlePreview = null;
275
+ },
276
+ };
277
+ /** A drag on the rotation grip seeded by `seed`, pressed at `(x, y)`. */
278
+ function rotateGesture(seed, x, y, canvas) {
279
+ const startAngle = Math.atan2(y - seed.pivotY, x - seed.pivotX);
280
+ let moved = false;
281
+ // The latest pointer, so the Shift / Alt handlers re-snap with no
282
+ // pointer movement.
283
+ let lastX = x;
284
+ let lastY = y;
285
+ /**
286
+ * The rotation delta (radians) the drag implies for the last pointer
287
+ * position: the pointer's angle about the grabbed box's center, less
288
+ * where the drag began. Snapping acts on the grabbed box's *absolute*
289
+ * on-screen angle (its `baseAngle` plus the raw delta), so the grabbed
290
+ * box lands on clean angles and the rest of a selection follow by the
291
+ * same delta:
292
+ *
293
+ * - `alt` — no snap; the raw, free-rotating delta.
294
+ * - `shift` — hard-snap to {@link ROTATE_SNAP} (15°) steps, always.
295
+ * - neither — magnetic-snap to a cardinal ({@link ROTATE_CARDINAL},
296
+ * 0/90/…) only while within {@link ROTATE_CARDINAL_TOLERANCE}, else
297
+ * rotate freely.
298
+ */
299
+ const delta = (shift, alt) => {
300
+ const raw = Math.atan2(lastY - seed.pivotY, lastX - seed.pivotX) - startAngle;
301
+ if (alt)
302
+ return raw;
303
+ const abs = seed.baseAngle + raw;
304
+ if (shift)
305
+ return Math.round(abs / ROTATE_SNAP) * ROTATE_SNAP - seed.baseAngle;
306
+ const cardinal = Math.round(abs / ROTATE_CARDINAL) * ROTATE_CARDINAL;
307
+ return Math.abs(abs - cardinal) <= ROTATE_CARDINAL_TOLERANCE ? cardinal - seed.baseAngle : raw;
308
+ };
309
+ // Re-apply the live rotation preview for the last pointer position and
310
+ // modifier state. Shared by the pointer drag and the Shift/Alt keys.
311
+ const preview = (shift, alt) => {
312
+ if (moved)
313
+ canvas.preview({ kind: "rotateEach", angle: delta(shift, alt) });
314
+ };
315
+ return {
316
+ move(px, py, ev) {
317
+ lastX = px;
318
+ lastY = py;
319
+ if (!moved) {
320
+ // Still close to the pivot — too noisy to read an angle.
321
+ if (Math.hypot(px - seed.pivotX, py - seed.pivotY) < DRAG_THRESHOLD)
322
+ return;
323
+ moved = true;
324
+ }
325
+ // Default snaps to cardinals; Shift → 15° steps, Alt → free.
326
+ // Read live (and re-applied by the key handlers) like the lock.
327
+ preview(ev.shiftKey, ev.altKey);
328
+ },
329
+ up(px, py, ev) {
330
+ lastX = px;
331
+ lastY = py;
332
+ if (!moved) {
333
+ // A bare click on the rotation handle — drop the (no-op) preview.
334
+ canvas.preview(null);
335
+ return;
336
+ }
337
+ // Keep the preview until the rotated geometry arrives, so the box
338
+ // settles onto the new angle with no flash. Each object spins
339
+ // about its own center, so this can't ride one shared affine
340
+ // delta — the engine reads the per-object pivots.
341
+ canvas.committing();
342
+ void tools()?.arrange.rotateSelectionEach(delta(ev.shiftKey, ev.altKey));
343
+ },
344
+ cancel() {
345
+ canvas.preview(null);
346
+ },
347
+ modifier(ev) {
348
+ // Shift (15° steps) and Alt (free) both retarget the snap.
349
+ if (ev.key === "Shift" || ev.key === "Alt")
350
+ preview(ev.shiftKey, ev.altKey);
351
+ },
352
+ };
353
+ }
354
+ /** A drag on the geometry grip `grab`, pressed at `(x, y)`. */
355
+ function adjustGesture(grab, x, y, canvas) {
356
+ let moved = false;
357
+ // Whether the drag is still on — a probe answering after release draws
358
+ // nothing.
359
+ let live = true;
360
+ // The drag probe, coalesced latest-wins: one query in flight, the newest
361
+ // pointer chased on completion.
362
+ let probeSeq = 0;
363
+ let probeBusy = false;
364
+ let probeLatest = null;
365
+ /**
366
+ * Probe where the grabbed grip lands for a pointer at canvas-local
367
+ * `(px, py)`, and draw it there.
368
+ *
369
+ * A geometry handle doesn't follow the pointer — it runs along whatever
370
+ * track its guide describes and stops at the ends of its range — so the
371
+ * position has to come from the engine, which is a worker hop.
372
+ * Latest-wins like the canvas's hover probe, so the diamond tracks the
373
+ * drag a frame behind rather than queueing up a hop per move. Stale
374
+ * replies (a newer probe already out, or the drag ended) are dropped, so
375
+ * nothing repaints the grip after release.
376
+ */
377
+ const probe = (px, py) => {
378
+ const to = adjustHandleLocal(grab, px, py);
379
+ const edit = tools()?.host.edit;
380
+ if (!to || !edit)
381
+ return; // the page scrolled off — nothing to project against
382
+ probeLatest = { x: px, y: py };
383
+ if (probeBusy)
384
+ return;
385
+ probeBusy = true;
386
+ const seq = ++probeSeq;
387
+ void edit.selectionHandlePreview(grab.index, to.x, to.y).then((handle) => {
388
+ probeBusy = false;
389
+ if (seq === probeSeq && live && handlePreview !== handle) {
390
+ handlePreview = handle;
391
+ canvas.refreshChrome();
392
+ }
393
+ const next = probeLatest;
394
+ if (next && (next.x !== px || next.y !== py) && live)
395
+ probe(next.x, next.y);
396
+ });
397
+ };
398
+ // Drop the grip's preview: it returns to where the geometry has it.
399
+ const unpreview = () => {
400
+ handlePreview = null;
401
+ canvas.refreshChrome();
402
+ };
403
+ return {
404
+ move(px, py) {
405
+ if (!moved) {
406
+ if (Math.hypot(px - x, py - y) < DRAG_THRESHOLD)
407
+ return;
408
+ moved = true;
409
+ }
410
+ // The grip follows the pointer along its own track — where that
411
+ // is, only the engine can say (the handle drives a guide, not a
412
+ // transform), so ask and draw the answer. The outline itself
413
+ // holds its last drawn geometry until the commit lands.
414
+ probe(px, py);
415
+ },
416
+ up(px, py) {
417
+ live = false;
418
+ if (!moved) {
419
+ // A bare click on a diamond — drop the (no-op) preview.
420
+ unpreview();
421
+ return;
422
+ }
423
+ const to = adjustHandleLocal(grab, px, py);
424
+ const host = tools()?.host;
425
+ if (!to || !host)
426
+ return;
427
+ // Hold the previewed grip until the reshaped geometry arrives,
428
+ // so it settles onto the new outline instead of snapping back to
429
+ // where the drag started. Selection-relative like the canvas's
430
+ // other drags — the engine resolves which shape and solves the
431
+ // adjust value the drag implies.
432
+ canvas.committing();
433
+ void host.commit(() => host.client.executeOnSelection({ kind: "adjustShapeHandle", index: grab.index, to }));
434
+ },
435
+ cancel() {
436
+ // Nothing was committed, so the preview has nothing to settle onto.
437
+ live = false;
438
+ unpreview();
439
+ },
440
+ };
441
+ }
442
+ return {
443
+ chrome,
444
+ press(x, y, canvas) {
445
+ const grab = adjustHandleAt(x, y);
446
+ if (grab)
447
+ return adjustGesture(grab, x, y, canvas);
448
+ const seed = rotateHitTest(x, y);
449
+ return seed ? rotateGesture(seed, x, y, canvas) : null;
450
+ },
451
+ cursor(x, y) {
452
+ if (adjustHandleAt(x, y))
453
+ return "crosshair";
454
+ const seed = rotateHitTest(x, y);
455
+ return seed ? rotateCursorForAngle(seed.baseAngle) : null;
456
+ },
457
+ };
458
+ }
459
+ //# sourceMappingURL=grips.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grips.js","sourceRoot":"","sources":["../src/grips.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,2EAA2E;AAC3E,4EAA4E;AAC5E,iFAAiF;AACjF,4DAA4D;AAC5D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAa7G,MAAM,MAAM,GAAG,4BAA4B,CAAC;AAE5C,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B;2DAC2D;AAC3D,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,4EAA4E;AAC5E,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,2CAA2C;AAC3C,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,gFAAgF;AAChF,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;sEACsE;AACtE,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;AAEjC;;;2EAG2E;AAC3E,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;AAEpC;gEACgE;AAChE,MAAM,yBAAyB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AA0BzD;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,oCAAoC,CAAC;AACxD,MAAM,aAAa,GAAG,wCAAwC,CAAC;AAC/D,MAAM,aAAa,GAAG,0CAA0C,CAAC;AAEjE,SAAS,eAAe,CAAC,GAAW;IAChC,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,CAAC;QAC3D,CAAC;QACD,MAAM,CAAC,CAAC,EAAE,CAAC;YACP,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;gBAAE,OAAO,WAAW,CAAC;YAC7C,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9D,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { EditMessages } from "./messages.js";
2
+ /** Arabic. */
3
+ export declare const ar: EditMessages;
4
+ //# sourceMappingURL=ar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../src/i18n/ar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,cAAc;AACd,eAAO,MAAM,EAAE,EAAE,YA6LhB,CAAC"}