tldraw 4.2.0-next.f100cedfc45b → 4.3.0-canary.03ae87dcc44b

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 (268) hide show
  1. package/dist-cjs/index.d.ts +17 -7
  2. package/dist-cjs/index.js +1 -1
  3. package/dist-cjs/lib/bindings/arrow/ArrowBindingUtil.js.map +2 -2
  4. package/dist-cjs/lib/canvas/TldrawSelectionForeground.js +5 -2
  5. package/dist-cjs/lib/canvas/TldrawSelectionForeground.js.map +2 -2
  6. package/dist-cjs/lib/defaultExternalContentHandlers.js.map +2 -2
  7. package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
  8. package/dist-cjs/lib/shapes/arrow/arrowLabel.js.map +2 -2
  9. package/dist-cjs/lib/shapes/arrow/arrowTargetState.js.map +2 -2
  10. package/dist-cjs/lib/shapes/arrow/elbow/elbowArrowSnapLines.js.map +2 -2
  11. package/dist-cjs/lib/shapes/arrow/shared.js.map +2 -2
  12. package/dist-cjs/lib/shapes/arrow/toolStates/Pointing.js.map +2 -2
  13. package/dist-cjs/lib/shapes/bookmark/bookmarks.js.map +2 -2
  14. package/dist-cjs/lib/shapes/draw/toolStates/Drawing.js.map +2 -2
  15. package/dist-cjs/lib/shapes/embed/EmbedShapeUtil.js.map +2 -2
  16. package/dist-cjs/lib/shapes/frame/FrameShapeTool.js.map +1 -1
  17. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js +63 -36
  18. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js.map +2 -2
  19. package/dist-cjs/lib/shapes/geo/toolStates/Pointing.js.map +2 -2
  20. package/dist-cjs/lib/shapes/line/toolStates/Pointing.js.map +2 -2
  21. package/dist-cjs/lib/shapes/note/NoteShapeUtil.js +3 -3
  22. package/dist-cjs/lib/shapes/note/NoteShapeUtil.js.map +2 -2
  23. package/dist-cjs/lib/shapes/note/noteHelpers.js.map +2 -2
  24. package/dist-cjs/lib/shapes/shared/PlainTextLabel.js.map +2 -2
  25. package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
  26. package/dist-cjs/lib/shapes/shared/ShapeFill.js +3 -0
  27. package/dist-cjs/lib/shapes/shared/ShapeFill.js.map +2 -2
  28. package/dist-cjs/lib/shapes/shared/crop.js +1 -0
  29. package/dist-cjs/lib/shapes/shared/crop.js.map +2 -2
  30. package/dist-cjs/lib/shapes/shared/useEditablePlainText.js.map +2 -2
  31. package/dist-cjs/lib/shapes/shared/useEditableRichText.js.map +2 -2
  32. package/dist-cjs/lib/shapes/text/toolStates/Pointing.js.map +2 -2
  33. package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js.map +2 -2
  34. package/dist-cjs/lib/tools/EraserTool/childStates/Pointing.js.map +2 -2
  35. package/dist-cjs/lib/tools/SelectTool/DragAndDropManager.js +1 -4
  36. package/dist-cjs/lib/tools/SelectTool/DragAndDropManager.js.map +2 -2
  37. package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js.map +2 -2
  38. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Idle.js.map +2 -2
  39. package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js +15 -7
  40. package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js.map +2 -2
  41. package/dist-cjs/lib/tools/SelectTool/childStates/EditingShape.js.map +2 -2
  42. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +2 -2
  43. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
  44. package/dist-cjs/lib/tools/SelectTool/childStates/PointingArrowLabel.js.map +2 -2
  45. package/dist-cjs/lib/tools/SelectTool/childStates/PointingHandle.js.map +2 -2
  46. package/dist-cjs/lib/tools/SelectTool/childStates/PointingSelection.js.map +2 -2
  47. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
  48. package/dist-cjs/lib/tools/SelectTool/childStates/ScribbleBrushing.js.map +2 -2
  49. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
  50. package/dist-cjs/lib/ui/components/Dialogs.js +2 -14
  51. package/dist-cjs/lib/ui/components/Dialogs.js.map +2 -2
  52. package/dist-cjs/lib/ui/components/EditLinkDialog.js +11 -1
  53. package/dist-cjs/lib/ui/components/EditLinkDialog.js.map +2 -2
  54. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js +5 -4
  55. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js.map +2 -2
  56. package/dist-cjs/lib/ui/components/Toolbar/AltTextEditor.js.map +2 -2
  57. package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.js +2 -1
  58. package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.js.map +2 -2
  59. package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
  60. package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButton.js +2 -2
  61. package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButton.js.map +2 -2
  62. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +2 -1
  63. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
  64. package/dist-cjs/lib/ui/context/actions.js +17 -2
  65. package/dist-cjs/lib/ui/context/actions.js.map +2 -2
  66. package/dist-cjs/lib/ui/context/events.js.map +2 -2
  67. package/dist-cjs/lib/ui/hooks/menu-hooks.js.map +2 -2
  68. package/dist-cjs/lib/ui/hooks/useClipboardEvents.js +18 -16
  69. package/dist-cjs/lib/ui/hooks/useClipboardEvents.js.map +3 -3
  70. package/dist-cjs/lib/ui/hooks/useFlatten.js.map +2 -2
  71. package/dist-cjs/lib/ui/hooks/useTools.js.map +2 -2
  72. package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
  73. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +1 -0
  74. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
  75. package/dist-cjs/lib/ui/hooks/useTranslation/useTranslation.js +1 -0
  76. package/dist-cjs/lib/ui/hooks/useTranslation/useTranslation.js.map +2 -2
  77. package/dist-cjs/lib/ui/version.js +3 -3
  78. package/dist-cjs/lib/ui/version.js.map +1 -1
  79. package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js +8 -0
  80. package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js.map +2 -2
  81. package/dist-cjs/lib/utils/export/exportAs.js.map +2 -2
  82. package/dist-cjs/lib/utils/frames/frames.js.map +2 -2
  83. package/dist-cjs/lib/utils/tldr/buildFromV1Document.js.map +2 -2
  84. package/dist-esm/index.d.mts +17 -7
  85. package/dist-esm/index.mjs +1 -1
  86. package/dist-esm/lib/bindings/arrow/ArrowBindingUtil.mjs.map +2 -2
  87. package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs +6 -2
  88. package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs.map +2 -2
  89. package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +2 -2
  90. package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
  91. package/dist-esm/lib/shapes/arrow/arrowLabel.mjs.map +2 -2
  92. package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs.map +2 -2
  93. package/dist-esm/lib/shapes/arrow/elbow/elbowArrowSnapLines.mjs.map +2 -2
  94. package/dist-esm/lib/shapes/arrow/shared.mjs.map +2 -2
  95. package/dist-esm/lib/shapes/arrow/toolStates/Pointing.mjs.map +2 -2
  96. package/dist-esm/lib/shapes/bookmark/bookmarks.mjs.map +2 -2
  97. package/dist-esm/lib/shapes/draw/toolStates/Drawing.mjs.map +2 -2
  98. package/dist-esm/lib/shapes/embed/EmbedShapeUtil.mjs.map +2 -2
  99. package/dist-esm/lib/shapes/frame/FrameShapeTool.mjs.map +1 -1
  100. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs +65 -38
  101. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs.map +2 -2
  102. package/dist-esm/lib/shapes/geo/toolStates/Pointing.mjs.map +2 -2
  103. package/dist-esm/lib/shapes/line/toolStates/Pointing.mjs.map +2 -2
  104. package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +5 -5
  105. package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs.map +2 -2
  106. package/dist-esm/lib/shapes/note/noteHelpers.mjs.map +2 -2
  107. package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs.map +2 -2
  108. package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
  109. package/dist-esm/lib/shapes/shared/ShapeFill.mjs +3 -0
  110. package/dist-esm/lib/shapes/shared/ShapeFill.mjs.map +2 -2
  111. package/dist-esm/lib/shapes/shared/crop.mjs +1 -0
  112. package/dist-esm/lib/shapes/shared/crop.mjs.map +2 -2
  113. package/dist-esm/lib/shapes/shared/useEditablePlainText.mjs.map +2 -2
  114. package/dist-esm/lib/shapes/shared/useEditableRichText.mjs.map +2 -2
  115. package/dist-esm/lib/shapes/text/toolStates/Pointing.mjs.map +2 -2
  116. package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs.map +2 -2
  117. package/dist-esm/lib/tools/EraserTool/childStates/Pointing.mjs +1 -4
  118. package/dist-esm/lib/tools/EraserTool/childStates/Pointing.mjs.map +2 -2
  119. package/dist-esm/lib/tools/SelectTool/DragAndDropManager.mjs +1 -4
  120. package/dist-esm/lib/tools/SelectTool/DragAndDropManager.mjs.map +2 -2
  121. package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs.map +2 -2
  122. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Idle.mjs.map +2 -2
  123. package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs +15 -7
  124. package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs.map +2 -2
  125. package/dist-esm/lib/tools/SelectTool/childStates/EditingShape.mjs.map +2 -2
  126. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +2 -2
  127. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
  128. package/dist-esm/lib/tools/SelectTool/childStates/PointingArrowLabel.mjs.map +2 -2
  129. package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs +1 -4
  130. package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs.map +2 -2
  131. package/dist-esm/lib/tools/SelectTool/childStates/PointingSelection.mjs.map +2 -2
  132. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
  133. package/dist-esm/lib/tools/SelectTool/childStates/ScribbleBrushing.mjs.map +2 -2
  134. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
  135. package/dist-esm/lib/ui/components/Dialogs.mjs +2 -14
  136. package/dist-esm/lib/ui/components/Dialogs.mjs.map +2 -2
  137. package/dist-esm/lib/ui/components/EditLinkDialog.mjs +11 -1
  138. package/dist-esm/lib/ui/components/EditLinkDialog.mjs.map +2 -2
  139. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +5 -5
  140. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +2 -2
  141. package/dist-esm/lib/ui/components/Toolbar/AltTextEditor.mjs.map +2 -2
  142. package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.mjs +2 -1
  143. package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.mjs.map +2 -2
  144. package/dist-esm/lib/ui/components/menu-items.mjs +1 -4
  145. package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
  146. package/dist-esm/lib/ui/components/primitives/Button/TldrawUiButton.mjs +2 -2
  147. package/dist-esm/lib/ui/components/primitives/Button/TldrawUiButton.mjs.map +2 -2
  148. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +2 -1
  149. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
  150. package/dist-esm/lib/ui/context/actions.mjs +17 -2
  151. package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
  152. package/dist-esm/lib/ui/context/events.mjs.map +2 -2
  153. package/dist-esm/lib/ui/hooks/menu-hooks.mjs +1 -4
  154. package/dist-esm/lib/ui/hooks/menu-hooks.mjs.map +2 -2
  155. package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs +18 -16
  156. package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs.map +3 -3
  157. package/dist-esm/lib/ui/hooks/useFlatten.mjs.map +2 -2
  158. package/dist-esm/lib/ui/hooks/useTools.mjs.map +2 -2
  159. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +1 -0
  160. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
  161. package/dist-esm/lib/ui/hooks/useTranslation/useTranslation.mjs +1 -0
  162. package/dist-esm/lib/ui/hooks/useTranslation/useTranslation.mjs.map +2 -2
  163. package/dist-esm/lib/ui/version.mjs +3 -3
  164. package/dist-esm/lib/ui/version.mjs.map +1 -1
  165. package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs +8 -0
  166. package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs.map +2 -2
  167. package/dist-esm/lib/utils/export/exportAs.mjs +1 -3
  168. package/dist-esm/lib/utils/export/exportAs.mjs.map +2 -2
  169. package/dist-esm/lib/utils/frames/frames.mjs.map +2 -2
  170. package/dist-esm/lib/utils/tldr/buildFromV1Document.mjs.map +2 -2
  171. package/package.json +10 -10
  172. package/src/lib/bindings/arrow/ArrowBindingUtil.ts +1 -1
  173. package/src/lib/canvas/TldrawSelectionForeground.tsx +18 -7
  174. package/src/lib/defaultExternalContentHandlers.ts +3 -4
  175. package/src/lib/shapes/arrow/ArrowShapeUtil.test.ts +2 -2
  176. package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +1 -1
  177. package/src/lib/shapes/arrow/arrowLabel.ts +1 -1
  178. package/src/lib/shapes/arrow/arrowTargetState.ts +1 -1
  179. package/src/lib/shapes/arrow/elbow/elbowArrowSnapLines.tsx +3 -3
  180. package/src/lib/shapes/arrow/shared.ts +4 -4
  181. package/src/lib/shapes/arrow/toolStates/Pointing.tsx +1 -1
  182. package/src/lib/shapes/bookmark/bookmarks.ts +3 -3
  183. package/src/lib/shapes/draw/toolStates/Drawing.ts +4 -4
  184. package/src/lib/shapes/embed/EmbedShapeUtil.tsx +1 -1
  185. package/src/lib/shapes/frame/FrameShapeTool.ts +1 -1
  186. package/src/lib/shapes/frame/components/FrameLabelInput.tsx +48 -24
  187. package/src/lib/shapes/geo/GeoShapeUtil.test.tsx +10 -2
  188. package/src/lib/shapes/geo/toolStates/Pointing.ts +3 -3
  189. package/src/lib/shapes/line/LineShapeTool.test.ts +6 -6
  190. package/src/lib/shapes/line/LineShapeUtil.test.tsx +5 -5
  191. package/src/lib/shapes/line/toolStates/Pointing.ts +1 -1
  192. package/src/lib/shapes/note/NoteShapeTool.test.ts +2 -1
  193. package/src/lib/shapes/note/NoteShapeUtil.tsx +6 -5
  194. package/src/lib/shapes/note/noteHelpers.ts +2 -2
  195. package/src/lib/shapes/shared/PlainTextLabel.tsx +2 -1
  196. package/src/lib/shapes/shared/RichTextLabel.tsx +2 -1
  197. package/src/lib/shapes/shared/ShapeFill.tsx +3 -0
  198. package/src/lib/shapes/shared/crop.ts +1 -0
  199. package/src/lib/shapes/shared/useEditablePlainText.ts +7 -3
  200. package/src/lib/shapes/shared/useEditableRichText.ts +7 -3
  201. package/src/lib/shapes/text/TextShapeTool.test.ts +4 -4
  202. package/src/lib/shapes/text/toolStates/Pointing.ts +1 -1
  203. package/src/lib/tools/EraserTool/childStates/Erasing.ts +3 -5
  204. package/src/lib/tools/EraserTool/childStates/Pointing.ts +3 -16
  205. package/src/lib/tools/SelectTool/DragAndDropManager.ts +2 -4
  206. package/src/lib/tools/SelectTool/childStates/Brushing.ts +2 -6
  207. package/src/lib/tools/SelectTool/childStates/Crop/children/Idle.ts +2 -3
  208. package/src/lib/tools/SelectTool/childStates/DraggingHandle.tsx +23 -15
  209. package/src/lib/tools/SelectTool/childStates/EditingShape.ts +2 -4
  210. package/src/lib/tools/SelectTool/childStates/Idle.ts +8 -12
  211. package/src/lib/tools/SelectTool/childStates/PointingArrowLabel.ts +1 -1
  212. package/src/lib/tools/SelectTool/childStates/PointingHandle.ts +4 -12
  213. package/src/lib/tools/SelectTool/childStates/PointingSelection.ts +2 -2
  214. package/src/lib/tools/SelectTool/childStates/Resizing.ts +2 -4
  215. package/src/lib/tools/SelectTool/childStates/ScribbleBrushing.ts +2 -4
  216. package/src/lib/tools/SelectTool/childStates/Translating.ts +1 -3
  217. package/src/lib/ui/components/Dialogs.tsx +2 -14
  218. package/src/lib/ui/components/EditLinkDialog.tsx +16 -6
  219. package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +6 -5
  220. package/src/lib/ui/components/Toolbar/AltTextEditor.tsx +2 -2
  221. package/src/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.tsx +4 -1
  222. package/src/lib/ui/components/menu-items.tsx +6 -14
  223. package/src/lib/ui/components/primitives/Button/TldrawUiButton.tsx +3 -2
  224. package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +1 -0
  225. package/src/lib/ui/context/actions.tsx +25 -13
  226. package/src/lib/ui/context/events.tsx +1 -0
  227. package/src/lib/ui/hooks/menu-hooks.ts +9 -19
  228. package/src/lib/ui/hooks/useClipboardEvents.ts +12 -9
  229. package/src/lib/ui/hooks/useFlatten.ts +1 -2
  230. package/src/lib/ui/hooks/useTools.tsx +1 -2
  231. package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +1 -0
  232. package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +1 -0
  233. package/src/lib/ui/hooks/useTranslation/useTranslation.tsx +2 -1
  234. package/src/lib/ui/version.ts +3 -3
  235. package/src/lib/ui.css +4 -6
  236. package/src/lib/utils/excalidraw/putExcalidrawContent.ts +8 -0
  237. package/src/lib/utils/export/exportAs.ts +2 -9
  238. package/src/lib/utils/frames/frames.ts +1 -1
  239. package/src/lib/utils/tldr/buildFromV1Document.ts +12 -17
  240. package/src/test/Editor.test.tsx +38 -12
  241. package/src/test/SelectTool.test.ts +11 -19
  242. package/src/test/TestEditor.ts +1 -4
  243. package/src/test/TldrawEditor.test.tsx +87 -40
  244. package/src/test/bindings.test.tsx +29 -25
  245. package/src/test/bindingsIndex.test.tsx +4 -4
  246. package/src/test/commands/createShape.test.ts +64 -0
  247. package/src/test/commands/createShapes.test.ts +15 -1
  248. package/src/test/commands/getSvgString.test.ts +2 -2
  249. package/src/test/commands/isShapeOfType.test.ts +44 -0
  250. package/src/test/commands/putContent.test.ts +1 -0
  251. package/src/test/commands/updateShape.test.ts +67 -0
  252. package/src/test/commands/updateShapes.test.ts +21 -5
  253. package/src/test/custom-clipping.test.ts +36 -35
  254. package/src/test/customSnapping.test.tsx +254 -54
  255. package/src/test/duplicate.test.ts +1 -1
  256. package/src/test/frames.test.ts +2 -2
  257. package/src/test/getCulledShapes.test.tsx +11 -3
  258. package/src/test/getShapeAtPoint.test.ts +2 -2
  259. package/src/test/groups.test.tsx +6 -3
  260. package/src/test/resizing.test.ts +9 -13
  261. package/src/test/selection-omnibus.test.ts +11 -11
  262. package/src/test/shapeutils.test.ts +1 -1
  263. package/src/test/styles2.test.tsx +1 -1
  264. package/src/test/styles3.test.ts +5 -5
  265. package/src/test/test-jsx.tsx +69 -57
  266. package/src/test/text.test.ts +15 -17
  267. package/src/test/translating.test.ts +6 -8
  268. package/tldraw.css +4 -6
@@ -15,6 +15,7 @@ import { Editor } from '@tldraw/editor';
15
15
  import { ElbowArrowSnap } from '@tldraw/editor';
16
16
  import { Extension } from '@tiptap/core';
17
17
  import { Extensions } from '@tiptap/core';
18
+ import { ExtractShapeByProps } from '@tldraw/editor';
18
19
  import { ForwardRefExoticComponent } from 'react';
19
20
  import { Geometry2d } from '@tldraw/editor';
20
21
  import { Geometry2dFilters } from '@tldraw/editor';
@@ -1615,7 +1616,7 @@ export declare interface FrameShapeOptions {
1615
1616
  export declare class FrameShapeTool extends BaseBoxShapeTool {
1616
1617
  static id: string;
1617
1618
  static initial: string;
1618
- shapeType: string;
1619
+ shapeType: "frame";
1619
1620
  onCreate(shape: null | TLShape): void;
1620
1621
  }
1621
1622
 
@@ -2414,7 +2415,9 @@ export declare const PlainTextLabel: React_3.NamedExoticComponent<PlainTextLabel
2414
2415
  /** @public */
2415
2416
  export declare interface PlainTextLabelProps {
2416
2417
  shapeId: TLShapeId;
2417
- type: string;
2418
+ type: ExtractShapeByProps<{
2419
+ text: string;
2420
+ }>['type'];
2418
2421
  font: TLDefaultFontStyle;
2419
2422
  fontSize: number;
2420
2423
  lineHeight: number;
@@ -2556,7 +2559,9 @@ export declare const RichTextLabel: React_3.NamedExoticComponent<RichTextLabelPr
2556
2559
  /** @public */
2557
2560
  export declare interface RichTextLabelProps {
2558
2561
  shapeId: TLShapeId;
2559
- type: string;
2562
+ type: ExtractShapeByProps<{
2563
+ richText: TLRichText;
2564
+ }>['type'];
2560
2565
  font: TLDefaultFontStyle;
2561
2566
  fontSize: number;
2562
2567
  lineHeight: number;
@@ -3566,6 +3571,7 @@ export declare interface TLUiButtonProps extends React_2.HTMLAttributes<HTMLButt
3566
3571
  disabled?: boolean;
3567
3572
  isActive?: boolean;
3568
3573
  type: 'danger' | 'help' | 'icon' | 'low' | 'menu' | 'normal' | 'primary' | 'tool';
3574
+ htmlButtonType?: 'button' | 'reset' | 'submit';
3569
3575
  }
3570
3576
 
3571
3577
  /** @public */
@@ -3942,7 +3948,7 @@ export declare interface TLUiEventMap {
3942
3948
  }
3943
3949
 
3944
3950
  /** @public */
3945
- export declare type TLUiEventSource = 'actions-menu' | 'context-menu' | 'debug-panel' | 'dialog' | 'document-name' | 'export-menu' | 'help-menu' | 'helper-buttons' | 'image-toolbar' | 'kbd' | 'main-menu' | 'menu' | 'navigation-zone' | 'page-menu' | 'people-menu' | 'quick-actions' | 'rich-text-menu' | 'share-menu' | 'style-panel' | 'toolbar' | 'unknown' | 'video-toolbar' | 'zoom-menu';
3951
+ export declare type TLUiEventSource = 'actions-menu' | 'context-menu' | 'debug-panel' | 'dialog' | 'document-name' | 'export-menu' | 'fairy-panel' | 'help-menu' | 'helper-buttons' | 'image-toolbar' | 'kbd' | 'main-menu' | 'menu' | 'navigation-zone' | 'page-menu' | 'people-menu' | 'quick-actions' | 'rich-text-menu' | 'share-menu' | 'style-panel' | 'toolbar' | 'unknown' | 'video-toolbar' | 'zoom-menu';
3946
3952
 
3947
3953
  /** @public */
3948
3954
  export declare interface TLUiHelperButtonsProps {
@@ -4333,7 +4339,7 @@ export declare interface TLUiTranslation {
4333
4339
  export declare type TLUiTranslationContextType = TLUiTranslation;
4334
4340
 
4335
4341
  /** @public */
4336
- export declare type TLUiTranslationKey = 'a11y.adjust-shape-styles' | 'a11y.enlarge-shape' | 'a11y.enter-leave-container' | 'a11y.move-shape-faster' | 'a11y.move-shape' | 'a11y.multiple-shapes' | 'a11y.open-context-menu' | 'a11y.open-keyboard-shortcuts' | 'a11y.pan-camera' | 'a11y.repeat-shape' | 'a11y.rotate-shape-ccw-fine' | 'a11y.rotate-shape-ccw' | 'a11y.rotate-shape-cw-fine' | 'a11y.rotate-shape-cw' | 'a11y.select-shape-direction' | 'a11y.select-shape' | 'a11y.shape-image' | 'a11y.shape-index' | 'a11y.shape-video' | 'a11y.shrink-shape' | 'a11y.skip-to-main-content' | 'a11y.status' | 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.enhanced-a11y-mode.menu' | 'action.enhanced-a11y-mode' | 'action.exit-pen-mode' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flatten-to-image' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project-on-tldraw' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.open-kbd-shortcuts' | 'action.pack' | 'action.paste-error-description' | 'action.paste-error-title' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-none' | 'action.toggle-auto-pan' | 'action.toggle-auto-size' | 'action.toggle-auto-zoom' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-keyboard-shortcuts.menu' | 'action.toggle-keyboard-shortcuts' | 'action.toggle-lock' | 'action.toggle-mouse' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-trackpad' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'app.loading' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'assets.files.amount-too-many' | 'assets.files.maximum-size' | 'assets.files.size-too-big' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.url.failed' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.white' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.edit' | 'context-menu.export-all-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context-menu.title' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'document-name-menu.copy-link' | 'document.default-name' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.external-link' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.fill' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'handle.crop.bottom-left' | 'handle.crop.bottom-right' | 'handle.crop.bottom' | 'handle.crop.left' | 'handle.crop.right' | 'handle.crop.top-left' | 'handle.crop.top-right' | 'handle.crop.top' | 'handle.resize-bottom-left' | 'handle.resize-bottom-right' | 'handle.resize-bottom' | 'handle.resize-left' | 'handle.resize-right' | 'handle.resize-top-left' | 'handle.resize-top-right' | 'handle.resize-top' | 'handle.rotate.bottom_left_rotate' | 'handle.rotate.bottom_right_rotate' | 'handle.rotate.mobile_rotate' | 'handle.rotate.top_left_rotate' | 'handle.rotate.top_right_rotate' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.import-tldr-file' | 'help-menu.keyboard-shortcuts' | 'help-menu.privacy' | 'help-menu.terms' | 'help-menu.title' | 'help-menu.twitter' | 'menu.accessibility' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.input-mode' | 'menu.language' | 'menu.preferences' | 'menu.theme' | 'menu.title' | 'menu.view' | 'navigation-zone.minimap' | 'navigation-zone.title' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.anonymous-user' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'share-menu.copied' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.creating-project' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.text-formatting' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'style-panel.align' | 'style-panel.arrow-kind' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.label-align' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.selected' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'theme.dark' | 'theme.light' | 'theme.system' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'toast.error' | 'toast.info' | 'toast.success' | 'toast.warning' | 'tool-panel.more' | 'tool-panel.title' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.wide' | 'tool.aspect-ratio' | 'tool.bookmark' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.flip-horz' | 'tool.flip-vert' | 'tool.frame' | 'tool.hand' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.image-crop-confirm' | 'tool.image-crop' | 'tool.image-toolbar-title' | 'tool.image-zoom' | 'tool.laser' | 'tool.line' | 'tool.media-alt-text-confirm' | 'tool.media-alt-text-desc' | 'tool.media-alt-text' | 'tool.media' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.pointer-down' | 'tool.rectangle' | 'tool.replace-media' | 'tool.rhombus' | 'tool.rich-text-bold' | 'tool.rich-text-bulletList' | 'tool.rich-text-code' | 'tool.rich-text-header' | 'tool.rich-text-highlight' | 'tool.rich-text-italic' | 'tool.rich-text-link-remove' | 'tool.rich-text-link-visit' | 'tool.rich-text-link' | 'tool.rich-text-orderedList' | 'tool.rich-text-strikethrough' | 'tool.rich-text-toolbar-title' | 'tool.rotate-cw' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'ui.checked' | 'ui.close' | 'ui.unchecked' | 'verticalAlign-style.end' | 'verticalAlign-style.middle' | 'verticalAlign-style.start' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
4342
+ export declare type TLUiTranslationKey = 'a11y.adjust-shape-styles' | 'a11y.enlarge-shape' | 'a11y.enter-leave-container' | 'a11y.move-shape-faster' | 'a11y.move-shape' | 'a11y.multiple-shapes' | 'a11y.open-context-menu' | 'a11y.open-keyboard-shortcuts' | 'a11y.pan-camera' | 'a11y.repeat-shape' | 'a11y.rotate-shape-ccw-fine' | 'a11y.rotate-shape-ccw' | 'a11y.rotate-shape-cw-fine' | 'a11y.rotate-shape-cw' | 'a11y.select-shape-direction' | 'a11y.select-shape' | 'a11y.shape-image' | 'a11y.shape-index' | 'a11y.shape-video' | 'a11y.shrink-shape' | 'a11y.skip-to-main-content' | 'a11y.status' | 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.enhanced-a11y-mode.menu' | 'action.enhanced-a11y-mode' | 'action.exit-pen-mode' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flatten-to-image' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project-on-tldraw' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.open-kbd-shortcuts' | 'action.pack' | 'action.paste-error-description' | 'action.paste-error-title' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-none' | 'action.toggle-auto-pan' | 'action.toggle-auto-size' | 'action.toggle-auto-zoom' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-keyboard-shortcuts.menu' | 'action.toggle-keyboard-shortcuts' | 'action.toggle-lock' | 'action.toggle-mouse' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-trackpad' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'app.loading' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'assets.files.amount-too-many' | 'assets.files.maximum-size' | 'assets.files.size-too-big' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.url.failed' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.white' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.edit' | 'context-menu.export-all-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context-menu.title' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'document-name-menu.copy-link' | 'document.default-name' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.external-link' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.fill' | 'fill-style.lined-fill' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'handle.crop.bottom-left' | 'handle.crop.bottom-right' | 'handle.crop.bottom' | 'handle.crop.left' | 'handle.crop.right' | 'handle.crop.top-left' | 'handle.crop.top-right' | 'handle.crop.top' | 'handle.resize-bottom-left' | 'handle.resize-bottom-right' | 'handle.resize-bottom' | 'handle.resize-left' | 'handle.resize-right' | 'handle.resize-top-left' | 'handle.resize-top-right' | 'handle.resize-top' | 'handle.rotate.bottom_left_rotate' | 'handle.rotate.bottom_right_rotate' | 'handle.rotate.mobile_rotate' | 'handle.rotate.top_left_rotate' | 'handle.rotate.top_right_rotate' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.import-tldr-file' | 'help-menu.keyboard-shortcuts' | 'help-menu.privacy' | 'help-menu.terms' | 'help-menu.title' | 'help-menu.twitter' | 'menu.accessibility' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.input-mode' | 'menu.language' | 'menu.preferences' | 'menu.theme' | 'menu.title' | 'menu.view' | 'navigation-zone.minimap' | 'navigation-zone.title' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.anonymous-user' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'share-menu.copied' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.creating-project' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.text-formatting' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'style-panel.align' | 'style-panel.arrow-kind' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.label-align' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.selected' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'theme.dark' | 'theme.light' | 'theme.system' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'toast.error' | 'toast.info' | 'toast.success' | 'toast.warning' | 'tool-panel.more' | 'tool-panel.title' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.wide' | 'tool.aspect-ratio' | 'tool.bookmark' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.flip-horz' | 'tool.flip-vert' | 'tool.frame' | 'tool.hand' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.image-crop-confirm' | 'tool.image-crop' | 'tool.image-toolbar-title' | 'tool.image-zoom' | 'tool.laser' | 'tool.line' | 'tool.media-alt-text-confirm' | 'tool.media-alt-text-desc' | 'tool.media-alt-text' | 'tool.media' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.pointer-down' | 'tool.rectangle' | 'tool.replace-media' | 'tool.rhombus' | 'tool.rich-text-bold' | 'tool.rich-text-bulletList' | 'tool.rich-text-code' | 'tool.rich-text-header' | 'tool.rich-text-highlight' | 'tool.rich-text-italic' | 'tool.rich-text-link-remove' | 'tool.rich-text-link-visit' | 'tool.rich-text-link' | 'tool.rich-text-orderedList' | 'tool.rich-text-strikethrough' | 'tool.rich-text-toolbar-title' | 'tool.rotate-cw' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'ui.checked' | 'ui.close' | 'ui.unchecked' | 'verticalAlign-style.end' | 'verticalAlign-style.middle' | 'verticalAlign-style.start' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
4337
4343
 
4338
4344
  /** @public */
4339
4345
  export declare interface TLUiTranslationProviderProps {
@@ -4613,7 +4619,9 @@ export declare function useDefaultHelpers(): {
4613
4619
  export declare function useDialogs(): TLUiDialogsContextType;
4614
4620
 
4615
4621
  /** @public */
4616
- export declare function useEditablePlainText(shapeId: TLShapeId, type: string, text?: string): {
4622
+ export declare function useEditablePlainText(shapeId: TLShapeId, type: ExtractShapeByProps<{
4623
+ text: string;
4624
+ }>['type'], text?: string): {
4617
4625
  handleBlur: () => void;
4618
4626
  handleChange: ({ plaintext }: {
4619
4627
  plaintext: string;
@@ -4632,7 +4640,9 @@ export declare function useEditablePlainText(shapeId: TLShapeId, type: string, t
4632
4640
  };
4633
4641
 
4634
4642
  /** @public */
4635
- export declare function useEditableRichText(shapeId: TLShapeId, type: string, richText?: TLRichText): {
4643
+ export declare function useEditableRichText(shapeId: TLShapeId, type: ExtractShapeByProps<{
4644
+ richText: TLRichText;
4645
+ }>['type'], richText?: TLRichText): {
4636
4646
  handleBlur: () => void;
4637
4647
  handleChange: ({ richText }: {
4638
4648
  richText: TLRichText;
package/dist-cjs/index.js CHANGED
@@ -584,7 +584,7 @@ var import_buildFromV1Document = require("./lib/utils/tldr/buildFromV1Document")
584
584
  var import_file = require("./lib/utils/tldr/file");
585
585
  (0, import_editor.registerTldrawLibraryVersion)(
586
586
  "tldraw",
587
- "4.2.0-next.f100cedfc45b",
587
+ "4.3.0-canary.03ae87dcc44b",
588
588
  "cjs"
589
589
  );
590
590
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/bindings/arrow/ArrowBindingUtil.ts"],
4
- "sourcesContent": ["import {\n\tBindingOnChangeOptions,\n\tBindingOnCreateOptions,\n\tBindingOnShapeChangeOptions,\n\tBindingOnShapeIsolateOptions,\n\tBindingUtil,\n\tEditor,\n\tIndexKey,\n\tTLArrowBinding,\n\tTLArrowBindingProps,\n\tTLArrowShape,\n\tTLParentId,\n\tTLShape,\n\tTLShapeId,\n\tTLShapePartial,\n\tVec,\n\tapproximately,\n\tarrowBindingMigrations,\n\tarrowBindingProps,\n\tassert,\n\tgetIndexAbove,\n\tgetIndexBetween,\n\tintersectLineSegmentCircle,\n} from '@tldraw/editor'\nimport { getArrowBindings, getArrowInfo, removeArrowBinding } from '../../shapes/arrow/shared'\n\n/**\n * @public\n */\nexport class ArrowBindingUtil extends BindingUtil<TLArrowBinding> {\n\tstatic override type = 'arrow'\n\n\tstatic override props = arrowBindingProps\n\tstatic override migrations = arrowBindingMigrations\n\n\toverride getDefaultProps(): Partial<TLArrowBindingProps> {\n\t\treturn {\n\t\t\tisPrecise: false,\n\t\t\tisExact: false,\n\t\t\tnormalizedAnchor: { x: 0.5, y: 0.5 },\n\t\t\tsnap: 'none',\n\t\t}\n\t}\n\n\t// when the binding itself changes\n\toverride onAfterCreate({ binding }: BindingOnCreateOptions<TLArrowBinding>): void {\n\t\tconst arrow = this.editor.getShape(binding.fromId) as TLArrowShape | undefined\n\t\tif (!arrow) return\n\t\tarrowDidUpdate(this.editor, arrow)\n\t}\n\n\t// when the binding itself changes\n\toverride onAfterChange({ bindingAfter }: BindingOnChangeOptions<TLArrowBinding>): void {\n\t\tconst arrow = this.editor.getShape(bindingAfter.fromId) as TLArrowShape | undefined\n\t\tif (!arrow) return\n\t\tarrowDidUpdate(this.editor, arrow)\n\t}\n\n\t// when the arrow itself changes\n\toverride onAfterChangeFromShape({\n\t\tshapeAfter,\n\t}: BindingOnShapeChangeOptions<TLArrowBinding>): void {\n\t\tarrowDidUpdate(this.editor, shapeAfter as TLArrowShape)\n\t}\n\n\t// when the shape an arrow is bound to changes\n\toverride onAfterChangeToShape({\n\t\tbinding,\n\t\tshapeBefore,\n\t\tshapeAfter,\n\t\treason,\n\t}: BindingOnShapeChangeOptions<TLArrowBinding>): void {\n\t\tif (\n\t\t\treason !== 'ancestry' &&\n\t\t\tshapeBefore.parentId === shapeAfter.parentId &&\n\t\t\tshapeBefore.index === shapeAfter.index\n\t\t) {\n\t\t\treturn\n\t\t}\n\t\treparentArrow(this.editor, binding.fromId)\n\t}\n\n\t// when the arrow is isolated we need to update it's x,y positions\n\toverride onBeforeIsolateFromShape({\n\t\tbinding,\n\t}: BindingOnShapeIsolateOptions<TLArrowBinding>): void {\n\t\tconst arrow = this.editor.getShape<TLArrowShape>(binding.fromId)\n\t\tif (!arrow) return\n\t\tupdateArrowTerminal({\n\t\t\teditor: this.editor,\n\t\t\tarrow,\n\t\t\tterminal: binding.props.terminal,\n\t\t})\n\t}\n}\n\nfunction reparentArrow(editor: Editor, arrowId: TLShapeId) {\n\tconst arrow = editor.getShape<TLArrowShape>(arrowId)\n\tif (!arrow) return\n\tconst bindings = getArrowBindings(editor, arrow)\n\tconst { start, end } = bindings\n\tconst startShape = start ? editor.getShape(start.toId) : undefined\n\tconst endShape = end ? editor.getShape(end.toId) : undefined\n\n\tconst parentPageId = editor.getAncestorPageId(arrow)\n\tif (!parentPageId) return\n\n\tlet nextParentId: TLParentId\n\tif (startShape && endShape) {\n\t\t// if arrow has two bindings, always parent arrow to closest common ancestor of the bindings\n\t\tnextParentId = editor.findCommonAncestor([startShape, endShape]) ?? parentPageId\n\t} else if (startShape || endShape) {\n\t\tconst bindingParentId = (startShape || endShape)?.parentId\n\t\t// If the arrow and the shape that it is bound to have the same parent, then keep that parent\n\t\tif (bindingParentId && bindingParentId === arrow.parentId) {\n\t\t\tnextParentId = arrow.parentId\n\t\t} else {\n\t\t\t// if arrow has one binding, keep arrow on its own page\n\t\t\tnextParentId = parentPageId\n\t\t}\n\t} else {\n\t\treturn\n\t}\n\n\tif (nextParentId && nextParentId !== arrow.parentId) {\n\t\teditor.reparentShapes([arrowId], nextParentId)\n\t}\n\n\tconst reparentedArrow = editor.getShape<TLArrowShape>(arrowId)\n\tif (!reparentedArrow) throw Error('no reparented arrow')\n\n\tconst startSibling = editor.getShapeNearestSibling(reparentedArrow, startShape)\n\tconst endSibling = editor.getShapeNearestSibling(reparentedArrow, endShape)\n\n\tlet highestSibling: TLShape | undefined\n\n\tif (startSibling && endSibling) {\n\t\thighestSibling = startSibling.index > endSibling.index ? startSibling : endSibling\n\t} else if (startSibling && !endSibling) {\n\t\thighestSibling = startSibling\n\t} else if (endSibling && !startSibling) {\n\t\thighestSibling = endSibling\n\t} else {\n\t\treturn\n\t}\n\n\tlet finalIndex: IndexKey\n\n\tconst higherSiblings = editor\n\t\t.getSortedChildIdsForParent(highestSibling.parentId)\n\t\t.map((id) => editor.getShape(id)!)\n\t\t.filter((sibling) => sibling.index > highestSibling!.index)\n\n\tif (higherSiblings.length) {\n\t\t// there are siblings above the highest bound sibling, we need to\n\t\t// insert between them.\n\n\t\t// if the next sibling is also a bound arrow though, we can end up\n\t\t// all fighting for the same indexes. so lets find the next\n\t\t// non-arrow sibling...\n\t\tconst nextHighestNonArrowSibling = higherSiblings.find((sibling) => sibling.type !== 'arrow')\n\n\t\tif (\n\t\t\t// ...then, if we're above the last shape we want to be above...\n\t\t\treparentedArrow.index > highestSibling.index &&\n\t\t\t// ...but below the next non-arrow sibling...\n\t\t\t(!nextHighestNonArrowSibling || reparentedArrow.index < nextHighestNonArrowSibling.index)\n\t\t) {\n\t\t\t// ...then we're already in the right place. no need to update!\n\t\t\treturn\n\t\t}\n\n\t\t// otherwise, we need to find the index between the highest sibling\n\t\t// we want to be above, and the next highest sibling we want to be\n\t\t// below:\n\t\tfinalIndex = getIndexBetween(highestSibling.index, higherSiblings[0].index)\n\t} else {\n\t\t// if there are no siblings above us, we can just get the next index:\n\t\tfinalIndex = getIndexAbove(highestSibling.index)\n\t}\n\n\tif (finalIndex !== reparentedArrow.index) {\n\t\teditor.updateShapes<TLArrowShape>([{ id: arrowId, type: 'arrow', index: finalIndex }])\n\t}\n}\n\nfunction arrowDidUpdate(editor: Editor, arrow: TLArrowShape) {\n\tconst bindings = getArrowBindings(editor, arrow)\n\t// if the shape is an arrow and its bound shape is on another page\n\t// or was deleted, unbind it\n\tfor (const handle of ['start', 'end'] as const) {\n\t\tconst binding = bindings[handle]\n\t\tif (!binding) continue\n\t\tconst boundShape = editor.getShape(binding.toId)\n\t\tconst isShapeInSamePageAsArrow =\n\t\t\teditor.getAncestorPageId(arrow) === editor.getAncestorPageId(boundShape)\n\t\tif (!boundShape || !isShapeInSamePageAsArrow) {\n\t\t\tupdateArrowTerminal({ editor, arrow, terminal: handle, unbind: true })\n\t\t}\n\t}\n\n\t// always check the arrow parents\n\treparentArrow(editor, arrow.id)\n}\n\n/** @internal */\nexport function updateArrowTerminal({\n\teditor,\n\tarrow,\n\tterminal,\n\tunbind = false,\n\tuseHandle = false,\n}: {\n\teditor: Editor\n\tarrow: TLArrowShape\n\tterminal: 'start' | 'end'\n\tunbind?: boolean\n\tuseHandle?: boolean\n}) {\n\tconst info = getArrowInfo(editor, arrow)\n\tif (!info) {\n\t\tthrow new Error('expected arrow info')\n\t}\n\n\tconst startPoint = useHandle ? info.start.handle : info.start.point\n\tconst endPoint = useHandle ? info.end.handle : info.end.point\n\tconst point = terminal === 'start' ? startPoint : endPoint\n\n\tconst update = {\n\t\tid: arrow.id,\n\t\ttype: 'arrow',\n\t\tprops: {\n\t\t\t[terminal]: { x: point.x, y: point.y },\n\t\t\tbend: arrow.props.bend,\n\t\t},\n\t} satisfies TLShapePartial<TLArrowShape>\n\n\t// fix up the bend:\n\tif (info.type === 'arc') {\n\t\t// find the new start/end points of the resulting arrow\n\t\tconst newStart = terminal === 'start' ? startPoint : info.start.handle\n\t\tconst newEnd = terminal === 'end' ? endPoint : info.end.handle\n\t\tconst newMidPoint = Vec.Med(newStart, newEnd)\n\n\t\t// intersect a line segment perpendicular to the new arrow with the old arrow arc to\n\t\t// find the new mid-point\n\t\tconst lineSegment = Vec.Sub(newStart, newEnd)\n\t\t\t.per()\n\t\t\t.uni()\n\t\t\t.mul(info.handleArc.radius * 2 * Math.sign(arrow.props.bend))\n\n\t\t// find the intersections with the old arrow arc:\n\t\tconst intersections = intersectLineSegmentCircle(\n\t\t\tinfo.handleArc.center,\n\t\t\tVec.Add(newMidPoint, lineSegment),\n\t\t\tinfo.handleArc.center,\n\t\t\tinfo.handleArc.radius\n\t\t)\n\n\t\tassert(intersections?.length === 1)\n\t\tconst bend = Vec.Dist(newMidPoint, intersections[0]) * Math.sign(arrow.props.bend)\n\t\t// use `approximately` to avoid endless update loops\n\t\tif (!approximately(bend, update.props.bend)) {\n\t\t\tupdate.props.bend = bend\n\t\t}\n\t}\n\n\teditor.updateShape(update)\n\tif (unbind) {\n\t\tremoveArrowBinding(editor, arrow, terminal)\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAuBO;AACP,oBAAmE;AAK5D,MAAM,yBAAyB,0BAA4B;AAAA,EACjE,OAAgB,OAAO;AAAA,EAEvB,OAAgB,QAAQ;AAAA,EACxB,OAAgB,aAAa;AAAA,EAEpB,kBAAgD;AACxD,WAAO;AAAA,MACN,WAAW;AAAA,MACX,SAAS;AAAA,MACT,kBAAkB,EAAE,GAAG,KAAK,GAAG,IAAI;AAAA,MACnC,MAAM;AAAA,IACP;AAAA,EACD;AAAA;AAAA,EAGS,cAAc,EAAE,QAAQ,GAAiD;AACjF,UAAM,QAAQ,KAAK,OAAO,SAAS,QAAQ,MAAM;AACjD,QAAI,CAAC,MAAO;AACZ,mBAAe,KAAK,QAAQ,KAAK;AAAA,EAClC;AAAA;AAAA,EAGS,cAAc,EAAE,aAAa,GAAiD;AACtF,UAAM,QAAQ,KAAK,OAAO,SAAS,aAAa,MAAM;AACtD,QAAI,CAAC,MAAO;AACZ,mBAAe,KAAK,QAAQ,KAAK;AAAA,EAClC;AAAA;AAAA,EAGS,uBAAuB;AAAA,IAC/B;AAAA,EACD,GAAsD;AACrD,mBAAe,KAAK,QAAQ,UAA0B;AAA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AK,UAAU;AAAA,IAChB;AAEA,8BAAO,eAAe,WAAW,CAAC;AAClC,UAAM,OAAO,kBAAI,KAAK,aAAa,cAAc,CAAC,CAAC,IAAI,KAAK,KAAK,MAAM,MAAM,IAAI;AAEjF,QAAI,KAAC,6BAAc,MAAM,OAAO,MAAM,IAAI,GAAG;AAC5C,aAAO,MAAM,OAAO;AAAA,IACrB;AAAA,EACD;AAEA,SAAO,YAAY,MAAM;AACzB,MAAI,QAAQ;AACX,0CAAmB,QAAQ,OAAO,QAAQ;AAAA,EAC3C;AACD;",
4
+ "sourcesContent": ["import {\n\tBindingOnChangeOptions,\n\tBindingOnCreateOptions,\n\tBindingOnShapeChangeOptions,\n\tBindingOnShapeIsolateOptions,\n\tBindingUtil,\n\tEditor,\n\tIndexKey,\n\tTLArrowBinding,\n\tTLArrowBindingProps,\n\tTLArrowShape,\n\tTLParentId,\n\tTLShape,\n\tTLShapeId,\n\tTLShapePartial,\n\tVec,\n\tapproximately,\n\tarrowBindingMigrations,\n\tarrowBindingProps,\n\tassert,\n\tgetIndexAbove,\n\tgetIndexBetween,\n\tintersectLineSegmentCircle,\n} from '@tldraw/editor'\nimport { getArrowBindings, getArrowInfo, removeArrowBinding } from '../../shapes/arrow/shared'\n\n/**\n * @public\n */\nexport class ArrowBindingUtil extends BindingUtil<TLArrowBinding> {\n\tstatic override type = 'arrow'\n\n\tstatic override props = arrowBindingProps\n\tstatic override migrations = arrowBindingMigrations\n\n\toverride getDefaultProps(): Partial<TLArrowBindingProps> {\n\t\treturn {\n\t\t\tisPrecise: false,\n\t\t\tisExact: false,\n\t\t\tnormalizedAnchor: { x: 0.5, y: 0.5 },\n\t\t\tsnap: 'none',\n\t\t}\n\t}\n\n\t// when the binding itself changes\n\toverride onAfterCreate({ binding }: BindingOnCreateOptions<TLArrowBinding>): void {\n\t\tconst arrow = this.editor.getShape(binding.fromId) as TLArrowShape | undefined\n\t\tif (!arrow) return\n\t\tarrowDidUpdate(this.editor, arrow)\n\t}\n\n\t// when the binding itself changes\n\toverride onAfterChange({ bindingAfter }: BindingOnChangeOptions<TLArrowBinding>): void {\n\t\tconst arrow = this.editor.getShape(bindingAfter.fromId) as TLArrowShape | undefined\n\t\tif (!arrow) return\n\t\tarrowDidUpdate(this.editor, arrow)\n\t}\n\n\t// when the arrow itself changes\n\toverride onAfterChangeFromShape({\n\t\tshapeAfter,\n\t}: BindingOnShapeChangeOptions<TLArrowBinding>): void {\n\t\tarrowDidUpdate(this.editor, shapeAfter as TLArrowShape)\n\t}\n\n\t// when the shape an arrow is bound to changes\n\toverride onAfterChangeToShape({\n\t\tbinding,\n\t\tshapeBefore,\n\t\tshapeAfter,\n\t\treason,\n\t}: BindingOnShapeChangeOptions<TLArrowBinding>): void {\n\t\tif (\n\t\t\treason !== 'ancestry' &&\n\t\t\tshapeBefore.parentId === shapeAfter.parentId &&\n\t\t\tshapeBefore.index === shapeAfter.index\n\t\t) {\n\t\t\treturn\n\t\t}\n\t\treparentArrow(this.editor, binding.fromId)\n\t}\n\n\t// when the arrow is isolated we need to update it's x,y positions\n\toverride onBeforeIsolateFromShape({\n\t\tbinding,\n\t}: BindingOnShapeIsolateOptions<TLArrowBinding>): void {\n\t\tconst arrow = this.editor.getShape<TLArrowShape>(binding.fromId)\n\t\tif (!arrow) return\n\t\tupdateArrowTerminal({\n\t\t\teditor: this.editor,\n\t\t\tarrow,\n\t\t\tterminal: binding.props.terminal,\n\t\t})\n\t}\n}\n\nfunction reparentArrow(editor: Editor, arrowId: TLShapeId) {\n\tconst arrow = editor.getShape<TLArrowShape>(arrowId)\n\tif (!arrow) return\n\tconst bindings = getArrowBindings(editor, arrow)\n\tconst { start, end } = bindings\n\tconst startShape = start ? editor.getShape(start.toId) : undefined\n\tconst endShape = end ? editor.getShape(end.toId) : undefined\n\n\tconst parentPageId = editor.getAncestorPageId(arrow)\n\tif (!parentPageId) return\n\n\tlet nextParentId: TLParentId\n\tif (startShape && endShape) {\n\t\t// if arrow has two bindings, always parent arrow to closest common ancestor of the bindings\n\t\tnextParentId = editor.findCommonAncestor([startShape, endShape]) ?? parentPageId\n\t} else if (startShape || endShape) {\n\t\tconst bindingParentId = (startShape || endShape)?.parentId\n\t\t// If the arrow and the shape that it is bound to have the same parent, then keep that parent\n\t\tif (bindingParentId && bindingParentId === arrow.parentId) {\n\t\t\tnextParentId = arrow.parentId\n\t\t} else {\n\t\t\t// if arrow has one binding, keep arrow on its own page\n\t\t\tnextParentId = parentPageId\n\t\t}\n\t} else {\n\t\treturn\n\t}\n\n\tif (nextParentId && nextParentId !== arrow.parentId) {\n\t\teditor.reparentShapes([arrowId], nextParentId)\n\t}\n\n\tconst reparentedArrow = editor.getShape<TLArrowShape>(arrowId)\n\tif (!reparentedArrow) throw Error('no reparented arrow')\n\n\tconst startSibling = editor.getShapeNearestSibling(reparentedArrow, startShape)\n\tconst endSibling = editor.getShapeNearestSibling(reparentedArrow, endShape)\n\n\tlet highestSibling: TLShape | undefined\n\n\tif (startSibling && endSibling) {\n\t\thighestSibling = startSibling.index > endSibling.index ? startSibling : endSibling\n\t} else if (startSibling && !endSibling) {\n\t\thighestSibling = startSibling\n\t} else if (endSibling && !startSibling) {\n\t\thighestSibling = endSibling\n\t} else {\n\t\treturn\n\t}\n\n\tlet finalIndex: IndexKey\n\n\tconst higherSiblings = editor\n\t\t.getSortedChildIdsForParent(highestSibling.parentId)\n\t\t.map((id) => editor.getShape(id)!)\n\t\t.filter((sibling) => sibling.index > highestSibling!.index)\n\n\tif (higherSiblings.length) {\n\t\t// there are siblings above the highest bound sibling, we need to\n\t\t// insert between them.\n\n\t\t// if the next sibling is also a bound arrow though, we can end up\n\t\t// all fighting for the same indexes. so lets find the next\n\t\t// non-arrow sibling...\n\t\tconst nextHighestNonArrowSibling = higherSiblings.find((sibling) => sibling.type !== 'arrow')\n\n\t\tif (\n\t\t\t// ...then, if we're above the last shape we want to be above...\n\t\t\treparentedArrow.index > highestSibling.index &&\n\t\t\t// ...but below the next non-arrow sibling...\n\t\t\t(!nextHighestNonArrowSibling || reparentedArrow.index < nextHighestNonArrowSibling.index)\n\t\t) {\n\t\t\t// ...then we're already in the right place. no need to update!\n\t\t\treturn\n\t\t}\n\n\t\t// otherwise, we need to find the index between the highest sibling\n\t\t// we want to be above, and the next highest sibling we want to be\n\t\t// below:\n\t\tfinalIndex = getIndexBetween(highestSibling.index, higherSiblings[0].index)\n\t} else {\n\t\t// if there are no siblings above us, we can just get the next index:\n\t\tfinalIndex = getIndexAbove(highestSibling.index)\n\t}\n\n\tif (finalIndex !== reparentedArrow.index) {\n\t\teditor.updateShapes([{ id: arrowId, type: 'arrow', index: finalIndex }])\n\t}\n}\n\nfunction arrowDidUpdate(editor: Editor, arrow: TLArrowShape) {\n\tconst bindings = getArrowBindings(editor, arrow)\n\t// if the shape is an arrow and its bound shape is on another page\n\t// or was deleted, unbind it\n\tfor (const handle of ['start', 'end'] as const) {\n\t\tconst binding = bindings[handle]\n\t\tif (!binding) continue\n\t\tconst boundShape = editor.getShape(binding.toId)\n\t\tconst isShapeInSamePageAsArrow =\n\t\t\teditor.getAncestorPageId(arrow) === editor.getAncestorPageId(boundShape)\n\t\tif (!boundShape || !isShapeInSamePageAsArrow) {\n\t\t\tupdateArrowTerminal({ editor, arrow, terminal: handle, unbind: true })\n\t\t}\n\t}\n\n\t// always check the arrow parents\n\treparentArrow(editor, arrow.id)\n}\n\n/** @internal */\nexport function updateArrowTerminal({\n\teditor,\n\tarrow,\n\tterminal,\n\tunbind = false,\n\tuseHandle = false,\n}: {\n\teditor: Editor\n\tarrow: TLArrowShape\n\tterminal: 'start' | 'end'\n\tunbind?: boolean\n\tuseHandle?: boolean\n}) {\n\tconst info = getArrowInfo(editor, arrow)\n\tif (!info) {\n\t\tthrow new Error('expected arrow info')\n\t}\n\n\tconst startPoint = useHandle ? info.start.handle : info.start.point\n\tconst endPoint = useHandle ? info.end.handle : info.end.point\n\tconst point = terminal === 'start' ? startPoint : endPoint\n\n\tconst update = {\n\t\tid: arrow.id,\n\t\ttype: 'arrow',\n\t\tprops: {\n\t\t\t[terminal]: { x: point.x, y: point.y },\n\t\t\tbend: arrow.props.bend,\n\t\t},\n\t} satisfies TLShapePartial<TLArrowShape>\n\n\t// fix up the bend:\n\tif (info.type === 'arc') {\n\t\t// find the new start/end points of the resulting arrow\n\t\tconst newStart = terminal === 'start' ? startPoint : info.start.handle\n\t\tconst newEnd = terminal === 'end' ? endPoint : info.end.handle\n\t\tconst newMidPoint = Vec.Med(newStart, newEnd)\n\n\t\t// intersect a line segment perpendicular to the new arrow with the old arrow arc to\n\t\t// find the new mid-point\n\t\tconst lineSegment = Vec.Sub(newStart, newEnd)\n\t\t\t.per()\n\t\t\t.uni()\n\t\t\t.mul(info.handleArc.radius * 2 * Math.sign(arrow.props.bend))\n\n\t\t// find the intersections with the old arrow arc:\n\t\tconst intersections = intersectLineSegmentCircle(\n\t\t\tinfo.handleArc.center,\n\t\t\tVec.Add(newMidPoint, lineSegment),\n\t\t\tinfo.handleArc.center,\n\t\t\tinfo.handleArc.radius\n\t\t)\n\n\t\tassert(intersections?.length === 1)\n\t\tconst bend = Vec.Dist(newMidPoint, intersections[0]) * Math.sign(arrow.props.bend)\n\t\t// use `approximately` to avoid endless update loops\n\t\tif (!approximately(bend, update.props.bend)) {\n\t\t\tupdate.props.bend = bend\n\t\t}\n\t}\n\n\teditor.updateShape(update)\n\tif (unbind) {\n\t\tremoveArrowBinding(editor, arrow, terminal)\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAuBO;AACP,oBAAmE;AAK5D,MAAM,yBAAyB,0BAA4B;AAAA,EACjE,OAAgB,OAAO;AAAA,EAEvB,OAAgB,QAAQ;AAAA,EACxB,OAAgB,aAAa;AAAA,EAEpB,kBAAgD;AACxD,WAAO;AAAA,MACN,WAAW;AAAA,MACX,SAAS;AAAA,MACT,kBAAkB,EAAE,GAAG,KAAK,GAAG,IAAI;AAAA,MACnC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ACnB;AAAA,EACD;AAGA,MAAI,KAAK,SAAS,OAAO;AAExB,UAAM,WAAW,aAAa,UAAU,aAAa,KAAK,MAAM;AAChE,UAAM,SAAS,aAAa,QAAQ,WAAW,KAAK,IAAI;AACxD,UAAM,cAAc,kBAAI,IAAI,UAAU,MAAM;AAI5C,UAAM,cAAc,kBAAI,IAAI,UAAU,MAAM,EAC1C,IAAI,EACJ,IAAI,EACJ,IAAI,KAAK,UAAU,SAAS,IAAI,KAAK,KAAK,MAAM,MAAM,IAAI,CAAC;AAG7D,UAAM,oBAAgB;AAAA,MACrB,KAAK,UAAU;AAAA,MACf,kBAAI,IAAI,aAAa,WAAW;AAAA,MAChC,KAAK,UAAU;AAAA,MACf,KAAK,UAAU;AAAA,IAChB;AAEA,8BAAO,eAAe,WAAW,CAAC;AAClC,UAAM,OAAO,kBAAI,KAAK,aAAa,cAAc,CAAC,CAAC,IAAI,KAAK,KAAK,MAAM,MAAM,IAAI;AAEjF,QAAI,KAAC,6BAAc,MAAM,OAAO,MAAM,IAAI,GAAG;AAC5C,aAAO,MAAM,OAAO;AAAA,IACrB;AAAA,EACD;AAEA,SAAO,YAAY,MAAM;AACzB,MAAI,QAAQ;AACX,0CAAmB,QAAQ,OAAO,QAAQ;AAAA,EAC3C;AACD;",
6
6
  "names": []
7
7
  }
@@ -63,7 +63,9 @@ const TldrawSelectionForeground = (0, import_editor.track)(function TldrawSelect
63
63
  const isLockedShape = onlyShape && editor.isShapeOrAncestorLocked(onlyShape);
64
64
  const expandOutlineBy = onlyShape ? editor.getShapeUtil(onlyShape).expandSelectionOutlinePx(onlyShape) : 0;
65
65
  const expandedBounds = expandOutlineBy instanceof import_editor.Box ? bounds.clone().expand(expandOutlineBy).zeroFix() : bounds.clone().expandBy(expandOutlineBy).zeroFix();
66
- (0, import_editor.useTransform)(rSvg, bounds?.x, bounds?.y, 1, editor.getSelectionRotation(), {
66
+ const selectionRotation = editor.getSelectionRotation();
67
+ const isShapeTooCloseToContextualToolbar = selectionRotation / import_editor.HALF_PI > 1.6 && selectionRotation / import_editor.HALF_PI < 2.4;
68
+ (0, import_editor.useTransform)(rSvg, bounds?.x, bounds?.y, 1, selectionRotation, {
67
69
  x: expandedBounds.x - bounds.x,
68
70
  y: expandedBounds.y - bounds.y
69
71
  });
@@ -137,6 +139,7 @@ const TldrawSelectionForeground = (0, import_editor.track)(function TldrawSelect
137
139
  }
138
140
  const textHandleHeight = Math.min(24 / zoom, height - targetSizeY * 3);
139
141
  const showTextResizeHandles = shouldDisplayControls && isCoarsePointer && onlyShape && editor.isShapeOfType(onlyShape, "text") && textHandleHeight * zoom >= 4;
142
+ const isMediaShape = onlyShape && (editor.isShapeOfType(onlyShape, "image") || editor.isShapeOfType(onlyShape, "video"));
140
143
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
141
144
  "svg",
142
145
  {
@@ -205,7 +208,7 @@ const TldrawSelectionForeground = (0, import_editor.track)(function TldrawSelect
205
208
  {
206
209
  "data-testid": "selection.rotate.mobile",
207
210
  cx: isSmallX ? -targetSize * 1.5 : width / 2,
208
- cy: isSmallX ? height / 2 : -targetSize * 1.5,
211
+ cy: isSmallX ? height / 2 : isMediaShape && !isShapeTooCloseToContextualToolbar ? height + targetSize * 1.5 : -targetSize * 1.5,
209
212
  size,
210
213
  isHidden: hideMobileRotateHandle
211
214
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/canvas/TldrawSelectionForeground.tsx"],
4
- "sourcesContent": ["import {\n\tBox,\n\tRotateCorner,\n\tTLEmbedShape,\n\tTLSelectionForegroundProps,\n\tTLTextShape,\n\tgetCursor,\n\ttlenv,\n\ttoDomPrecision,\n\ttrack,\n\tuseEditor,\n\tuseSelectionEvents,\n\tuseTransform,\n\tuseValue,\n} from '@tldraw/editor'\nimport classNames from 'classnames'\nimport { PointerEventHandler, useRef } from 'react'\nimport { useReadonly } from '../ui/hooks/useReadonly'\nimport { useTranslation } from '../ui/hooks/useTranslation/useTranslation'\nimport { TldrawCropHandles } from './TldrawCropHandles'\n\n/** @public */\nexport const TldrawSelectionForeground = track(function TldrawSelectionForeground({\n\tbounds,\n\trotation,\n}: TLSelectionForegroundProps) {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst rSvg = useRef<SVGSVGElement>(null)\n\n\tconst isReadonlyMode = useReadonly()\n\tconst topEvents = useSelectionEvents('top')\n\tconst rightEvents = useSelectionEvents('right')\n\tconst bottomEvents = useSelectionEvents('bottom')\n\tconst leftEvents = useSelectionEvents('left')\n\tconst topLeftEvents = useSelectionEvents('top_left')\n\tconst topRightEvents = useSelectionEvents('top_right')\n\tconst bottomRightEvents = useSelectionEvents('bottom_right')\n\tconst bottomLeftEvents = useSelectionEvents('bottom_left')\n\n\tconst isDefaultCursor = editor.getInstanceState().cursor.type === 'default'\n\tconst isCoarsePointer = editor.getInstanceState().isCoarsePointer\n\n\tconst onlyShape = editor.getOnlySelectedShape()\n\tconst isLockedShape = onlyShape && editor.isShapeOrAncestorLocked(onlyShape)\n\n\t// if all shapes have an expandBy for the selection outline, we can expand by the l\n\tconst expandOutlineBy = onlyShape\n\t\t? editor.getShapeUtil(onlyShape).expandSelectionOutlinePx(onlyShape)\n\t\t: 0\n\n\tconst expandedBounds =\n\t\texpandOutlineBy instanceof Box\n\t\t\t? bounds.clone().expand(expandOutlineBy).zeroFix()\n\t\t\t: bounds.clone().expandBy(expandOutlineBy).zeroFix()\n\n\tuseTransform(rSvg, bounds?.x, bounds?.y, 1, editor.getSelectionRotation(), {\n\t\tx: expandedBounds.x - bounds.x,\n\t\ty: expandedBounds.y - bounds.y,\n\t})\n\n\tif (onlyShape && editor.isShapeHidden(onlyShape)) return null\n\n\tconst zoom = editor.getZoomLevel()\n\tconst isChangingStyle = editor.getInstanceState().isChangingStyle\n\n\tconst width = expandedBounds.width\n\tconst height = expandedBounds.height\n\n\tconst size = 8 / zoom\n\tconst isTinyX = width < size * 2\n\tconst isTinyY = height < size * 2\n\n\tconst isSmallX = width < size * 4\n\tconst isSmallY = height < size * 4\n\tconst isSmallCropX = width < size * 5\n\tconst isSmallCropY = height < size * 5\n\n\tconst mobileHandleMultiplier = isCoarsePointer ? 1.75 : 1\n\tconst targetSize = (6 / zoom) * mobileHandleMultiplier\n\n\tconst targetSizeX = (isSmallX ? targetSize / 2 : targetSize) * (mobileHandleMultiplier * 0.75)\n\tconst targetSizeY = (isSmallY ? targetSize / 2 : targetSize) * (mobileHandleMultiplier * 0.75)\n\n\tconst showSelectionBounds =\n\t\t(onlyShape ? !editor.getShapeUtil(onlyShape).hideSelectionBoundsFg(onlyShape) : true) &&\n\t\t!isChangingStyle\n\n\tlet shouldDisplayBox =\n\t\t(showSelectionBounds &&\n\t\t\teditor.isInAny(\n\t\t\t\t'select.idle',\n\t\t\t\t'select.brushing',\n\t\t\t\t'select.scribble_brushing',\n\t\t\t\t'select.pointing_canvas',\n\t\t\t\t'select.pointing_selection',\n\t\t\t\t'select.pointing_shape',\n\t\t\t\t'select.crop.idle',\n\t\t\t\t'select.crop.pointing_crop',\n\t\t\t\t'select.crop.pointing_crop_handle',\n\t\t\t\t'select.pointing_resize_handle'\n\t\t\t)) ||\n\t\t(showSelectionBounds &&\n\t\t\teditor.isIn('select.resizing') &&\n\t\t\tonlyShape &&\n\t\t\teditor.isShapeOfType<TLTextShape>(onlyShape, 'text'))\n\n\tif (onlyShape && shouldDisplayBox) {\n\t\tif (tlenv.isFirefox && editor.isShapeOfType<TLEmbedShape>(onlyShape, 'embed')) {\n\t\t\tshouldDisplayBox = false\n\t\t}\n\t}\n\n\tconst showCropHandles =\n\t\teditor.isInAny(\n\t\t\t'select.crop.idle',\n\t\t\t'select.crop.pointing_crop',\n\t\t\t'select.crop.pointing_crop_handle'\n\t\t) &&\n\t\t!isChangingStyle &&\n\t\t!isReadonlyMode\n\n\tconst shouldDisplayControls =\n\t\teditor.isInAny(\n\t\t\t'select.idle',\n\t\t\t'select.pointing_selection',\n\t\t\t'select.pointing_shape',\n\t\t\t'select.crop.idle'\n\t\t) &&\n\t\t!isChangingStyle &&\n\t\t!isReadonlyMode\n\n\tconst showCornerRotateHandles =\n\t\t!isCoarsePointer &&\n\t\t!(isTinyX || isTinyY) &&\n\t\t(shouldDisplayControls || showCropHandles) &&\n\t\t(onlyShape ? !editor.getShapeUtil(onlyShape).hideRotateHandle(onlyShape) : true) &&\n\t\t!isLockedShape\n\n\tconst showMobileRotateHandle =\n\t\tisCoarsePointer &&\n\t\t(!isSmallX || !isSmallY) &&\n\t\t(shouldDisplayControls || showCropHandles) &&\n\t\t(onlyShape ? !editor.getShapeUtil(onlyShape).hideRotateHandle(onlyShape) : true) &&\n\t\t!isLockedShape\n\n\tconst showResizeHandles =\n\t\tshouldDisplayControls &&\n\t\t(onlyShape\n\t\t\t? editor.getShapeUtil(onlyShape).canResize(onlyShape) &&\n\t\t\t\t!editor.getShapeUtil(onlyShape).hideResizeHandles(onlyShape)\n\t\t\t: true) &&\n\t\t!showCropHandles &&\n\t\t!isLockedShape\n\n\tconst hideAlternateCornerHandles = isTinyX || isTinyY\n\tconst showOnlyOneHandle = isTinyX && isTinyY\n\tconst hideAlternateCropHandles = isSmallCropX || isSmallCropY\n\n\tconst showHandles = showResizeHandles || showCropHandles\n\tconst hideRotateCornerHandles = !showCornerRotateHandles\n\tconst hideMobileRotateHandle = !shouldDisplayControls || !showMobileRotateHandle\n\tconst hideTopLeftCorner = !shouldDisplayControls || !showHandles\n\tconst hideTopRightCorner = !shouldDisplayControls || !showHandles || hideAlternateCornerHandles\n\tconst hideBottomLeftCorner = !shouldDisplayControls || !showHandles || hideAlternateCornerHandles\n\tconst hideBottomRightCorner =\n\t\t!shouldDisplayControls || !showHandles || (showOnlyOneHandle && !showCropHandles)\n\n\t// If we're showing crop handles, then show the edges too.\n\t// If we're showing resize handles, then show the edges only\n\t// if we're not hiding them for some other reason.\n\tlet hideVerticalEdgeTargets = true\n\t// The same logic above applies here, except another nuance is that\n\t// we enable resizing for text on mobile (coarse).\n\tlet hideHorizontalEdgeTargets = true\n\n\tif (showCropHandles) {\n\t\thideVerticalEdgeTargets = hideAlternateCropHandles\n\t\thideHorizontalEdgeTargets = hideAlternateCropHandles\n\t} else if (showResizeHandles) {\n\t\thideVerticalEdgeTargets = hideAlternateCornerHandles || showOnlyOneHandle || isCoarsePointer\n\t\tconst isMobileAndTextShape = isCoarsePointer && onlyShape && onlyShape.type === 'text'\n\t\thideHorizontalEdgeTargets = hideVerticalEdgeTargets && !isMobileAndTextShape\n\t}\n\n\tconst textHandleHeight = Math.min(24 / zoom, height - targetSizeY * 3)\n\tconst showTextResizeHandles =\n\t\tshouldDisplayControls &&\n\t\tisCoarsePointer &&\n\t\tonlyShape &&\n\t\teditor.isShapeOfType<TLTextShape>(onlyShape, 'text') &&\n\t\ttextHandleHeight * zoom >= 4\n\n\treturn (\n\t\t<svg\n\t\t\tclassName=\"tl-overlays__item tl-selection__fg\"\n\t\t\tdata-testid=\"selection-foreground\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<g ref={rSvg}>\n\t\t\t\t{shouldDisplayBox && (\n\t\t\t\t\t<rect\n\t\t\t\t\t\tclassName=\"tl-selection__fg__outline\"\n\t\t\t\t\t\twidth={toDomPrecision(width)}\n\t\t\t\t\t\theight={toDomPrecision(height)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.top-left\"\n\t\t\t\t\tcx={0}\n\t\t\t\t\tcy={0}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"top_left_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nwse-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.top-right\"\n\t\t\t\t\tcx={width + targetSize * 3}\n\t\t\t\t\tcy={0}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"top_right_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nesw-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.bottom-left\"\n\t\t\t\t\tcx={0}\n\t\t\t\t\tcy={height + targetSize * 3}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"bottom_left_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('swne-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.bottom-right\"\n\t\t\t\t\tcx={width + targetSize * 3}\n\t\t\t\t\tcy={height + targetSize * 3}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"bottom_right_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('senw-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<MobileRotateHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.mobile\"\n\t\t\t\t\tcx={isSmallX ? -targetSize * 1.5 : width / 2}\n\t\t\t\t\tcy={isSmallX ? height / 2 : -targetSize * 1.5}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tisHidden={hideMobileRotateHandle}\n\t\t\t\t/>\n\t\t\t\t{/* Targets */}\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideVerticalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.top\"\n\t\t\t\t\tariaLabel={msg('handle.resize-top')}\n\t\t\t\t\tx={0}\n\t\t\t\t\ty={toDomPrecision(0 - (isSmallY ? targetSizeY * 2 : targetSizeY))}\n\t\t\t\t\twidth={toDomPrecision(width)}\n\t\t\t\t\theight={toDomPrecision(Math.max(1, targetSizeY * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ns-resize', rotation) : undefined}\n\t\t\t\t\tevents={topEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideHorizontalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.right\"\n\t\t\t\t\tariaLabel={msg('handle.resize-right')}\n\t\t\t\t\tx={toDomPrecision(width - (isSmallX ? 0 : targetSizeX))}\n\t\t\t\t\ty={0}\n\t\t\t\t\theight={toDomPrecision(height)}\n\t\t\t\t\twidth={toDomPrecision(Math.max(1, targetSizeX * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ew-resize', rotation) : undefined}\n\t\t\t\t\tevents={rightEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideVerticalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.bottom\"\n\t\t\t\t\tariaLabel={msg('handle.resize-bottom')}\n\t\t\t\t\tx={0}\n\t\t\t\t\ty={toDomPrecision(height - (isSmallY ? 0 : targetSizeY))}\n\t\t\t\t\twidth={toDomPrecision(width)}\n\t\t\t\t\theight={toDomPrecision(Math.max(1, targetSizeY * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ns-resize', rotation) : undefined}\n\t\t\t\t\tevents={bottomEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideHorizontalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.left\"\n\t\t\t\t\tariaLabel={msg('handle.resize-left')}\n\t\t\t\t\tx={toDomPrecision(0 - (isSmallX ? targetSizeX * 2 : targetSizeX))}\n\t\t\t\t\ty={0}\n\t\t\t\t\theight={toDomPrecision(height)}\n\t\t\t\t\twidth={toDomPrecision(Math.max(1, targetSizeX * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ew-resize', rotation) : undefined}\n\t\t\t\t\tevents={leftEvents}\n\t\t\t\t/>\n\t\t\t\t{/* Corner Targets */}\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideTopLeftCorner}\n\t\t\t\t\tdataTestId=\"selection.target.top-left\"\n\t\t\t\t\tariaLabel={msg('handle.resize-top-left')}\n\t\t\t\t\tx={toDomPrecision(0 - (isSmallX ? targetSizeX * 2 : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nwse-resize', rotation) : undefined}\n\t\t\t\t\tevents={topLeftEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideTopRightCorner}\n\t\t\t\t\tdataTestId=\"selection.target.top-right\"\n\t\t\t\t\tariaLabel={msg('handle.resize-top-right')}\n\t\t\t\t\tx={toDomPrecision(width - (isSmallX ? 0 : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nesw-resize', rotation) : undefined}\n\t\t\t\t\tevents={topRightEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideBottomRightCorner}\n\t\t\t\t\tdataTestId=\"selection.target.bottom-right\"\n\t\t\t\t\tariaLabel={msg('handle.resize-bottom-right')}\n\t\t\t\t\tx={toDomPrecision(width - (isSmallX ? targetSizeX : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(height - (isSmallY ? targetSizeY : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nwse-resize', rotation) : undefined}\n\t\t\t\t\tevents={bottomRightEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideBottomLeftCorner}\n\t\t\t\t\tdataTestId=\"selection.target.bottom-left\"\n\t\t\t\t\tariaLabel={msg('handle.resize-bottom-left')}\n\t\t\t\t\tx={toDomPrecision(0 - (isSmallX ? targetSizeX * 3 : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(height - (isSmallY ? 0 : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nesw-resize', rotation) : undefined}\n\t\t\t\t\tevents={bottomLeftEvents}\n\t\t\t\t/>\n\t\t\t\t{/* Resize Handles */}\n\t\t\t\t{showResizeHandles && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.top-left\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideTopLeftCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.top-right\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideTopRightCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(width - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.bottom-right\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideBottomRightCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(width - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(height - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.bottom-left\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideBottomLeftCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(height - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{showTextResizeHandles && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.text-resize.left.handle\"\n\t\t\t\t\t\t\tclassName=\"tl-text-handle\"\n\t\t\t\t\t\t\tx={toDomPrecision(0 - size / 4)}\n\t\t\t\t\t\t\ty={toDomPrecision(height / 2 - textHandleHeight / 2)}\n\t\t\t\t\t\t\trx={size / 4}\n\t\t\t\t\t\t\twidth={toDomPrecision(size / 2)}\n\t\t\t\t\t\t\theight={toDomPrecision(textHandleHeight)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.text-resize.right.handle\"\n\t\t\t\t\t\t\tclassName=\"tl-text-handle\"\n\t\t\t\t\t\t\trx={size / 4}\n\t\t\t\t\t\t\tx={toDomPrecision(width - size / 4)}\n\t\t\t\t\t\t\ty={toDomPrecision(height / 2 - textHandleHeight / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size / 2)}\n\t\t\t\t\t\t\theight={toDomPrecision(textHandleHeight)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{/* Crop Handles */}\n\t\t\t\t{showCropHandles && (\n\t\t\t\t\t<TldrawCropHandles\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\thideAlternateHandles: hideAlternateCropHandles,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</g>\n\t\t</svg>\n\t)\n})\n\nexport const ResizeHandle = function ResizeHandle({\n\thide,\n\tdataTestId,\n\tariaLabel,\n\tx,\n\ty,\n\twidth,\n\theight,\n\tcursor,\n\tevents,\n}: {\n\thide: boolean\n\tdataTestId: string\n\tariaLabel: string\n\tx: number\n\ty: number\n\twidth: number\n\theight: number\n\tcursor?: string\n\tevents: {\n\t\tonPointerUp: PointerEventHandler<Element>\n\t\tonPointerMove(e: React.PointerEvent<Element>): void\n\t\tonPointerDown: PointerEventHandler<Element>\n\t}\n}) {\n\treturn (\n\t\t<rect\n\t\t\tclassName={classNames('tl-resize-handle', 'tl-transparent', {\n\t\t\t\t'tl-hidden': hide,\n\t\t\t})}\n\t\t\tdata-testid={dataTestId}\n\t\t\trole=\"button\"\n\t\t\taria-label={ariaLabel}\n\t\t\tpointerEvents=\"all\"\n\t\t\tx={x}\n\t\t\ty={y}\n\t\t\twidth={width}\n\t\t\theight={height}\n\t\t\tcursor={cursor}\n\t\t\t{...events}\n\t\t/>\n\t)\n}\n\nexport const RotateCornerHandle = function RotateCornerHandle({\n\tcx,\n\tcy,\n\ttargetSize,\n\tcorner,\n\tcursor,\n\tisHidden,\n\t'data-testid': testId,\n}: {\n\tcx: number\n\tcy: number\n\ttargetSize: number\n\tcorner: RotateCorner\n\tcursor?: string\n\tisHidden: boolean\n\t'data-testid'?: string\n}) {\n\tconst events = useSelectionEvents(corner)\n\tconst msg = useTranslation()\n\tconst label = msg(`handle.rotate.${corner}`)\n\n\treturn (\n\t\t<rect\n\t\t\tclassName={classNames('tl-transparent', 'tl-rotate-corner', { 'tl-hidden': isHidden })}\n\t\t\tdata-testid={testId}\n\t\t\trole=\"button\"\n\t\t\taria-label={label}\n\t\t\tpointerEvents=\"all\"\n\t\t\tx={toDomPrecision(cx - targetSize * 3)}\n\t\t\ty={toDomPrecision(cy - targetSize * 3)}\n\t\t\twidth={toDomPrecision(Math.max(1, targetSize * 3))}\n\t\t\theight={toDomPrecision(Math.max(1, targetSize * 3))}\n\t\t\tcursor={cursor}\n\t\t\t{...events}\n\t\t/>\n\t)\n}\n\nconst SQUARE_ROOT_PI = Math.sqrt(Math.PI)\n\nexport const MobileRotateHandle = function RotateHandle({\n\tcx,\n\tcy,\n\tsize,\n\tisHidden,\n\t'data-testid': testId,\n}: {\n\tcx: number\n\tcy: number\n\tsize: number\n\tisHidden: boolean\n\t'data-testid'?: string\n}) {\n\tconst events = useSelectionEvents('mobile_rotate')\n\n\tconst editor = useEditor()\n\tconst zoom = useValue('zoom level', () => editor.getZoomLevel(), [editor])\n\tconst bgRadius = Math.max(14 * (1 / zoom), 20 / Math.max(1, zoom))\n\tconst msg = useTranslation()\n\treturn (\n\t\t<g role=\"button\" aria-label={msg('handle.rotate.mobile_rotate')}>\n\t\t\t<circle\n\t\t\t\tdata-testid={testId}\n\t\t\t\tpointerEvents=\"all\"\n\t\t\t\tclassName={classNames('tl-transparent', 'tl-mobile-rotate__bg', { 'tl-hidden': isHidden })}\n\t\t\t\tcx={cx}\n\t\t\t\tcy={cy}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qB,SAAS,aAAa;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAChB,GAMG;AACF,QAAM,aAAS,kCAAmB,eAAe;AAEjD,QAAM,aAAS,yBAAU;AACzB,QAAM,WAAO,wBAAS,cAAc,MAAM,OAAO,aAAa,GAAG,CAAC,MAAM,CAAC;AACzE,QAAM,WAAW,KAAK,IAAI,MAAM,IAAI,OAAO,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;AACjE,QAAM,UAAM,sCAAe;AAC3B,SACC,6CAAC,OAAE,MAAK,UAAS,cAAY,IAAI,6BAA6B,GAC7D;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,eAAa;AAAA,QACb,eAAc;AAAA,QACd,eAAW,kBAAAA,SAAW,kBAAkB,wBAAwB,EAAE,aAAa,SAAS,CAAC;AAAA,QACzF;AAAA,QACA;AAAA,QACA,GAAG;AAAA,QACF,GAAG;AAAA;AAAA,IACL;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,eAAW,kBAAAA,SAAW,wBAAwB,EAAE,aAAa,SAAS,CAAC;AAAA,QACvE;AAAA,QACA;AAAA,QACA,GAAG,OAAO;AAAA;AAAA,IACX;AAAA,KACD;AAEF;",
4
+ "sourcesContent": ["import {\n\tBox,\n\tHALF_PI,\n\tRotateCorner,\n\tTLSelectionForegroundProps,\n\tgetCursor,\n\ttlenv,\n\ttoDomPrecision,\n\ttrack,\n\tuseEditor,\n\tuseSelectionEvents,\n\tuseTransform,\n\tuseValue,\n} from '@tldraw/editor'\nimport classNames from 'classnames'\nimport { PointerEventHandler, useRef } from 'react'\nimport { useReadonly } from '../ui/hooks/useReadonly'\nimport { useTranslation } from '../ui/hooks/useTranslation/useTranslation'\nimport { TldrawCropHandles } from './TldrawCropHandles'\n\n/** @public */\nexport const TldrawSelectionForeground = track(function TldrawSelectionForeground({\n\tbounds,\n\trotation,\n}: TLSelectionForegroundProps) {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst rSvg = useRef<SVGSVGElement>(null)\n\n\tconst isReadonlyMode = useReadonly()\n\tconst topEvents = useSelectionEvents('top')\n\tconst rightEvents = useSelectionEvents('right')\n\tconst bottomEvents = useSelectionEvents('bottom')\n\tconst leftEvents = useSelectionEvents('left')\n\tconst topLeftEvents = useSelectionEvents('top_left')\n\tconst topRightEvents = useSelectionEvents('top_right')\n\tconst bottomRightEvents = useSelectionEvents('bottom_right')\n\tconst bottomLeftEvents = useSelectionEvents('bottom_left')\n\n\tconst isDefaultCursor = editor.getInstanceState().cursor.type === 'default'\n\tconst isCoarsePointer = editor.getInstanceState().isCoarsePointer\n\n\tconst onlyShape = editor.getOnlySelectedShape()\n\tconst isLockedShape = onlyShape && editor.isShapeOrAncestorLocked(onlyShape)\n\n\t// if all shapes have an expandBy for the selection outline, we can expand by the l\n\tconst expandOutlineBy = onlyShape\n\t\t? editor.getShapeUtil(onlyShape).expandSelectionOutlinePx(onlyShape)\n\t\t: 0\n\n\tconst expandedBounds =\n\t\texpandOutlineBy instanceof Box\n\t\t\t? bounds.clone().expand(expandOutlineBy).zeroFix()\n\t\t\t: bounds.clone().expandBy(expandOutlineBy).zeroFix()\n\n\tconst selectionRotation = editor.getSelectionRotation()\n\tconst isShapeTooCloseToContextualToolbar =\n\t\tselectionRotation / HALF_PI > 1.6 && selectionRotation / HALF_PI < 2.4\n\tuseTransform(rSvg, bounds?.x, bounds?.y, 1, selectionRotation, {\n\t\tx: expandedBounds.x - bounds.x,\n\t\ty: expandedBounds.y - bounds.y,\n\t})\n\n\tif (onlyShape && editor.isShapeHidden(onlyShape)) return null\n\n\tconst zoom = editor.getZoomLevel()\n\tconst isChangingStyle = editor.getInstanceState().isChangingStyle\n\n\tconst width = expandedBounds.width\n\tconst height = expandedBounds.height\n\n\tconst size = 8 / zoom\n\tconst isTinyX = width < size * 2\n\tconst isTinyY = height < size * 2\n\n\tconst isSmallX = width < size * 4\n\tconst isSmallY = height < size * 4\n\tconst isSmallCropX = width < size * 5\n\tconst isSmallCropY = height < size * 5\n\n\tconst mobileHandleMultiplier = isCoarsePointer ? 1.75 : 1\n\tconst targetSize = (6 / zoom) * mobileHandleMultiplier\n\n\tconst targetSizeX = (isSmallX ? targetSize / 2 : targetSize) * (mobileHandleMultiplier * 0.75)\n\tconst targetSizeY = (isSmallY ? targetSize / 2 : targetSize) * (mobileHandleMultiplier * 0.75)\n\n\tconst showSelectionBounds =\n\t\t(onlyShape ? !editor.getShapeUtil(onlyShape).hideSelectionBoundsFg(onlyShape) : true) &&\n\t\t!isChangingStyle\n\n\tlet shouldDisplayBox =\n\t\t(showSelectionBounds &&\n\t\t\teditor.isInAny(\n\t\t\t\t'select.idle',\n\t\t\t\t'select.brushing',\n\t\t\t\t'select.scribble_brushing',\n\t\t\t\t'select.pointing_canvas',\n\t\t\t\t'select.pointing_selection',\n\t\t\t\t'select.pointing_shape',\n\t\t\t\t'select.crop.idle',\n\t\t\t\t'select.crop.pointing_crop',\n\t\t\t\t'select.crop.pointing_crop_handle',\n\t\t\t\t'select.pointing_resize_handle'\n\t\t\t)) ||\n\t\t(showSelectionBounds &&\n\t\t\teditor.isIn('select.resizing') &&\n\t\t\tonlyShape &&\n\t\t\teditor.isShapeOfType(onlyShape, 'text'))\n\n\tif (onlyShape && shouldDisplayBox) {\n\t\tif (tlenv.isFirefox && editor.isShapeOfType(onlyShape, 'embed')) {\n\t\t\tshouldDisplayBox = false\n\t\t}\n\t}\n\n\tconst showCropHandles =\n\t\teditor.isInAny(\n\t\t\t'select.crop.idle',\n\t\t\t'select.crop.pointing_crop',\n\t\t\t'select.crop.pointing_crop_handle'\n\t\t) &&\n\t\t!isChangingStyle &&\n\t\t!isReadonlyMode\n\n\tconst shouldDisplayControls =\n\t\teditor.isInAny(\n\t\t\t'select.idle',\n\t\t\t'select.pointing_selection',\n\t\t\t'select.pointing_shape',\n\t\t\t'select.crop.idle'\n\t\t) &&\n\t\t!isChangingStyle &&\n\t\t!isReadonlyMode\n\n\tconst showCornerRotateHandles =\n\t\t!isCoarsePointer &&\n\t\t!(isTinyX || isTinyY) &&\n\t\t(shouldDisplayControls || showCropHandles) &&\n\t\t(onlyShape ? !editor.getShapeUtil(onlyShape).hideRotateHandle(onlyShape) : true) &&\n\t\t!isLockedShape\n\n\tconst showMobileRotateHandle =\n\t\tisCoarsePointer &&\n\t\t(!isSmallX || !isSmallY) &&\n\t\t(shouldDisplayControls || showCropHandles) &&\n\t\t(onlyShape ? !editor.getShapeUtil(onlyShape).hideRotateHandle(onlyShape) : true) &&\n\t\t!isLockedShape\n\n\tconst showResizeHandles =\n\t\tshouldDisplayControls &&\n\t\t(onlyShape\n\t\t\t? editor.getShapeUtil(onlyShape).canResize(onlyShape) &&\n\t\t\t\t!editor.getShapeUtil(onlyShape).hideResizeHandles(onlyShape)\n\t\t\t: true) &&\n\t\t!showCropHandles &&\n\t\t!isLockedShape\n\n\tconst hideAlternateCornerHandles = isTinyX || isTinyY\n\tconst showOnlyOneHandle = isTinyX && isTinyY\n\tconst hideAlternateCropHandles = isSmallCropX || isSmallCropY\n\n\tconst showHandles = showResizeHandles || showCropHandles\n\tconst hideRotateCornerHandles = !showCornerRotateHandles\n\tconst hideMobileRotateHandle = !shouldDisplayControls || !showMobileRotateHandle\n\tconst hideTopLeftCorner = !shouldDisplayControls || !showHandles\n\tconst hideTopRightCorner = !shouldDisplayControls || !showHandles || hideAlternateCornerHandles\n\tconst hideBottomLeftCorner = !shouldDisplayControls || !showHandles || hideAlternateCornerHandles\n\tconst hideBottomRightCorner =\n\t\t!shouldDisplayControls || !showHandles || (showOnlyOneHandle && !showCropHandles)\n\n\t// If we're showing crop handles, then show the edges too.\n\t// If we're showing resize handles, then show the edges only\n\t// if we're not hiding them for some other reason.\n\tlet hideVerticalEdgeTargets = true\n\t// The same logic above applies here, except another nuance is that\n\t// we enable resizing for text on mobile (coarse).\n\tlet hideHorizontalEdgeTargets = true\n\n\tif (showCropHandles) {\n\t\thideVerticalEdgeTargets = hideAlternateCropHandles\n\t\thideHorizontalEdgeTargets = hideAlternateCropHandles\n\t} else if (showResizeHandles) {\n\t\thideVerticalEdgeTargets = hideAlternateCornerHandles || showOnlyOneHandle || isCoarsePointer\n\t\tconst isMobileAndTextShape = isCoarsePointer && onlyShape && onlyShape.type === 'text'\n\t\thideHorizontalEdgeTargets = hideVerticalEdgeTargets && !isMobileAndTextShape\n\t}\n\n\tconst textHandleHeight = Math.min(24 / zoom, height - targetSizeY * 3)\n\tconst showTextResizeHandles =\n\t\tshouldDisplayControls &&\n\t\tisCoarsePointer &&\n\t\tonlyShape &&\n\t\teditor.isShapeOfType(onlyShape, 'text') &&\n\t\ttextHandleHeight * zoom >= 4\n\tconst isMediaShape =\n\t\tonlyShape &&\n\t\t(editor.isShapeOfType(onlyShape, 'image') || editor.isShapeOfType(onlyShape, 'video'))\n\n\treturn (\n\t\t<svg\n\t\t\tclassName=\"tl-overlays__item tl-selection__fg\"\n\t\t\tdata-testid=\"selection-foreground\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<g ref={rSvg}>\n\t\t\t\t{shouldDisplayBox && (\n\t\t\t\t\t<rect\n\t\t\t\t\t\tclassName=\"tl-selection__fg__outline\"\n\t\t\t\t\t\twidth={toDomPrecision(width)}\n\t\t\t\t\t\theight={toDomPrecision(height)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.top-left\"\n\t\t\t\t\tcx={0}\n\t\t\t\t\tcy={0}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"top_left_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nwse-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.top-right\"\n\t\t\t\t\tcx={width + targetSize * 3}\n\t\t\t\t\tcy={0}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"top_right_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nesw-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.bottom-left\"\n\t\t\t\t\tcx={0}\n\t\t\t\t\tcy={height + targetSize * 3}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"bottom_left_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('swne-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<RotateCornerHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.bottom-right\"\n\t\t\t\t\tcx={width + targetSize * 3}\n\t\t\t\t\tcy={height + targetSize * 3}\n\t\t\t\t\ttargetSize={targetSize}\n\t\t\t\t\tcorner=\"bottom_right_rotate\"\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('senw-rotate', rotation) : undefined}\n\t\t\t\t\tisHidden={hideRotateCornerHandles}\n\t\t\t\t/>\n\t\t\t\t<MobileRotateHandle\n\t\t\t\t\tdata-testid=\"selection.rotate.mobile\"\n\t\t\t\t\tcx={isSmallX ? -targetSize * 1.5 : width / 2}\n\t\t\t\t\tcy={\n\t\t\t\t\t\tisSmallX\n\t\t\t\t\t\t\t? height / 2\n\t\t\t\t\t\t\t: isMediaShape && !isShapeTooCloseToContextualToolbar\n\t\t\t\t\t\t\t\t? height + targetSize * 1.5\n\t\t\t\t\t\t\t\t: -targetSize * 1.5\n\t\t\t\t\t}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tisHidden={hideMobileRotateHandle}\n\t\t\t\t/>\n\t\t\t\t{/* Targets */}\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideVerticalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.top\"\n\t\t\t\t\tariaLabel={msg('handle.resize-top')}\n\t\t\t\t\tx={0}\n\t\t\t\t\ty={toDomPrecision(0 - (isSmallY ? targetSizeY * 2 : targetSizeY))}\n\t\t\t\t\twidth={toDomPrecision(width)}\n\t\t\t\t\theight={toDomPrecision(Math.max(1, targetSizeY * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ns-resize', rotation) : undefined}\n\t\t\t\t\tevents={topEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideHorizontalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.right\"\n\t\t\t\t\tariaLabel={msg('handle.resize-right')}\n\t\t\t\t\tx={toDomPrecision(width - (isSmallX ? 0 : targetSizeX))}\n\t\t\t\t\ty={0}\n\t\t\t\t\theight={toDomPrecision(height)}\n\t\t\t\t\twidth={toDomPrecision(Math.max(1, targetSizeX * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ew-resize', rotation) : undefined}\n\t\t\t\t\tevents={rightEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideVerticalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.bottom\"\n\t\t\t\t\tariaLabel={msg('handle.resize-bottom')}\n\t\t\t\t\tx={0}\n\t\t\t\t\ty={toDomPrecision(height - (isSmallY ? 0 : targetSizeY))}\n\t\t\t\t\twidth={toDomPrecision(width)}\n\t\t\t\t\theight={toDomPrecision(Math.max(1, targetSizeY * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ns-resize', rotation) : undefined}\n\t\t\t\t\tevents={bottomEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideHorizontalEdgeTargets}\n\t\t\t\t\tdataTestId=\"selection.resize.left\"\n\t\t\t\t\tariaLabel={msg('handle.resize-left')}\n\t\t\t\t\tx={toDomPrecision(0 - (isSmallX ? targetSizeX * 2 : targetSizeX))}\n\t\t\t\t\ty={0}\n\t\t\t\t\theight={toDomPrecision(height)}\n\t\t\t\t\twidth={toDomPrecision(Math.max(1, targetSizeX * 2))}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('ew-resize', rotation) : undefined}\n\t\t\t\t\tevents={leftEvents}\n\t\t\t\t/>\n\t\t\t\t{/* Corner Targets */}\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideTopLeftCorner}\n\t\t\t\t\tdataTestId=\"selection.target.top-left\"\n\t\t\t\t\tariaLabel={msg('handle.resize-top-left')}\n\t\t\t\t\tx={toDomPrecision(0 - (isSmallX ? targetSizeX * 2 : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nwse-resize', rotation) : undefined}\n\t\t\t\t\tevents={topLeftEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideTopRightCorner}\n\t\t\t\t\tdataTestId=\"selection.target.top-right\"\n\t\t\t\t\tariaLabel={msg('handle.resize-top-right')}\n\t\t\t\t\tx={toDomPrecision(width - (isSmallX ? 0 : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nesw-resize', rotation) : undefined}\n\t\t\t\t\tevents={topRightEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideBottomRightCorner}\n\t\t\t\t\tdataTestId=\"selection.target.bottom-right\"\n\t\t\t\t\tariaLabel={msg('handle.resize-bottom-right')}\n\t\t\t\t\tx={toDomPrecision(width - (isSmallX ? targetSizeX : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(height - (isSmallY ? targetSizeY : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nwse-resize', rotation) : undefined}\n\t\t\t\t\tevents={bottomRightEvents}\n\t\t\t\t/>\n\t\t\t\t<ResizeHandle\n\t\t\t\t\thide={hideBottomLeftCorner}\n\t\t\t\t\tdataTestId=\"selection.target.bottom-left\"\n\t\t\t\t\tariaLabel={msg('handle.resize-bottom-left')}\n\t\t\t\t\tx={toDomPrecision(0 - (isSmallX ? targetSizeX * 3 : targetSizeX * 1.5))}\n\t\t\t\t\ty={toDomPrecision(height - (isSmallY ? 0 : targetSizeY * 1.5))}\n\t\t\t\t\twidth={toDomPrecision(targetSizeX * 3)}\n\t\t\t\t\theight={toDomPrecision(targetSizeY * 3)}\n\t\t\t\t\tcursor={isDefaultCursor ? getCursor('nesw-resize', rotation) : undefined}\n\t\t\t\t\tevents={bottomLeftEvents}\n\t\t\t\t/>\n\t\t\t\t{/* Resize Handles */}\n\t\t\t\t{showResizeHandles && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.top-left\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideTopLeftCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.top-right\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideTopRightCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(width - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.bottom-right\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideBottomRightCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(width - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(height - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.resize.bottom-left\"\n\t\t\t\t\t\t\tclassName={classNames('tl-corner-handle', {\n\t\t\t\t\t\t\t\t'tl-hidden': hideBottomLeftCorner,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tx={toDomPrecision(0 - size / 2)}\n\t\t\t\t\t\t\ty={toDomPrecision(height - size / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size)}\n\t\t\t\t\t\t\theight={toDomPrecision(size)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{showTextResizeHandles && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.text-resize.left.handle\"\n\t\t\t\t\t\t\tclassName=\"tl-text-handle\"\n\t\t\t\t\t\t\tx={toDomPrecision(0 - size / 4)}\n\t\t\t\t\t\t\ty={toDomPrecision(height / 2 - textHandleHeight / 2)}\n\t\t\t\t\t\t\trx={size / 4}\n\t\t\t\t\t\t\twidth={toDomPrecision(size / 2)}\n\t\t\t\t\t\t\theight={toDomPrecision(textHandleHeight)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tdata-testid=\"selection.text-resize.right.handle\"\n\t\t\t\t\t\t\tclassName=\"tl-text-handle\"\n\t\t\t\t\t\t\trx={size / 4}\n\t\t\t\t\t\t\tx={toDomPrecision(width - size / 4)}\n\t\t\t\t\t\t\ty={toDomPrecision(height / 2 - textHandleHeight / 2)}\n\t\t\t\t\t\t\twidth={toDomPrecision(size / 2)}\n\t\t\t\t\t\t\theight={toDomPrecision(textHandleHeight)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{/* Crop Handles */}\n\t\t\t\t{showCropHandles && (\n\t\t\t\t\t<TldrawCropHandles\n\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\thideAlternateHandles: hideAlternateCropHandles,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</g>\n\t\t</svg>\n\t)\n})\n\nexport const ResizeHandle = function ResizeHandle({\n\thide,\n\tdataTestId,\n\tariaLabel,\n\tx,\n\ty,\n\twidth,\n\theight,\n\tcursor,\n\tevents,\n}: {\n\thide: boolean\n\tdataTestId: string\n\tariaLabel: string\n\tx: number\n\ty: number\n\twidth: number\n\theight: number\n\tcursor?: string\n\tevents: {\n\t\tonPointerUp: PointerEventHandler<Element>\n\t\tonPointerMove(e: React.PointerEvent<Element>): void\n\t\tonPointerDown: PointerEventHandler<Element>\n\t}\n}) {\n\treturn (\n\t\t<rect\n\t\t\tclassName={classNames('tl-resize-handle', 'tl-transparent', {\n\t\t\t\t'tl-hidden': hide,\n\t\t\t})}\n\t\t\tdata-testid={dataTestId}\n\t\t\trole=\"button\"\n\t\t\taria-label={ariaLabel}\n\t\t\tpointerEvents=\"all\"\n\t\t\tx={x}\n\t\t\ty={y}\n\t\t\twidth={width}\n\t\t\theight={height}\n\t\t\tcursor={cursor}\n\t\t\t{...events}\n\t\t/>\n\t)\n}\n\nexport const RotateCornerHandle = function RotateCornerHandle({\n\tcx,\n\tcy,\n\ttargetSize,\n\tcorner,\n\tcursor,\n\tisHidden,\n\t'data-testid': testId,\n}: {\n\tcx: number\n\tcy: number\n\ttargetSize: number\n\tcorner: RotateCorner\n\tcursor?: string\n\tisHidden: boolean\n\t'data-testid'?: string\n}) {\n\tconst events = useSelectionEvents(corner)\n\tconst msg = useTranslation()\n\tconst label = msg(`handle.rotate.${corner}`)\n\n\treturn (\n\t\t<rect\n\t\t\tclassName={classNames('tl-transparent', 'tl-rotate-corner', { 'tl-hidden': isHidden })}\n\t\t\tdata-testid={testId}\n\t\t\trole=\"button\"\n\t\t\taria-label={label}\n\t\t\tpointerEvents=\"all\"\n\t\t\tx={toDomPrecision(cx - targetSize * 3)}\n\t\t\ty={toDomPrecision(cy - targetSize * 3)}\n\t\t\twidth={toDomPrecision(Math.max(1, targetSize * 3))}\n\t\t\theight={toDomPrecision(Math.max(1, targetSize * 3))}\n\t\t\tcursor={cursor}\n\t\t\t{...events}\n\t\t/>\n\t)\n}\n\nconst SQUARE_ROOT_PI = Math.sqrt(Math.PI)\n\nexport const MobileRotateHandle = function RotateHandle({\n\tcx,\n\tcy,\n\tsize,\n\tisHidden,\n\t'data-testid': testId,\n}: {\n\tcx: number\n\tcy: number\n\tsize: number\n\tisHidden: boolean\n\t'data-testid'?: string\n}) {\n\tconst events = useSelectionEvents('mobile_rotate')\n\n\tconst editor = useEditor()\n\tconst zoom = useValue('zoom level', () => editor.getZoomLevel(), [editor])\n\tconst bgRadius = Math.max(14 * (1 / zoom), 20 / Math.max(1, zoom))\n\tconst msg = useTranslation()\n\treturn (\n\t\t<g role=\"button\" aria-label={msg('handle.rotate.mobile_rotate')}>\n\t\t\t<circle\n\t\t\t\tdata-testid={testId}\n\t\t\t\tpointerEvents=\"all\"\n\t\t\t\tclassName={classNames('tl-transparent', 'tl-mobile-rotate__bg', { 'tl-hidden': isHidden })}\n\t\t\t\tcx={cx}\n\t\t\t\tcy={cy}\n\t\t\t\tr={bgRadius}\n\t\t\t\t{...events}\n\t\t\t/>\n\t\t\t<circle\n\t\t\t\tclassName={classNames('tl-mobile-rotate__fg', { 'tl-hidden': isHidden })}\n\t\t\t\tcx={cx}\n\t\t\t\tcy={cy}\n\t\t\t\tr={size / SQUARE_ROOT_PI}\n\t\t\t/>\n\t\t</g>\n\t)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8MK;AA9ML,oBAaO;AACP,wBAAuB;AACvB,mBAA4C;AAC5C,yBAA4B;AAC5B,4BAA+B;AAC/B,+BAAkC;AAG3B,MAAM,gCAA4B,qBAAM,SAASA,2BAA0B;AAAA,EACjF;AAAA,EACA;AACD,GAA+B;AAC9B,QAAM,aAAS,yBAAU;AACzB,QAAM,UAAM,sCAAe;AAC3B,QAAM,WAAO,qBAAsB,IAAI;AAEvC,QAAM,qBAAiB,gCAAY;AACnC,QAAM,gBAAY,kCAAmB,KAAK;AAC1C,QAAM,kBAAc,kCAAmB,OAAO;AAC9C,QAAM,mBAAe,kCAAmB,QAAQ;AAChD,QAAM,iBAAa,kCAAmB,MAAM;AAC5C,QAAM,oBAAgB,kCAAmB,UAAU;AACnD,QAAM,qBAAiB,kCAAmB,WAAW;AACrD,QAAM,wBAAoB,kCAAmB,cAAc;AAC3D,QAAM,uBAAmB,kCAAmB,aAAa;AAEzD,QAAM,kBAAkB,OAAO,iBAAiB,EAAE,OAAO,SAAS;AAClE,QAAM,kBAAkB,OAAO,iBAAiB,EAAE;AAElD,QAAM,YAAY,OAAO,qBAAqB;AAC9C,QAAM,gBAAgB,aAAa,OAAO,wBAAwB,SAAS;AAG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