tldraw 3.16.0-canary.ffdf566dd0a8 → 3.16.0-internal.a478398270c6

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 (327) hide show
  1. package/dist-cjs/index.d.ts +19 -125
  2. package/dist-cjs/index.js +2 -19
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/TldrawImage.js +2 -5
  5. package/dist-cjs/lib/TldrawImage.js.map +3 -3
  6. package/dist-cjs/lib/canvas/TldrawCropHandles.js +1 -1
  7. package/dist-cjs/lib/canvas/TldrawCropHandles.js.map +2 -2
  8. package/dist-cjs/lib/canvas/TldrawHandles.js +1 -1
  9. package/dist-cjs/lib/canvas/TldrawHandles.js.map +2 -2
  10. package/dist-cjs/lib/canvas/TldrawOverlays.js +1 -1
  11. package/dist-cjs/lib/canvas/TldrawOverlays.js.map +2 -2
  12. package/dist-cjs/lib/canvas/TldrawSelectionForeground.js +271 -279
  13. package/dist-cjs/lib/canvas/TldrawSelectionForeground.js.map +2 -2
  14. package/dist-cjs/lib/defaultExternalContentHandlers.js +0 -1
  15. package/dist-cjs/lib/defaultExternalContentHandlers.js.map +2 -2
  16. package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js +41 -24
  17. package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
  18. package/dist-cjs/lib/shapes/arrow/arrowLabel.js +4 -16
  19. package/dist-cjs/lib/shapes/arrow/arrowLabel.js.map +2 -2
  20. package/dist-cjs/lib/shapes/arrow/arrowTargetState.js +1 -1
  21. package/dist-cjs/lib/shapes/arrow/arrowTargetState.js.map +2 -2
  22. package/dist-cjs/lib/shapes/arrow/toolStates/Pointing.js +0 -3
  23. package/dist-cjs/lib/shapes/arrow/toolStates/Pointing.js.map +2 -2
  24. package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js +3 -0
  25. package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js.map +2 -2
  26. package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js +5 -5
  27. package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js.map +2 -2
  28. package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js +3 -0
  29. package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js.map +2 -2
  30. package/dist-cjs/lib/shapes/line/LineShapeUtil.js +4 -15
  31. package/dist-cjs/lib/shapes/line/LineShapeUtil.js.map +2 -2
  32. package/dist-cjs/lib/shapes/note/NoteShapeUtil.js +1 -2
  33. package/dist-cjs/lib/shapes/note/NoteShapeUtil.js.map +2 -2
  34. package/dist-cjs/lib/shapes/shared/PathBuilder.js +3 -21
  35. package/dist-cjs/lib/shapes/shared/PathBuilder.js.map +2 -2
  36. package/dist-cjs/lib/shapes/shared/PlainTextLabel.js +0 -1
  37. package/dist-cjs/lib/shapes/shared/PlainTextLabel.js.map +2 -2
  38. package/dist-cjs/lib/shapes/shared/RichTextLabel.js +2 -5
  39. package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
  40. package/dist-cjs/lib/shapes/shared/SvgTextLabel.js +3 -4
  41. package/dist-cjs/lib/shapes/shared/SvgTextLabel.js.map +2 -2
  42. package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js +1 -10
  43. package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js.map +2 -2
  44. package/dist-cjs/lib/shapes/text/TextShapeUtil.js +11 -5
  45. package/dist-cjs/lib/shapes/text/TextShapeUtil.js.map +2 -2
  46. package/dist-cjs/lib/styles.js.map +2 -2
  47. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js +1 -7
  48. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js.map +2 -2
  49. package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js +22 -43
  50. package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js.map +2 -2
  51. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +15 -2
  52. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
  53. package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js +0 -5
  54. package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js.map +2 -2
  55. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +0 -8
  56. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
  57. package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js +0 -8
  58. package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js.map +2 -2
  59. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +0 -8
  60. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
  61. package/dist-cjs/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.js.map +2 -2
  62. package/dist-cjs/lib/ui/assetUrls.js +13 -10
  63. package/dist-cjs/lib/ui/assetUrls.js.map +2 -2
  64. package/dist-cjs/lib/ui/components/A11y.js +12 -14
  65. package/dist-cjs/lib/ui/components/A11y.js.map +2 -2
  66. package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js +1 -51
  67. package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js.map +2 -2
  68. package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js +2 -3
  69. package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js.map +2 -2
  70. package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +4 -3
  71. package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
  72. package/dist-cjs/lib/ui/components/Spinner.js +25 -2
  73. package/dist-cjs/lib/ui/components/Spinner.js.map +2 -2
  74. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js +0 -2
  75. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js.map +2 -2
  76. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +136 -168
  77. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
  78. package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js +7 -21
  79. package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js.map +3 -3
  80. package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +3 -3
  81. package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +2 -2
  82. package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +2 -3
  83. package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js.map +2 -2
  84. package/dist-cjs/lib/ui/components/menu-items.js +0 -22
  85. package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
  86. package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButtonIcon.js.map +2 -2
  87. package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js +0 -2
  88. package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js.map +2 -2
  89. package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js +1 -1
  90. package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js.map +2 -2
  91. package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js +1 -35
  92. package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js.map +2 -2
  93. package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +2 -6
  94. package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js.map +2 -2
  95. package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +3 -12
  96. package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js.map +2 -2
  97. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.js.map +2 -2
  98. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +2 -0
  99. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
  100. package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js +2 -3
  101. package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js.map +2 -2
  102. package/dist-cjs/lib/ui/context/actions.js +8 -57
  103. package/dist-cjs/lib/ui/context/actions.js.map +2 -2
  104. package/dist-cjs/lib/ui/context/events.js.map +2 -2
  105. package/dist-cjs/lib/ui/hooks/menu-hooks.js.map +2 -2
  106. package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js +2 -2
  107. package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js.map +2 -2
  108. package/dist-cjs/lib/ui/hooks/useTools.js.map +2 -2
  109. package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
  110. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +0 -11
  111. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
  112. package/dist-cjs/lib/ui/kbd-utils.js +1 -2
  113. package/dist-cjs/lib/ui/kbd-utils.js.map +2 -2
  114. package/dist-cjs/lib/ui/version.js +3 -3
  115. package/dist-cjs/lib/ui/version.js.map +1 -1
  116. package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js +1 -1
  117. package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js.map +2 -2
  118. package/dist-cjs/lib/utils/tldr/buildFromV1Document.js +2 -3
  119. package/dist-cjs/lib/utils/tldr/buildFromV1Document.js.map +2 -2
  120. package/dist-esm/index.d.mts +19 -125
  121. package/dist-esm/index.mjs +4 -33
  122. package/dist-esm/index.mjs.map +2 -2
  123. package/dist-esm/lib/TldrawImage.mjs +2 -5
  124. package/dist-esm/lib/TldrawImage.mjs.map +2 -2
  125. package/dist-esm/lib/canvas/TldrawCropHandles.mjs +1 -1
  126. package/dist-esm/lib/canvas/TldrawCropHandles.mjs.map +2 -2
  127. package/dist-esm/lib/canvas/TldrawHandles.mjs +1 -1
  128. package/dist-esm/lib/canvas/TldrawHandles.mjs.map +2 -2
  129. package/dist-esm/lib/canvas/TldrawOverlays.mjs +1 -1
  130. package/dist-esm/lib/canvas/TldrawOverlays.mjs.map +2 -2
  131. package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs +271 -279
  132. package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs.map +2 -2
  133. package/dist-esm/lib/defaultExternalContentHandlers.mjs +0 -1
  134. package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +2 -2
  135. package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs +41 -26
  136. package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
  137. package/dist-esm/lib/shapes/arrow/arrowLabel.mjs +5 -19
  138. package/dist-esm/lib/shapes/arrow/arrowLabel.mjs.map +2 -2
  139. package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs +1 -1
  140. package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs.map +2 -2
  141. package/dist-esm/lib/shapes/arrow/toolStates/Pointing.mjs +0 -3
  142. package/dist-esm/lib/shapes/arrow/toolStates/Pointing.mjs.map +2 -2
  143. package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs +3 -0
  144. package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs.map +2 -2
  145. package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs +5 -5
  146. package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs.map +2 -2
  147. package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs +3 -0
  148. package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs.map +2 -2
  149. package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +4 -15
  150. package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
  151. package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +1 -2
  152. package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs.map +2 -2
  153. package/dist-esm/lib/shapes/shared/PathBuilder.mjs +3 -22
  154. package/dist-esm/lib/shapes/shared/PathBuilder.mjs.map +2 -2
  155. package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs +0 -1
  156. package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs.map +2 -2
  157. package/dist-esm/lib/shapes/shared/RichTextLabel.mjs +2 -5
  158. package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
  159. package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs +3 -4
  160. package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs.map +2 -2
  161. package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs +1 -10
  162. package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs.map +2 -2
  163. package/dist-esm/lib/shapes/text/TextShapeUtil.mjs +11 -5
  164. package/dist-esm/lib/shapes/text/TextShapeUtil.mjs.map +2 -2
  165. package/dist-esm/lib/styles.mjs.map +2 -2
  166. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs +1 -7
  167. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs.map +2 -2
  168. package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs +22 -43
  169. package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs.map +2 -2
  170. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +15 -2
  171. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
  172. package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs +0 -5
  173. package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs.map +2 -2
  174. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +0 -8
  175. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
  176. package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs +0 -8
  177. package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs.map +2 -2
  178. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +0 -8
  179. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
  180. package/dist-esm/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.mjs.map +2 -2
  181. package/dist-esm/lib/ui/assetUrls.mjs +13 -10
  182. package/dist-esm/lib/ui/assetUrls.mjs.map +2 -2
  183. package/dist-esm/lib/ui/components/A11y.mjs +12 -14
  184. package/dist-esm/lib/ui/components/A11y.mjs.map +2 -2
  185. package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs +1 -51
  186. package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs.map +2 -2
  187. package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs +3 -3
  188. package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs.map +2 -2
  189. package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +4 -3
  190. package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
  191. package/dist-esm/lib/ui/components/Spinner.mjs +26 -3
  192. package/dist-esm/lib/ui/components/Spinner.mjs.map +2 -2
  193. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs +1 -3
  194. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs.map +2 -2
  195. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +136 -168
  196. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
  197. package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs +9 -23
  198. package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs.map +3 -3
  199. package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +3 -3
  200. package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +2 -2
  201. package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs +2 -3
  202. package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs.map +2 -2
  203. package/dist-esm/lib/ui/components/menu-items.mjs +0 -22
  204. package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
  205. package/dist-esm/lib/ui/components/primitives/Button/TldrawUiButtonIcon.mjs.map +2 -2
  206. package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs +0 -2
  207. package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs.map +2 -2
  208. package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs +1 -1
  209. package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs.map +2 -2
  210. package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs +2 -36
  211. package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs.map +2 -2
  212. package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs +2 -6
  213. package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
  214. package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +3 -12
  215. package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs.map +2 -2
  216. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.mjs.map +2 -2
  217. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +2 -0
  218. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
  219. package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs +2 -3
  220. package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs.map +2 -2
  221. package/dist-esm/lib/ui/context/actions.mjs +8 -57
  222. package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
  223. package/dist-esm/lib/ui/context/events.mjs.map +2 -2
  224. package/dist-esm/lib/ui/hooks/menu-hooks.mjs.map +2 -2
  225. package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs +2 -2
  226. package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs.map +2 -2
  227. package/dist-esm/lib/ui/hooks/useTools.mjs.map +2 -2
  228. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +0 -11
  229. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
  230. package/dist-esm/lib/ui/kbd-utils.mjs +1 -2
  231. package/dist-esm/lib/ui/kbd-utils.mjs.map +2 -2
  232. package/dist-esm/lib/ui/version.mjs +3 -3
  233. package/dist-esm/lib/ui/version.mjs.map +1 -1
  234. package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs +1 -1
  235. package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs.map +2 -2
  236. package/dist-esm/lib/utils/tldr/buildFromV1Document.mjs +2 -3
  237. package/dist-esm/lib/utils/tldr/buildFromV1Document.mjs.map +2 -2
  238. package/package.json +3 -4
  239. package/src/index.ts +2 -24
  240. package/src/lib/TldrawImage.tsx +2 -6
  241. package/src/lib/canvas/TldrawCropHandles.tsx +1 -3
  242. package/src/lib/canvas/TldrawHandles.tsx +1 -5
  243. package/src/lib/canvas/TldrawOverlays.tsx +1 -1
  244. package/src/lib/canvas/TldrawSelectionForeground.tsx +1 -5
  245. package/src/lib/defaultExternalContentHandlers.ts +1 -2
  246. package/src/lib/shapes/arrow/ArrowShapeUtil.test.ts +5 -5
  247. package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +43 -26
  248. package/src/lib/shapes/arrow/arrowLabel.ts +3 -23
  249. package/src/lib/shapes/arrow/arrowTargetState.ts +1 -2
  250. package/src/lib/shapes/arrow/toolStates/Pointing.tsx +0 -3
  251. package/src/lib/shapes/draw/DrawShapeUtil.tsx +4 -0
  252. package/src/lib/shapes/frame/FrameShapeUtil.tsx +7 -5
  253. package/src/lib/shapes/highlight/HighlightShapeUtil.tsx +3 -0
  254. package/src/lib/shapes/line/LineShapeUtil.tsx +5 -19
  255. package/src/lib/shapes/note/NoteShapeUtil.tsx +0 -1
  256. package/src/lib/shapes/shared/PathBuilder.test.tsx +1 -1
  257. package/src/lib/shapes/shared/PathBuilder.tsx +1 -35
  258. package/src/lib/shapes/shared/PlainTextLabel.tsx +0 -1
  259. package/src/lib/shapes/shared/RichTextLabel.tsx +0 -4
  260. package/src/lib/shapes/shared/SvgTextLabel.tsx +2 -4
  261. package/src/lib/shapes/shared/usePrefersReducedMotion.tsx +1 -11
  262. package/src/lib/shapes/text/TextShapeUtil.tsx +12 -5
  263. package/src/lib/styles.tsx +1 -3
  264. package/src/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.ts +1 -8
  265. package/src/lib/tools/SelectTool/childStates/DraggingHandle.tsx +30 -54
  266. package/src/lib/tools/SelectTool/childStates/Idle.ts +24 -2
  267. package/src/lib/tools/SelectTool/childStates/PointingShape.ts +0 -7
  268. package/src/lib/tools/SelectTool/childStates/Resizing.ts +1 -12
  269. package/src/lib/tools/SelectTool/childStates/Rotating.ts +0 -11
  270. package/src/lib/tools/SelectTool/childStates/Translating.ts +0 -11
  271. package/src/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.ts +0 -1
  272. package/src/lib/ui/assetUrls.ts +13 -10
  273. package/src/lib/ui/components/A11y.tsx +13 -15
  274. package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.tsx +0 -40
  275. package/src/lib/ui/components/MainMenu/DefaultMainMenuContent.tsx +2 -4
  276. package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +4 -3
  277. package/src/lib/ui/components/Spinner.tsx +24 -2
  278. package/src/lib/ui/components/StylePanel/DefaultStylePanel.tsx +1 -3
  279. package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +127 -171
  280. package/src/lib/ui/components/Toolbar/DefaultImageToolbar.tsx +9 -25
  281. package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +3 -3
  282. package/src/lib/ui/components/Toolbar/ToggleToolLockedButton.tsx +12 -17
  283. package/src/lib/ui/components/menu-items.tsx +0 -25
  284. package/src/lib/ui/components/primitives/Button/TldrawUiButtonIcon.tsx +2 -2
  285. package/src/lib/ui/components/primitives/TldrawUiButtonPicker.tsx +0 -2
  286. package/src/lib/ui/components/primitives/TldrawUiDialog.tsx +1 -1
  287. package/src/lib/ui/components/primitives/TldrawUiIcon.tsx +3 -41
  288. package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +1 -6
  289. package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +3 -24
  290. package/src/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.tsx +2 -2
  291. package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +4 -3
  292. package/src/lib/ui/context/TldrawUiContextProvider.tsx +20 -23
  293. package/src/lib/ui/context/actions.tsx +9 -59
  294. package/src/lib/ui/context/events.tsx +2 -5
  295. package/src/lib/ui/hooks/menu-hooks.ts +0 -1
  296. package/src/lib/ui/hooks/useKeyboardShortcuts.ts +2 -3
  297. package/src/lib/ui/hooks/useTools.tsx +1 -2
  298. package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +0 -11
  299. package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +0 -11
  300. package/src/lib/ui/kbd-utils.ts +1 -2
  301. package/src/lib/ui/version.ts +3 -3
  302. package/src/lib/ui.css +23 -65
  303. package/src/lib/utils/excalidraw/__snapshots__/putExcalidrawContent.test.tsx.snap +2 -16
  304. package/src/lib/utils/excalidraw/putExcalidrawContent.ts +1 -1
  305. package/src/lib/utils/tldr/__snapshots__/buildFromV1Document.test.ts.snap +3 -24
  306. package/src/lib/utils/tldr/buildFromV1Document.ts +1 -2
  307. package/src/test/Editor.test.tsx +1 -1
  308. package/src/test/SelectTool.test.ts +11 -37
  309. package/src/test/arrows-megabus.test.tsx +6 -12
  310. package/src/test/commands/__snapshots__/getSvgString.test.ts.snap +2 -2
  311. package/src/test/commands/deletePage.test.ts +1 -84
  312. package/src/test/groups.test.tsx +1 -1
  313. package/src/test/navigation.test.ts +0 -254
  314. package/src/test/shapeutils.test.ts +45 -394
  315. package/src/test/translating.test.ts +1 -1
  316. package/tldraw.css +50 -88
  317. package/dist-cjs/lib/ui/components/AccessibilityMenu.js +0 -35
  318. package/dist-cjs/lib/ui/components/AccessibilityMenu.js.map +0 -7
  319. package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +0 -267
  320. package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +0 -7
  321. package/dist-esm/lib/ui/components/AccessibilityMenu.mjs +0 -19
  322. package/dist-esm/lib/ui/components/AccessibilityMenu.mjs.map +0 -7
  323. package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs +0 -237
  324. package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +0 -7
  325. package/src/lib/ui/components/AccessibilityMenu.tsx +0 -20
  326. package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +0 -313
  327. package/src/test/inner-outer-margin.test.ts +0 -315
@@ -137,285 +137,277 @@ const TldrawSelectionForeground = (0, import_editor.track)(function TldrawSelect
137
137
  }
138
138
  const textHandleHeight = Math.min(24 / zoom, height - targetSizeY * 3);
139
139
  const showTextResizeHandles = shouldDisplayControls && isCoarsePointer && onlyShape && editor.isShapeOfType(onlyShape, "text") && textHandleHeight * zoom >= 4;
140
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
141
- "svg",
142
- {
143
- className: "tl-overlays__item tl-selection__fg",
144
- "data-testid": "selection-foreground",
145
- "aria-hidden": "true",
146
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { ref: rSvg, children: [
147
- shouldDisplayBox && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
148
- "rect",
149
- {
150
- className: "tl-selection__fg__outline",
151
- width: (0, import_editor.toDomPrecision)(width),
152
- height: (0, import_editor.toDomPrecision)(height)
153
- }
154
- ),
155
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
156
- RotateCornerHandle,
157
- {
158
- "data-testid": "selection.rotate.top-left",
159
- cx: 0,
160
- cy: 0,
161
- targetSize,
162
- corner: "top_left_rotate",
163
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("nwse-rotate", rotation) : void 0,
164
- isHidden: hideRotateCornerHandles
165
- }
166
- ),
167
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
168
- RotateCornerHandle,
169
- {
170
- "data-testid": "selection.rotate.top-right",
171
- cx: width + targetSize * 3,
172
- cy: 0,
173
- targetSize,
174
- corner: "top_right_rotate",
175
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("nesw-rotate", rotation) : void 0,
176
- isHidden: hideRotateCornerHandles
177
- }
178
- ),
179
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
180
- RotateCornerHandle,
181
- {
182
- "data-testid": "selection.rotate.bottom-left",
183
- cx: 0,
184
- cy: height + targetSize * 3,
185
- targetSize,
186
- corner: "bottom_left_rotate",
187
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("swne-rotate", rotation) : void 0,
188
- isHidden: hideRotateCornerHandles
189
- }
190
- ),
191
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
192
- RotateCornerHandle,
193
- {
194
- "data-testid": "selection.rotate.bottom-right",
195
- cx: width + targetSize * 3,
196
- cy: height + targetSize * 3,
197
- targetSize,
198
- corner: "bottom_right_rotate",
199
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("senw-rotate", rotation) : void 0,
200
- isHidden: hideRotateCornerHandles
201
- }
202
- ),
203
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
204
- MobileRotateHandle,
205
- {
206
- "data-testid": "selection.rotate.mobile",
207
- cx: isSmallX ? -targetSize * 1.5 : width / 2,
208
- cy: isSmallX ? height / 2 : -targetSize * 1.5,
209
- size,
210
- isHidden: hideMobileRotateHandle
211
- }
212
- ),
213
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
214
- ResizeHandle,
215
- {
216
- hide: hideVerticalEdgeTargets,
217
- dataTestId: "selection.resize.top",
218
- ariaLabel: msg("handle.resize-top"),
219
- x: 0,
220
- y: (0, import_editor.toDomPrecision)(0 - (isSmallY ? targetSizeY * 2 : targetSizeY)),
221
- width: (0, import_editor.toDomPrecision)(width),
222
- height: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeY * 2)),
223
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("ns-resize", rotation) : void 0,
224
- events: topEvents
225
- }
226
- ),
227
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
228
- ResizeHandle,
229
- {
230
- hide: hideHorizontalEdgeTargets,
231
- dataTestId: "selection.resize.right",
232
- ariaLabel: msg("handle.resize-right"),
233
- x: (0, import_editor.toDomPrecision)(width - (isSmallX ? 0 : targetSizeX)),
234
- y: 0,
235
- height: (0, import_editor.toDomPrecision)(height),
236
- width: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeX * 2)),
237
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("ew-resize", rotation) : void 0,
238
- events: rightEvents
239
- }
240
- ),
241
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
242
- ResizeHandle,
243
- {
244
- hide: hideVerticalEdgeTargets,
245
- dataTestId: "selection.resize.bottom",
246
- ariaLabel: msg("handle.resize-bottom"),
247
- x: 0,
248
- y: (0, import_editor.toDomPrecision)(height - (isSmallY ? 0 : targetSizeY)),
249
- width: (0, import_editor.toDomPrecision)(width),
250
- height: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeY * 2)),
251
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("ns-resize", rotation) : void 0,
252
- events: bottomEvents
253
- }
254
- ),
255
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
256
- ResizeHandle,
257
- {
258
- hide: hideHorizontalEdgeTargets,
259
- dataTestId: "selection.resize.left",
260
- ariaLabel: msg("handle.resize-left"),
261
- x: (0, import_editor.toDomPrecision)(0 - (isSmallX ? targetSizeX * 2 : targetSizeX)),
262
- y: 0,
263
- height: (0, import_editor.toDomPrecision)(height),
264
- width: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeX * 2)),
265
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("ew-resize", rotation) : void 0,
266
- events: leftEvents
267
- }
268
- ),
269
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
270
- ResizeHandle,
271
- {
272
- hide: hideTopLeftCorner,
273
- dataTestId: "selection.target.top-left",
274
- ariaLabel: msg("handle.resize-top-left"),
275
- x: (0, import_editor.toDomPrecision)(0 - (isSmallX ? targetSizeX * 2 : targetSizeX * 1.5)),
276
- y: (0, import_editor.toDomPrecision)(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5)),
277
- width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
278
- height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
279
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("nwse-resize", rotation) : void 0,
280
- events: topLeftEvents
281
- }
282
- ),
283
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
284
- ResizeHandle,
285
- {
286
- hide: hideTopRightCorner,
287
- dataTestId: "selection.target.top-right",
288
- ariaLabel: msg("handle.resize-top-right"),
289
- x: (0, import_editor.toDomPrecision)(width - (isSmallX ? 0 : targetSizeX * 1.5)),
290
- y: (0, import_editor.toDomPrecision)(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5)),
291
- width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
292
- height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
293
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("nesw-resize", rotation) : void 0,
294
- events: topRightEvents
295
- }
296
- ),
297
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
298
- ResizeHandle,
299
- {
300
- hide: hideBottomRightCorner,
301
- dataTestId: "selection.target.bottom-right",
302
- ariaLabel: msg("handle.resize-bottom-right"),
303
- x: (0, import_editor.toDomPrecision)(width - (isSmallX ? targetSizeX : targetSizeX * 1.5)),
304
- y: (0, import_editor.toDomPrecision)(height - (isSmallY ? targetSizeY : targetSizeY * 1.5)),
305
- width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
306
- height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
307
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("nwse-resize", rotation) : void 0,
308
- events: bottomRightEvents
309
- }
310
- ),
311
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
312
- ResizeHandle,
313
- {
314
- hide: hideBottomLeftCorner,
315
- dataTestId: "selection.target.bottom-left",
316
- ariaLabel: msg("handle.resize-bottom-left"),
317
- x: (0, import_editor.toDomPrecision)(0 - (isSmallX ? targetSizeX * 3 : targetSizeX * 1.5)),
318
- y: (0, import_editor.toDomPrecision)(height - (isSmallY ? 0 : targetSizeY * 1.5)),
319
- width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
320
- height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
321
- cursor: isDefaultCursor ? (0, import_editor.getCursor)("nesw-resize", rotation) : void 0,
322
- events: bottomLeftEvents
323
- }
324
- ),
325
- showResizeHandles && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
326
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
327
- "rect",
328
- {
329
- "data-testid": "selection.resize.top-left",
330
- className: (0, import_classnames.default)("tl-corner-handle", {
331
- "tl-hidden": hideTopLeftCorner
332
- }),
333
- x: (0, import_editor.toDomPrecision)(0 - size / 2),
334
- y: (0, import_editor.toDomPrecision)(0 - size / 2),
335
- width: (0, import_editor.toDomPrecision)(size),
336
- height: (0, import_editor.toDomPrecision)(size)
337
- }
338
- ),
339
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
340
- "rect",
341
- {
342
- "data-testid": "selection.resize.top-right",
343
- className: (0, import_classnames.default)("tl-corner-handle", {
344
- "tl-hidden": hideTopRightCorner
345
- }),
346
- x: (0, import_editor.toDomPrecision)(width - size / 2),
347
- y: (0, import_editor.toDomPrecision)(0 - size / 2),
348
- width: (0, import_editor.toDomPrecision)(size),
349
- height: (0, import_editor.toDomPrecision)(size)
350
- }
351
- ),
352
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
353
- "rect",
354
- {
355
- "data-testid": "selection.resize.bottom-right",
356
- className: (0, import_classnames.default)("tl-corner-handle", {
357
- "tl-hidden": hideBottomRightCorner
358
- }),
359
- x: (0, import_editor.toDomPrecision)(width - size / 2),
360
- y: (0, import_editor.toDomPrecision)(height - size / 2),
361
- width: (0, import_editor.toDomPrecision)(size),
362
- height: (0, import_editor.toDomPrecision)(size)
363
- }
364
- ),
365
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
366
- "rect",
367
- {
368
- "data-testid": "selection.resize.bottom-left",
369
- className: (0, import_classnames.default)("tl-corner-handle", {
370
- "tl-hidden": hideBottomLeftCorner
371
- }),
372
- x: (0, import_editor.toDomPrecision)(0 - size / 2),
373
- y: (0, import_editor.toDomPrecision)(height - size / 2),
374
- width: (0, import_editor.toDomPrecision)(size),
375
- height: (0, import_editor.toDomPrecision)(size)
376
- }
377
- )
378
- ] }),
379
- showTextResizeHandles && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
380
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
381
- "rect",
382
- {
383
- "data-testid": "selection.text-resize.left.handle",
384
- className: "tl-text-handle",
385
- x: (0, import_editor.toDomPrecision)(0 - size / 4),
386
- y: (0, import_editor.toDomPrecision)(height / 2 - textHandleHeight / 2),
387
- rx: size / 4,
388
- width: (0, import_editor.toDomPrecision)(size / 2),
389
- height: (0, import_editor.toDomPrecision)(textHandleHeight)
390
- }
391
- ),
392
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
393
- "rect",
394
- {
395
- "data-testid": "selection.text-resize.right.handle",
396
- className: "tl-text-handle",
397
- rx: size / 4,
398
- x: (0, import_editor.toDomPrecision)(width - size / 4),
399
- y: (0, import_editor.toDomPrecision)(height / 2 - textHandleHeight / 2),
400
- width: (0, import_editor.toDomPrecision)(size / 2),
401
- height: (0, import_editor.toDomPrecision)(textHandleHeight)
402
- }
403
- )
404
- ] }),
405
- showCropHandles && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
406
- import_TldrawCropHandles.TldrawCropHandles,
407
- {
408
- ...{
409
- size,
410
- width,
411
- height,
412
- hideAlternateHandles: hideAlternateCropHandles
413
- }
414
- }
415
- )
416
- ] })
417
- }
418
- );
140
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "tl-overlays__item tl-selection__fg", "data-testid": "selection-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { ref: rSvg, children: [
141
+ shouldDisplayBox && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
142
+ "rect",
143
+ {
144
+ className: "tl-selection__fg__outline",
145
+ width: (0, import_editor.toDomPrecision)(width),
146
+ height: (0, import_editor.toDomPrecision)(height)
147
+ }
148
+ ),
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
150
+ RotateCornerHandle,
151
+ {
152
+ "data-testid": "selection.rotate.top-left",
153
+ cx: 0,
154
+ cy: 0,
155
+ targetSize,
156
+ corner: "top_left_rotate",
157
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("nwse-rotate", rotation) : void 0,
158
+ isHidden: hideRotateCornerHandles
159
+ }
160
+ ),
161
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
162
+ RotateCornerHandle,
163
+ {
164
+ "data-testid": "selection.rotate.top-right",
165
+ cx: width + targetSize * 3,
166
+ cy: 0,
167
+ targetSize,
168
+ corner: "top_right_rotate",
169
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("nesw-rotate", rotation) : void 0,
170
+ isHidden: hideRotateCornerHandles
171
+ }
172
+ ),
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
174
+ RotateCornerHandle,
175
+ {
176
+ "data-testid": "selection.rotate.bottom-left",
177
+ cx: 0,
178
+ cy: height + targetSize * 3,
179
+ targetSize,
180
+ corner: "bottom_left_rotate",
181
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("swne-rotate", rotation) : void 0,
182
+ isHidden: hideRotateCornerHandles
183
+ }
184
+ ),
185
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
186
+ RotateCornerHandle,
187
+ {
188
+ "data-testid": "selection.rotate.bottom-right",
189
+ cx: width + targetSize * 3,
190
+ cy: height + targetSize * 3,
191
+ targetSize,
192
+ corner: "bottom_right_rotate",
193
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("senw-rotate", rotation) : void 0,
194
+ isHidden: hideRotateCornerHandles
195
+ }
196
+ ),
197
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
198
+ MobileRotateHandle,
199
+ {
200
+ "data-testid": "selection.rotate.mobile",
201
+ cx: isSmallX ? -targetSize * 1.5 : width / 2,
202
+ cy: isSmallX ? height / 2 : -targetSize * 1.5,
203
+ size,
204
+ isHidden: hideMobileRotateHandle
205
+ }
206
+ ),
207
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
208
+ ResizeHandle,
209
+ {
210
+ hide: hideVerticalEdgeTargets,
211
+ dataTestId: "selection.resize.top",
212
+ ariaLabel: msg("handle.resize-top"),
213
+ x: 0,
214
+ y: (0, import_editor.toDomPrecision)(0 - (isSmallY ? targetSizeY * 2 : targetSizeY)),
215
+ width: (0, import_editor.toDomPrecision)(width),
216
+ height: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeY * 2)),
217
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("ns-resize", rotation) : void 0,
218
+ events: topEvents
219
+ }
220
+ ),
221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
222
+ ResizeHandle,
223
+ {
224
+ hide: hideHorizontalEdgeTargets,
225
+ dataTestId: "selection.resize.right",
226
+ ariaLabel: msg("handle.resize-right"),
227
+ x: (0, import_editor.toDomPrecision)(width - (isSmallX ? 0 : targetSizeX)),
228
+ y: 0,
229
+ height: (0, import_editor.toDomPrecision)(height),
230
+ width: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeX * 2)),
231
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("ew-resize", rotation) : void 0,
232
+ events: rightEvents
233
+ }
234
+ ),
235
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
236
+ ResizeHandle,
237
+ {
238
+ hide: hideVerticalEdgeTargets,
239
+ dataTestId: "selection.resize.bottom",
240
+ ariaLabel: msg("handle.resize-bottom"),
241
+ x: 0,
242
+ y: (0, import_editor.toDomPrecision)(height - (isSmallY ? 0 : targetSizeY)),
243
+ width: (0, import_editor.toDomPrecision)(width),
244
+ height: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeY * 2)),
245
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("ns-resize", rotation) : void 0,
246
+ events: bottomEvents
247
+ }
248
+ ),
249
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
250
+ ResizeHandle,
251
+ {
252
+ hide: hideHorizontalEdgeTargets,
253
+ dataTestId: "selection.resize.left",
254
+ ariaLabel: msg("handle.resize-left"),
255
+ x: (0, import_editor.toDomPrecision)(0 - (isSmallX ? targetSizeX * 2 : targetSizeX)),
256
+ y: 0,
257
+ height: (0, import_editor.toDomPrecision)(height),
258
+ width: (0, import_editor.toDomPrecision)(Math.max(1, targetSizeX * 2)),
259
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("ew-resize", rotation) : void 0,
260
+ events: leftEvents
261
+ }
262
+ ),
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
264
+ ResizeHandle,
265
+ {
266
+ hide: hideTopLeftCorner,
267
+ dataTestId: "selection.target.top-left",
268
+ ariaLabel: msg("handle.resize-top-left"),
269
+ x: (0, import_editor.toDomPrecision)(0 - (isSmallX ? targetSizeX * 2 : targetSizeX * 1.5)),
270
+ y: (0, import_editor.toDomPrecision)(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5)),
271
+ width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
272
+ height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
273
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("nwse-resize", rotation) : void 0,
274
+ events: topLeftEvents
275
+ }
276
+ ),
277
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
278
+ ResizeHandle,
279
+ {
280
+ hide: hideTopRightCorner,
281
+ dataTestId: "selection.target.top-right",
282
+ ariaLabel: msg("handle.resize-top-right"),
283
+ x: (0, import_editor.toDomPrecision)(width - (isSmallX ? 0 : targetSizeX * 1.5)),
284
+ y: (0, import_editor.toDomPrecision)(0 - (isSmallY ? targetSizeY * 2 : targetSizeY * 1.5)),
285
+ width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
286
+ height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
287
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("nesw-resize", rotation) : void 0,
288
+ events: topRightEvents
289
+ }
290
+ ),
291
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
292
+ ResizeHandle,
293
+ {
294
+ hide: hideBottomRightCorner,
295
+ dataTestId: "selection.target.bottom-right",
296
+ ariaLabel: msg("handle.resize-bottom-right"),
297
+ x: (0, import_editor.toDomPrecision)(width - (isSmallX ? targetSizeX : targetSizeX * 1.5)),
298
+ y: (0, import_editor.toDomPrecision)(height - (isSmallY ? targetSizeY : targetSizeY * 1.5)),
299
+ width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
300
+ height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
301
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("nwse-resize", rotation) : void 0,
302
+ events: bottomRightEvents
303
+ }
304
+ ),
305
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
306
+ ResizeHandle,
307
+ {
308
+ hide: hideBottomLeftCorner,
309
+ dataTestId: "selection.target.bottom-left",
310
+ ariaLabel: msg("handle.resize-bottom-left"),
311
+ x: (0, import_editor.toDomPrecision)(0 - (isSmallX ? targetSizeX * 3 : targetSizeX * 1.5)),
312
+ y: (0, import_editor.toDomPrecision)(height - (isSmallY ? 0 : targetSizeY * 1.5)),
313
+ width: (0, import_editor.toDomPrecision)(targetSizeX * 3),
314
+ height: (0, import_editor.toDomPrecision)(targetSizeY * 3),
315
+ cursor: isDefaultCursor ? (0, import_editor.getCursor)("nesw-resize", rotation) : void 0,
316
+ events: bottomLeftEvents
317
+ }
318
+ ),
319
+ showResizeHandles && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
320
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
321
+ "rect",
322
+ {
323
+ "data-testid": "selection.resize.top-left",
324
+ className: (0, import_classnames.default)("tl-corner-handle", {
325
+ "tl-hidden": hideTopLeftCorner
326
+ }),
327
+ x: (0, import_editor.toDomPrecision)(0 - size / 2),
328
+ y: (0, import_editor.toDomPrecision)(0 - size / 2),
329
+ width: (0, import_editor.toDomPrecision)(size),
330
+ height: (0, import_editor.toDomPrecision)(size)
331
+ }
332
+ ),
333
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
334
+ "rect",
335
+ {
336
+ "data-testid": "selection.resize.top-right",
337
+ className: (0, import_classnames.default)("tl-corner-handle", {
338
+ "tl-hidden": hideTopRightCorner
339
+ }),
340
+ x: (0, import_editor.toDomPrecision)(width - size / 2),
341
+ y: (0, import_editor.toDomPrecision)(0 - size / 2),
342
+ width: (0, import_editor.toDomPrecision)(size),
343
+ height: (0, import_editor.toDomPrecision)(size)
344
+ }
345
+ ),
346
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
347
+ "rect",
348
+ {
349
+ "data-testid": "selection.resize.bottom-right",
350
+ className: (0, import_classnames.default)("tl-corner-handle", {
351
+ "tl-hidden": hideBottomRightCorner
352
+ }),
353
+ x: (0, import_editor.toDomPrecision)(width - size / 2),
354
+ y: (0, import_editor.toDomPrecision)(height - size / 2),
355
+ width: (0, import_editor.toDomPrecision)(size),
356
+ height: (0, import_editor.toDomPrecision)(size)
357
+ }
358
+ ),
359
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
360
+ "rect",
361
+ {
362
+ "data-testid": "selection.resize.bottom-left",
363
+ className: (0, import_classnames.default)("tl-corner-handle", {
364
+ "tl-hidden": hideBottomLeftCorner
365
+ }),
366
+ x: (0, import_editor.toDomPrecision)(0 - size / 2),
367
+ y: (0, import_editor.toDomPrecision)(height - size / 2),
368
+ width: (0, import_editor.toDomPrecision)(size),
369
+ height: (0, import_editor.toDomPrecision)(size)
370
+ }
371
+ )
372
+ ] }),
373
+ showTextResizeHandles && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
374
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
375
+ "rect",
376
+ {
377
+ "data-testid": "selection.text-resize.left.handle",
378
+ className: "tl-text-handle",
379
+ x: (0, import_editor.toDomPrecision)(0 - size / 4),
380
+ y: (0, import_editor.toDomPrecision)(height / 2 - textHandleHeight / 2),
381
+ rx: size / 4,
382
+ width: (0, import_editor.toDomPrecision)(size / 2),
383
+ height: (0, import_editor.toDomPrecision)(textHandleHeight)
384
+ }
385
+ ),
386
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
387
+ "rect",
388
+ {
389
+ "data-testid": "selection.text-resize.right.handle",
390
+ className: "tl-text-handle",
391
+ rx: size / 4,
392
+ x: (0, import_editor.toDomPrecision)(width - size / 4),
393
+ y: (0, import_editor.toDomPrecision)(height / 2 - textHandleHeight / 2),
394
+ width: (0, import_editor.toDomPrecision)(size / 2),
395
+ height: (0, import_editor.toDomPrecision)(textHandleHeight)
396
+ }
397
+ )
398
+ ] }),
399
+ showCropHandles && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
400
+ import_TldrawCropHandles.TldrawCropHandles,
401
+ {
402
+ ...{
403
+ size,
404
+ width,
405
+ height,
406
+ hideAlternateHandles: hideAlternateCropHandles
407
+ }
408
+ }
409
+ )
410
+ ] }) });
419
411
  });
420
412
  const ResizeHandle = function ResizeHandle2({
421
413
  hide,