tldraw 5.5.2 → 5.6.0-canary.0091c91994d6

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 (639) hide show
  1. package/DOCS.md +264 -93
  2. package/RELEASE_NOTES.md +8 -36
  3. package/dist-cjs/index.d.ts +161 -26
  4. package/dist-cjs/index.js +6 -1
  5. package/dist-cjs/index.js.map +2 -2
  6. package/dist-cjs/lib/Tldraw.js +1 -1
  7. package/dist-cjs/lib/Tldraw.js.map +2 -2
  8. package/dist-cjs/lib/defaultExternalContentHandlers.js +31 -11
  9. package/dist-cjs/lib/defaultExternalContentHandlers.js.map +2 -2
  10. package/dist-cjs/lib/overlays/ShapeIndicatorOverlayUtil.js +1 -1
  11. package/dist-cjs/lib/overlays/ShapeIndicatorOverlayUtil.js.map +2 -2
  12. package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js +3 -0
  13. package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
  14. package/dist-cjs/lib/shapes/arrow/toolStates/Idle.js +24 -16
  15. package/dist-cjs/lib/shapes/arrow/toolStates/Idle.js.map +2 -2
  16. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +6 -0
  17. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +2 -2
  18. package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js +3 -0
  19. package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js.map +2 -2
  20. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js +4 -1
  21. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js.map +2 -2
  22. package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js +13 -0
  23. package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js.map +2 -2
  24. package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js +3 -0
  25. package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js.map +2 -2
  26. package/dist-cjs/lib/shapes/image/ImageShapeUtil.js +9 -0
  27. package/dist-cjs/lib/shapes/image/ImageShapeUtil.js.map +2 -2
  28. package/dist-cjs/lib/shapes/line/LineShapeUtil.js +3 -0
  29. package/dist-cjs/lib/shapes/line/LineShapeUtil.js.map +2 -2
  30. package/dist-cjs/lib/shapes/shared/interpolate-props.js +5 -0
  31. package/dist-cjs/lib/shapes/shared/interpolate-props.js.map +2 -2
  32. package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +6 -0
  33. package/dist-cjs/lib/shapes/video/VideoShapeUtil.js.map +2 -2
  34. package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js +3 -6
  35. package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js.map +2 -2
  36. package/dist-cjs/lib/tools/LaserTool/LaserTool.js +14 -0
  37. package/dist-cjs/lib/tools/LaserTool/LaserTool.js.map +2 -2
  38. package/dist-cjs/lib/tools/LaserTool/childStates/Idle.js +2 -8
  39. package/dist-cjs/lib/tools/LaserTool/childStates/Idle.js.map +2 -2
  40. package/dist-cjs/lib/tools/LaserTool/childStates/Lasering.js +8 -1
  41. package/dist-cjs/lib/tools/LaserTool/childStates/Lasering.js.map +2 -2
  42. package/dist-cjs/lib/tools/SelectTool/DragAndDropManager.js +2 -8
  43. package/dist-cjs/lib/tools/SelectTool/DragAndDropManager.js.map +2 -2
  44. package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js +13 -9
  45. package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js.map +3 -3
  46. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Cropping.js +2 -1
  47. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Cropping.js.map +2 -2
  48. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Idle.js +2 -9
  49. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Idle.js.map +2 -2
  50. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js +6 -13
  51. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js.map +2 -2
  52. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCropHandle.js +5 -12
  53. package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCropHandle.js.map +2 -2
  54. package/dist-cjs/lib/tools/SelectTool/childStates/EditingShape.js +2 -2
  55. package/dist-cjs/lib/tools/SelectTool/childStates/EditingShape.js.map +2 -2
  56. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +44 -71
  57. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +3 -3
  58. package/dist-cjs/lib/tools/SelectTool/childStates/PointingCanvas.js +6 -4
  59. package/dist-cjs/lib/tools/SelectTool/childStates/PointingCanvas.js.map +2 -2
  60. package/dist-cjs/lib/tools/SelectTool/childStates/PointingHandle.js +4 -16
  61. package/dist-cjs/lib/tools/SelectTool/childStates/PointingHandle.js.map +2 -2
  62. package/dist-cjs/lib/tools/SelectTool/childStates/PointingResizeHandle.js +5 -14
  63. package/dist-cjs/lib/tools/SelectTool/childStates/PointingResizeHandle.js.map +2 -2
  64. package/dist-cjs/lib/tools/SelectTool/childStates/PointingRotateHandle.js +5 -12
  65. package/dist-cjs/lib/tools/SelectTool/childStates/PointingRotateHandle.js.map +2 -2
  66. package/dist-cjs/lib/tools/SelectTool/childStates/PointingSelection.js +2 -7
  67. package/dist-cjs/lib/tools/SelectTool/childStates/PointingSelection.js.map +2 -2
  68. package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js +19 -23
  69. package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js.map +2 -2
  70. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +2 -2
  71. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
  72. package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js +1 -2
  73. package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js.map +2 -2
  74. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +0 -2
  75. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
  76. package/dist-cjs/lib/tools/SelectTool/selectHelpers.js +53 -0
  77. package/dist-cjs/lib/tools/SelectTool/selectHelpers.js.map +2 -2
  78. package/dist-cjs/lib/tools/selection-logic/selectOnCanvasPointerUp.js +2 -1
  79. package/dist-cjs/lib/tools/selection-logic/selectOnCanvasPointerUp.js.map +2 -2
  80. package/dist-cjs/lib/tools/selection-logic/updateHoveredShapeId.js.map +2 -2
  81. package/dist-cjs/lib/ui/TldrawUi.js +7 -1
  82. package/dist-cjs/lib/ui/TldrawUi.js.map +2 -2
  83. package/dist-cjs/lib/ui/components/A11y.js +24 -7
  84. package/dist-cjs/lib/ui/components/A11y.js.map +2 -2
  85. package/dist-cjs/lib/ui/components/AccessibilityMenu.js +5 -1
  86. package/dist-cjs/lib/ui/components/AccessibilityMenu.js.map +2 -2
  87. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js +6 -2
  88. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js.map +2 -2
  89. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.js +26 -48
  90. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.js.map +2 -2
  91. package/dist-cjs/lib/ui/components/ColorSchemeMenu.js +12 -6
  92. package/dist-cjs/lib/ui/components/ColorSchemeMenu.js.map +2 -2
  93. package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenu.js +4 -1
  94. package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenu.js.map +2 -2
  95. package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenuContent.js +13 -1
  96. package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenuContent.js.map +2 -2
  97. package/dist-cjs/lib/ui/components/CursorChatBubble.js +4 -1
  98. package/dist-cjs/lib/ui/components/CursorChatBubble.js.map +2 -2
  99. package/dist-cjs/lib/ui/components/DefaultMenuPanel.js +4 -1
  100. package/dist-cjs/lib/ui/components/DefaultMenuPanel.js.map +2 -2
  101. package/dist-cjs/lib/ui/components/EditLinkDialog.js +11 -8
  102. package/dist-cjs/lib/ui/components/EditLinkDialog.js.map +2 -2
  103. package/dist-cjs/lib/ui/components/EmbedDialog.js +24 -8
  104. package/dist-cjs/lib/ui/components/EmbedDialog.js.map +2 -2
  105. package/dist-cjs/lib/ui/components/HelpMenu/DefaultHelpMenu.js +12 -1
  106. package/dist-cjs/lib/ui/components/HelpMenu/DefaultHelpMenu.js.map +2 -2
  107. package/dist-cjs/lib/ui/components/HelpMenu/DefaultHelpMenuContent.js +8 -1
  108. package/dist-cjs/lib/ui/components/HelpMenu/DefaultHelpMenuContent.js.map +2 -2
  109. package/dist-cjs/lib/ui/components/InputModeMenu.js +18 -5
  110. package/dist-cjs/lib/ui/components/InputModeMenu.js.map +2 -2
  111. package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog.js +9 -2
  112. package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog.js.map +2 -2
  113. package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js +98 -27
  114. package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js.map +2 -2
  115. package/dist-cjs/lib/ui/components/LanguageMenu.js +6 -3
  116. package/dist-cjs/lib/ui/components/LanguageMenu.js.map +2 -2
  117. package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenu.js +4 -1
  118. package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenu.js.map +2 -2
  119. package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js +13 -9
  120. package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js.map +2 -2
  121. package/dist-cjs/lib/ui/components/Minimap/DefaultMinimap.js +4 -1
  122. package/dist-cjs/lib/ui/components/Minimap/DefaultMinimap.js.map +2 -2
  123. package/dist-cjs/lib/ui/components/MobileStylePanel.js +2 -1
  124. package/dist-cjs/lib/ui/components/MobileStylePanel.js.map +2 -2
  125. package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +9 -2
  126. package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
  127. package/dist-cjs/lib/ui/components/OfflineIndicator/OfflineIndicator.js +5 -1
  128. package/dist-cjs/lib/ui/components/OfflineIndicator/OfflineIndicator.js.map +2 -2
  129. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js +49 -28
  130. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js.map +3 -3
  131. package/dist-cjs/lib/ui/components/PageMenu/PageItemSubmenu.js +32 -7
  132. package/dist-cjs/lib/ui/components/PageMenu/PageItemSubmenu.js.map +2 -2
  133. package/dist-cjs/lib/ui/components/QuickActions/DefaultQuickActionsContent.js +4 -10
  134. package/dist-cjs/lib/ui/components/QuickActions/DefaultQuickActionsContent.js.map +2 -2
  135. package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenu.js +4 -1
  136. package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenu.js.map +2 -2
  137. package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuItem.js +17 -3
  138. package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuItem.js.map +2 -2
  139. package/dist-cjs/lib/ui/components/SharePanel/DefaultUserPresenceEditor.js +8 -3
  140. package/dist-cjs/lib/ui/components/SharePanel/DefaultUserPresenceEditor.js.map +2 -2
  141. package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js +4 -1
  142. package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js.map +2 -2
  143. package/dist-cjs/lib/ui/components/Spinner.js +4 -1
  144. package/dist-cjs/lib/ui/components/Spinner.js.map +2 -2
  145. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +12 -11
  146. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
  147. package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js +4 -3
  148. package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js.map +2 -2
  149. package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js +3 -2
  150. package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js.map +2 -2
  151. package/dist-cjs/lib/ui/components/StylePanel/StylePanelDropdownPicker.js +5 -4
  152. package/dist-cjs/lib/ui/components/StylePanel/StylePanelDropdownPicker.js.map +2 -2
  153. package/dist-cjs/lib/ui/components/Toasts.js +12 -3
  154. package/dist-cjs/lib/ui/components/Toasts.js.map +2 -2
  155. package/dist-cjs/lib/ui/components/Toolbar/AltTextEditor.js +7 -3
  156. package/dist-cjs/lib/ui/components/Toolbar/AltTextEditor.js.map +2 -2
  157. package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js +4 -1
  158. package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js.map +2 -2
  159. package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbarContent.js +27 -10
  160. package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbarContent.js.map +2 -2
  161. package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbar.js +7 -1
  162. package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbar.js.map +2 -2
  163. package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.js +12 -4
  164. package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.js.map +2 -2
  165. package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js +4 -1
  166. package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js.map +2 -2
  167. package/dist-cjs/lib/ui/components/Toolbar/DefaultVideoToolbar.js +4 -1
  168. package/dist-cjs/lib/ui/components/Toolbar/DefaultVideoToolbar.js.map +2 -2
  169. package/dist-cjs/lib/ui/components/Toolbar/DefaultVideoToolbarContent.js +8 -3
  170. package/dist-cjs/lib/ui/components/Toolbar/DefaultVideoToolbarContent.js.map +2 -2
  171. package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js +6 -2
  172. package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js.map +2 -2
  173. package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +7 -3
  174. package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +2 -2
  175. package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +4 -1
  176. package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js.map +2 -2
  177. package/dist-cjs/lib/ui/components/ZoomMenu/DefaultZoomMenu.js +5 -2
  178. package/dist-cjs/lib/ui/components/ZoomMenu/DefaultZoomMenu.js.map +2 -2
  179. package/dist-cjs/lib/ui/components/menu-items.js +115 -344
  180. package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
  181. package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButtonCheck.js +6 -1
  182. package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButtonCheck.js.map +2 -2
  183. package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js +5 -1
  184. package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js.map +2 -2
  185. package/dist-cjs/lib/ui/components/primitives/TldrawUiDropdownMenu.js +5 -2
  186. package/dist-cjs/lib/ui/components/primitives/TldrawUiDropdownMenu.js.map +2 -2
  187. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem.js +16 -2
  188. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem.js.map +2 -2
  189. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuActionItem.js +23 -2
  190. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuActionItem.js.map +2 -2
  191. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.js +5 -1
  192. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.js.map +2 -2
  193. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuContext.js +2 -1
  194. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuContext.js.map +2 -2
  195. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +13 -4
  196. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
  197. package/dist-cjs/lib/ui/consumerMessages.js +70 -0
  198. package/dist-cjs/lib/ui/consumerMessages.js.map +7 -0
  199. package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js +19 -2
  200. package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js.map +2 -2
  201. package/dist-cjs/lib/ui/context/action-predicates.js +157 -0
  202. package/dist-cjs/lib/ui/context/action-predicates.js.map +7 -0
  203. package/dist-cjs/lib/ui/context/action-state.js +81 -0
  204. package/dist-cjs/lib/ui/context/action-state.js.map +7 -0
  205. package/dist-cjs/lib/ui/context/actions.js +555 -306
  206. package/dist-cjs/lib/ui/context/actions.js.map +3 -3
  207. package/dist-cjs/lib/ui/context/events.js.map +2 -2
  208. package/dist-cjs/lib/ui/context/i18n.js +57 -0
  209. package/dist-cjs/lib/ui/context/i18n.js.map +7 -0
  210. package/dist-cjs/lib/ui/hooks/menu-hooks.js +4 -88
  211. package/dist-cjs/lib/ui/hooks/menu-hooks.js.map +2 -2
  212. package/dist-cjs/lib/ui/hooks/useActionState.js +59 -0
  213. package/dist-cjs/lib/ui/hooks/useActionState.js.map +7 -0
  214. package/dist-cjs/lib/ui/hooks/useCopyAs.js +9 -2
  215. package/dist-cjs/lib/ui/hooks/useCopyAs.js.map +2 -2
  216. package/dist-cjs/lib/ui/hooks/useExportAs.js +12 -2
  217. package/dist-cjs/lib/ui/hooks/useExportAs.js.map +2 -2
  218. package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js +1 -0
  219. package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js.map +2 -2
  220. package/dist-cjs/lib/ui/hooks/useTools.js +54 -14
  221. package/dist-cjs/lib/ui/hooks/useTools.js.map +2 -2
  222. package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
  223. package/dist-cjs/lib/ui/hooks/useTranslation/translations.js +10 -13
  224. package/dist-cjs/lib/ui/hooks/useTranslation/translations.js.map +2 -2
  225. package/dist-cjs/lib/ui/hooks/useTranslation/useTranslation.js +65 -17
  226. package/dist-cjs/lib/ui/hooks/useTranslation/useTranslation.js.map +2 -2
  227. package/dist-cjs/lib/ui/overrides.js.map +2 -2
  228. package/dist-cjs/lib/ui/styleMessages.js +150 -0
  229. package/dist-cjs/lib/ui/styleMessages.js.map +7 -0
  230. package/dist-cjs/lib/ui/version.js +3 -3
  231. package/dist-cjs/lib/ui/version.js.map +1 -1
  232. package/dist-cjs/lib/utils/frames/frames.js +1 -1
  233. package/dist-cjs/lib/utils/frames/frames.js.map +2 -2
  234. package/dist-cjs/lib/utils/text/richText.js +3 -2
  235. package/dist-cjs/lib/utils/text/richText.js.map +2 -2
  236. package/dist-cjs/lib/utils/tldr/file.js +26 -7
  237. package/dist-cjs/lib/utils/tldr/file.js.map +2 -2
  238. package/dist-esm/index.d.mts +161 -26
  239. package/dist-esm/index.mjs +9 -1
  240. package/dist-esm/index.mjs.map +2 -2
  241. package/dist-esm/lib/Tldraw.mjs +2 -1
  242. package/dist-esm/lib/Tldraw.mjs.map +2 -2
  243. package/dist-esm/lib/defaultExternalContentHandlers.mjs +36 -15
  244. package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +2 -2
  245. package/dist-esm/lib/overlays/ShapeIndicatorOverlayUtil.mjs +1 -1
  246. package/dist-esm/lib/overlays/ShapeIndicatorOverlayUtil.mjs.map +2 -2
  247. package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs +3 -0
  248. package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
  249. package/dist-esm/lib/shapes/arrow/toolStates/Idle.mjs +24 -16
  250. package/dist-esm/lib/shapes/arrow/toolStates/Idle.mjs.map +2 -2
  251. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +11 -3
  252. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +2 -2
  253. package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs +3 -0
  254. package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs.map +2 -2
  255. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs +5 -2
  256. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs.map +2 -2
  257. package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs +23 -9
  258. package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs.map +2 -2
  259. package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs +3 -0
  260. package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs.map +2 -2
  261. package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs +19 -8
  262. package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs.map +2 -2
  263. package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +3 -0
  264. package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
  265. package/dist-esm/lib/shapes/shared/interpolate-props.mjs +5 -0
  266. package/dist-esm/lib/shapes/shared/interpolate-props.mjs.map +2 -2
  267. package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs +11 -3
  268. package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs.map +2 -2
  269. package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs +3 -6
  270. package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs.map +2 -2
  271. package/dist-esm/lib/tools/LaserTool/LaserTool.mjs +14 -0
  272. package/dist-esm/lib/tools/LaserTool/LaserTool.mjs.map +2 -2
  273. package/dist-esm/lib/tools/LaserTool/childStates/Idle.mjs +2 -8
  274. package/dist-esm/lib/tools/LaserTool/childStates/Idle.mjs.map +2 -2
  275. package/dist-esm/lib/tools/LaserTool/childStates/Lasering.mjs +8 -1
  276. package/dist-esm/lib/tools/LaserTool/childStates/Lasering.mjs.map +2 -2
  277. package/dist-esm/lib/tools/SelectTool/DragAndDropManager.mjs +2 -8
  278. package/dist-esm/lib/tools/SelectTool/DragAndDropManager.mjs.map +2 -2
  279. package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs +13 -9
  280. package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs.map +3 -3
  281. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Cropping.mjs +2 -2
  282. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Cropping.mjs.map +2 -2
  283. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Idle.mjs +2 -9
  284. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Idle.mjs.map +2 -2
  285. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs +6 -13
  286. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs.map +2 -2
  287. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCropHandle.mjs +5 -12
  288. package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCropHandle.mjs.map +2 -2
  289. package/dist-esm/lib/tools/SelectTool/childStates/EditingShape.mjs +2 -2
  290. package/dist-esm/lib/tools/SelectTool/childStates/EditingShape.mjs.map +2 -2
  291. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +45 -71
  292. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +3 -3
  293. package/dist-esm/lib/tools/SelectTool/childStates/PointingCanvas.mjs +6 -4
  294. package/dist-esm/lib/tools/SelectTool/childStates/PointingCanvas.mjs.map +2 -2
  295. package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs +5 -17
  296. package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs.map +2 -2
  297. package/dist-esm/lib/tools/SelectTool/childStates/PointingResizeHandle.mjs +5 -14
  298. package/dist-esm/lib/tools/SelectTool/childStates/PointingResizeHandle.mjs.map +2 -2
  299. package/dist-esm/lib/tools/SelectTool/childStates/PointingRotateHandle.mjs +5 -12
  300. package/dist-esm/lib/tools/SelectTool/childStates/PointingRotateHandle.mjs.map +2 -2
  301. package/dist-esm/lib/tools/SelectTool/childStates/PointingSelection.mjs +2 -7
  302. package/dist-esm/lib/tools/SelectTool/childStates/PointingSelection.mjs.map +2 -2
  303. package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs +20 -24
  304. package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs.map +2 -2
  305. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +2 -3
  306. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
  307. package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs +1 -2
  308. package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs.map +2 -2
  309. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +0 -2
  310. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
  311. package/dist-esm/lib/tools/SelectTool/selectHelpers.mjs +56 -1
  312. package/dist-esm/lib/tools/SelectTool/selectHelpers.mjs.map +2 -2
  313. package/dist-esm/lib/tools/selection-logic/selectOnCanvasPointerUp.mjs +2 -1
  314. package/dist-esm/lib/tools/selection-logic/selectOnCanvasPointerUp.mjs.map +2 -2
  315. package/dist-esm/lib/tools/selection-logic/updateHoveredShapeId.mjs.map +2 -2
  316. package/dist-esm/lib/ui/TldrawUi.mjs +15 -2
  317. package/dist-esm/lib/ui/TldrawUi.mjs.map +2 -2
  318. package/dist-esm/lib/ui/components/A11y.mjs +25 -7
  319. package/dist-esm/lib/ui/components/A11y.mjs.map +2 -2
  320. package/dist-esm/lib/ui/components/AccessibilityMenu.mjs +5 -1
  321. package/dist-esm/lib/ui/components/AccessibilityMenu.mjs.map +2 -2
  322. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs +6 -2
  323. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs.map +2 -2
  324. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.mjs +26 -55
  325. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.mjs.map +2 -2
  326. package/dist-esm/lib/ui/components/ColorSchemeMenu.mjs +13 -7
  327. package/dist-esm/lib/ui/components/ColorSchemeMenu.mjs.map +2 -2
  328. package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenu.mjs +5 -1
  329. package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenu.mjs.map +2 -2
  330. package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenuContent.mjs +13 -1
  331. package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenuContent.mjs.map +2 -2
  332. package/dist-esm/lib/ui/components/CursorChatBubble.mjs +5 -2
  333. package/dist-esm/lib/ui/components/CursorChatBubble.mjs.map +2 -2
  334. package/dist-esm/lib/ui/components/DefaultMenuPanel.mjs +5 -2
  335. package/dist-esm/lib/ui/components/DefaultMenuPanel.mjs.map +2 -2
  336. package/dist-esm/lib/ui/components/EditLinkDialog.mjs +12 -9
  337. package/dist-esm/lib/ui/components/EditLinkDialog.mjs.map +2 -2
  338. package/dist-esm/lib/ui/components/EmbedDialog.mjs +25 -9
  339. package/dist-esm/lib/ui/components/EmbedDialog.mjs.map +2 -2
  340. package/dist-esm/lib/ui/components/HelpMenu/DefaultHelpMenu.mjs +13 -2
  341. package/dist-esm/lib/ui/components/HelpMenu/DefaultHelpMenu.mjs.map +2 -2
  342. package/dist-esm/lib/ui/components/HelpMenu/DefaultHelpMenuContent.mjs +8 -1
  343. package/dist-esm/lib/ui/components/HelpMenu/DefaultHelpMenuContent.mjs.map +2 -2
  344. package/dist-esm/lib/ui/components/InputModeMenu.mjs +19 -6
  345. package/dist-esm/lib/ui/components/InputModeMenu.mjs.map +2 -2
  346. package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog.mjs +10 -3
  347. package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog.mjs.map +2 -2
  348. package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs +99 -28
  349. package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs.map +2 -2
  350. package/dist-esm/lib/ui/components/LanguageMenu.mjs +7 -4
  351. package/dist-esm/lib/ui/components/LanguageMenu.mjs.map +2 -2
  352. package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenu.mjs +5 -2
  353. package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenu.mjs.map +2 -2
  354. package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs +13 -9
  355. package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs.map +2 -2
  356. package/dist-esm/lib/ui/components/Minimap/DefaultMinimap.mjs +8 -4
  357. package/dist-esm/lib/ui/components/Minimap/DefaultMinimap.mjs.map +2 -2
  358. package/dist-esm/lib/ui/components/MobileStylePanel.mjs +2 -1
  359. package/dist-esm/lib/ui/components/MobileStylePanel.mjs.map +2 -2
  360. package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +10 -3
  361. package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
  362. package/dist-esm/lib/ui/components/OfflineIndicator/OfflineIndicator.mjs +5 -1
  363. package/dist-esm/lib/ui/components/OfflineIndicator/OfflineIndicator.mjs.map +2 -2
  364. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +51 -29
  365. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +3 -3
  366. package/dist-esm/lib/ui/components/PageMenu/PageItemSubmenu.mjs +33 -8
  367. package/dist-esm/lib/ui/components/PageMenu/PageItemSubmenu.mjs.map +2 -2
  368. package/dist-esm/lib/ui/components/QuickActions/DefaultQuickActionsContent.mjs +4 -15
  369. package/dist-esm/lib/ui/components/QuickActions/DefaultQuickActionsContent.mjs.map +2 -2
  370. package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenu.mjs +5 -2
  371. package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenu.mjs.map +2 -2
  372. package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuItem.mjs +18 -4
  373. package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuItem.mjs.map +2 -2
  374. package/dist-esm/lib/ui/components/SharePanel/DefaultUserPresenceEditor.mjs +9 -4
  375. package/dist-esm/lib/ui/components/SharePanel/DefaultUserPresenceEditor.mjs.map +2 -2
  376. package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs +12 -2
  377. package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs.map +2 -2
  378. package/dist-esm/lib/ui/components/Spinner.mjs +5 -2
  379. package/dist-esm/lib/ui/components/Spinner.mjs.map +2 -2
  380. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +12 -11
  381. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
  382. package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs +4 -3
  383. package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs.map +2 -2
  384. package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs +3 -2
  385. package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs.map +2 -2
  386. package/dist-esm/lib/ui/components/StylePanel/StylePanelDropdownPicker.mjs +5 -4
  387. package/dist-esm/lib/ui/components/StylePanel/StylePanelDropdownPicker.mjs.map +2 -2
  388. package/dist-esm/lib/ui/components/Toasts.mjs +13 -4
  389. package/dist-esm/lib/ui/components/Toasts.mjs.map +2 -2
  390. package/dist-esm/lib/ui/components/Toolbar/AltTextEditor.mjs +12 -4
  391. package/dist-esm/lib/ui/components/Toolbar/AltTextEditor.mjs.map +2 -2
  392. package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs +5 -2
  393. package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs.map +2 -2
  394. package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbarContent.mjs +28 -10
  395. package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbarContent.mjs.map +2 -2
  396. package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbar.mjs +15 -2
  397. package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbar.mjs.map +2 -2
  398. package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.mjs +18 -5
  399. package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.mjs.map +2 -2
  400. package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs +5 -2
  401. package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs.map +2 -2
  402. package/dist-esm/lib/ui/components/Toolbar/DefaultVideoToolbar.mjs +5 -2
  403. package/dist-esm/lib/ui/components/Toolbar/DefaultVideoToolbar.mjs.map +2 -2
  404. package/dist-esm/lib/ui/components/Toolbar/DefaultVideoToolbarContent.mjs +9 -4
  405. package/dist-esm/lib/ui/components/Toolbar/DefaultVideoToolbarContent.mjs.map +2 -2
  406. package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs +7 -3
  407. package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs.map +2 -2
  408. package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +8 -3
  409. package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +2 -2
  410. package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs +5 -2
  411. package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs.map +2 -2
  412. package/dist-esm/lib/ui/components/ZoomMenu/DefaultZoomMenu.mjs +6 -3
  413. package/dist-esm/lib/ui/components/ZoomMenu/DefaultZoomMenu.mjs.map +2 -2
  414. package/dist-esm/lib/ui/components/menu-items.mjs +117 -354
  415. package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
  416. package/dist-esm/lib/ui/components/primitives/Button/TldrawUiButtonCheck.mjs +6 -1
  417. package/dist-esm/lib/ui/components/primitives/Button/TldrawUiButtonCheck.mjs.map +2 -2
  418. package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs +5 -1
  419. package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs.map +2 -2
  420. package/dist-esm/lib/ui/components/primitives/TldrawUiDropdownMenu.mjs +6 -3
  421. package/dist-esm/lib/ui/components/primitives/TldrawUiDropdownMenu.mjs.map +2 -2
  422. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem.mjs +16 -2
  423. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem.mjs.map +2 -2
  424. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuActionItem.mjs +23 -2
  425. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuActionItem.mjs.map +2 -2
  426. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.mjs +6 -2
  427. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.mjs.map +2 -2
  428. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuContext.mjs +3 -2
  429. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuContext.mjs.map +2 -2
  430. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +13 -4
  431. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
  432. package/dist-esm/lib/ui/consumerMessages.mjs +50 -0
  433. package/dist-esm/lib/ui/consumerMessages.mjs.map +7 -0
  434. package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs +26 -4
  435. package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs.map +2 -2
  436. package/dist-esm/lib/ui/context/action-predicates.mjs +137 -0
  437. package/dist-esm/lib/ui/context/action-predicates.mjs.map +7 -0
  438. package/dist-esm/lib/ui/context/action-state.mjs +61 -0
  439. package/dist-esm/lib/ui/context/action-state.mjs.map +7 -0
  440. package/dist-esm/lib/ui/context/actions.mjs +579 -305
  441. package/dist-esm/lib/ui/context/actions.mjs.map +3 -3
  442. package/dist-esm/lib/ui/context/events.mjs.map +2 -2
  443. package/dist-esm/lib/ui/context/i18n.mjs +42 -0
  444. package/dist-esm/lib/ui/context/i18n.mjs.map +7 -0
  445. package/dist-esm/lib/ui/hooks/menu-hooks.mjs +8 -88
  446. package/dist-esm/lib/ui/hooks/menu-hooks.mjs.map +2 -2
  447. package/dist-esm/lib/ui/hooks/useActionState.mjs +39 -0
  448. package/dist-esm/lib/ui/hooks/useActionState.mjs.map +7 -0
  449. package/dist-esm/lib/ui/hooks/useCopyAs.mjs +10 -3
  450. package/dist-esm/lib/ui/hooks/useCopyAs.mjs.map +2 -2
  451. package/dist-esm/lib/ui/hooks/useExportAs.mjs +13 -3
  452. package/dist-esm/lib/ui/hooks/useExportAs.mjs.map +2 -2
  453. package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs +1 -0
  454. package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs.map +2 -2
  455. package/dist-esm/lib/ui/hooks/useTools.mjs +55 -14
  456. package/dist-esm/lib/ui/hooks/useTools.mjs.map +2 -2
  457. package/dist-esm/lib/ui/hooks/useTranslation/translations.mjs +11 -14
  458. package/dist-esm/lib/ui/hooks/useTranslation/translations.mjs.map +2 -2
  459. package/dist-esm/lib/ui/hooks/useTranslation/useTranslation.mjs +73 -19
  460. package/dist-esm/lib/ui/hooks/useTranslation/useTranslation.mjs.map +2 -2
  461. package/dist-esm/lib/ui/overrides.mjs.map +2 -2
  462. package/dist-esm/lib/ui/styleMessages.mjs +130 -0
  463. package/dist-esm/lib/ui/styleMessages.mjs.map +7 -0
  464. package/dist-esm/lib/ui/version.mjs +3 -3
  465. package/dist-esm/lib/ui/version.mjs.map +1 -1
  466. package/dist-esm/lib/utils/frames/frames.mjs +1 -1
  467. package/dist-esm/lib/utils/frames/frames.mjs.map +2 -2
  468. package/dist-esm/lib/utils/text/richText.mjs +3 -2
  469. package/dist-esm/lib/utils/text/richText.mjs.map +2 -2
  470. package/dist-esm/lib/utils/tldr/file.mjs +30 -10
  471. package/dist-esm/lib/utils/tldr/file.mjs.map +2 -2
  472. package/package.json +20 -24
  473. package/src/index.ts +8 -0
  474. package/src/lib/Tldraw.test.tsx +16 -0
  475. package/src/lib/Tldraw.tsx +4 -1
  476. package/src/lib/defaultExternalContentHandlers.ts +43 -20
  477. package/src/lib/overlays/ShapeIndicatorOverlayUtil.ts +1 -1
  478. package/src/lib/shapes/arrow/ArrowShapeTool.test.ts +43 -0
  479. package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +4 -0
  480. package/src/lib/shapes/arrow/toolStates/Idle.tsx +29 -17
  481. package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +13 -3
  482. package/src/lib/shapes/draw/DrawShapeUtil.test.ts +32 -0
  483. package/src/lib/shapes/draw/DrawShapeUtil.tsx +4 -0
  484. package/src/lib/shapes/frame/components/FrameLabelInput.tsx +6 -2
  485. package/src/lib/shapes/geo/GeoShapeUtil.tsx +30 -14
  486. package/src/lib/shapes/highlight/HighlightShapeUtil.test.ts +15 -0
  487. package/src/lib/shapes/highlight/HighlightShapeUtil.tsx +4 -0
  488. package/src/lib/shapes/image/ImageShapeUtil.tsx +26 -12
  489. package/src/lib/shapes/line/LineShapeUtil.tsx +4 -0
  490. package/src/lib/shapes/shared/interpolate-props.test.ts +52 -0
  491. package/src/lib/shapes/shared/interpolate-props.ts +10 -0
  492. package/src/lib/shapes/video/VideoShapeUtil.tsx +13 -3
  493. package/src/lib/tools/EraserTool/childStates/Erasing.ts +3 -8
  494. package/src/lib/tools/LaserTool/LaserTool.ts +15 -0
  495. package/src/lib/tools/LaserTool/childStates/Idle.ts +2 -8
  496. package/src/lib/tools/LaserTool/childStates/Lasering.ts +12 -1
  497. package/src/lib/tools/SelectTool/DragAndDropManager.ts +2 -9
  498. package/src/lib/tools/SelectTool/childStates/Brushing.ts +20 -11
  499. package/src/lib/tools/SelectTool/childStates/Crop/children/Cropping.ts +2 -2
  500. package/src/lib/tools/SelectTool/childStates/Crop/children/Idle.ts +5 -10
  501. package/src/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.ts +6 -19
  502. package/src/lib/tools/SelectTool/childStates/Crop/children/PointingCropHandle.ts +5 -18
  503. package/src/lib/tools/SelectTool/childStates/EditingShape.ts +2 -2
  504. package/src/lib/tools/SelectTool/childStates/Idle.ts +50 -74
  505. package/src/lib/tools/SelectTool/childStates/PointingCanvas.ts +11 -9
  506. package/src/lib/tools/SelectTool/childStates/PointingHandle.ts +5 -23
  507. package/src/lib/tools/SelectTool/childStates/PointingResizeHandle.ts +5 -20
  508. package/src/lib/tools/SelectTool/childStates/PointingRotateHandle.ts +5 -18
  509. package/src/lib/tools/SelectTool/childStates/PointingSelection.ts +2 -16
  510. package/src/lib/tools/SelectTool/childStates/PointingShape.ts +22 -33
  511. package/src/lib/tools/SelectTool/childStates/Resizing.ts +2 -6
  512. package/src/lib/tools/SelectTool/childStates/Rotating.ts +1 -4
  513. package/src/lib/tools/SelectTool/childStates/Translating.ts +0 -2
  514. package/src/lib/tools/SelectTool/selectHelpers.ts +89 -0
  515. package/src/lib/tools/selection-logic/selectOnCanvasPointerUp.ts +2 -1
  516. package/src/lib/tools/selection-logic/updateHoveredShapeId.ts +2 -5
  517. package/src/lib/ui/TldrawUi.tsx +16 -2
  518. package/src/lib/ui/components/A11y.tsx +35 -17
  519. package/src/lib/ui/components/AccessibilityMenu.tsx +6 -1
  520. package/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx +7 -2
  521. package/src/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.tsx +26 -63
  522. package/src/lib/ui/components/ColorSchemeMenu.tsx +14 -7
  523. package/src/lib/ui/components/ContextMenu/DefaultContextMenu.tsx +6 -1
  524. package/src/lib/ui/components/ContextMenu/DefaultContextMenuContent.tsx +14 -2
  525. package/src/lib/ui/components/CursorChatBubble.tsx +6 -2
  526. package/src/lib/ui/components/DefaultMenuPanel.tsx +6 -2
  527. package/src/lib/ui/components/EditLinkDialog.tsx +25 -11
  528. package/src/lib/ui/components/EmbedDialog.tsx +27 -10
  529. package/src/lib/ui/components/HelpMenu/DefaultHelpMenu.tsx +10 -2
  530. package/src/lib/ui/components/HelpMenu/DefaultHelpMenuContent.tsx +9 -1
  531. package/src/lib/ui/components/InputModeMenu.tsx +21 -6
  532. package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog.tsx +12 -3
  533. package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.tsx +97 -28
  534. package/src/lib/ui/components/LanguageMenu.tsx +8 -4
  535. package/src/lib/ui/components/MainMenu/DefaultMainMenu.tsx +6 -2
  536. package/src/lib/ui/components/MainMenu/DefaultMainMenuContent.tsx +14 -9
  537. package/src/lib/ui/components/Minimap/DefaultMinimap.tsx +9 -4
  538. package/src/lib/ui/components/MobileStylePanel.tsx +2 -1
  539. package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +11 -3
  540. package/src/lib/ui/components/OfflineIndicator/OfflineIndicator.tsx +7 -2
  541. package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +60 -29
  542. package/src/lib/ui/components/PageMenu/PageItemSubmenu.tsx +28 -8
  543. package/src/lib/ui/components/QuickActions/DefaultQuickActionsContent.tsx +4 -15
  544. package/src/lib/ui/components/SharePanel/DefaultPeopleMenu.tsx +6 -2
  545. package/src/lib/ui/components/SharePanel/DefaultPeopleMenuItem.tsx +18 -6
  546. package/src/lib/ui/components/SharePanel/DefaultUserPresenceEditor.tsx +10 -4
  547. package/src/lib/ui/components/SharePanel/UserPresenceColorPicker.tsx +13 -2
  548. package/src/lib/ui/components/Spinner.tsx +6 -2
  549. package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +12 -11
  550. package/src/lib/ui/components/StylePanel/StylePanelButtonPicker.tsx +4 -4
  551. package/src/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.tsx +4 -3
  552. package/src/lib/ui/components/StylePanel/StylePanelDropdownPicker.tsx +6 -9
  553. package/src/lib/ui/components/Toasts.tsx +22 -4
  554. package/src/lib/ui/components/Toolbar/AltTextEditor.tsx +16 -4
  555. package/src/lib/ui/components/Toolbar/DefaultImageToolbar.tsx +6 -2
  556. package/src/lib/ui/components/Toolbar/DefaultImageToolbarContent.tsx +34 -10
  557. package/src/lib/ui/components/Toolbar/DefaultRichTextToolbar.tsx +17 -2
  558. package/src/lib/ui/components/Toolbar/DefaultRichTextToolbarContent.tsx +28 -8
  559. package/src/lib/ui/components/Toolbar/DefaultToolbar.tsx +6 -2
  560. package/src/lib/ui/components/Toolbar/DefaultVideoToolbar.tsx +6 -2
  561. package/src/lib/ui/components/Toolbar/DefaultVideoToolbarContent.tsx +10 -4
  562. package/src/lib/ui/components/Toolbar/LinkEditor.tsx +8 -3
  563. package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +9 -3
  564. package/src/lib/ui/components/Toolbar/ToggleToolLockedButton.tsx +7 -3
  565. package/src/lib/ui/components/ZoomMenu/DefaultZoomMenu.tsx +7 -3
  566. package/src/lib/ui/components/menu-items.tsx +136 -416
  567. package/src/lib/ui/components/primitives/Button/TldrawUiButtonCheck.tsx +7 -1
  568. package/src/lib/ui/components/primitives/TldrawUiDialog.tsx +6 -1
  569. package/src/lib/ui/components/primitives/TldrawUiDropdownMenu.tsx +7 -3
  570. package/src/lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem.tsx +17 -2
  571. package/src/lib/ui/components/primitives/menus/TldrawUiMenuActionItem.tsx +25 -2
  572. package/src/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.tsx +7 -2
  573. package/src/lib/ui/components/primitives/menus/TldrawUiMenuContext.tsx +4 -2
  574. package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +6 -1
  575. package/src/lib/ui/consumerMessages.ts +60 -0
  576. package/src/lib/ui/context/TldrawUiContextProvider.tsx +25 -2
  577. package/src/lib/ui/context/action-predicates.ts +194 -0
  578. package/src/lib/ui/context/action-state.ts +93 -0
  579. package/src/lib/ui/context/actions.tsx +630 -377
  580. package/src/lib/ui/context/events.tsx +3 -0
  581. package/src/lib/ui/context/i18n.test.tsx +343 -0
  582. package/src/lib/ui/context/i18n.tsx +111 -0
  583. package/src/lib/ui/hooks/menu-hooks.ts +10 -118
  584. package/src/lib/ui/hooks/useActionState.ts +61 -0
  585. package/src/lib/ui/hooks/useCopyAs.ts +11 -3
  586. package/src/lib/ui/hooks/useExportAs.ts +14 -3
  587. package/src/lib/ui/hooks/useKeyboardShortcuts.ts +4 -1
  588. package/src/lib/ui/hooks/useTools.tsx +62 -14
  589. package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +333 -385
  590. package/src/lib/ui/hooks/useTranslation/translations.ts +15 -22
  591. package/src/lib/ui/hooks/useTranslation/useTranslation.test.tsx +55 -2
  592. package/src/lib/ui/hooks/useTranslation/useTranslation.tsx +163 -24
  593. package/src/lib/ui/overrides.ts +4 -0
  594. package/src/lib/ui/styleMessages.test.ts +83 -0
  595. package/src/lib/ui/styleMessages.ts +169 -0
  596. package/src/lib/ui/version.ts +3 -3
  597. package/src/lib/utils/frames/frames.ts +1 -1
  598. package/src/lib/utils/text/richText.test.ts +37 -0
  599. package/src/lib/utils/text/richText.ts +3 -2
  600. package/src/lib/utils/tldr/file.ts +36 -14
  601. package/src/test/A11y.test.tsx +85 -13
  602. package/src/test/EraserTool.test.ts +42 -1
  603. package/src/test/LaserTool.test.ts +86 -0
  604. package/src/test/ScribbleManager.test.ts +25 -0
  605. package/src/test/SelectTool.test.ts +31 -60
  606. package/src/test/TldrawEditor.test.tsx +66 -1
  607. package/src/test/commands/duplicatePage.test.ts +41 -1
  608. package/src/test/cropping.test.ts +66 -66
  609. package/src/test/deferredDoubleClick.test.ts +231 -0
  610. package/src/test/frames.test.ts +89 -0
  611. package/src/test/navigation.test.ts +26 -66
  612. package/src/test/pinch-dom.test.tsx +1 -24
  613. package/src/test/pointercancel-dom.test.tsx +1 -23
  614. package/src/test/resizeBox.test.ts +25 -0
  615. package/src/test/resizing.test.ts +158 -0
  616. package/src/test/richTextToolbarEvents.test.tsx +46 -0
  617. package/src/test/select.test.tsx +143 -0
  618. package/src/test/shapeIdsInCurrentPage.test.ts +37 -0
  619. package/src/test/shapeutils.test.ts +58 -1
  620. package/src/test/spatialIndex.test.ts +35 -0
  621. package/src/test/testutils/renderTldrawComponent.tsx +3 -3
  622. package/src/test/toolbar-tool-selection.test.tsx +41 -0
  623. package/src/test/ui/FrameSelectionMenuItem.test.tsx +11 -2
  624. package/src/test/ui/PageMenu.test.tsx +165 -0
  625. package/src/test/ui/SkipToMainContent.test.tsx +51 -0
  626. package/src/test/ui/actionGate.test.tsx +197 -0
  627. package/src/test/ui/actionGating.test.tsx +447 -0
  628. package/src/test/ui/actionPredicates.test.ts +156 -0
  629. package/src/test/ui/keyboardShortcuts.test.tsx +376 -26
  630. package/src/test/ui/menuActionItem.test.tsx +548 -0
  631. package/src/test/ui/menuGating.test.tsx +336 -0
  632. package/src/test/ui/menuPaste.test.tsx +18 -0
  633. package/src/test/ui/menuSubmenus.test.tsx +111 -0
  634. package/tldraw.css +1 -5
  635. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +0 -567
  636. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +0 -7
  637. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +0 -547
  638. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +0 -7
  639. package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +0 -558
package/DOCS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # tldraw Documentation
2
2
 
3
- Version: `5.5.2`
3
+ Version: `5.6.0-canary.0091c91994d6`
4
4
 
5
5
  This file is generated during package publishing from the tldraw docs content for this exact package version.
6
6
 
@@ -1890,8 +1890,8 @@ Attach each incoming WebSocket to the room and forward its events:
1890
1890
  room.handleSocketConnect({ sessionId, socket })
1891
1891
  // If your platform doesn't let the room add listeners to the socket itself
1892
1892
  // (Bun.serve, Cloudflare hibernation), forward events by hand:
1893
- room.handleSocketMessage(sessionId, message)
1894
- room.handleSocketClose(sessionId)
1893
+ room.handleSocketMessage(sessionId, message, socket)
1894
+ room.handleSocketClose(sessionId, socket)
1895
1895
  ```
1896
1896
 
1897
1897
  You should make sure that there's only ever one `TLSocketRoom` globally for each room in your app.
@@ -1986,7 +1986,8 @@ interface SocketAttachment {
1986
1986
 
1987
1987
  export class TldrawDurableObject extends DurableObject {
1988
1988
  private room: TLSocketRoom<TLRecord, void> | null = null
1989
- // Maps sessionId → ws. Populate this in your webSocketMessage handler.
1989
+ // Maps sessionId → ws. Set it on connect and on resume, never from webSocketMessage: a
1990
+ // superseded socket for the same session id can still deliver messages.
1990
1991
  private readonly sessionIdToWs = new Map<string, WebSocket>()
1991
1992
 
1992
1993
  private getOrCreateRoom() {
@@ -2015,6 +2016,7 @@ export class TldrawDurableObject extends DurableObject {
2015
2016
  socket: ws,
2016
2017
  snapshot: attachment.snapshot,
2017
2018
  })
2019
+ this.sessionIdToWs.set(attachment.sessionId, ws)
2018
2020
  }
2019
2021
  }
2020
2022
 
@@ -2025,7 +2027,7 @@ export class TldrawDurableObject extends DurableObject {
2025
2027
 
2026
2028
  Three pieces make this work. The `onSessionSnapshot` callback persists each session's state to its WebSocket's attachment so the snapshot is still around after hibernation. When the object wakes up with sockets still open, `handleSocketResume` replays each saved snapshot and the session lands straight in `Connected` state; the client never sees a reconnect. Setting `clientTimeout: Infinity` disables the room's idle timer; hibernating platforms handle keep-alive themselves and would otherwise see the room disconnect healthy clients.
2027
2029
 
2028
- For a complete implementation, including the hibernation event handlers that populate `sessionIdToWs`, see the [sync-cloudflare template](https://github.com/tldraw/tldraw/tree/main/templates/sync-cloudflare).
2030
+ For a complete implementation, including the connect handler and the hibernation event handlers that pass each socket to the room, see the [sync-cloudflare template](https://github.com/tldraw/tldraw/tree/main/templates/sync-cloudflare).
2029
2031
 
2030
2032
  For non-hibernating environments (Node servers, long-lived processes), you don't need any of this. The in-memory `TLSocketRoom` outlives individual sockets, and the default `clientTimeout` (20 seconds) removes idle sessions.
2031
2033
 
@@ -4261,9 +4263,9 @@ The `priority` option accepts `'polite'` or `'assertive'` and defaults to `'asse
4261
4263
 
4262
4264
  Users can navigate between shapes using the keyboard. With a shape selected, Tab moves selection to the next shape in reading order and Shift+Tab moves to the previous shape. Arrow keys with Ctrl/Cmd move selection to the nearest shape in that direction, and Ctrl/Cmd+Shift+Down or Up select a group's first child or its parent. `Editor#selectAdjacentShape` is the programmatic equivalent.
4263
4265
 
4264
- Tldraw determines reading order by analyzing shape positions on the canvas. Shapes are grouped into rows based on their vertical position, then sorted left-to-right within each row. This creates a natural top-to-bottom, left-to-right reading order similar to text. You can access this order programmatically with `Editor#getCurrentPageShapesInReadingOrder`.
4266
+ Tldraw determines reading order by analyzing shape positions on the canvas. Shapes are grouped into rows based on their vertical position, then sorted left-to-right within each row. This creates a natural top-to-bottom, left-to-right reading order similar to text. You can access this order programmatically with `Editor#getCurrentPageShapesInReadingOrder`. Locked shapes are included, so keyboard users can reach a locked shape and unlock it.
4265
4267
 
4266
- A "Skip to main content" link appears when users Tab into the editor. It selects the first shape on the canvas and zooms to it.
4268
+ A "Move focus to canvas" button appears when users Tab into the editor. It selects the first shape in reading order and zooms to it.
4267
4269
 
4268
4270
  ##### Excluding shapes from keyboard navigation
4269
4271
 
@@ -4480,16 +4482,19 @@ Keyboard shortcuts are bound automatically. The `useKeyboardShortcuts` hook pars
4480
4482
 
4481
4483
  The `TLUiActionItem` interface defines what an action contains:
4482
4484
 
4483
- | Property | Description |
4484
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
4485
- | `id` | Unique identifier for the action (e.g., `'duplicate'`, `'zoom-in'`) |
4486
- | `label` | Translation key for display text. Can be a string or an object mapping contexts to different keys (see [Context-sensitive labels](#context-sensitive-labels)) |
4487
- | `icon` | Icon name from tldraw's icon set, or a custom React element |
4488
- | `kbd` | Keyboard shortcut string. Use commas to bind several combinations, e.g. `'cmd+g,ctrl+g'` (see [Keyboard shortcuts](#keyboard-shortcuts)) |
4489
- | `readonlyOk` | When `true`, the action works in readonly mode. Defaults to `false` |
4490
- | `checkbox` | When `true`, renders as a toggle with a checkmark indicator in menus |
4491
- | `isRequiredA11yAction` | When `true`, the keyboard shortcut works even when shortcuts are normally disabled (e.g., while editing a shape). Used for accessibility actions |
4492
- | `onSelect` | Handler called when the action is triggered. Receives a `TLUiEventSource` indicating the trigger origin (`'kbd'`, `'menu'`, `'toolbar'`, etc.) |
4485
+ | Property | Description |
4486
+ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
4487
+ | `id` | Unique identifier for the action (e.g., `'duplicate'`, `'zoom-in'`) |
4488
+ | `label` | Translation key for display text. Can be a string or an object mapping contexts to different keys (see [Context-sensitive labels](#context-sensitive-labels)) |
4489
+ | `icon` | Icon name from tldraw's icon set, or a custom React element |
4490
+ | `kbd` | Keyboard shortcut string. Use commas to bind several combinations, e.g. `'cmd+g,ctrl+g'` (see [Keyboard shortcuts](#keyboard-shortcuts)) |
4491
+ | `readonlyOk` | When `true`, the action runs in readonly mode; otherwise it doesn't run, however it's triggered. Defaults to `false` |
4492
+ | `checkbox` | When `true`, renders as a toggle with a checkmark indicator in menus |
4493
+ | `isRequiredA11yAction` | When `true`, the keyboard shortcut works even when shortcuts are normally disabled (e.g., while editing a shape). Used for accessibility actions |
4494
+ | `isAvailable` | Optional `(editor) => boolean`. When it returns `false`, menus hide the action, and the action doesn't run (see [Enabling and checking actions](#enabling-and-checking-actions)) |
4495
+ | `isEnabled` | Optional `(editor) => boolean`. When it returns `false`, menus disable or hide the action, and the action doesn't run |
4496
+ | `isChecked` | Optional `(editor) => boolean`. For checkbox actions, whether the item shows as checked |
4497
+ | `onSelect` | Handler called when the action is triggered. Receives a `TLUiEventSource` indicating the trigger origin (`'kbd'`, `'menu'`, `'toolbar'`, etc.) |
4493
4498
 
4494
4499
  #### Accessing actions
4495
4500
 
@@ -4518,13 +4523,14 @@ The default actions cover most editing operations you'd expect in a canvas appli
4518
4523
  | Category | Action ids |
4519
4524
  | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
4520
4525
  | Editing | `undo`, `redo`, `duplicate`, `delete`, `copy`, `cut`, `paste` |
4521
- | Grouping | `group`, `ungroup` |
4526
+ | Grouping | `group`, `ungroup`, `toggle-group` |
4527
+ | Frames | `frame-selection`, `remove-frame`, `toggle-frame`, `fit-frame-to-content` |
4522
4528
  | Arrangement | `bring-to-front`, `bring-forward`, `send-backward`, `send-to-back`, `align-left`, `align-center-horizontal`, `align-right`, `distribute-horizontal`, `distribute-vertical` |
4523
4529
  | Export | `export-as-svg`, `export-as-png`, `copy-as-svg`, `copy-as-png` |
4524
4530
  | Zoom | `zoom-in`, `zoom-out`, `zoom-to-100`, `zoom-to-fit`, `zoom-to-selection`, `select-zoom-tool` |
4525
4531
  | Preferences | `toggle-dark-mode`, `toggle-snap-mode`, `toggle-grid`, `toggle-focus-mode` |
4526
4532
 
4527
- The full list is in the [default actions source](https://github.com/tldraw/tldraw/blob/main/packages/tldraw/src/lib/ui/context/actions.tsx). Most actions guard themselves inside their handlers. For example, `group` and the arrangement actions do nothing unless shapes are selected and the select tool is active.
4533
+ The full list is in the [default actions source](https://github.com/tldraw/tldraw/blob/main/packages/tldraw/src/lib/ui/context/actions.tsx). An action doesn't run when its `isAvailable` or `isEnabled` returns false, or when the editor is readonly and it isn't `readonlyOk`, including when you call `onSelect` on an action from `useActions()`. For example, `group` does nothing unless two or more unlocked shapes are selected in the select tool.
4528
4534
 
4529
4535
  #### Overriding actions
4530
4536
 
@@ -4550,7 +4556,9 @@ function App() {
4550
4556
  }
4551
4557
  ```
4552
4558
 
4553
- The `copy`, `cut`, and `paste` shortcuts are handled by native clipboard events rather than the `kbd` system, so changing their `kbd` has no effect.
4559
+ The `copy`, `cut`, and `paste` shortcuts are handled by native clipboard events rather than the `kbd` system, so changing their `kbd` or `isEnabled` has no effect on them.
4560
+
4561
+ Cmd+G and Cmd+Alt+G belong to `toggle-group` and `toggle-frame`, which run `group` or `ungroup`, and `frame-selection` or `remove-frame`, depending on the selection. To change or remove those shortcuts, override the toggle actions, not `group` or `frame-selection`.
4554
4562
 
4555
4563
  ##### Modifying behavior
4556
4564
 
@@ -4576,7 +4584,7 @@ You can call the original handler before or after your custom logic, or replace
4576
4584
 
4577
4585
  ##### Adding custom actions
4578
4586
 
4579
- Add new actions by inserting them into the actions record:
4587
+ Add new actions by inserting them into the actions record. The `actions` map passed to `overrides` isn't gated yet, so calling a built-in's `onSelect` on it from inside a custom action skips the readonly check, `isAvailable` and `isEnabled`. Before you call it, check `editor.getIsReadonly()` (unless it's `readonlyOk`) and whichever of `isAvailable` and `isEnabled` it defines. Actions you get from `useActions()` in component code are gated.
4580
4588
 
4581
4589
  ```typescript
4582
4590
  const overrides: TLUiOverrides = {
@@ -4681,7 +4689,7 @@ function CustomMenu() {
4681
4689
  }
4682
4690
  ```
4683
4691
 
4684
- This component looks up the action by ID and renders it with the correct label, icon, and shortcut hint. Pass `disabled` yourself if the item should be disabled. For toggle actions, use `TldrawUiMenuActionCheckboxItem` with a `checked` prop.
4692
+ This component looks up the action by ID and renders it with the correct label, icon, and shortcut hint. If the action defines `isEnabled`, the item disables itself when it returns false. Pass `whenDisabled="hide"` to hide it instead, whether it's disabled by `isEnabled` or by your own `disabled` prop. In the context menu, a disabled `TldrawUiMenuActionItem` is hidden either way. For toggle actions, use `TldrawUiMenuActionCheckboxItem`; it reads `checked` from the action's `isChecked` unless you pass `checked`.
4685
4693
 
4686
4694
  #### Context-sensitive labels
4687
4695
 
@@ -4689,18 +4697,72 @@ Some actions show different labels depending on where they appear. The `label` p
4689
4697
 
4690
4698
  ```typescript
4691
4699
  actions['export-as-svg'] = {
4692
- id: 'export-as-svg',
4700
+ ...actions['export-as-svg'],
4693
4701
  label: {
4694
4702
  default: 'action.export-as-svg',
4695
4703
  menu: 'action.export-as-svg.short',
4696
4704
  'context-menu': 'action.export-as-svg.short',
4697
4705
  },
4698
- // ...
4699
4706
  }
4700
4707
  ```
4701
4708
 
4702
4709
  The menu component uses the appropriate label based on its context. If no specific label exists for a context, it falls back to `default`.
4703
4710
 
4711
+ #### Enabling and checking actions
4712
+
4713
+ `isEnabled` tells every menu whether the action can run right now. `isChecked` tells checkbox items whether they're on. Both receive the editor and must not change anything. Menus re-run them when the editor state they read changes, so read everything they depend on from the editor; a value read from anywhere else won't update the menu.
4714
+
4715
+ ```tsx
4716
+ actions['make-red'] = {
4717
+ id: 'make-red',
4718
+ label: 'action.make-red',
4719
+ isEnabled: (editor) => editor.getSelectedShapeIds().length > 0,
4720
+ onSelect() {
4721
+ // ...
4722
+ },
4723
+ }
4724
+ ```
4725
+
4726
+ Menus, keyboard shortcuts and `onSelect` calls on actions from `useActions()` all respect `isEnabled`, so `onSelect` doesn't need to check it again. The gate comes from the action as `overrides` returned it, so changing `isEnabled` on a copy of an action from `useActions()` doesn't change when it runs; override it instead. The exception is the copy, cut and paste shortcuts: they come from native clipboard events, which don't check the action's `isEnabled`.
4727
+
4728
+ When you change a built-in action, spread the original so it keeps its `isAvailable`, `isEnabled` and `isChecked`:
4729
+
4730
+ ```tsx
4731
+ actions['group'] = { ...actions['group'], onSelect: myGroup }
4732
+ ```
4733
+
4734
+ Replacing an action with a new object drops them, along with `readonlyOk`: menus show it as always enabled, a checkbox item for it always shows as unchecked, shortcuts and `onSelect` calls run it whatever the selection, and if the built-in was `readonlyOk`, it stops running while the editor is readonly.
4735
+
4736
+ Use `isAvailable` instead when the action doesn't exist in the current context at all, rather than being blocked right now. Every menu item hides an unavailable action, whatever `whenDisabled` says; only the keyboard shortcuts dialog still lists it. The built-in paste (without clipboard read access), copy as PNG (without clipboard write access), copy as JSON (outside debug mode), cursor chat (on touch), exit pen mode, stop following, and back to content work this way.
4737
+
4738
+ ```tsx
4739
+ actions['open-devtools'] = {
4740
+ id: 'open-devtools',
4741
+ label: 'action.open-devtools',
4742
+ isAvailable: (editor) => editor.getInstanceState().isDebugMode,
4743
+ onSelect() {
4744
+ // ...
4745
+ },
4746
+ }
4747
+ ```
4748
+
4749
+ To hide a submenu when none of its actions can run, use `useSomeActionsEnabled`. It returns true when any of the given actions is available and enabled; actions that aren't `readonlyOk` count as unavailable while the editor is readonly:
4750
+
4751
+ ```tsx
4752
+ const IDS = ['make-red', 'make-blue']
4753
+
4754
+ function ColorsSubmenu() {
4755
+ if (!useSomeActionsEnabled(IDS)) return null
4756
+ return (
4757
+ <TldrawUiMenuSubmenu id="colors" label="menu.colors">
4758
+ {IDS.map((id) => (
4759
+ <TldrawUiMenuActionItem key={id} actionId={id} whenDisabled="hide" />
4760
+ ))}
4761
+ </TldrawUiMenuSubmenu>
4762
+ )
4763
+ }
4764
+ ```
4765
+
4704
4766
  #### Tracking action usage
4705
4767
 
4706
4768
  The `source` parameter tells you where the action was triggered. Use this for analytics:
@@ -6779,7 +6841,9 @@ Mount the layer through the `InFrontOfTheCanvas` component slot so it sits above
6779
6841
 
6780
6842
  #### Placing comments
6781
6843
 
6782
- `commentToolOverrides` puts the comment tool in Quick Actions with the `C` shortcut. With the tool active, clicking empty canvas starts a thread anchored to that point, and clicking a shape anchors a comment to the shape. You can also turn on region comments, where dragging the tool out covers an area. Either way the click only opens a composer: nothing is written to the store until the comment is posted.
6844
+ `commentToolOverrides` puts the comment tool in Quick Actions with the `C` shortcut, and adds a **Comment** item to the canvas context menu that opens the composer where the menu was opened. With the tool active, clicking empty canvas starts a thread anchored to that point, and clicking a shape anchors a comment to the shape. You can also turn on region comments, where dragging the tool out covers an area. Either way the click only opens a composer: nothing is written to the store until the comment is posted.
6845
+
6846
+ To start a comment from somewhere else, such as your own menu item, call `startCommentAt(editor, point)` with a page point. It enters the comment tool and opens the composer there, anchored the same way a click would be.
6783
6847
 
6784
6848
  Once a comment thread exists, its pin is the handle for everything else.
6785
6849
 
@@ -7318,19 +7382,19 @@ This is the same question the client's [`canModifyComment`](#who-can-edit-and-de
7318
7382
 
7319
7383
  `CanvasComments` is one way to assemble the parts, and every part it uses is exported. You can rebuild it, or build something quite different, from the same pieces.
7320
7384
 
7321
- | Export | Description |
7322
- | ---------------------------------------- | ----------------------------------------------------------- |
7323
- | `CommentTool`, `commentToolOverrides` | Placement: the tool state machine and its toolbar entry. |
7324
- | `CommentPin`, `CountBadge` | The pin marker and the clustered-count badge. |
7325
- | `CommentThread`, `CommentCard`, `Byline` | A thread and its comments. |
7326
- | `CommentComposer`, `SendButton` | The composer and its send control. |
7327
- | `CommentsList`, `CommentListItem` | A list of threads and one row of it. |
7328
- | `EmptyState`, `sortSidebarRows` | The list's empty state, and the sidebar's ordering. |
7329
- | `Avatar`, `Mention`, `MentionList` | Author avatars and the mention picker. |
7330
- | `Reaction`, `Reactions` | A reaction pill and a comment's row of them. |
7331
- | `anchorPagePoint`, `shapeAnchorAt` | Anchor math: page position from an anchor, and the reverse. |
7332
- | `editComment`, `deleteComment` | The write verbs. See [Writing comments](#writing-comments). |
7333
- | `registerCommentAnchorLifecycle` | Keeps shape-anchored threads alive across shape deletion. |
7385
+ | Export | Description |
7386
+ | ------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
7387
+ | `CommentTool`, `commentToolOverrides`, `startCommentAt` | Placement: the tool state machine, its toolbar entry, and starting a comment at a point. |
7388
+ | `CommentPin`, `CountBadge` | The pin marker and the clustered-count badge. |
7389
+ | `CommentThread`, `CommentCard`, `Byline` | A thread and its comments. |
7390
+ | `CommentComposer`, `SendButton` | The composer and its send control. |
7391
+ | `CommentsList`, `CommentListItem` | A list of threads and one row of it. |
7392
+ | `EmptyState`, `sortSidebarRows` | The list's empty state, and the sidebar's ordering. |
7393
+ | `Avatar`, `Mention`, `MentionList` | Author avatars and the mention picker. |
7394
+ | `Reaction`, `Reactions` | A reaction pill and a comment's row of them. |
7395
+ | `anchorPagePoint`, `shapeAnchorAt` | Anchor math: page position from an anchor, and the reverse. |
7396
+ | `editComment`, `deleteComment` | The write verbs. See [Writing comments](#writing-comments). |
7397
+ | `registerCommentAnchorLifecycle` | Keeps shape-anchored threads alive across shape deletion. |
7334
7398
 
7335
7399
  The presentational components take plain props and know nothing about the editor. The canvas layer, the tool, and the hooks build on them. `CanvasComments` registers the anchor lifecycle for you, so call `registerCommentAnchorLifecycle` yourself only if you're replacing the layer wholesale.
7336
7400
 
@@ -7840,31 +7904,34 @@ The `type` determines the visual appearance—like `'default'`, `'grab'`, or `'n
7840
7904
 
7841
7905
  tldraw supports these cursor types:
7842
7906
 
7843
- | Type | Description |
7844
- | ------------- | ---------------------------------------------- |
7845
- | `default` | Standard pointer arrow |
7846
- | `pointer` | Hand indicating clickable element |
7847
- | `cross` | Crosshair for precise positioning |
7848
- | `comment` | Speech bubble for placing comments |
7849
- | `grab` | Open hand for draggable content |
7850
- | `grabbing` | Closed hand while dragging |
7851
- | `text` | I-beam for text editing |
7852
- | `move` | Four-way arrow for moving elements |
7853
- | `zoom-in` | Magnifying glass with plus |
7854
- | `zoom-out` | Magnifying glass with minus |
7855
- | `ew-resize` | Horizontal resize (east-west) |
7856
- | `ns-resize` | Vertical resize (north-south) |
7857
- | `nesw-resize` | Diagonal resize (northeast-southwest) |
7858
- | `nwse-resize` | Diagonal resize (northwest-southeast) |
7859
- | `nesw-rotate` | Rotation handle (northeast-southwest position) |
7860
- | `nwse-rotate` | Rotation handle (northwest-southeast position) |
7861
- | `senw-rotate` | Rotation handle (southeast-northwest position) |
7862
- | `swne-rotate` | Rotation handle (southwest-northeast position) |
7863
- | `none` | Hidden cursor |
7907
+ | Type | Description |
7908
+ | --------------- | --------------------------------------------------------- |
7909
+ | `default` | Standard pointer arrow |
7910
+ | `pointer` | Hand indicating clickable element |
7911
+ | `cross` | Crosshair for precise positioning |
7912
+ | `comment` | Speech bubble for placing comments |
7913
+ | `grab` | Open hand for draggable content |
7914
+ | `grabbing` | Closed hand while dragging |
7915
+ | `text` | I-beam for text editing |
7916
+ | `move` | Four-way arrow for moving elements |
7917
+ | `zoom-in` | Magnifying glass with plus |
7918
+ | `zoom-out` | Magnifying glass with minus |
7919
+ | `ew-resize` | Horizontal resize (east-west) |
7920
+ | `ns-resize` | Vertical resize (north-south) |
7921
+ | `nesw-resize` | Diagonal resize (northeast-southwest) |
7922
+ | `nwse-resize` | Diagonal resize (northwest-southeast) |
7923
+ | `nesw-rotate` | Rotation handle (northeast-southwest position) |
7924
+ | `nwse-rotate` | Rotation handle (northwest-southeast position) |
7925
+ | `senw-rotate` | Rotation handle (southeast-northwest position) |
7926
+ | `swne-rotate` | Rotation handle (southwest-northeast position) |
7927
+ | `none` | Hidden cursor |
7928
+ | `rotate` | Static rotation cursor (falls back to `pointer`) |
7929
+ | `resize-edge` | Static edge resize cursor (falls back to `ew-resize`) |
7930
+ | `resize-corner` | Static corner resize cursor (falls back to `nesw-resize`) |
7864
7931
 
7865
7932
  Static cursors like `default`, `pointer`, and `grab` are prerendered SVG cursors defined as CSS custom properties in tldraw's stylesheet (`--tl-cursor-default`, `--tl-cursor-grab`, and so on). Dynamic cursors like the resize and rotate types are generated at runtime as SVGs with the current rotation applied. The canvas reads the result from the `--tl-cursor` variable.
7866
7933
 
7867
- > `TLCursorType` also includes `resize-edge`, `resize-corner`, and `rotate` for schema compatibility. The default cursor rendering doesn't support them, so don't pass them to `setCursor`.
7934
+ The `rotate`, `resize-edge`, and `resize-corner` types are static too: they map to `--tl-cursor-rotate`, `--tl-cursor-resize-edge`, and `--tl-cursor-resize-corner`, which default to the browser's `pointer`, `ew-resize`, and `nesw-resize` cursors and ignore the cursor rotation. Use the direction-specific `*-resize` and `*-rotate` types when you want the rotated SVG cursors.
7868
7935
 
7869
7936
  #### Setting the cursor
7870
7937
 
@@ -10883,7 +10950,7 @@ editor.createShape({
10883
10950
 
10884
10951
  #### Creating frames
10885
10952
 
10886
- You can create a frame programmatically with `Editor#createShape`, or interactively with the frame tool. The frame tool ships in the default toolbar; users can also press `F` to switch to it. The **Frame selection** action (`Cmd/Ctrl+Alt+G`) wraps the current selection in a new frame.
10953
+ You can create a frame programmatically with `Editor#createShape`, or interactively with the frame tool. The frame tool ships in the default toolbar; users can also press `F` to switch to it. The **Frame selection** action wraps the current selection in a new frame. `Cmd/Ctrl+Alt+G` runs the `toggle-frame` action: it frames the selection, or removes the frame if only frames are selected. Override `toggle-frame` to rebind it.
10887
10954
 
10888
10955
  When the user drags a frame around existing shapes, the frame tool reparents any sibling shapes that fall fully inside the frame's bounds. Locked shapes are skipped. This is what makes "draw a frame around the things I want to group" work as a single gesture.
10889
10956
 
@@ -10966,7 +11033,7 @@ import { removeFrame } from 'tldraw'
10966
11033
  removeFrame(editor, [frameId])
10967
11034
  ```
10968
11035
 
10969
- The **Remove frame** and **Fit frame to content** actions in the main menu and the context menu's Edit submenu call these helpers when a frame is selected. **Frame selection** (`Cmd/Ctrl+Alt+G`) also removes frames when every selected shape is a frame.
11036
+ The **Remove frame** and **Fit frame to content** actions in the main menu and the context menu's Edit submenu call these helpers when a frame is selected. **Remove frame** (`remove-frame`) has its own shortcut, `Cmd/Ctrl+Alt+Shift+G`.
10970
11037
 
10971
11038
  #### Exporting frames
10972
11039
 
@@ -11870,7 +11937,7 @@ editor.groupShapes([shapeId1, shapeId2], {
11870
11937
  })
11871
11938
  ```
11872
11939
 
11873
- Grouping requires at least two shapes. The method does nothing if you pass fewer, and it skips [locked shapes](https://tldraw.dev/sdk-features/locked-shapes). Users can also group shapes with Ctrl+G (Cmd+G on Mac); when the only selected shape is a group, the same shortcut ungroups it.
11940
+ Grouping requires at least two shapes. The method does nothing if you pass fewer, and it skips [locked shapes](https://tldraw.dev/sdk-features/locked-shapes). Users can also group shapes with Ctrl+G (Cmd+G on Mac). Pressing the shortcut again with the resulting group selected ungroups it. The shortcut belongs to the `toggle-group` action, so override that action to rebind it.
11874
11941
 
11875
11942
  The new group is positioned at the top-left of the combined bounds of all grouped shapes. It takes the z-index of the topmost grouped shape, so it sits where that shape was in its parent's layer stack.
11876
11943
 
@@ -13392,6 +13459,48 @@ function CopyButton() {
13392
13459
  }
13393
13460
  ```
13394
13461
 
13462
+ Pass a second argument to fill in a message's placeholders:
13463
+
13464
+ ```tsx
13465
+ function SelectionStatus({ count }: { count: number }) {
13466
+ const msg = useTranslation()
13467
+ return <p>{msg('a11y.multiple-shapes', { num: count })}</p>
13468
+ }
13469
+ ```
13470
+
13471
+ ##### Rendering a message as an element
13472
+
13473
+ `F` renders a message where it belongs in the markup, with its English alongside:
13474
+
13475
+ ```tsx
13476
+ import { F } from 'tldraw'
13477
+
13478
+ function CopyButton() {
13479
+ return (
13480
+ <button>
13481
+ <F defaultMessage="Copy" id="action.copy" />
13482
+ </button>
13483
+ )
13484
+ }
13485
+ ```
13486
+
13487
+ Where a string is needed instead — an `aria-label`, a `title`, a `placeholder` — pass the declared message to `useTranslation`. If the current locale has no translation for it yet, its `defaultMessage` is used:
13488
+
13489
+ ```tsx
13490
+ import { defineMessages, useTranslation } from 'tldraw'
13491
+
13492
+ const messages = defineMessages({
13493
+ close: { id: 'ui.close', defaultMessage: 'Close' },
13494
+ })
13495
+
13496
+ function CloseButton() {
13497
+ const msg = useTranslation()
13498
+ return <button aria-label={msg(messages.close)} />
13499
+ }
13500
+ ```
13501
+
13502
+ Both resolve against the same translations, so an override reaches each of them.
13503
+
13395
13504
  Use `useCurrentTranslation` for the full translation object, including locale and text direction:
13396
13505
 
13397
13506
  ```tsx
@@ -13410,6 +13519,25 @@ function LocaleInfo() {
13410
13519
 
13411
13520
  The `TLUiTranslation` object contains a `locale` code (e.g., `'fr'`), a `label` in the native script (e.g., `'Français'`), a `messages` record with all translation strings, and a `dir` indicating text direction (`'ltr'` or `'rtl'`).
13412
13521
 
13522
+ ##### Generated message ids
13523
+
13524
+ The SDK's own messages have hand-written ids, because an app overrides by id and an id has to survive a reworded English string. An app's own messages needn't: if you use [@formatjs/unplugin](https://formatjs.github.io/docs/tooling/bundler-plugins) with an `idInterpolationPattern`, your bundler derives each id from the message's own text, and you can leave it out.
13525
+
13526
+ ```tsx
13527
+ import { defineMessages, F } from 'tldraw'
13528
+
13529
+ const messages = defineMessages({
13530
+ // No id: the plugin injects one at build.
13531
+ welcome: { defaultMessage: 'Welcome back' },
13532
+ })
13533
+
13534
+ function Greeting() {
13535
+ return <F {...messages.welcome} />
13536
+ }
13537
+ ```
13538
+
13539
+ Where no plugin ran either — a unit test, normally — the English stands in as the id. It matches nothing in any catalogue, so the message renders as that English rather than failing.
13540
+
13413
13541
  #### Overriding translations
13414
13542
 
13415
13543
  Pass translation overrides through the `overrides` prop on `Tldraw`:
@@ -13438,6 +13566,46 @@ function App() {
13438
13566
 
13439
13567
  Overrides are merged with the base translations for each language. English is the fallback: any key missing from the target language uses the English string. If you add your own keys (for example a custom tool label), provide at least an `en` override for them.
13440
13568
 
13569
+ Your strings are ICU messages too, so they can pluralise and take placeholders. A `{` that isn't opening a placeholder has to be escaped as `'{'`, or the message won't parse — a message that fails to parse renders as written rather than disappearing.
13570
+
13571
+ #### Message format
13572
+
13573
+ Messages are [ICU MessageFormat](https://unicode-org.github.io/icu/userguide/format_parse/messages/), so a single message can say the right thing for any number:
13574
+
13575
+ ```json
13576
+ {
13577
+ "comments.replies": "{count, plural, one {# reply} other {# replies}}"
13578
+ }
13579
+ ```
13580
+
13581
+ ```tsx
13582
+ msg('comments.replies', { count: 1 }) // "1 reply"
13583
+ msg('comments.replies', { count: 4 }) // "4 replies"
13584
+ ```
13585
+
13586
+ This matters beyond English. A language picks between its own plural categories, which is why one string per number doesn't travel: Arabic has six, Polish four, Russian three. ICU asks the locale which category a number falls into, so the translator writes each form their language needs and the right one is chosen at runtime.
13587
+
13588
+ `select` chooses between fixed options rather than numbers:
13589
+
13590
+ ```json
13591
+ {
13592
+ "my.app.greeting": "{gender, select, female {She} male {He} other {They}} shared a file"
13593
+ }
13594
+ ```
13595
+
13596
+ Numbers and dates are formatted for the locale as well:
13597
+
13598
+ ```json
13599
+ {
13600
+ "my.app.fileCount": "{count, number} files",
13601
+ "my.app.lastEdited": "Edited {when, date, medium}"
13602
+ }
13603
+ ```
13604
+
13605
+ > Use `#` inside a plural to print the number being matched. Outside a plural it's a literal `#`.
13606
+
13607
+ A message's `defaultMessage` is its English, and it's formatted as English. The translation from the catalog is what gets the user's locale and its plural categories, so a locale missing a string falls back to readable English rather than to English grammar applied to another language.
13608
+
13441
13609
  ##### Translation keys
13442
13610
 
13443
13611
  Translation keys follow a hierarchical naming convention. Common prefixes include `action.*` for user actions like copy and paste, `tool.*` for tool names, `menu.*` for menu labels, `style-panel.*` for style panel UI, and `a11y.*` for accessibility announcements.
@@ -13771,7 +13939,7 @@ When this returns `true`, `Editor#canEditShape` allows the shape to enter edit m
13771
13939
 
13772
13940
  #### Locking in the UI
13773
13941
 
13774
- In the default tldraw UI, users can lock shapes through the context menu or the keyboard shortcut (`Shift+L`). Right-clicking a locked shape opens the context menu with an unlock option, and the main menu has an "Unlock all" action.
13942
+ In the default tldraw UI, users can lock shapes through the context menu or the keyboard shortcut (`Shift+L`). Right-clicking a locked shape opens the context menu with an unlock option. Keyboard users can Tab to a locked shape and press `Shift+L`, or use "Toggle locked" in the main menu's Edit submenu. The Edit submenu also has an "Unlock all" action.
13775
13943
 
13776
13944
  #### Related examples
13777
13945
 
@@ -13985,7 +14153,7 @@ Configure selection handles and click target areas:
13985
14153
  | --------------------- | ------- | --------------------------------------------- |
13986
14154
  | `handleRadius` | 12 | Radius of selection handles |
13987
14155
  | `coarseHandleRadius` | 20 | Handle radius for touch input |
13988
- | `hitTestMargin` | 3 | Additional margin around shapes for hit tests |
14156
+ | `hitTestMargin` | 4.5 | Additional margin around shapes for hit tests |
13989
14157
  | `coarseHitTestMargin` | 4 | Hit test margin when using a coarse pointer |
13990
14158
 
13991
14159
  ##### Edge scrolling
@@ -16314,7 +16482,7 @@ editor.selectAdjacentShape('up')
16314
16482
  editor.selectAdjacentShape('down')
16315
16483
  ```
16316
16484
 
16317
- Cardinal directions score candidate shapes by distance and by how far they sit off the axis of travel, then pick the lowest score. If the selection is inside a group or frame, only siblings in that container are considered. Shapes whose util returns `false` from `ShapeUtil#canTabTo` are skipped. In the default UI, Tab and Shift+Tab move to the next and previous shape, and Cmd/Ctrl+Arrow moves by direction.
16485
+ Cardinal directions score candidate shapes by distance and by how far they sit off the axis of travel, then pick the lowest score. If the selection is inside a group or frame, only siblings in that container are considered. Shapes whose util returns `false` from `ShapeUtil#canTabTo` are skipped. Locked shapes are not, so keyboard users can reach them. In the default UI, Tab and Shift+Tab move to the next and previous shape, and Cmd/Ctrl+Arrow moves by direction.
16318
16486
 
16319
16487
  ##### Hierarchical selection
16320
16488
 
@@ -16811,6 +16979,8 @@ editor.flipShapes([box1, box2], 'vertical')
16811
16979
 
16812
16980
  When flipping groups, the editor includes all children of the group so the whole hierarchy flips together. Shapes can opt out of flipping by returning `false` from `ShapeUtil#canBeLaidOut`; arrows do this when the shape they're bound to isn't part of the flip.
16813
16981
 
16982
+ The default UI only offers flip for a single selected shape when `ShapeUtil#canFlip` returns `true`, meaning flipping changes the shape itself by mirroring it or toggling its stored flip. `Editor#flipShapes` doesn't check it. It defaults to `false`; the built-in group, image, arrow, line, draw, highlight and geo shapes return `true`. Override it in your shape util if your shape changes when flipped. Shapes that return `false` still move with the rest of a multi-shape flip.
16983
+
16814
16984
  ##### Rotation
16815
16985
 
16816
16986
  `Editor#rotateShapesBy` rotates shapes by a delta in radians around a common center point. The editor calculates the center of all the shapes' rotated bounds, then rotates each shape around that point and around its own origin: shapes orbit the selection center while also rotating individually. Pass `{ center }` to rotate around a different point.
@@ -20984,7 +21154,7 @@ The tldraw SDK is a product of a company. See [tldraw.dev](https://tldraw.dev/co
20984
21154
 
20985
21155
  ### Dependencies
20986
21156
 
20987
- {/* This page is generated by `yarn license-report --prod`. Do not edit it by hand. */}
21157
+ {/* This page is generated by `pnpm license-report --prod`. Do not edit it by hand. */}
20988
21158
 
20989
21159
  The tldraw SDK itself is published under the [tldraw license](https://tldraw.dev/legal/tldraw-license). It also depends on the third-party packages listed below, each under its own license.
20990
21160
 
@@ -20992,32 +21162,33 @@ This covers the runtime dependencies that the `@tldraw/*` packages declare direc
20992
21162
 
20993
21163
  #### Dependencies
20994
21164
 
20995
- | Dependency | Version | License | Used by |
20996
- | -------------------------------------------------------------------- | ------- | ------- | -------------------------------------------- |
20997
- | [@tiptap/core](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
20998
- | [@tiptap/extension-code](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
20999
- | [@tiptap/extension-highlight](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21000
- | [@tiptap/extension-list](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21001
- | [@tiptap/extension-mention](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `mentions` |
21002
- | [@tiptap/extension-typography](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21003
- | [@tiptap/pm](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
21004
- | [@tiptap/react](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
21005
- | [@tiptap/starter-kit](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21006
- | [@tiptap/suggestion](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `mentions` |
21007
- | [classnames](https://github.com/JedWatson/classnames) | 2.5.1 | MIT | `editor`, `tldraw` |
21008
- | [eventemitter3](https://github.com/primus/eventemitter3) | 4.0.7 | MIT | `editor` |
21009
- | [idb](https://github.com/jakearchibald/idb) | 7.1.1 | ISC | `editor`, `tldraw` |
21010
- | [is-plain-object](https://github.com/jonschlinkert/is-plain-object) | 5.0.0 | MIT | `editor` |
21011
- | [lodash.isequal](https://github.com/lodash/lodash) | 4.5.0 | MIT | `utils` |
21012
- | [lodash.isequalwith](https://github.com/lodash/lodash) | 4.4.0 | MIT | `utils` |
21013
- | [lodash.throttle](https://github.com/lodash/lodash) | 4.1.1 | MIT | `utils` |
21014
- | [lodash.uniq](https://github.com/lodash/lodash) | 4.5.0 | MIT | `utils` |
21015
- | [lz-string](https://github.com/pieroxy/lz-string) | 1.5.0 | MIT | `tldraw` |
21016
- | [mermaid](https://github.com/mermaid-js/mermaid) | 11.16.1 | MIT | `mermaid` |
21017
- | [nanoevents](https://github.com/ai/nanoevents) | 7.0.1 | MIT | `sync`, `sync-core` |
21018
- | [radix-ui](https://github.com/radix-ui/primitives) | 1.4.2 | MIT | `tldraw` |
21019
- | [rbush](https://github.com/mourner/rbush) | 3.0.1 | MIT | `editor` |
21020
- | [ws](https://github.com/websockets/ws) | 8.21.0 | MIT | `sync`, `sync-core` |
21165
+ | Dependency | Version | License | Used by |
21166
+ | -------------------------------------------------------------------- | ------- | ------------ | -------------------------------------------- |
21167
+ | [@tiptap/core](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
21168
+ | [@tiptap/extension-code](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21169
+ | [@tiptap/extension-highlight](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21170
+ | [@tiptap/extension-list](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21171
+ | [@tiptap/extension-mention](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `mentions` |
21172
+ | [@tiptap/extension-typography](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21173
+ | [@tiptap/pm](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
21174
+ | [@tiptap/react](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
21175
+ | [@tiptap/starter-kit](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
21176
+ | [@tiptap/suggestion](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `mentions` |
21177
+ | [classnames](https://github.com/JedWatson/classnames) | 2.5.1 | MIT | `editor`, `tldraw` |
21178
+ | [eventemitter3](https://github.com/primus/eventemitter3) | 4.0.7 | MIT | `editor` |
21179
+ | [idb](https://github.com/jakearchibald/idb) | 7.1.1 | ISC | `editor`, `tldraw` |
21180
+ | [is-plain-object](https://github.com/jonschlinkert/is-plain-object) | 5.0.0 | MIT | `editor` |
21181
+ | [lodash.isequal](https://github.com/lodash/lodash) | 4.5.0 | MIT | `utils` |
21182
+ | [lodash.isequalwith](https://github.com/lodash/lodash) | 4.4.0 | MIT | `utils` |
21183
+ | [lodash.throttle](https://github.com/lodash/lodash) | 4.1.1 | MIT | `utils` |
21184
+ | [lodash.uniq](https://github.com/lodash/lodash) | 4.5.0 | MIT | `utils` |
21185
+ | [lz-string](https://github.com/pieroxy/lz-string) | 1.5.0 | MIT | `tldraw` |
21186
+ | [mermaid](https://github.com/mermaid-js/mermaid) | 11.16.1 | MIT | `mermaid` |
21187
+ | [nanoevents](https://github.com/ai/nanoevents) | 7.0.1 | MIT | `sync`, `sync-core` |
21188
+ | [radix-ui](https://github.com/radix-ui/primitives) | 1.4.2 | MIT | `tldraw` |
21189
+ | [rbush](https://github.com/mourner/rbush) | 3.0.1 | MIT | `editor` |
21190
+ | react-intl | 12.1.4 | BSD-3-Clause | `tldraw` |
21191
+ | [ws](https://github.com/websockets/ws) | 8.21.0 | MIT | `sync`, `sync-core` |
21021
21192
 
21022
21193
  #### Inline code
21023
21194