@excalidraw/excalidraw 0.17.1-88812e0 → 0.17.1-96eeec5

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 (316) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/browser/dev/excalidraw-assets-dev/{chunk-47LVF2XL.js → chunk-DEYXWPUO.js} +4933 -1520
  3. package/dist/browser/dev/excalidraw-assets-dev/chunk-DEYXWPUO.js.map +7 -0
  4. package/dist/browser/dev/excalidraw-assets-dev/{chunk-XOM7LNOU.js → chunk-EM6LVGFW.js} +27 -4
  5. package/dist/browser/dev/excalidraw-assets-dev/chunk-EM6LVGFW.js.map +7 -0
  6. package/dist/browser/dev/excalidraw-assets-dev/{dist-ITJNUBZF.js → dist-6QVAH5JA.js} +36 -14
  7. package/dist/browser/dev/excalidraw-assets-dev/dist-6QVAH5JA.js.map +7 -0
  8. package/dist/browser/dev/excalidraw-assets-dev/{en-TR4QLF5E.js → en-AZFA5HJJ.js} +4 -2
  9. package/dist/browser/dev/excalidraw-assets-dev/{image-LHMGJWTI.js → image-5XCR4WHS.js} +2 -2
  10. package/dist/browser/dev/index.css +157 -62
  11. package/dist/browser/dev/index.css.map +3 -3
  12. package/dist/browser/dev/index.js +12016 -7663
  13. package/dist/browser/dev/index.js.map +4 -4
  14. package/dist/browser/prod/excalidraw-assets/{chunk-5SYIAZGL.js → chunk-7DXALCB2.js} +5 -5
  15. package/dist/browser/prod/excalidraw-assets/chunk-ODWTVSS7.js +68 -0
  16. package/dist/browser/prod/excalidraw-assets/dist-567JAXHK.js +7 -0
  17. package/dist/browser/prod/excalidraw-assets/en-6E7MYLWO.js +1 -0
  18. package/dist/browser/prod/excalidraw-assets/image-LQAMCFQI.js +1 -0
  19. package/dist/browser/prod/index.css +1 -1
  20. package/dist/browser/prod/index.js +69 -51
  21. package/dist/dev/{en-XW4JO6VX.json → en-EB2MBPAV.json} +24 -3
  22. package/dist/dev/index.css +157 -62
  23. package/dist/dev/index.css.map +3 -3
  24. package/dist/dev/index.js +18250 -16114
  25. package/dist/dev/index.js.map +4 -4
  26. package/dist/excalidraw/actions/actionAddToLibrary.d.ts +15 -6
  27. package/dist/excalidraw/actions/actionAlign.d.ts +8 -8
  28. package/dist/excalidraw/actions/actionBoundText.d.ts +14 -8
  29. package/dist/excalidraw/actions/actionBoundText.js +3 -1
  30. package/dist/excalidraw/actions/actionCanvas.d.ts +64 -28
  31. package/dist/excalidraw/actions/actionCanvas.js +1 -1
  32. package/dist/excalidraw/actions/actionClipboard.d.ts +40 -19
  33. package/dist/excalidraw/actions/actionDeleteSelected.d.ts +17 -8
  34. package/dist/excalidraw/actions/actionDistribute.d.ts +4 -4
  35. package/dist/excalidraw/actions/actionDuplicateSelection.d.ts +3 -3
  36. package/dist/excalidraw/actions/actionElementLock.d.ts +11 -5
  37. package/dist/excalidraw/actions/actionExport.d.ts +48 -21
  38. package/dist/excalidraw/actions/actionFinalize.d.ts +11 -5
  39. package/dist/excalidraw/actions/actionFinalize.js +1 -1
  40. package/dist/excalidraw/actions/actionFlip.d.ts +4 -4
  41. package/dist/excalidraw/actions/actionFlip.js +5 -6
  42. package/dist/excalidraw/actions/actionFrame.d.ts +328 -8
  43. package/dist/excalidraw/actions/actionGroup.d.ts +320 -4
  44. package/dist/excalidraw/actions/actionHistory.d.ts +3 -3
  45. package/dist/excalidraw/actions/actionHistory.js +4 -4
  46. package/dist/excalidraw/actions/actionLinearEditor.d.ts +9 -4
  47. package/dist/excalidraw/actions/actionLinearEditor.js +19 -4
  48. package/dist/excalidraw/actions/actionLink.d.ts +5 -2
  49. package/dist/excalidraw/actions/actionMenu.d.ts +15 -6
  50. package/dist/excalidraw/actions/actionNavigate.d.ts +11 -5
  51. package/dist/excalidraw/actions/actionProperties.d.ts +67 -28
  52. package/dist/excalidraw/actions/actionProperties.js +1 -1
  53. package/dist/excalidraw/actions/actionSelectAll.d.ts +6 -3
  54. package/dist/excalidraw/actions/actionStyles.d.ts +9 -3
  55. package/dist/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
  56. package/dist/excalidraw/actions/actionTextAutoResize.js +38 -0
  57. package/dist/excalidraw/actions/actionToggleGridMode.d.ts +6 -3
  58. package/dist/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -2
  59. package/dist/excalidraw/actions/actionToggleStats.d.ts +6 -2
  60. package/dist/excalidraw/actions/actionToggleStats.js +4 -3
  61. package/dist/excalidraw/actions/actionToggleViewMode.d.ts +5 -2
  62. package/dist/excalidraw/actions/actionToggleZenMode.d.ts +5 -2
  63. package/dist/excalidraw/actions/actionZindex.d.ts +8 -4
  64. package/dist/excalidraw/actions/actionZindex.js +4 -0
  65. package/dist/excalidraw/actions/manager.d.ts +3 -3
  66. package/dist/excalidraw/actions/register.d.ts +1 -1
  67. package/dist/excalidraw/actions/shortcuts.d.ts +2 -2
  68. package/dist/excalidraw/actions/types.d.ts +6 -6
  69. package/dist/excalidraw/align.d.ts +1 -1
  70. package/dist/excalidraw/animated-trail.d.ts +2 -2
  71. package/dist/excalidraw/appState.d.ts +5 -2
  72. package/dist/excalidraw/appState.js +6 -3
  73. package/dist/excalidraw/change.d.ts +4 -4
  74. package/dist/excalidraw/change.js +14 -7
  75. package/dist/excalidraw/charts.d.ts +1 -1
  76. package/dist/excalidraw/clients.d.ts +2 -2
  77. package/dist/excalidraw/clients.js +1 -1
  78. package/dist/excalidraw/clipboard.d.ts +3 -3
  79. package/dist/excalidraw/colors.d.ts +1 -1
  80. package/dist/excalidraw/components/Actions.d.ts +3 -3
  81. package/dist/excalidraw/components/Actions.js +9 -6
  82. package/dist/excalidraw/components/App.d.ts +10 -16
  83. package/dist/excalidraw/components/App.js +190 -142
  84. package/dist/excalidraw/components/ButtonIconSelect.js +1 -1
  85. package/dist/excalidraw/components/CheckboxItem.js +1 -1
  86. package/dist/excalidraw/components/ColorPicker/ColorInput.d.ts +1 -1
  87. package/dist/excalidraw/components/ColorPicker/ColorInput.js +1 -1
  88. package/dist/excalidraw/components/ColorPicker/ColorPicker.d.ts +4 -4
  89. package/dist/excalidraw/components/ColorPicker/ColorPicker.js +1 -1
  90. package/dist/excalidraw/components/ColorPicker/Picker.d.ts +3 -3
  91. package/dist/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -1
  92. package/dist/excalidraw/components/ColorPicker/PickerHeading.d.ts +1 -1
  93. package/dist/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -1
  94. package/dist/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  95. package/dist/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +2 -2
  96. package/dist/excalidraw/components/ColorPicker/colorPickerUtils.js +1 -1
  97. package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
  98. package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.js +1 -1
  99. package/dist/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -1
  100. package/dist/excalidraw/components/CommandPalette/CommandPalette.js +5 -5
  101. package/dist/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -1
  102. package/dist/excalidraw/components/CommandPalette/types.d.ts +3 -3
  103. package/dist/excalidraw/components/ConfirmDialog.d.ts +1 -1
  104. package/dist/excalidraw/components/ContextMenu.d.ts +2 -2
  105. package/dist/excalidraw/components/ContextMenu.js +2 -2
  106. package/dist/excalidraw/components/DarkModeToggle.d.ts +1 -1
  107. package/dist/excalidraw/components/DefaultSidebar.d.ts +2 -2
  108. package/dist/excalidraw/components/Dialog.js +1 -1
  109. package/dist/excalidraw/components/DialogActionButton.d.ts +1 -1
  110. package/dist/excalidraw/components/EyeDropper.d.ts +2 -2
  111. package/dist/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
  112. package/dist/excalidraw/components/FollowMode/FollowMode.js +1 -1
  113. package/dist/excalidraw/components/HelpDialog.js +1 -1
  114. package/dist/excalidraw/components/HintViewer.d.ts +1 -1
  115. package/dist/excalidraw/components/IconPicker.js +2 -2
  116. package/dist/excalidraw/components/ImageExportDialog.d.ts +1 -1
  117. package/dist/excalidraw/components/InitializeApp.d.ts +2 -2
  118. package/dist/excalidraw/components/JSONExportDialog.d.ts +3 -3
  119. package/dist/excalidraw/components/LayerUI.d.ts +4 -4
  120. package/dist/excalidraw/components/LayerUI.js +10 -7
  121. package/dist/excalidraw/components/LibraryMenu.d.ts +2 -2
  122. package/dist/excalidraw/components/LibraryMenuBrowseButton.d.ts +1 -1
  123. package/dist/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  124. package/dist/excalidraw/components/LibraryMenuHeaderContent.d.ts +2 -2
  125. package/dist/excalidraw/components/LibraryMenuItems.d.ts +1 -1
  126. package/dist/excalidraw/components/LibraryMenuSection.d.ts +5 -4
  127. package/dist/excalidraw/components/LibraryUnit.d.ts +2 -2
  128. package/dist/excalidraw/components/LoadingMessage.d.ts +1 -1
  129. package/dist/excalidraw/components/MagicSettings.js +2 -2
  130. package/dist/excalidraw/components/MobileMenu.d.ts +3 -3
  131. package/dist/excalidraw/components/MobileMenu.js +2 -6
  132. package/dist/excalidraw/components/Modal.d.ts +1 -1
  133. package/dist/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  134. package/dist/excalidraw/components/PasteChartDialog.d.ts +1 -1
  135. package/dist/excalidraw/components/PasteChartDialog.js +1 -1
  136. package/dist/excalidraw/components/PublishLibrary.d.ts +1 -1
  137. package/dist/excalidraw/components/SVGLayer.d.ts +1 -1
  138. package/dist/excalidraw/components/Sidebar/Sidebar.js +1 -1
  139. package/dist/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -1
  140. package/dist/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -1
  141. package/dist/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
  142. package/dist/excalidraw/components/Sidebar/common.d.ts +1 -1
  143. package/dist/excalidraw/components/Stats/Angle.d.ts +12 -0
  144. package/dist/excalidraw/components/Stats/Angle.js +52 -0
  145. package/dist/excalidraw/components/Stats/Collapsible.d.ts +9 -0
  146. package/dist/excalidraw/components/Stats/Collapsible.js +12 -0
  147. package/dist/excalidraw/components/Stats/Dimension.d.ts +12 -0
  148. package/dist/excalidraw/components/Stats/Dimension.js +67 -0
  149. package/dist/excalidraw/components/Stats/DragInput.d.ts +32 -0
  150. package/dist/excalidraw/components/Stats/DragInput.js +174 -0
  151. package/dist/excalidraw/components/Stats/FontSize.d.ts +12 -0
  152. package/dist/excalidraw/components/Stats/FontSize.js +50 -0
  153. package/dist/excalidraw/components/Stats/MultiAngle.d.ts +12 -0
  154. package/dist/excalidraw/components/Stats/MultiAngle.js +66 -0
  155. package/dist/excalidraw/components/Stats/MultiDimension.d.ts +15 -0
  156. package/dist/excalidraw/components/Stats/MultiDimension.js +197 -0
  157. package/dist/excalidraw/components/Stats/MultiFontSize.d.ts +13 -0
  158. package/dist/excalidraw/components/Stats/MultiFontSize.js +72 -0
  159. package/dist/excalidraw/components/Stats/MultiPosition.d.ts +15 -0
  160. package/dist/excalidraw/components/Stats/MultiPosition.js +100 -0
  161. package/dist/excalidraw/components/Stats/Position.d.ts +13 -0
  162. package/dist/excalidraw/components/Stats/Position.js +39 -0
  163. package/dist/excalidraw/components/Stats/index.d.ts +16 -0
  164. package/dist/excalidraw/components/Stats/index.js +78 -0
  165. package/dist/excalidraw/components/Stats/utils.d.ts +25 -0
  166. package/dist/excalidraw/components/Stats/utils.js +158 -0
  167. package/dist/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -1
  168. package/dist/excalidraw/components/TTDDialog/TTDDialog.js +2 -2
  169. package/dist/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +1 -1
  170. package/dist/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +1 -1
  171. package/dist/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +1 -1
  172. package/dist/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +1 -1
  173. package/dist/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
  174. package/dist/excalidraw/components/TTDDialog/common.d.ts +4 -4
  175. package/dist/excalidraw/components/TextField.d.ts +1 -1
  176. package/dist/excalidraw/components/Toast.d.ts +1 -1
  177. package/dist/excalidraw/components/ToolButton.d.ts +3 -2
  178. package/dist/excalidraw/components/Trans.d.ts +1 -1
  179. package/dist/excalidraw/components/UserList.d.ts +1 -1
  180. package/dist/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -2
  181. package/dist/excalidraw/components/canvases/InteractiveCanvas.js +4 -2
  182. package/dist/excalidraw/components/canvases/StaticCanvas.d.ts +2 -2
  183. package/dist/excalidraw/components/canvases/StaticCanvas.js +2 -2
  184. package/dist/excalidraw/components/dropdownMenu/DropdownMenuItem.js +2 -2
  185. package/dist/excalidraw/components/footer/Footer.d.ts +2 -2
  186. package/dist/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
  187. package/dist/excalidraw/components/hyperlink/helpers.d.ts +3 -3
  188. package/dist/excalidraw/components/icons.d.ts +6 -2
  189. package/dist/excalidraw/components/icons.js +22 -6
  190. package/dist/excalidraw/constants.d.ts +8 -2
  191. package/dist/excalidraw/constants.js +8 -1
  192. package/dist/excalidraw/context/ui-appState.d.ts +1 -1
  193. package/dist/excalidraw/cursor.d.ts +1 -1
  194. package/dist/excalidraw/data/EditorLocalStorage.d.ts +2 -2
  195. package/dist/excalidraw/data/blob.d.ts +5 -5
  196. package/dist/excalidraw/data/filesystem.d.ts +2 -1
  197. package/dist/excalidraw/data/index.d.ts +4 -4
  198. package/dist/excalidraw/data/json.d.ts +3 -3
  199. package/dist/excalidraw/data/library.d.ts +3 -3
  200. package/dist/excalidraw/data/magic.d.ts +3 -3
  201. package/dist/excalidraw/data/reconcile.d.ts +3 -3
  202. package/dist/excalidraw/data/resave.d.ts +2 -2
  203. package/dist/excalidraw/data/restore.d.ts +3 -3
  204. package/dist/excalidraw/data/restore.js +16 -1
  205. package/dist/excalidraw/data/transform.d.ts +3 -3
  206. package/dist/excalidraw/data/types.d.ts +3 -3
  207. package/dist/excalidraw/element/ElementCanvasButtons.d.ts +1 -1
  208. package/dist/excalidraw/element/binding.d.ts +7 -21
  209. package/dist/excalidraw/element/binding.js +127 -102
  210. package/dist/excalidraw/element/bounds.d.ts +3 -3
  211. package/dist/excalidraw/element/collision.d.ts +3 -3
  212. package/dist/excalidraw/element/collision.js +1 -1
  213. package/dist/excalidraw/element/containerCache.d.ts +1 -1
  214. package/dist/excalidraw/element/dragElements.d.ts +4 -4
  215. package/dist/excalidraw/element/dragElements.js +27 -3
  216. package/dist/excalidraw/element/embeddable.d.ts +8 -5
  217. package/dist/excalidraw/element/image.d.ts +2 -2
  218. package/dist/excalidraw/element/index.d.ts +2 -2
  219. package/dist/excalidraw/element/index.js +1 -1
  220. package/dist/excalidraw/element/linearElementEditor.d.ts +8 -5
  221. package/dist/excalidraw/element/linearElementEditor.js +7 -4
  222. package/dist/excalidraw/element/mutateElement.d.ts +2 -2
  223. package/dist/excalidraw/element/mutateElement.js +1 -1
  224. package/dist/excalidraw/element/newElement.d.ts +5 -8
  225. package/dist/excalidraw/element/newElement.js +16 -14
  226. package/dist/excalidraw/element/resizeElements.d.ts +11 -3
  227. package/dist/excalidraw/element/resizeElements.js +75 -23
  228. package/dist/excalidraw/element/resizeTest.d.ts +4 -4
  229. package/dist/excalidraw/element/resizeTest.js +2 -4
  230. package/dist/excalidraw/element/showSelectedShapeActions.d.ts +2 -2
  231. package/dist/excalidraw/element/sizeHelpers.d.ts +2 -2
  232. package/dist/excalidraw/element/sortElements.d.ts +1 -1
  233. package/dist/excalidraw/element/textElement.d.ts +5 -4
  234. package/dist/excalidraw/element/textElement.js +11 -3
  235. package/dist/excalidraw/element/textWysiwyg.d.ts +12 -6
  236. package/dist/excalidraw/element/textWysiwyg.js +38 -17
  237. package/dist/excalidraw/element/transformHandles.d.ts +3 -3
  238. package/dist/excalidraw/element/transformHandles.js +0 -10
  239. package/dist/excalidraw/element/typeChecks.d.ts +4 -4
  240. package/dist/excalidraw/element/types.d.ts +11 -4
  241. package/dist/excalidraw/emitter.d.ts +1 -1
  242. package/dist/excalidraw/fractionalIndex.d.ts +1 -1
  243. package/dist/excalidraw/fractionalIndex.js +2 -4
  244. package/dist/excalidraw/frame.d.ts +3 -3
  245. package/dist/excalidraw/gatransforms.d.ts +1 -1
  246. package/dist/excalidraw/gesture.d.ts +1 -1
  247. package/dist/excalidraw/groups.d.ts +4 -4
  248. package/dist/excalidraw/history.d.ts +4 -4
  249. package/dist/excalidraw/hooks/useEmitter.d.ts +1 -1
  250. package/dist/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  251. package/dist/excalidraw/i18n.d.ts +1 -1
  252. package/dist/excalidraw/index.d.ts +1 -1
  253. package/dist/excalidraw/jotai.d.ts +1 -1
  254. package/dist/excalidraw/laser-trails.d.ts +3 -2
  255. package/dist/excalidraw/locales/en.json +24 -3
  256. package/dist/excalidraw/math.d.ts +4 -2
  257. package/dist/excalidraw/math.js +6 -0
  258. package/dist/excalidraw/mermaid.d.ts +2 -0
  259. package/dist/excalidraw/mermaid.js +28 -0
  260. package/dist/excalidraw/points.d.ts +1 -1
  261. package/dist/excalidraw/queue.d.ts +1 -1
  262. package/dist/excalidraw/renderer/helpers.d.ts +2 -2
  263. package/dist/excalidraw/renderer/interactiveScene.d.ts +2 -2
  264. package/dist/excalidraw/renderer/interactiveScene.js +32 -6
  265. package/dist/excalidraw/renderer/renderElement.d.ts +4 -4
  266. package/dist/excalidraw/renderer/renderElement.js +5 -5
  267. package/dist/excalidraw/renderer/renderSnaps.d.ts +1 -1
  268. package/dist/excalidraw/renderer/staticScene.d.ts +1 -1
  269. package/dist/excalidraw/renderer/staticSvgScene.d.ts +4 -4
  270. package/dist/excalidraw/scene/Fonts.d.ts +2 -4
  271. package/dist/excalidraw/scene/Fonts.js +12 -15
  272. package/dist/excalidraw/scene/Renderer.d.ts +4 -4
  273. package/dist/excalidraw/scene/Renderer.js +2 -3
  274. package/dist/excalidraw/scene/Scene.d.ts +16 -7
  275. package/dist/excalidraw/scene/Scene.js +17 -8
  276. package/dist/excalidraw/scene/Shape.d.ts +1 -1
  277. package/dist/excalidraw/scene/ShapeCache.d.ts +4 -4
  278. package/dist/excalidraw/scene/comparisons.d.ts +2 -2
  279. package/dist/excalidraw/scene/export.d.ts +2 -2
  280. package/dist/excalidraw/scene/export.js +2 -2
  281. package/dist/excalidraw/scene/scroll.d.ts +2 -2
  282. package/dist/excalidraw/scene/scrollbars.d.ts +3 -3
  283. package/dist/excalidraw/scene/selection.d.ts +2 -2
  284. package/dist/excalidraw/scene/types.d.ts +6 -8
  285. package/dist/excalidraw/scene/zoom.d.ts +1 -1
  286. package/dist/excalidraw/shapes.d.ts +7 -0
  287. package/dist/excalidraw/shapes.js +40 -0
  288. package/dist/excalidraw/snapping.d.ts +4 -4
  289. package/dist/excalidraw/snapping.js +2 -1
  290. package/dist/excalidraw/store.d.ts +34 -4
  291. package/dist/excalidraw/store.js +27 -0
  292. package/dist/excalidraw/types.d.ts +25 -20
  293. package/dist/excalidraw/utils.d.ts +4 -4
  294. package/dist/excalidraw/zindex.d.ts +2 -2
  295. package/dist/prod/{en-XW4JO6VX.json → en-EB2MBPAV.json} +24 -3
  296. package/dist/prod/index.css +1 -1
  297. package/dist/prod/index.js +39 -39
  298. package/dist/utils/bbox.d.ts +2 -2
  299. package/dist/utils/collision.d.ts +1 -1
  300. package/dist/utils/export.d.ts +2 -2
  301. package/dist/utils/geometry/geometry.d.ts +1 -1
  302. package/dist/utils/geometry/shape.d.ts +1 -1
  303. package/dist/utils/withinBounds.d.ts +1 -1
  304. package/history.ts +4 -4
  305. package/package.json +2 -2
  306. package/dist/browser/dev/excalidraw-assets-dev/chunk-47LVF2XL.js.map +0 -7
  307. package/dist/browser/dev/excalidraw-assets-dev/chunk-XOM7LNOU.js.map +0 -7
  308. package/dist/browser/dev/excalidraw-assets-dev/dist-ITJNUBZF.js.map +0 -7
  309. package/dist/browser/prod/excalidraw-assets/chunk-4SNEEDZH.js +0 -55
  310. package/dist/browser/prod/excalidraw-assets/dist-54276HPL.js +0 -6
  311. package/dist/browser/prod/excalidraw-assets/en-7GPZE2Y2.js +0 -1
  312. package/dist/browser/prod/excalidraw-assets/image-ISQJGWLB.js +0 -1
  313. package/dist/excalidraw/components/Stats.d.ts +0 -11
  314. package/dist/excalidraw/components/Stats.js +0 -13
  315. /package/dist/browser/dev/excalidraw-assets-dev/{en-TR4QLF5E.js.map → en-AZFA5HJJ.js.map} +0 -0
  316. /package/dist/browser/dev/excalidraw-assets-dev/{image-LHMGJWTI.js.map → image-5XCR4WHS.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  // TODO: It might be "clever" to add option.icon to the existing component <ButtonSelect />
4
- export const ButtonIconSelect = (props) => (_jsx("div", { className: "buttonList buttonListIcon", children: props.options.map((option) => props.type === "button" ? (_jsx("button", { onClick: (event) => props.onClick(option.value, event), className: clsx({
4
+ export const ButtonIconSelect = (props) => (_jsx("div", { className: "buttonList buttonListIcon", children: props.options.map((option) => props.type === "button" ? (_jsx("button", { type: "button", onClick: (event) => props.onClick(option.value, event), className: clsx({
5
5
  active: option.active ?? props.value === option.value,
6
6
  }), "data-testid": option.testId, title: option.text, children: option.icon }, option.text)) : (_jsxs("label", { className: clsx({ active: props.value === option.value }), title: option.text, children: [_jsx("input", { type: "radio", name: props.group, onChange: () => props.onChange(option.value), checked: props.value === option.value, "data-testid": option.testId }), option.icon] }, option.text))) }));
@@ -6,5 +6,5 @@ export const CheckboxItem = ({ children, checked, onChange, className }) => {
6
6
  return (_jsxs("div", { className: clsx("Checkbox", className, { "is-checked": checked }), onClick: (event) => {
7
7
  onChange(!checked, event);
8
8
  event.currentTarget.querySelector(".Checkbox-box").focus();
9
- }, children: [_jsx("button", { className: "Checkbox-box", role: "checkbox", "aria-checked": checked, children: checkIcon }), _jsx("div", { className: "Checkbox-label", children: children })] }));
9
+ }, children: [_jsx("button", { type: "button", className: "Checkbox-box", role: "checkbox", "aria-checked": checked, children: checkIcon }), _jsx("div", { className: "Checkbox-label", children: children })] }));
10
10
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ColorPickerType } from "./colorPickerUtils";
2
+ import type { ColorPickerType } from "./colorPickerUtils";
3
3
  interface ColorInputProps {
4
4
  color: string;
5
5
  onChange: (color: string) => void;
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { getColor } from "./ColorPicker";
4
4
  import { useAtom } from "jotai";
5
- import { activeColorPickerSectionAtom, } from "./colorPickerUtils";
5
+ import { activeColorPickerSectionAtom } from "./colorPickerUtils";
6
6
  import { eyeDropperIcon } from "../icons";
7
7
  import { jotaiScope } from "../../jotai";
8
8
  import { KEYS } from "../../keys";
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { ExcalidrawElement } from "../../element/types";
3
- import { AppState } from "../../types";
4
- import { ColorPickerType } from "./colorPickerUtils";
5
- import { ColorTuple, ColorPaletteCustom } from "../../colors";
2
+ import type { ExcalidrawElement } from "../../element/types";
3
+ import type { AppState } from "../../types";
4
+ import type { ColorPickerType } from "./colorPickerUtils";
5
+ import type { ColorTuple, ColorPaletteCustom } from "../../colors";
6
6
  import "./ColorPicker.scss";
7
7
  export declare const getColor: (color: string) => string | null;
8
8
  interface ColorPickerProps {
@@ -4,7 +4,7 @@ import { TopPicks } from "./TopPicks";
4
4
  import { Picker } from "./Picker";
5
5
  import * as Popover from "@radix-ui/react-popover";
6
6
  import { useAtom } from "jotai";
7
- import { activeColorPickerSectionAtom, } from "./colorPickerUtils";
7
+ import { activeColorPickerSectionAtom } from "./colorPickerUtils";
8
8
  import { useDevice, useExcalidrawContainer } from "../App";
9
9
  import { COLOR_PALETTE } from "../../colors";
10
10
  import PickerHeading from "./PickerHeading";
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { ExcalidrawElement } from "../../element/types";
3
- import { ColorPickerType } from "./colorPickerUtils";
4
- import { ColorPaletteCustom } from "../../colors";
2
+ import type { ExcalidrawElement } from "../../element/types";
3
+ import type { ColorPickerType } from "./colorPickerUtils";
4
+ import type { ColorPaletteCustom } from "../../colors";
5
5
  interface PickerProps {
6
6
  color: string;
7
7
  onChange: (color: string) => void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ColorPaletteCustom } from "../../colors";
2
+ import type { ColorPaletteCustom } from "../../colors";
3
3
  interface PickerColorListProps {
4
4
  palette: ColorPaletteCustom;
5
5
  color: string;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
  declare const PickerHeading: ({ children }: {
3
3
  children: ReactNode;
4
4
  }) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ColorPaletteCustom } from "../../colors";
2
+ import type { ColorPaletteCustom } from "../../colors";
3
3
  interface ShadeListProps {
4
4
  hex: string;
5
5
  onChange: (color: string) => void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ColorPickerType } from "./colorPickerUtils";
2
+ import type { ColorPickerType } from "./colorPickerUtils";
3
3
  interface TopPicksProps {
4
4
  onChange: (color: string) => void;
5
5
  type: ColorPickerType;
@@ -1,5 +1,5 @@
1
- import { ExcalidrawElement } from "../../element/types";
2
- import { ColorPickerColor, ColorPaletteCustom } from "../../colors";
1
+ import type { ExcalidrawElement } from "../../element/types";
2
+ import type { ColorPickerColor, ColorPaletteCustom } from "../../colors";
3
3
  export declare const getColorNameAndShadeFromColor: ({ palette, color, }: {
4
4
  palette: ColorPaletteCustom;
5
5
  color: string;
@@ -1,5 +1,5 @@
1
1
  import { atom } from "jotai";
2
- import { MAX_CUSTOM_COLORS_USED_IN_CANVAS, } from "../../colors";
2
+ import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "../../colors";
3
3
  export const getColorNameAndShadeFromColor = ({ palette, color, }) => {
4
4
  for (const [colorName, colorVal] of Object.entries(palette)) {
5
5
  if (Array.isArray(colorVal)) {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ColorPaletteCustom } from "../../colors";
3
- import { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
2
+ import type { ColorPaletteCustom } from "../../colors";
3
+ import type { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
4
4
  interface ColorPickerKeyNavHandlerProps {
5
5
  event: React.KeyboardEvent;
6
6
  activeColorPickerSection: ActiveColorPickerSectionAtomType;
@@ -1,5 +1,5 @@
1
1
  import { KEYS } from "../../keys";
2
- import { COLORS_PER_ROW, COLOR_PALETTE, } from "../../colors";
2
+ import { COLORS_PER_ROW, COLOR_PALETTE } from "../../colors";
3
3
  import { colorPickerHotkeyBindings, getColorNameAndShadeFromColor, } from "./colorPickerUtils";
4
4
  const arrowHandler = (eventKey, currentIndex, length) => {
5
5
  const rows = Math.ceil(length / COLORS_PER_ROW);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CommandPaletteItem } from "./types";
2
+ import type { CommandPaletteItem } from "./types";
3
3
  import * as defaultItems from "./defaultCommandPaletteItems";
4
4
  import "./CommandPalette.scss";
5
5
  export declare const DEFAULT_CATEGORIES: {
@@ -7,7 +7,7 @@ import { TextField } from "../TextField";
7
7
  import clsx from "clsx";
8
8
  import { getSelectedElements } from "../../scene";
9
9
  import { t } from "../../i18n";
10
- import { getShortcutFromShortcutName, } from "../../actions/shortcuts";
10
+ import { getShortcutFromShortcutName } from "../../actions/shortcuts";
11
11
  import { DEFAULT_SIDEBAR, EVENT } from "../../constants";
12
12
  import { LockedIcon, UnlockedIcon, clockIcon, searchIcon, boltIcon, bucketFillIcon, ExportImageIcon, mermaidLogoIcon, brainIconThin, LibraryIcon, } from "../icons";
13
13
  import fuzzy from "fuzzy";
@@ -164,10 +164,10 @@ function CommandPaletteInner({ customCommandPaletteItems, }) {
164
164
  actionManager.actions.deleteSelectedElements,
165
165
  actionManager.actions.copyStyles,
166
166
  actionManager.actions.pasteStyles,
167
+ actionManager.actions.bringToFront,
168
+ actionManager.actions.bringForward,
167
169
  actionManager.actions.sendBackward,
168
170
  actionManager.actions.sendToBack,
169
- actionManager.actions.bringForward,
170
- actionManager.actions.bringToFront,
171
171
  actionManager.actions.alignTop,
172
172
  actionManager.actions.alignBottom,
173
173
  actionManager.actions.alignLeft,
@@ -416,7 +416,7 @@ function CommandPaletteInner({ customCommandPaletteItems, }) {
416
416
  ...command,
417
417
  icon: command.icon || boltIcon,
418
418
  order: command.order ?? getCategoryOrder(command.category),
419
- haystack: `${deburr(command.label)} ${command.keywords?.join(" ") || ""}`,
419
+ haystack: `${deburr(command.label.toLocaleLowerCase())} ${command.keywords?.join(" ") || ""}`,
420
420
  };
421
421
  });
422
422
  setAllCommands(allCommands);
@@ -584,7 +584,7 @@ function CommandPaletteInner({ customCommandPaletteItems, }) {
584
584
  setCurrentCommand(showLastUsed ? lastUsed : matchingCommands[0] || null);
585
585
  return;
586
586
  }
587
- const _query = deburr(commandSearch.replace(/[<>-_| ]/g, ""));
587
+ const _query = deburr(commandSearch.toLocaleLowerCase().replace(/[<>_| -]/g, ""));
588
588
  matchingCommands = fuzzy
589
589
  .filter(_query, matchingCommands, {
590
590
  extract: (command) => command.haystack,
@@ -1,2 +1,2 @@
1
- import { CommandPaletteItem } from "./types";
1
+ import type { CommandPaletteItem } from "./types";
2
2
  export declare const toggleTheme: CommandPaletteItem;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ActionManager } from "../../actions/manager";
3
- import { Action } from "../../actions/types";
4
- import { UIAppState } from "../../types";
2
+ import type { ActionManager } from "../../actions/manager";
3
+ import type { Action } from "../../actions/types";
4
+ import type { UIAppState } from "../../types";
5
5
  export type CommandPaletteItem = {
6
6
  label: string;
7
7
  /** additional keywords to match against
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DialogProps } from "./Dialog";
2
+ import type { DialogProps } from "./Dialog";
3
3
  import "./ConfirmDialog.scss";
4
4
  interface Props extends Omit<DialogProps, "onCloseRequest"> {
5
5
  onConfirm: () => void;
@@ -1,6 +1,6 @@
1
1
  import "./ContextMenu.scss";
2
- import { Action } from "../actions/types";
3
- import { ActionManager } from "../actions/manager";
2
+ import type { Action } from "../actions/types";
3
+ import type { ActionManager } from "../actions/manager";
4
4
  import React from "react";
5
5
  export type ContextMenuItem = typeof CONTEXT_MENU_SEPARATOR | Action;
6
6
  export type ContextMenuItems = (ContextMenuItem | false | null | undefined)[];
@@ -3,7 +3,7 @@ import clsx from "clsx";
3
3
  import { Popover } from "./Popover";
4
4
  import { t } from "../i18n";
5
5
  import "./ContextMenu.scss";
6
- import { getShortcutFromShortcutName, } from "../actions/shortcuts";
6
+ import { getShortcutFromShortcutName } from "../actions/shortcuts";
7
7
  import { useExcalidrawAppState, useExcalidrawElements } from "./App";
8
8
  import React from "react";
9
9
  export const CONTEXT_MENU_SEPARATOR = "separator";
@@ -46,7 +46,7 @@ export const ContextMenu = React.memo(({ actionManager, items, top, left, onClos
46
46
  onClose(() => {
47
47
  actionManager.executeAction(item, "contextMenu");
48
48
  });
49
- }, children: _jsxs("button", { className: clsx("context-menu-item", {
49
+ }, children: _jsxs("button", { type: "button", className: clsx("context-menu-item", {
50
50
  dangerous: actionName === "deleteSelectedElements",
51
51
  checkmark: item.checked?.(appState),
52
52
  }), children: [_jsx("div", { className: "context-menu-item__label", children: label }), _jsx("kbd", { className: "context-menu-item__shortcut", children: actionName
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import "./ToolIcon.scss";
3
- import { Theme } from "../element/types";
3
+ import type { Theme } from "../element/types";
4
4
  export declare const DarkModeToggle: (props: {
5
5
  value: Theme;
6
6
  onChange: (value: Theme) => void;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { MarkOptional } from "../utility-types";
3
- import { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
2
+ import type { MarkOptional } from "../utility-types";
3
+ import type { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
4
4
  export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
5
5
  name: string;
6
6
  children: import("react").ReactNode;
@@ -72,5 +72,5 @@ export const Dialog = (props) => {
72
72
  };
73
73
  return (_jsx(Modal, { className: clsx("Dialog", props.className, {
74
74
  "Dialog--fullscreen": isFullscreen,
75
- }), labelledBy: "dialog-title", maxWidth: getDialogSize(props.size), onCloseRequest: onClose, closeOnClickOutside: props.closeOnClickOutside, children: _jsxs(Island, { ref: setIslandNode, children: [props.title && (_jsx("h2", { id: `${id}-dialog-title`, className: "Dialog__title", children: _jsx("span", { className: "Dialog__titleContent", children: props.title }) })), isFullscreen && (_jsx("button", { className: "Dialog__close", onClick: onClose, title: t("buttons.close"), "aria-label": t("buttons.close"), children: CloseIcon })), _jsx("div", { className: "Dialog__content", children: props.children })] }) }));
75
+ }), labelledBy: "dialog-title", maxWidth: getDialogSize(props.size), onCloseRequest: onClose, closeOnClickOutside: props.closeOnClickOutside, children: _jsxs(Island, { ref: setIslandNode, children: [props.title && (_jsx("h2", { id: `${id}-dialog-title`, className: "Dialog__title", children: _jsx("span", { className: "Dialog__titleContent", children: props.title }) })), isFullscreen && (_jsx("button", { className: "Dialog__close", onClick: onClose, title: t("buttons.close"), "aria-label": t("buttons.close"), type: "button", children: CloseIcon })), _jsx("div", { className: "Dialog__content", children: props.children })] }) }));
76
76
  };
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
  import "./DialogActionButton.scss";
3
3
  interface DialogActionButtonProps {
4
4
  label: string;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import "./EyeDropper.scss";
3
- import { ColorPickerType } from "./ColorPicker/colorPickerUtils";
4
- import { ExcalidrawElement } from "../element/types";
3
+ import type { ColorPickerType } from "./ColorPicker/colorPickerUtils";
4
+ import type { ExcalidrawElement } from "../element/types";
5
5
  export type EyeDropperProperties = {
6
6
  keepOpenOnAlt: boolean;
7
7
  swapPreviewOnAlt?: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { UserToFollow } from "../../types";
2
+ import type { UserToFollow } from "../../types";
3
3
  import "./FollowMode.scss";
4
4
  interface FollowModeProps {
5
5
  width: number;
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CloseIcon } from "../icons";
3
3
  import "./FollowMode.scss";
4
4
  const FollowMode = ({ height, width, userToFollow, onDisconnect, }) => {
5
- return (_jsx("div", { className: "follow-mode", style: { width, height }, children: _jsxs("div", { className: "follow-mode__badge", children: [_jsxs("div", { className: "follow-mode__badge__label", children: ["Following", " ", _jsx("span", { className: "follow-mode__badge__username", title: userToFollow.username, children: userToFollow.username })] }), _jsx("button", { onClick: onDisconnect, className: "follow-mode__disconnect-btn", children: CloseIcon })] }) }));
5
+ return (_jsx("div", { className: "follow-mode", style: { width, height }, children: _jsxs("div", { className: "follow-mode__badge", children: [_jsxs("div", { className: "follow-mode__badge__label", children: ["Following", " ", _jsx("span", { className: "follow-mode__badge__username", title: userToFollow.username, children: userToFollow.username })] }), _jsx("button", { type: "button", onClick: onDisconnect, className: "follow-mode__disconnect-btn", children: CloseIcon })] }) }));
6
6
  };
7
7
  export default FollowMode;
@@ -57,7 +57,7 @@ export const HelpDialog = ({ onClose }) => {
57
57
  t("helpDialog.click"),
58
58
  t("helpDialog.click"),
59
59
  t("helpDialog.click"),
60
- ], isOr: false }), _jsx(Shortcut, { label: t("toolBar.lock"), shortcuts: [KEYS.Q] }), _jsx(Shortcut, { label: t("helpDialog.preventBinding"), shortcuts: [getShortcutKey("CtrlOrCmd")] }), _jsx(Shortcut, { label: t("toolBar.link"), shortcuts: [getShortcutKey("CtrlOrCmd+K")] })] }), _jsxs(ShortcutIsland, { className: "HelpDialog__island--view", caption: t("helpDialog.view"), children: [_jsx(Shortcut, { label: t("buttons.zoomIn"), shortcuts: [getShortcutKey("CtrlOrCmd++")] }), _jsx(Shortcut, { label: t("buttons.zoomOut"), shortcuts: [getShortcutKey("CtrlOrCmd+-")] }), _jsx(Shortcut, { label: t("buttons.resetZoom"), shortcuts: [getShortcutKey("CtrlOrCmd+0")] }), _jsx(Shortcut, { label: t("helpDialog.zoomToFit"), shortcuts: ["Shift+1"] }), _jsx(Shortcut, { label: t("helpDialog.zoomToSelection"), shortcuts: ["Shift+2"] }), _jsx(Shortcut, { label: t("helpDialog.movePageUpDown"), shortcuts: ["PgUp/PgDn"] }), _jsx(Shortcut, { label: t("helpDialog.movePageLeftRight"), shortcuts: ["Shift+PgUp/PgDn"] }), _jsx(Shortcut, { label: t("buttons.zenMode"), shortcuts: [getShortcutKey("Alt+Z")] }), _jsx(Shortcut, { label: t("buttons.objectsSnapMode"), shortcuts: [getShortcutKey("Alt+S")] }), _jsx(Shortcut, { label: t("labels.toggleGrid"), shortcuts: [getShortcutKey("CtrlOrCmd+'")] }), _jsx(Shortcut, { label: t("labels.viewMode"), shortcuts: [getShortcutKey("Alt+R")] }), _jsx(Shortcut, { label: t("labels.toggleTheme"), shortcuts: [getShortcutKey("Alt+Shift+D")] }), _jsx(Shortcut, { label: t("stats.title"), shortcuts: [getShortcutKey("Alt+/")] }), _jsx(Shortcut, { label: t("commandPalette.title"), shortcuts: isFirefox
60
+ ], isOr: false }), _jsx(Shortcut, { label: t("toolBar.lock"), shortcuts: [KEYS.Q] }), _jsx(Shortcut, { label: t("helpDialog.preventBinding"), shortcuts: [getShortcutKey("CtrlOrCmd")] }), _jsx(Shortcut, { label: t("toolBar.link"), shortcuts: [getShortcutKey("CtrlOrCmd+K")] })] }), _jsxs(ShortcutIsland, { className: "HelpDialog__island--view", caption: t("helpDialog.view"), children: [_jsx(Shortcut, { label: t("buttons.zoomIn"), shortcuts: [getShortcutKey("CtrlOrCmd++")] }), _jsx(Shortcut, { label: t("buttons.zoomOut"), shortcuts: [getShortcutKey("CtrlOrCmd+-")] }), _jsx(Shortcut, { label: t("buttons.resetZoom"), shortcuts: [getShortcutKey("CtrlOrCmd+0")] }), _jsx(Shortcut, { label: t("helpDialog.zoomToFit"), shortcuts: ["Shift+1"] }), _jsx(Shortcut, { label: t("helpDialog.zoomToSelection"), shortcuts: ["Shift+2"] }), _jsx(Shortcut, { label: t("helpDialog.movePageUpDown"), shortcuts: ["PgUp/PgDn"] }), _jsx(Shortcut, { label: t("helpDialog.movePageLeftRight"), shortcuts: ["Shift+PgUp/PgDn"] }), _jsx(Shortcut, { label: t("buttons.zenMode"), shortcuts: [getShortcutKey("Alt+Z")] }), _jsx(Shortcut, { label: t("buttons.objectsSnapMode"), shortcuts: [getShortcutKey("Alt+S")] }), _jsx(Shortcut, { label: t("labels.toggleGrid"), shortcuts: [getShortcutKey("CtrlOrCmd+'")] }), _jsx(Shortcut, { label: t("labels.viewMode"), shortcuts: [getShortcutKey("Alt+R")] }), _jsx(Shortcut, { label: t("labels.toggleTheme"), shortcuts: [getShortcutKey("Alt+Shift+D")] }), _jsx(Shortcut, { label: t("stats.fullTitle"), shortcuts: [getShortcutKey("Alt+/")] }), _jsx(Shortcut, { label: t("commandPalette.title"), shortcuts: isFirefox
61
61
  ? [getShortcutFromShortcutName("commandPalette")]
62
62
  : [
63
63
  getShortcutFromShortcutName("commandPalette"),
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { AppClassProperties, Device, UIAppState } from "../types";
2
+ import type { AppClassProperties, Device, UIAppState } from "../types";
3
3
  import "./HintViewer.scss";
4
4
  interface HintViewerProps {
5
5
  appState: UIAppState;
@@ -72,7 +72,7 @@ function Picker({ options, value, label, onChange, onClose, }) {
72
72
  event.nativeEvent.stopImmediatePropagation();
73
73
  event.stopPropagation();
74
74
  };
75
- return (_jsx("div", { className: `picker`, role: "dialog", "aria-modal": "true", "aria-label": label, onKeyDown: handleKeyDown, children: _jsx("div", { className: "picker-content", ref: rGallery, children: options.map((option, i) => (_jsxs("button", { className: clsx("picker-option", {
75
+ return (_jsx("div", { className: `picker`, role: "dialog", "aria-modal": "true", "aria-label": label, onKeyDown: handleKeyDown, children: _jsx("div", { className: "picker-content", ref: rGallery, children: options.map((option, i) => (_jsxs("button", { type: "button", className: clsx("picker-option", {
76
76
  active: value === option.value,
77
77
  }), onClick: (event) => {
78
78
  event.currentTarget.focus();
@@ -92,7 +92,7 @@ export function IconPicker({ value, label, options, onChange, group = "", }) {
92
92
  const [isActive, setActive] = React.useState(false);
93
93
  const rPickerButton = React.useRef(null);
94
94
  const isRTL = getLanguage().rtl;
95
- return (_jsxs("div", { children: [_jsx("button", { name: group, className: isActive ? "active" : "", "aria-label": label, onClick: () => setActive(!isActive), ref: rPickerButton, children: options.find((option) => option.value === value)?.icon }), _jsx(React.Suspense, { fallback: "", children: isActive ? (_jsxs(_Fragment, { children: [_jsx(Popover, { onCloseRequest: (event) => event.target !== rPickerButton.current && setActive(false), ...(isRTL ? { right: 5.5 } : { left: -5.5 }), children: _jsx(Picker, { options: options.filter((opt) => opt.showInPicker !== false), value: value, label: label, onChange: onChange, onClose: () => {
95
+ return (_jsxs("div", { children: [_jsx("button", { name: group, type: "button", className: isActive ? "active" : "", "aria-label": label, onClick: () => setActive(!isActive), ref: rPickerButton, children: options.find((option) => option.value === value)?.icon }), _jsx(React.Suspense, { fallback: "", children: isActive ? (_jsxs(_Fragment, { children: [_jsx(Popover, { onCloseRequest: (event) => event.target !== rPickerButton.current && setActive(false), ...(isRTL ? { right: 5.5 } : { left: -5.5 }), children: _jsx(Picker, { options: options.filter((opt) => opt.showInPicker !== false), value: value, label: label, onChange: onChange, onClose: () => {
96
96
  setActive(false);
97
97
  rPickerButton.current?.focus();
98
98
  } }) }), _jsx("div", { className: "picker-triangle" })] })) : null })] }));
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { ActionManager } from "../actions/manager";
3
3
  import type { AppClassProperties, BinaryFiles, UIAppState } from "../types";
4
- import { NonDeletedExcalidrawElement } from "../element/types";
4
+ import type { NonDeletedExcalidrawElement } from "../element/types";
5
5
  import "./ImageExportDialog.scss";
6
6
  export declare const ErrorCanvasPreview: () => JSX.Element;
7
7
  export declare const ImageExportDialog: ({ elements, appState, files, actionManager, onExportImage, onCloseRequest, name, }: {
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { Language } from "../i18n";
3
- import { Theme } from "../element/types";
2
+ import type { Language } from "../i18n";
3
+ import type { Theme } from "../element/types";
4
4
  interface Props {
5
5
  langCode: Language["code"];
6
6
  children: React.ReactElement;
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { NonDeletedExcalidrawElement } from "../element/types";
3
- import { ExportOpts, BinaryFiles, UIAppState } from "../types";
2
+ import type { NonDeletedExcalidrawElement } from "../element/types";
3
+ import type { ExportOpts, BinaryFiles, UIAppState } from "../types";
4
4
  import "./ExportDialog.scss";
5
- import { ActionManager } from "../actions/manager";
5
+ import type { ActionManager } from "../actions/manager";
6
6
  export type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
7
7
  export declare const JSONExportDialog: ({ elements, appState, files, actionManager, exportOpts, canvas, setAppState, }: {
8
8
  elements: readonly NonDeletedExcalidrawElement[];
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { ActionManager } from "../actions/manager";
3
- import { NonDeletedExcalidrawElement } from "../element/types";
4
- import { Language } from "../i18n";
5
- import { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState, AppClassProperties } from "../types";
2
+ import type { ActionManager } from "../actions/manager";
3
+ import type { NonDeletedExcalidrawElement } from "../element/types";
4
+ import type { Language } from "../i18n";
5
+ import type { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState, AppClassProperties } from "../types";
6
6
  import "./LayerUI.scss";
7
7
  import "./Toolbar.scss";
8
8
  interface LayerUIProps {
@@ -24,8 +24,6 @@ import { JSONExportDialog } from "./JSONExportDialog";
24
24
  import { PenModeButton } from "./PenModeButton";
25
25
  import { trackEvent } from "../analytics";
26
26
  import { useDevice } from "./App";
27
- import { Stats } from "./Stats";
28
- import { actionToggleStats } from "../actions/actionToggleStats";
29
27
  import Footer from "./footer/Footer";
30
28
  import { isSidebarDockedAtom } from "./Sidebar/Sidebar";
31
29
  import { jotaiScope } from "../jotai";
@@ -48,6 +46,8 @@ import Scene from "../scene/Scene";
48
46
  import { LaserPointerButton } from "./LaserPointerButton";
49
47
  import { MagicSettings } from "./MagicSettings";
50
48
  import { TTDDialog } from "./TTDDialog/TTDDialog";
49
+ import { Stats } from "./Stats";
50
+ import { actionToggleStats } from "../actions";
51
51
  const DefaultMainMenu = ({ UIOptions }) => {
52
52
  return (_jsxs(MainMenu, { __fallback: true, children: [_jsx(MainMenu.DefaultItems.LoadScene, {}), _jsx(MainMenu.DefaultItems.SaveToActiveFile, {}), UIOptions.canvasActions.export && _jsx(MainMenu.DefaultItems.Export, {}), UIOptions.canvasActions.saveAsImage && (_jsx(MainMenu.DefaultItems.SaveAsImage, {})), _jsx(MainMenu.DefaultItems.Help, {}), _jsx(MainMenu.DefaultItems.ClearCanvas, {}), _jsx(MainMenu.Separator, {}), _jsx(MainMenu.Group, { title: "Excalidraw links", children: _jsx(MainMenu.DefaultItems.Socials, {}) }), _jsx(MainMenu.Separator, {}), _jsx(MainMenu.DefaultItems.ToggleTheme, {}), _jsx(MainMenu.DefaultItems.ChangeCanvasBackground, {})] }));
53
53
  };
@@ -81,6 +81,9 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
81
81
  }, children: _jsx(SelectedShapeActions, { appState: appState, elementsMap: app.scene.getNonDeletedElementsMap(), renderAction: actionManager.renderAction }) }) }));
82
82
  const renderFixedSideContainer = () => {
83
83
  const shouldRenderSelectedShapeActions = showSelectedShapeActions(appState, elements);
84
+ const shouldShowStats = appState.stats.open &&
85
+ !appState.zenModeEnabled &&
86
+ !appState.viewModeEnabled;
84
87
  return (_jsx(FixedSideContainer, { side: "top", children: _jsxs("div", { className: "App-menu App-menu_top", children: [_jsxs(Stack.Col, { gap: 6, className: clsx("App-menu_top__left"), children: [renderCanvasActions(), shouldRenderSelectedShapeActions && renderSelectedShapeActions()] }), !appState.viewModeEnabled && (_jsx(Section, { heading: "shapes", className: "shapes-section", children: (heading) => (_jsxs("div", { style: { position: "relative" }, children: [renderWelcomeScreen && (_jsx(tunnels.WelcomeScreenToolbarHintTunnel.Out, {})), _jsx(Stack.Col, { gap: 4, align: "start", children: _jsxs(Stack.Row, { gap: 1, className: clsx("App-toolbar-container", {
85
88
  "zen-mode": appState.zenModeEnabled,
86
89
  }), children: [_jsxs(Island, { padding: 1, className: clsx("App-toolbar", {
@@ -94,7 +97,9 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
94
97
  }), children: [appState.collaborators.size > 0 && (_jsx(UserList, { collaborators: appState.collaborators, userToFollow: appState.userToFollow?.socketId || null })), renderTopRightUI?.(device.editor.isMobile, appState), !appState.viewModeEnabled &&
95
98
  // hide button when sidebar docked
96
99
  (!isSidebarDocked ||
97
- appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && (_jsx(tunnels.DefaultSidebarTriggerTunnel.Out, {}))] })] }) }));
100
+ appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && (_jsx(tunnels.DefaultSidebarTriggerTunnel.Out, {})), shouldShowStats && (_jsx(Stats, { scene: app.scene, onClose: () => {
101
+ actionManager.executeAction(actionToggleStats);
102
+ }, renderCustomStats: renderCustomStats }))] })] }) }));
98
103
  };
99
104
  const renderSidebars = () => {
100
105
  return (_jsx(DefaultSidebar, { __fallback: true, onDock: (docked) => {
@@ -126,7 +131,7 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
126
131
  }, false);
127
132
  ShapeCache.delete(element);
128
133
  }
129
- Scene.getScene(selectedElements[0])?.informMutation();
134
+ Scene.getScene(selectedElements[0])?.triggerUpdate();
130
135
  }
131
136
  else if (colorPickerType === "elementBackground") {
132
137
  setAppState({
@@ -158,9 +163,7 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
158
163
  isSidebarDocked &&
159
164
  device.editor.canFitSidebar
160
165
  ? { width: `calc(100% - ${LIBRARY_SIDEBAR_WIDTH}px)` }
161
- : {}, children: [renderWelcomeScreen && _jsx(tunnels.WelcomeScreenCenterTunnel.Out, {}), renderFixedSideContainer(), _jsx(Footer, { appState: appState, actionManager: actionManager, showExitZenModeBtn: showExitZenModeBtn, renderWelcomeScreen: renderWelcomeScreen }), appState.showStats && (_jsx(Stats, { appState: appState, setAppState: setAppState, elements: elements, onClose: () => {
162
- actionManager.executeAction(actionToggleStats);
163
- }, renderCustomStats: renderCustomStats })), appState.scrolledOutside && (_jsx("button", { className: "scroll-back-to-content", onClick: () => {
166
+ : {}, children: [renderWelcomeScreen && _jsx(tunnels.WelcomeScreenCenterTunnel.Out, {}), renderFixedSideContainer(), _jsx(Footer, { appState: appState, actionManager: actionManager, showExitZenModeBtn: showExitZenModeBtn, renderWelcomeScreen: renderWelcomeScreen }), appState.scrolledOutside && (_jsx("button", { type: "button", className: "scroll-back-to-content", onClick: () => {
164
167
  setAppState((appState) => ({
165
168
  ...calculateScrollCenter(elements, appState),
166
169
  }));
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import Library from "../data/library";
3
- import { LibraryItems, LibraryItem, ExcalidrawProps, UIAppState } from "../types";
2
+ import type Library from "../data/library";
3
+ import type { LibraryItems, LibraryItem, ExcalidrawProps, UIAppState } from "../types";
4
4
  import "./LibraryMenu.scss";
5
5
  export declare const isLibraryMenuOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
6
6
  init: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ExcalidrawProps, UIAppState } from "../types";
2
+ import type { ExcalidrawProps, UIAppState } from "../types";
3
3
  declare const LibraryMenuBrowseButton: ({ theme, id, libraryReturnUrl, }: {
4
4
  libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
5
5
  theme: UIAppState["theme"];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ExcalidrawProps, UIAppState } from "../types";
2
+ import type { ExcalidrawProps, UIAppState } from "../types";
3
3
  export declare const LibraryMenuControlButtons: ({ libraryReturnUrl, theme, id, style, children, className, }: {
4
4
  libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
5
5
  theme: UIAppState["theme"];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { LibraryItem, UIAppState } from "../types";
3
- import Library from "../data/library";
2
+ import type { LibraryItem, UIAppState } from "../types";
3
+ import type Library from "../data/library";
4
4
  export declare const LibraryDropdownMenuButton: React.FC<{
5
5
  setAppState: React.Component<any, UIAppState>["setState"];
6
6
  selectedItems: LibraryItem["id"][];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ExcalidrawProps, LibraryItem, LibraryItems, UIAppState } from "../types";
2
+ import type { ExcalidrawProps, LibraryItem, LibraryItems, UIAppState } from "../types";
3
3
  import "./LibraryMenuItems.scss";
4
4
  export default function LibraryMenuItems({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, id, libraryReturnUrl, onSelectItems, selectedItems, }: {
5
5
  isLoading: boolean;
@@ -1,7 +1,8 @@
1
- import React, { ReactNode } from "react";
2
- import { LibraryItem } from "../types";
3
- import { ExcalidrawElement, NonDeleted } from "../element/types";
4
- import { SvgCache } from "../hooks/useLibraryItemSvg";
1
+ import type { ReactNode } from "react";
2
+ import React from "react";
3
+ import type { LibraryItem } from "../types";
4
+ import type { ExcalidrawElement, NonDeleted } from "../element/types";
5
+ import type { SvgCache } from "../hooks/useLibraryItemSvg";
5
6
  type LibraryOrPendingItem = (LibraryItem | /* pending library item */ {
6
7
  id: null;
7
8
  elements: readonly NonDeleted<ExcalidrawElement>[];
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { LibraryItem } from "../types";
2
+ import type { LibraryItem } from "../types";
3
3
  import "./LibraryUnit.scss";
4
- import { SvgCache } from "../hooks/useLibraryItemSvg";
4
+ import type { SvgCache } from "../hooks/useLibraryItemSvg";
5
5
  export declare const LibraryUnit: import("react").MemoExoticComponent<({ id, elements, isPending, onClick, selected, onToggle, onDrag, svgCache, }: {
6
6
  id: LibraryItem["id"] | /** for pending item */ null;
7
7
  elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Theme } from "../element/types";
2
+ import type { Theme } from "../element/types";
3
3
  export declare const LoadingMessage: React.FC<{
4
4
  delay?: number;
5
5
  theme?: Theme;
@@ -33,8 +33,8 @@ export const MagicSettings = (props) => {
33
33
  marginLeft: "1rem",
34
34
  fontSize: 14,
35
35
  borderRadius: "12px",
36
- color: "#000",
37
- background: "pink",
36
+ background: "var(--color-promo)",
37
+ color: "var(--color-surface-lowest)",
38
38
  }, children: "Experimental" })] }), className: "MagicSettings", autofocus: false, children: _jsx(TTDDialogTabs, { dialog: "settings", tab: appState.openDialog.tab, children: _jsxs(TTDDialogTab
39
39
  // className="ttd-dialog-content"
40
40
  , {
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { AppClassProperties, AppProps, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
3
- import { ActionManager } from "../actions/manager";
4
- import { NonDeletedExcalidrawElement } from "../element/types";
2
+ import type { AppClassProperties, AppProps, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
3
+ import type { ActionManager } from "../actions/manager";
4
+ import type { NonDeletedExcalidrawElement } from "../element/types";
5
5
  type MobileMenuProps = {
6
6
  appState: UIAppState;
7
7
  actionManager: ActionManager;