@dwelle/excalidraw 0.5.0-01f5cf7 → 0.5.0-078e047

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 (482) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/README.md +111 -14
  3. package/dist/dev/{chunk-6L6WB2VZ.js → chunk-FY4SXOMP.js} +3156 -1674
  4. package/dist/dev/chunk-FY4SXOMP.js.map +7 -0
  5. package/dist/dev/chunk-LCV6WMJR.js +69 -0
  6. package/dist/dev/chunk-LCV6WMJR.js.map +7 -0
  7. package/dist/dev/{chunk-EWKWI3K7.js → chunk-PM32OSOR.js} +14 -1
  8. package/dist/dev/chunk-PM32OSOR.js.map +7 -0
  9. package/dist/dev/{chunk-5I3XVQQV.js → chunk-YY3VJZEJ.js} +2 -2
  10. package/dist/dev/components/TTDDialog/{CodeMirrorEditor-FNBRG3XO.js → CodeMirrorEditor-UBKSUIQM.js} +2 -2
  11. package/dist/dev/data/{image-ADRLSYW7.js → image-KIEP3SMK.js} +3 -3
  12. package/dist/dev/index.css +333 -456
  13. package/dist/dev/index.css.map +3 -3
  14. package/dist/dev/index.js +5055 -4712
  15. package/dist/dev/index.js.map +4 -4
  16. package/dist/dev/locales/{ar-SA-AGVJN2FU.js → ar-SA-2YSRL2Y5.js} +26 -4
  17. package/dist/dev/locales/ar-SA-2YSRL2Y5.js.map +7 -0
  18. package/dist/dev/locales/{az-AZ-62IXPX5D.js → az-AZ-Y4BDU6NT.js} +25 -3
  19. package/dist/dev/locales/az-AZ-Y4BDU6NT.js.map +7 -0
  20. package/dist/dev/locales/{bg-BG-UBDZF4KA.js → bg-BG-VL3Z2EMR.js} +25 -3
  21. package/dist/dev/locales/bg-BG-VL3Z2EMR.js.map +7 -0
  22. package/dist/dev/locales/{bn-BD-4TAUVZOD.js → bn-BD-4B2A67HP.js} +25 -3
  23. package/dist/dev/locales/bn-BD-4B2A67HP.js.map +7 -0
  24. package/dist/dev/locales/{bn-IN-PUGL2LDE.js → bn-IN-4LXCFZMW.js} +25 -3
  25. package/dist/dev/locales/bn-IN-4LXCFZMW.js.map +7 -0
  26. package/dist/dev/locales/{ca-ES-GEEW5L7T.js → ca-ES-M4YCZMII.js} +26 -4
  27. package/dist/dev/locales/ca-ES-M4YCZMII.js.map +7 -0
  28. package/dist/dev/locales/{cs-CZ-LNVE3QM5.js → cs-CZ-UFSXS6HC.js} +25 -3
  29. package/dist/dev/locales/cs-CZ-UFSXS6HC.js.map +7 -0
  30. package/dist/dev/locales/{da-DK-CAYJG7FJ.js → da-DK-GITJMZWC.js} +25 -3
  31. package/dist/dev/locales/da-DK-GITJMZWC.js.map +7 -0
  32. package/dist/dev/locales/{de-CH-GCXOD4LK.js → de-CH-AEAPIGWW.js} +26 -4
  33. package/dist/dev/locales/de-CH-AEAPIGWW.js.map +7 -0
  34. package/dist/dev/locales/{de-DE-CGDBECYD.js → de-DE-5ZLSO65Y.js} +26 -4
  35. package/dist/dev/locales/de-DE-5ZLSO65Y.js.map +7 -0
  36. package/dist/dev/locales/{el-GR-G5QZC24A.js → el-GR-GYPZT4GZ.js} +26 -4
  37. package/dist/dev/locales/el-GR-GYPZT4GZ.js.map +7 -0
  38. package/dist/dev/locales/{en-A3UOWEYW.js → en-XFEPEVLS.js} +4 -2
  39. package/dist/dev/locales/{es-ES-UMEOH76W.js → es-ES-JFMAP7BU.js} +26 -4
  40. package/dist/dev/locales/es-ES-JFMAP7BU.js.map +7 -0
  41. package/dist/dev/locales/{eu-ES-IWRZXJC5.js → eu-ES-WNVIIFRL.js} +26 -4
  42. package/dist/dev/locales/eu-ES-WNVIIFRL.js.map +7 -0
  43. package/dist/dev/locales/{fa-IR-QOYVIIJA.js → fa-IR-WYXLIZOT.js} +34 -12
  44. package/dist/dev/locales/fa-IR-WYXLIZOT.js.map +7 -0
  45. package/dist/dev/locales/{fi-FI-BXRW65OA.js → fi-FI-54NSFYWG.js} +25 -3
  46. package/dist/dev/locales/fi-FI-54NSFYWG.js.map +7 -0
  47. package/dist/dev/locales/{fr-FR-R2QH5VCW.js → fr-FR-D5OGMLN6.js} +63 -41
  48. package/dist/dev/locales/fr-FR-D5OGMLN6.js.map +7 -0
  49. package/dist/dev/locales/{gl-ES-4ES3ZADP.js → gl-ES-KHXPF3VA.js} +25 -3
  50. package/dist/dev/locales/gl-ES-KHXPF3VA.js.map +7 -0
  51. package/dist/dev/locales/{he-IL-TRQRRYPH.js → he-IL-QSUPCRTQ.js} +26 -4
  52. package/dist/dev/locales/he-IL-QSUPCRTQ.js.map +7 -0
  53. package/dist/dev/locales/{hi-IN-U46BOJEC.js → hi-IN-TY7QEP7S.js} +26 -4
  54. package/dist/dev/locales/hi-IN-TY7QEP7S.js.map +7 -0
  55. package/dist/dev/locales/{hu-HU-JDULJ6XL.js → hu-HU-FHTE6N2G.js} +25 -3
  56. package/dist/dev/locales/hu-HU-FHTE6N2G.js.map +7 -0
  57. package/dist/dev/locales/{id-ID-BLIXNCUT.js → id-ID-4WWGEFMB.js} +26 -4
  58. package/dist/dev/locales/id-ID-4WWGEFMB.js.map +7 -0
  59. package/dist/dev/locales/{it-IT-6TBW7RUK.js → it-IT-P47ZQPB3.js} +30 -8
  60. package/dist/dev/locales/it-IT-P47ZQPB3.js.map +7 -0
  61. package/dist/dev/locales/{ja-JP-6HYAQFYX.js → ja-JP-URB5LBRT.js} +165 -143
  62. package/dist/dev/locales/ja-JP-URB5LBRT.js.map +7 -0
  63. package/dist/dev/locales/{kaa-Z5UP62XJ.js → kaa-FMANZGDI.js} +25 -3
  64. package/dist/dev/locales/kaa-FMANZGDI.js.map +7 -0
  65. package/dist/dev/locales/{kab-KAB-Z7STWQKS.js → kab-KAB-LKRLZQXY.js} +25 -3
  66. package/dist/dev/locales/kab-KAB-LKRLZQXY.js.map +7 -0
  67. package/dist/dev/locales/{kk-KZ-BWHY45DX.js → kk-KZ-3254S5T2.js} +25 -3
  68. package/dist/dev/locales/kk-KZ-3254S5T2.js.map +7 -0
  69. package/dist/dev/locales/{km-KH-HGLNWNRU.js → km-KH-L5X6KSOP.js} +25 -3
  70. package/dist/dev/locales/km-KH-L5X6KSOP.js.map +7 -0
  71. package/dist/dev/locales/{ko-KR-CO36WKPC.js → ko-KR-MFE6HC5B.js} +25 -3
  72. package/dist/dev/locales/ko-KR-MFE6HC5B.js.map +7 -0
  73. package/dist/dev/locales/{ku-TR-AACVIARC.js → ku-TR-QMA34F2F.js} +25 -3
  74. package/dist/dev/locales/ku-TR-QMA34F2F.js.map +7 -0
  75. package/dist/dev/locales/{lt-LT-CFYYFLDV.js → lt-LT-ZZ4ADZ7N.js} +25 -3
  76. package/dist/dev/locales/lt-LT-ZZ4ADZ7N.js.map +7 -0
  77. package/dist/dev/locales/{lv-LV-QCBBOFFU.js → lv-LV-BXTRSXJG.js} +25 -3
  78. package/dist/dev/locales/lv-LV-BXTRSXJG.js.map +7 -0
  79. package/dist/dev/locales/{mr-IN-B2CM5GK5.js → mr-IN-57KQDHC2.js} +26 -4
  80. package/dist/dev/locales/mr-IN-57KQDHC2.js.map +7 -0
  81. package/dist/dev/locales/{my-MM-756BNN36.js → my-MM-63XGVQB2.js} +25 -3
  82. package/dist/dev/locales/my-MM-63XGVQB2.js.map +7 -0
  83. package/dist/dev/locales/{nb-NO-5BLHQI4J.js → nb-NO-355CTFN2.js} +26 -4
  84. package/dist/dev/locales/nb-NO-355CTFN2.js.map +7 -0
  85. package/dist/dev/locales/{nl-NL-225BLGAH.js → nl-NL-CYL7CDFO.js} +32 -10
  86. package/dist/dev/locales/nl-NL-CYL7CDFO.js.map +7 -0
  87. package/dist/dev/locales/{nn-NO-4J7MR6GH.js → nn-NO-XXWWVC6Z.js} +25 -3
  88. package/dist/dev/locales/nn-NO-XXWWVC6Z.js.map +7 -0
  89. package/dist/dev/locales/{oc-FR-XCETH7KF.js → oc-FR-DRSDA2BN.js} +26 -4
  90. package/dist/dev/locales/oc-FR-DRSDA2BN.js.map +7 -0
  91. package/dist/dev/locales/{pa-IN-32NBAN5L.js → pa-IN-QDAURTVI.js} +25 -3
  92. package/dist/dev/locales/pa-IN-QDAURTVI.js.map +7 -0
  93. package/dist/dev/locales/{percentages-ZRLRVMSI.js → percentages-QGLYMXSX.js} +2 -2
  94. package/dist/dev/locales/{pl-PL-R6OJ54BT.js → pl-PL-MVJZXY6Q.js} +26 -4
  95. package/dist/dev/locales/pl-PL-MVJZXY6Q.js.map +7 -0
  96. package/dist/dev/locales/{pt-BR-7AFGAKGR.js → pt-BR-YJKF7STY.js} +49 -27
  97. package/dist/dev/locales/pt-BR-YJKF7STY.js.map +7 -0
  98. package/dist/dev/locales/{pt-PT-S6BMW6MY.js → pt-PT-VDTL5PFO.js} +26 -4
  99. package/dist/dev/locales/pt-PT-VDTL5PFO.js.map +7 -0
  100. package/dist/dev/locales/{ro-RO-4JVGQHS2.js → ro-RO-UPPQBRED.js} +27 -5
  101. package/dist/dev/locales/ro-RO-UPPQBRED.js.map +7 -0
  102. package/dist/dev/locales/{ru-RU-IESI752T.js → ru-RU-W4CHGSNY.js} +32 -10
  103. package/dist/dev/locales/ru-RU-W4CHGSNY.js.map +7 -0
  104. package/dist/dev/locales/{si-LK-H75E7PKD.js → si-LK-YBM4EAKD.js} +26 -4
  105. package/dist/dev/locales/si-LK-YBM4EAKD.js.map +7 -0
  106. package/dist/dev/locales/{sk-SK-EUK2NR2F.js → sk-SK-7437AQRD.js} +26 -4
  107. package/dist/dev/locales/sk-SK-7437AQRD.js.map +7 -0
  108. package/dist/dev/locales/{sl-SI-AKW7R5PW.js → sl-SI-4HMLL4KH.js} +26 -4
  109. package/dist/dev/locales/sl-SI-4HMLL4KH.js.map +7 -0
  110. package/dist/dev/locales/{sv-SE-QIBOOXLJ.js → sv-SE-ZOD3YMID.js} +26 -4
  111. package/dist/dev/locales/sv-SE-ZOD3YMID.js.map +7 -0
  112. package/dist/dev/locales/{ta-IN-LBK2NQ5K.js → ta-IN-LS6WD24E.js} +25 -3
  113. package/dist/dev/locales/ta-IN-LS6WD24E.js.map +7 -0
  114. package/dist/dev/locales/{th-TH-YJ2E6GVT.js → th-TH-LOAXQ4RD.js} +70 -48
  115. package/dist/dev/locales/th-TH-LOAXQ4RD.js.map +7 -0
  116. package/dist/dev/locales/{tr-TR-Y5GO2XJW.js → tr-TR-CPR4DIZR.js} +70 -48
  117. package/dist/dev/locales/tr-TR-CPR4DIZR.js.map +7 -0
  118. package/dist/dev/locales/{uk-UA-XYAFHHJW.js → uk-UA-DVTOBJYO.js} +54 -32
  119. package/dist/dev/locales/uk-UA-DVTOBJYO.js.map +7 -0
  120. package/dist/dev/locales/{uz-UZ-LF3CBRYE.js → uz-UZ-DDPKFZAS.js} +25 -3
  121. package/dist/dev/locales/uz-UZ-DDPKFZAS.js.map +7 -0
  122. package/dist/dev/locales/{vi-VN-WDPZEUOJ.js → vi-VN-EIMT27KG.js} +25 -3
  123. package/dist/dev/locales/vi-VN-EIMT27KG.js.map +7 -0
  124. package/dist/dev/locales/{zh-CN-SZ37453H.js → zh-CN-2TSGH3JY.js} +34 -12
  125. package/dist/dev/locales/zh-CN-2TSGH3JY.js.map +7 -0
  126. package/dist/dev/locales/{zh-HK-QDQ5QNBC.js → zh-HK-FQYY5CF5.js} +25 -3
  127. package/dist/dev/locales/zh-HK-FQYY5CF5.js.map +7 -0
  128. package/dist/dev/locales/{zh-TW-CYU6GFBV.js → zh-TW-7WFSJB6W.js} +110 -88
  129. package/dist/dev/locales/zh-TW-7WFSJB6W.js.map +7 -0
  130. package/dist/dev/subset-shared.chunk.js +1 -1
  131. package/dist/dev/subset-worker.chunk.js +1 -1
  132. package/dist/prod/chunk-C6JH6WQF.js +34 -0
  133. package/dist/prod/chunk-CJTDIR4C.js +1 -0
  134. package/dist/prod/{chunk-DF5Y7EC7.js → chunk-SRXBQMQ3.js} +6 -6
  135. package/dist/prod/{chunk-3MTDZU5A.js → chunk-XT3WNVPZ.js} +1 -1
  136. package/dist/prod/components/TTDDialog/{CodeMirrorEditor-L46K2UYD.js → CodeMirrorEditor-MHI25PXI.js} +1 -1
  137. package/dist/prod/data/image-OU2BX5LT.js +1 -0
  138. package/dist/prod/index.css +1 -1
  139. package/dist/prod/index.js +29 -29
  140. package/dist/prod/locales/ar-SA-YLAB6A27.js +8 -0
  141. package/dist/prod/locales/az-AZ-5JXPK2I2.js +1 -0
  142. package/dist/prod/locales/bg-BG-NIQ2RVNG.js +5 -0
  143. package/dist/prod/locales/bn-BD-BN65R3DE.js +3 -0
  144. package/dist/prod/locales/bn-IN-2YT4KVKB.js +3 -0
  145. package/dist/prod/locales/ca-ES-KSERGC3M.js +8 -0
  146. package/dist/prod/locales/cs-CZ-EOMS3IHD.js +7 -0
  147. package/dist/prod/locales/da-DK-AVL3DJQK.js +2 -0
  148. package/dist/prod/locales/de-CH-M25HCZK4.js +7 -0
  149. package/dist/prod/locales/de-DE-BEN6XGXY.js +7 -0
  150. package/dist/prod/locales/el-GR-UBGIF2NW.js +7 -0
  151. package/dist/prod/locales/en-5WHFLXFD.js +1 -0
  152. package/dist/prod/locales/es-ES-SQEM5MNY.js +7 -0
  153. package/dist/prod/locales/eu-ES-YG5N2JAG.js +7 -0
  154. package/dist/prod/locales/fa-IR-EVNM7MAJ.js +9 -0
  155. package/dist/prod/locales/fi-FI-MW7ZEZ64.js +6 -0
  156. package/dist/prod/locales/fr-FR-Q7ZPXBDE.js +12 -0
  157. package/dist/prod/locales/gl-ES-O5B74VQL.js +6 -0
  158. package/dist/prod/locales/he-IL-QGC2WXJA.js +8 -0
  159. package/dist/prod/locales/hi-IN-DEZ33NMQ.js +3 -0
  160. package/dist/prod/locales/hu-HU-2ZPNVYSC.js +3 -0
  161. package/dist/prod/locales/id-ID-W65WM5EO.js +8 -0
  162. package/dist/prod/locales/it-IT-GAWJM2XW.js +12 -0
  163. package/dist/prod/locales/ja-JP-FOAUPTH5.js +12 -0
  164. package/dist/prod/locales/kaa-UEDB54S7.js +1 -0
  165. package/dist/prod/locales/kab-KAB-CTLMBVE3.js +4 -0
  166. package/dist/prod/locales/kk-KZ-XZK63ADD.js +1 -0
  167. package/dist/prod/locales/km-KH-PBSJLZ2M.js +7 -0
  168. package/dist/prod/locales/ko-KR-YNTPN6WQ.js +5 -0
  169. package/dist/prod/locales/ku-TR-XUD5BUEU.js +6 -0
  170. package/dist/prod/locales/lt-LT-LYCDYH7O.js +3 -0
  171. package/dist/prod/locales/lv-LV-7ROPDEEI.js +4 -0
  172. package/dist/prod/locales/mr-IN-TU6BXRKP.js +9 -0
  173. package/dist/prod/locales/my-MM-SJ3RWIEQ.js +1 -0
  174. package/dist/prod/locales/nb-NO-GONF2AKR.js +8 -0
  175. package/dist/prod/locales/nl-NL-UZF6UEKB.js +13 -0
  176. package/dist/prod/locales/nn-NO-ZVFRXEEO.js +4 -0
  177. package/dist/prod/locales/oc-FR-MBF2Z56W.js +4 -0
  178. package/dist/prod/locales/pa-IN-3JCDVKKL.js +4 -0
  179. package/dist/prod/locales/percentages-WBIPKLEE.js +1 -0
  180. package/dist/prod/locales/pl-PL-EERMMCTN.js +12 -0
  181. package/dist/prod/locales/pt-BR-W4AF5QMX.js +6 -0
  182. package/dist/prod/locales/pt-PT-GNPUWAHX.js +8 -0
  183. package/dist/prod/locales/ro-RO-DXHP33S5.js +12 -0
  184. package/dist/prod/locales/ru-RU-TTW2P7NF.js +10 -0
  185. package/dist/prod/locales/si-LK-BE6O7LVF.js +1 -0
  186. package/dist/prod/locales/sk-SK-OI3KJLWQ.js +7 -0
  187. package/dist/prod/locales/sl-SI-HF74RBGV.js +6 -0
  188. package/dist/prod/locales/sv-SE-TXR2SQGA.js +8 -0
  189. package/dist/prod/locales/ta-IN-Y2DOZGBR.js +6 -0
  190. package/dist/prod/locales/th-TH-JUAISFQR.js +1 -0
  191. package/dist/prod/locales/tr-TR-U3HGKQXH.js +4 -0
  192. package/dist/prod/locales/uk-UA-FP2TKAFK.js +6 -0
  193. package/dist/prod/locales/uz-UZ-WY5QKWXJ.js +1 -0
  194. package/dist/prod/locales/vi-VN-DE5I4H6K.js +7 -0
  195. package/dist/prod/locales/zh-CN-VWHOHS7G.js +11 -0
  196. package/dist/prod/locales/zh-HK-KQF7FW7H.js +1 -0
  197. package/dist/prod/locales/zh-TW-6VHVWZKW.js +13 -0
  198. package/dist/prod/subset-shared.chunk.js +1 -1
  199. package/dist/prod/subset-worker.chunk.js +1 -1
  200. package/dist/types/common/src/appEventBus.d.ts +27 -0
  201. package/dist/types/common/src/colors.d.ts +1 -1
  202. package/dist/types/common/src/constants.d.ts +9 -7
  203. package/dist/types/common/src/index.d.ts +2 -0
  204. package/dist/types/common/src/points.d.ts +1 -1
  205. package/dist/types/common/src/utils.d.ts +2 -46
  206. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  207. package/dist/types/element/src/Scene.d.ts +6 -4
  208. package/dist/types/element/src/align.d.ts +2 -2
  209. package/dist/types/element/src/binding.d.ts +9 -7
  210. package/dist/types/element/src/bounds.d.ts +22 -7
  211. package/dist/types/element/src/collision.d.ts +1 -1
  212. package/dist/types/element/src/comparisons.d.ts +1 -0
  213. package/dist/types/element/src/distribute.d.ts +2 -2
  214. package/dist/types/element/src/duplicate.d.ts +4 -3
  215. package/dist/types/element/src/embeddable.d.ts +2 -2
  216. package/dist/types/element/src/flowchart.d.ts +7 -7
  217. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  218. package/dist/types/element/src/frame.d.ts +9 -8
  219. package/dist/types/element/src/groups.d.ts +9 -9
  220. package/dist/types/element/src/index.d.ts +1 -1
  221. package/dist/types/element/src/linearElementEditor.d.ts +10 -10
  222. package/dist/types/element/src/newElement.d.ts +1 -0
  223. package/dist/types/element/src/renderElement.d.ts +0 -3
  224. package/dist/types/element/src/resizeElements.d.ts +2 -2
  225. package/dist/types/element/src/selection.d.ts +7 -7
  226. package/dist/types/element/src/textElement.d.ts +7 -7
  227. package/dist/types/element/src/transform.d.ts +2 -2
  228. package/dist/types/element/src/typeChecks.d.ts +26 -25
  229. package/dist/types/element/src/types.d.ts +8 -1
  230. package/dist/types/element/src/zindex.d.ts +2 -2
  231. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +20 -17
  232. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  233. package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -12
  234. package/dist/types/excalidraw/actions/actionCanvas.d.ts +186 -705
  235. package/dist/types/excalidraw/actions/actionClipboard.d.ts +14 -12
  236. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -6
  237. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +23 -20
  238. package/dist/types/excalidraw/actions/actionDeselect.d.ts +9 -8
  239. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  240. package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -6
  241. package/dist/types/excalidraw/actions/actionElementLock.d.ts +15 -13
  242. package/dist/types/excalidraw/actions/actionExport.d.ts +118 -390
  243. package/dist/types/excalidraw/actions/actionFrame.d.ts +33 -203
  244. package/dist/types/excalidraw/actions/actionGroup.d.ts +29 -27
  245. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +10 -8
  246. package/dist/types/excalidraw/actions/actionLink.d.ts +8 -7
  247. package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -6
  248. package/dist/types/excalidraw/actions/actionProperties.d.ts +41 -30
  249. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +13 -12
  250. package/dist/types/excalidraw/actions/actionStyles.d.ts +6 -5
  251. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +8 -7
  252. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +11 -11
  253. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +8 -7
  254. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +8 -7
  255. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +11 -11
  256. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  257. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +8 -7
  258. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +8 -7
  259. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +8 -7
  260. package/dist/types/excalidraw/actions/index.d.ts +1 -2
  261. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  262. package/dist/types/excalidraw/actions/types.d.ts +4 -4
  263. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  264. package/dist/types/excalidraw/appState.d.ts +28 -26
  265. package/dist/types/excalidraw/clipboard.d.ts +2 -3
  266. package/dist/types/excalidraw/components/Actions.d.ts +17 -12
  267. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  268. package/dist/types/excalidraw/components/App.d.ts +119 -56
  269. package/dist/types/excalidraw/components/App.flowchart.d.ts +19 -0
  270. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  271. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +2 -2
  272. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  273. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  274. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
  275. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  276. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  277. package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
  278. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  279. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  280. package/dist/types/excalidraw/components/LayerUI.d.ts +1 -2
  281. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  282. package/dist/types/excalidraw/components/LockButton.d.ts +2 -4
  283. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
  284. package/dist/types/excalidraw/components/MobileMenu.d.ts +1 -2
  285. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  286. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  287. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  288. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  289. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  290. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  291. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
  292. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  293. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  294. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
  295. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  296. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  297. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  298. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  299. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  300. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
  301. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
  302. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +1 -1
  303. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  304. package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
  305. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  306. package/dist/types/excalidraw/components/Tools.d.ts +128 -0
  307. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
  308. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  309. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  310. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  311. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
  312. package/dist/types/excalidraw/components/icons.d.ts +2 -0
  313. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +7 -3
  314. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +36 -0
  315. package/dist/types/excalidraw/data/blob.d.ts +155 -152
  316. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  317. package/dist/types/excalidraw/data/index.d.ts +6 -7
  318. package/dist/types/excalidraw/data/json.d.ts +86 -76
  319. package/dist/types/excalidraw/data/library.d.ts +1 -1
  320. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  321. package/dist/types/excalidraw/data/restore.d.ts +1 -1
  322. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  323. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  324. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  325. package/dist/types/excalidraw/index.d.ts +27 -5
  326. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  327. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  328. package/dist/types/excalidraw/renderer/animation.d.ts +5 -1
  329. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -3
  330. package/dist/types/excalidraw/scene/Renderer.d.ts +426 -19
  331. package/dist/types/excalidraw/scene/export.d.ts +3 -3
  332. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  333. package/dist/types/excalidraw/scene/types.d.ts +1 -4
  334. package/dist/types/excalidraw/snapping.d.ts +7 -7
  335. package/dist/types/excalidraw/types.d.ts +246 -48
  336. package/dist/types/excalidraw/viewport.d.ts +316 -0
  337. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
  338. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  339. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  340. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  341. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  342. package/dist/types/laser-pointer/src/state.d.ts +35 -0
  343. package/dist/types/math/src/constants.d.ts +0 -1
  344. package/dist/types/math/src/curve.d.ts +4 -1
  345. package/dist/types/math/src/point.d.ts +1 -0
  346. package/package.json +4 -5
  347. package/dist/dev/chunk-6L6WB2VZ.js.map +0 -7
  348. package/dist/dev/chunk-EWKWI3K7.js.map +0 -7
  349. package/dist/dev/chunk-URPEKBQ3.js +0 -69
  350. package/dist/dev/chunk-URPEKBQ3.js.map +0 -7
  351. package/dist/dev/locales/ar-SA-AGVJN2FU.js.map +0 -7
  352. package/dist/dev/locales/az-AZ-62IXPX5D.js.map +0 -7
  353. package/dist/dev/locales/bg-BG-UBDZF4KA.js.map +0 -7
  354. package/dist/dev/locales/bn-BD-4TAUVZOD.js.map +0 -7
  355. package/dist/dev/locales/bn-IN-PUGL2LDE.js.map +0 -7
  356. package/dist/dev/locales/ca-ES-GEEW5L7T.js.map +0 -7
  357. package/dist/dev/locales/cs-CZ-LNVE3QM5.js.map +0 -7
  358. package/dist/dev/locales/da-DK-CAYJG7FJ.js.map +0 -7
  359. package/dist/dev/locales/de-CH-GCXOD4LK.js.map +0 -7
  360. package/dist/dev/locales/de-DE-CGDBECYD.js.map +0 -7
  361. package/dist/dev/locales/el-GR-G5QZC24A.js.map +0 -7
  362. package/dist/dev/locales/es-ES-UMEOH76W.js.map +0 -7
  363. package/dist/dev/locales/eu-ES-IWRZXJC5.js.map +0 -7
  364. package/dist/dev/locales/fa-IR-QOYVIIJA.js.map +0 -7
  365. package/dist/dev/locales/fi-FI-BXRW65OA.js.map +0 -7
  366. package/dist/dev/locales/fr-FR-R2QH5VCW.js.map +0 -7
  367. package/dist/dev/locales/gl-ES-4ES3ZADP.js.map +0 -7
  368. package/dist/dev/locales/he-IL-TRQRRYPH.js.map +0 -7
  369. package/dist/dev/locales/hi-IN-U46BOJEC.js.map +0 -7
  370. package/dist/dev/locales/hu-HU-JDULJ6XL.js.map +0 -7
  371. package/dist/dev/locales/id-ID-BLIXNCUT.js.map +0 -7
  372. package/dist/dev/locales/it-IT-6TBW7RUK.js.map +0 -7
  373. package/dist/dev/locales/ja-JP-6HYAQFYX.js.map +0 -7
  374. package/dist/dev/locales/kaa-Z5UP62XJ.js.map +0 -7
  375. package/dist/dev/locales/kab-KAB-Z7STWQKS.js.map +0 -7
  376. package/dist/dev/locales/kk-KZ-BWHY45DX.js.map +0 -7
  377. package/dist/dev/locales/km-KH-HGLNWNRU.js.map +0 -7
  378. package/dist/dev/locales/ko-KR-CO36WKPC.js.map +0 -7
  379. package/dist/dev/locales/ku-TR-AACVIARC.js.map +0 -7
  380. package/dist/dev/locales/lt-LT-CFYYFLDV.js.map +0 -7
  381. package/dist/dev/locales/lv-LV-QCBBOFFU.js.map +0 -7
  382. package/dist/dev/locales/mr-IN-B2CM5GK5.js.map +0 -7
  383. package/dist/dev/locales/my-MM-756BNN36.js.map +0 -7
  384. package/dist/dev/locales/nb-NO-5BLHQI4J.js.map +0 -7
  385. package/dist/dev/locales/nl-NL-225BLGAH.js.map +0 -7
  386. package/dist/dev/locales/nn-NO-4J7MR6GH.js.map +0 -7
  387. package/dist/dev/locales/oc-FR-XCETH7KF.js.map +0 -7
  388. package/dist/dev/locales/pa-IN-32NBAN5L.js.map +0 -7
  389. package/dist/dev/locales/pl-PL-R6OJ54BT.js.map +0 -7
  390. package/dist/dev/locales/pt-BR-7AFGAKGR.js.map +0 -7
  391. package/dist/dev/locales/pt-PT-S6BMW6MY.js.map +0 -7
  392. package/dist/dev/locales/ro-RO-4JVGQHS2.js.map +0 -7
  393. package/dist/dev/locales/ru-RU-IESI752T.js.map +0 -7
  394. package/dist/dev/locales/si-LK-H75E7PKD.js.map +0 -7
  395. package/dist/dev/locales/sk-SK-EUK2NR2F.js.map +0 -7
  396. package/dist/dev/locales/sl-SI-AKW7R5PW.js.map +0 -7
  397. package/dist/dev/locales/sv-SE-QIBOOXLJ.js.map +0 -7
  398. package/dist/dev/locales/ta-IN-LBK2NQ5K.js.map +0 -7
  399. package/dist/dev/locales/th-TH-YJ2E6GVT.js.map +0 -7
  400. package/dist/dev/locales/tr-TR-Y5GO2XJW.js.map +0 -7
  401. package/dist/dev/locales/uk-UA-XYAFHHJW.js.map +0 -7
  402. package/dist/dev/locales/uz-UZ-LF3CBRYE.js.map +0 -7
  403. package/dist/dev/locales/vi-VN-WDPZEUOJ.js.map +0 -7
  404. package/dist/dev/locales/zh-CN-SZ37453H.js.map +0 -7
  405. package/dist/dev/locales/zh-HK-QDQ5QNBC.js.map +0 -7
  406. package/dist/dev/locales/zh-TW-CYU6GFBV.js.map +0 -7
  407. package/dist/prod/chunk-3PELD44J.js +0 -1
  408. package/dist/prod/chunk-X5RUEEV4.js +0 -34
  409. package/dist/prod/data/image-DCRFHXRL.js +0 -1
  410. package/dist/prod/locales/ar-SA-NXDWD63E.js +0 -8
  411. package/dist/prod/locales/az-AZ-MXSORGZV.js +0 -1
  412. package/dist/prod/locales/bg-BG-O6MV2KSF.js +0 -5
  413. package/dist/prod/locales/bn-BD-T2VJNT7N.js +0 -3
  414. package/dist/prod/locales/bn-IN-MMW2ORAC.js +0 -3
  415. package/dist/prod/locales/ca-ES-MKBCGNOG.js +0 -8
  416. package/dist/prod/locales/cs-CZ-V77HGUP7.js +0 -7
  417. package/dist/prod/locales/da-DK-I5RFNTM4.js +0 -2
  418. package/dist/prod/locales/de-CH-WLRDEVBV.js +0 -7
  419. package/dist/prod/locales/de-DE-DTI4WUSC.js +0 -7
  420. package/dist/prod/locales/el-GR-ZXDJ2OS4.js +0 -7
  421. package/dist/prod/locales/en-QI57FMQH.js +0 -1
  422. package/dist/prod/locales/es-ES-DYQHAD43.js +0 -7
  423. package/dist/prod/locales/eu-ES-QDSYU5Y3.js +0 -7
  424. package/dist/prod/locales/fa-IR-26LZG4PM.js +0 -9
  425. package/dist/prod/locales/fi-FI-6YS4KDE4.js +0 -6
  426. package/dist/prod/locales/fr-FR-BRLLPTZC.js +0 -12
  427. package/dist/prod/locales/gl-ES-OKUZTLYG.js +0 -6
  428. package/dist/prod/locales/he-IL-26MGYIU7.js +0 -8
  429. package/dist/prod/locales/hi-IN-Q4ZOGTP2.js +0 -3
  430. package/dist/prod/locales/hu-HU-P2OXPSN5.js +0 -3
  431. package/dist/prod/locales/id-ID-2EIKXYN6.js +0 -8
  432. package/dist/prod/locales/it-IT-4CFKVXI2.js +0 -12
  433. package/dist/prod/locales/ja-JP-MAND2Z4V.js +0 -7
  434. package/dist/prod/locales/kaa-HQRTCXTJ.js +0 -1
  435. package/dist/prod/locales/kab-KAB-JKIKKTGH.js +0 -4
  436. package/dist/prod/locales/kk-KZ-HXQ63ZFC.js +0 -1
  437. package/dist/prod/locales/km-KH-PKL3LSGX.js +0 -7
  438. package/dist/prod/locales/ko-KR-KXLREZX3.js +0 -5
  439. package/dist/prod/locales/ku-TR-MJ4IER3X.js +0 -6
  440. package/dist/prod/locales/lt-LT-H6WFQ6FJ.js +0 -3
  441. package/dist/prod/locales/lv-LV-GOCK6SJW.js +0 -4
  442. package/dist/prod/locales/mr-IN-IXVLDMEQ.js +0 -9
  443. package/dist/prod/locales/my-MM-YG6MYTTD.js +0 -1
  444. package/dist/prod/locales/nb-NO-XGWJISD2.js +0 -8
  445. package/dist/prod/locales/nl-NL-XVDVCPNC.js +0 -13
  446. package/dist/prod/locales/nn-NO-EMX5MJX5.js +0 -4
  447. package/dist/prod/locales/oc-FR-ROEINTVO.js +0 -4
  448. package/dist/prod/locales/pa-IN-ZYN6SUDY.js +0 -4
  449. package/dist/prod/locales/percentages-5DKR754L.js +0 -1
  450. package/dist/prod/locales/pl-PL-6VTG7PHC.js +0 -12
  451. package/dist/prod/locales/pt-BR-5YFKRR5G.js +0 -6
  452. package/dist/prod/locales/pt-PT-GEIXXZ67.js +0 -8
  453. package/dist/prod/locales/ro-RO-E2P6TFZI.js +0 -12
  454. package/dist/prod/locales/ru-RU-YBIIY43T.js +0 -10
  455. package/dist/prod/locales/si-LK-673C2CI2.js +0 -1
  456. package/dist/prod/locales/sk-SK-CKZHQ4AP.js +0 -7
  457. package/dist/prod/locales/sl-SI-557H2GWM.js +0 -6
  458. package/dist/prod/locales/sv-SE-XOPKKDWS.js +0 -8
  459. package/dist/prod/locales/ta-IN-XBH7DQI3.js +0 -6
  460. package/dist/prod/locales/th-TH-TOCWH3R4.js +0 -1
  461. package/dist/prod/locales/tr-TR-GXW6CYY5.js +0 -4
  462. package/dist/prod/locales/uk-UA-IJKTNUDG.js +0 -6
  463. package/dist/prod/locales/uz-UZ-TBZZEA4V.js +0 -1
  464. package/dist/prod/locales/vi-VN-MULSGNVB.js +0 -7
  465. package/dist/prod/locales/zh-CN-MVX3E32U.js +0 -11
  466. package/dist/prod/locales/zh-HK-JNU5RLIE.js +0 -1
  467. package/dist/prod/locales/zh-TW-LENVCA6T.js +0 -9
  468. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -172
  469. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  470. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  471. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
  472. package/dist/types/excalidraw/components/shapes.d.ts +0 -263
  473. package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
  474. package/dist/types/excalidraw/scene/scrollConstraints.d.ts +0 -46
  475. package/dist/types/utils/src/bbox.d.ts +0 -9
  476. package/dist/types/utils/src/index.d.ts +0 -4
  477. package/dist/types/utils/src/withinBounds.d.ts +0 -19
  478. /package/dist/dev/{chunk-5I3XVQQV.js.map → chunk-YY3VJZEJ.js.map} +0 -0
  479. /package/dist/dev/components/TTDDialog/{CodeMirrorEditor-FNBRG3XO.js.map → CodeMirrorEditor-UBKSUIQM.js.map} +0 -0
  480. /package/dist/dev/data/{image-ADRLSYW7.js.map → image-KIEP3SMK.js.map} +0 -0
  481. /package/dist/dev/locales/{en-A3UOWEYW.js.map → en-XFEPEVLS.js.map} +0 -0
  482. /package/dist/dev/locales/{percentages-ZRLRVMSI.js.map → percentages-QGLYMXSX.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -11,8 +11,191 @@ The change should be grouped under one of the below section and must contain PR
11
11
  Please add the latest change on the top under the correct section.
12
12
  -->
13
13
 
14
+ ## Unreleased
15
+
16
+ ## Excalidraw API
17
+
18
+ ### Tool system & toolbar rework
19
+
20
+ The toolbar UI was rewritten from hidden radio/checkbox inputs to real `<button>` elements composed from a central tool registry, and all tool activation now goes through a single `setActiveTool` code path.
21
+
22
+ #### Breaking changes
23
+
24
+ - `ExcalidrawAPI.setActiveTool(tool, keepSelection?)` — the second parameter changed from a boolean to an options object: `setActiveTool(tool, { keepSelection?: boolean; toggle?: boolean = false })`. The hand and eraser tools are now _toggle tools_: activating one records the previously active tool, and if `toggle=true`, activating it again switches back — including via `setActiveTool` itself, so repeated `setActiveTool({ type: "hand" }, { toggle: true })` calls alternate rather than no-op. By default `false` for idempotent activation.
25
+
26
+ - Tool buttons render as semantic `<button>` elements with `aria-pressed` instead of `<label>`-wrapped hidden `<input type="radio">` / `<input type="checkbox">`. If you style or query the editor DOM:
27
+
28
+ - The `.ToolIcon_type_radio`, `.ToolIcon_type_checkbox`, and `.ToolIcon--selected` class names no longer exist — the pressed state is exposed through the `.ToolIcon--checked` class and the `aria-pressed` attribute.
29
+ - `<Sidebar.Trigger>` (including the default Library trigger) renders a `<button>` instead of a `<label>` + checkbox.
30
+
31
+ - Removed internal actions superseded by the `setActiveTool` funnel and the tool registry: `toggleHandTool`, `toggleEraserTool`, `toggleLassoTool`, `setFrameAsActiveTool`, `setEmbeddableAsActiveTool` (these `ActionName`s no longer exist).
32
+
33
+ #### Behavior changes
34
+
35
+ - Hand (`H`) and eraser (`E`) shortcuts now reliably toggle back to the previously active tool (previously inconsistent across platforms and input paths, and unavailable for hand in view mode). Pressing `Escape` while hand or eraser is active likewise returns to the previous tool. Re-clicking their toolbar buttons is a no-op.
36
+ - Clicking the active selection tool switches to lasso on all platforms (previously this only worked on iOS due to a controlled-radio quirk).
37
+ - Tool letter shortcuts are CapsLock-insensitive, `Shift+letter` never switches tools, and `Ctrl+E` no longer toggles the eraser.
38
+ - Switching tools no longer creates undo-history entries.
39
+ - Command palette tool commands are derived from the tool registry: the duplicate "Hand" entry is gone, "Web Embed" was added, and "Lasso" is always listed.
40
+ - Pen mode now activates on the first pen tap on any tool button (previously deferred and occasionally dropped).
41
+
42
+ #### Fixes
43
+
44
+ - Mobile toolbar popovers: the active option stays highlighted after tapping it (the highlight was being suppressed by sticky touch-hover).
45
+ - The active-tool highlight can no longer desync from the actually active tool (controlled-radio DOM desync).
46
+
47
+ ### Viewport control & scroll/zoom locking
48
+
49
+ `ExcalidrawAPI.scrollToContent` was rebuilt into `ExcalidrawAPI.setViewport()` — a single API for navigating the viewport (`fit: "scale-down" | "contain" | "none"`), locking scroll/zoom to a target (with rubberband overscroll), fitting around the rendered editor UI, and initializing the viewport on scene load [#11554](https://github.com/excalidraw/excalidraw/pull/11554).
50
+
51
+ #### Breaking changes
52
+
53
+ - `ExcalidrawAPI.scrollToContent(target?, opts?)` was replaced with `ExcalidrawAPI.setViewport(opts | null)`.
54
+
55
+ ```tsx
56
+ // before
57
+ excalidrawAPI.scrollToContent(element, {
58
+ fitToViewport: true,
59
+ animate: true,
60
+ });
61
+ // after
62
+ excalidrawAPI.setViewport({ target: element, fit: "contain" });
63
+ ```
64
+
65
+ - `target` is required and no longer defaults to the whole scene — pass `target: excalidrawAPI.getSceneElements()` for the old default. Besides element(s) or an element id / element-link URL, it now also accepts `Bounds` and `{ x, y, width?, height? }` rects (missing dimensions default to the viewport size). Deleted and non-scene elements in the target are filtered out with a console warning.
66
+ - `fitToContent` / `fitToViewport` were replaced by `fit: "scale-down" | "contain"` respectively, defaulting to `"scale-down"` (zoomed so the target fits, at most 100%). Previously the default depended on the target: element-id / element-link (string) targets defaulted to fit-to-content — matching the new default — while element(s) or omitted targets defaulted to recentering at the current zoom without changing it; pass `fit: "none"` for that behavior.
67
+ - `animate` / `duration` were replaced by `animation: boolean | { duration?: number }`. Navigation now always animates by default; previously only string targets did, while element(s) targets jumped unless `animate: true` — pass `animation: false` to jump instantly.
68
+ - `canvasOffsets` was replaced by `offsets`, which also accepts UI-derived offsets (see Features below).
69
+ - `viewportZoomFactor`, `minZoom`, and `maxZoom` are no longer supported.
70
+
71
+ - `zoomToFitBounds` takes `fit: "scale-down" | "contain" | "none"` instead of `fitToViewport` / `viewportZoomFactor`, and no longer rounds the resulting zoom down to the nearest 10% step by default — pass `steppedZoom: true` to keep the old rounding.
72
+
73
+ #### Features
74
+
75
+ - `setViewport({ ..., lock })` locks the viewport to the resolved target: `lock.scroll` constrains panning to the target box and `lock.zoom` makes the resolved zoom the minimum zoom (zooming in stays allowed). When the navigation is animated, the lock is installed once the viewport settles. `setViewport(null)` clears an active lock without navigating; a navigation without `lock` also supersedes a previously installed one.
76
+
77
+ - `lock.overscroll` adds a rubberband to the lock: panning can overshoot the constraint by the given amount (viewport px, zoom-independent) and snaps back once the interaction settles — on touch, once the multi-finger gesture ends. Defaults to `true` = `DEFAULT_OVERSCROLL` (150px, exported from the package root); pass a number to customize, or `false` / `0` for a rigid lock. Zooming is always hard-clamped against the lock, gliding along its edge instead of overscrolling.
78
+
79
+ - Added `<Excalidraw initialState={{ viewport }} />` for initializing the viewport (and optionally installing a lock) once on scene load. Accepts the same options as `setViewport` except `animation`, and takes precedence over `initialData.scrollToContent`.
80
+
81
+ - The `offsets` option (on `setViewport` and `initialState.viewport`) insets the usable viewport per side so targets aren't fitted underneath overlaid UI. It combines static pixel sides with `ui: true | ViewportOffsetsOptions`, which measures the currently rendered editor UI (toolbar, styles panel, sidebar…) — with configurable padding, per-side overrides, and reserving space for currently-hidden surfaces (`reserve: { stylesPanel?: boolean; sidebar?: boolean }`). The same measurement is exposed through the new `ExcalidrawAPI.getViewportOffsets(opts?)`, and custom UI rendered inside the editor container can opt into being measured via the `data-viewport-ui="top" | "bottom" | "side"` attribute.
82
+
83
+ ### Breaking changes
84
+
85
+ - `UIAppState` no longer includes `zoom`, `shouldCacheIgnoreZoom`, and the canvas-interaction transients `snapLines`, `originSnapOffset`, `suggestedBinding`, `frameToHighlight`, and `elementsToHighlight`. These update per pointermove or per animation frame and no longer re-render the editor UI, so UI render props receiving `UIAppState` (`renderCustomStats`, custom `<Footer/>` content, etc.) don't receive them anymore and would render stale values if they read them off the full `AppState`. Subscribe through `useExcalidrawStateValue` instead — the component re-renders only when the selected value changes:
86
+
87
+ ```tsx
88
+ import { useExcalidrawStateValue } from "@excalidraw/excalidraw";
89
+
90
+ const ZoomReadout = () => {
91
+ // `undefined` on initial render, before the editor API initializes
92
+ const zoomValue = useExcalidrawStateValue(
93
+ (appState) => appState.zoom.value,
94
+ );
95
+
96
+ if (zoomValue == null) {
97
+ return null;
98
+ }
99
+
100
+ return <div>{(zoomValue * 100).toFixed(0)}%</div>;
101
+ };
102
+ ```
103
+
104
+ Outside of React components, you can also subscribe via `ExcalidrawAPI.onStateChange((appState) => appState.zoom.value, (zoomValue) => {...})`, or keep using the existing `onScrollChange(scrollX, scrollY, zoom)` prop.
105
+
106
+ - Theme changes initiated by the default UI are now delegated to `<Excalidraw onThemeChange={(theme) => ...} />` when supplied. If `onThemeChange` is not supplied, light/dark theme toggling still falls back to updating the internal editor state.
107
+
108
+ - `MainMenu.DefaultItems.ToggleTheme` no longer accepts the item-level `onSelect` callback. Host apps that need to control light/dark/system theme should pass `onThemeChange` to `<Excalidraw />` instead.
109
+ - `MainMenu.DefaultItems.ToggleTheme` with system theme support now uses `allowSystemTheme` together with `theme={Theme | "system"}` only to render the selected value. For the regular light/dark item, pass `allowSystemTheme={false}`.
110
+ - `CommandPalette.defaultItems.toggleTheme` was removed. The default theme command is now rendered by the command palette itself when `UIOptions.canvasActions.toggleTheme` enables the action (see below).
111
+ - `UIOptions.canvasActions.toggleTheme` still controls default theme UI availability. When it is `null`, it defaults to `true` if `props.theme` is omitted or `props.onThemeChange` is supplied, and otherwise defaults to disabled.
112
+
113
+ - Renamed the `excalidrawAPI` prop to `onExcalidrawAPI`.
114
+ - `onExcalidrawAPI` is now called on mount (instead of during constructor), and later on unmount (with `null` value). The API may be removed altogether in the future (you can use `onMount` & `onUnmount` to manage the `ExcalidrawAPI` object (e.g. to cache it to a global state), already).
115
+
116
+ ### Features
117
+
118
+ - Added `ExcalidrawAPI.isDestroyed` flag. Set to `true` once the editor unmounts. Calling any `get*` method, `onStateChange`, or `onEvent` on a destroyed API instance will throw in development and `console.error` in production. The `ExcalidrawAPI` will be reset to `null` on unmount, but to be extra safe, you should check `ExcalidrawAPI.isDestroyed` before calling these methods to guard against subtle race conditions in your code.
119
+
120
+ - Added `onMount`, `onInitialize`, and `onUnmount` props. `onMount` receives `{ excalidrawAPI, container }` once the editor root is mounted. `onInitialize` fires once the initial scene has loaded. `onUnmount` fires just before unmounting.
121
+
122
+ - Same events are also accessible imperatively through `api.onEvent(...)`.
123
+
124
+ ```tsx
125
+ <Excalidraw
126
+ onExcalidrawAPI={(api) => {
127
+ api.onEvent("editor:mount", ({ excalidrawAPI, container }) => {
128
+ console.log(container);
129
+ });
130
+
131
+ api.onEvent("editor:initialize").then((readyApi) => {
132
+ readyApi.setViewport({
133
+ target: readyApi.getSceneElements(),
134
+ animation: false,
135
+ });
136
+ });
137
+ }}
138
+ />
139
+ ```
140
+
141
+ Note that in future releases, most, if not all, `excalidrawAPI.on*` subscriptions will be removed in favor of `excalidrawAPI.onEvent(name)`.
142
+
143
+ - Also added `"editor:unmount"` lifecycle event, only accessible via `api.onEvent("editor:unmount")`.
144
+
145
+ - Exported `<ExcalidrawAPIProvider/>`, `useExcalidrawAPI()`, `useExcalidrawStateValue(prop | props | selectorFunction)`, and `useOnExcalidrawStateChange(prop | props | selectorFunction, callback)` from the package. The imperative API also now exposes `onStateChange(prop | props | selectorFunction, callback?)`, and `onEvent(name, callback)`.
146
+
147
+ ```tsx
148
+ <ExcalidrawAPIProvider>
149
+ <Excalidraw />
150
+ <Logger />
151
+ </ExcalidrawAPIProvider>;
152
+
153
+ function Logger() {
154
+ // initially null before the ExcalidrawAPIProvider initializes after
155
+ // <Excalidraw/> renders
156
+ // When <Excalidraw/> unmounts, is reset back to null
157
+ const api = useExcalidrawAPI();
158
+
159
+ useExcalidrawStateValue("viewModeEnabled", (viewModeEnabled) => {
160
+ console.log("view mode changed:", viewModeEnabled);
161
+ });
162
+
163
+ React.useEffect(() => {
164
+ if (api) {
165
+ console.log("editor instance id:", api.id);
166
+ }
167
+ }, [api]);
168
+
169
+ return null;
170
+ }
171
+ ```
172
+
173
+ - Added `onExport` so host apps can delay JSON export until async work completes. The handler receives the export data plus an `AbortSignal`, and may return a `Promise` or an async generator that yields progress updates for the built-in toast UI.
174
+
175
+ ```tsx
176
+ <Excalidraw
177
+ onExport={async function* (_type, { files }, { signal }) {
178
+ yield { type: "progress", message: "Waiting for images..." };
179
+
180
+ await waitForImagesToLoad(files, signal);
181
+
182
+ if (signal.aborted) {
183
+ return;
184
+ }
185
+
186
+ yield { type: "progress", message: "Export ready", progress: 1 };
187
+ }}
188
+ />
189
+ ```
190
+
14
191
  ## Excalidraw Library
15
192
 
193
+ ### Breaking changes
194
+
195
+ - `updateActiveTool` (from `@excalidraw/common`): the `lastActiveToolBeforeEraser` property of the `data` parameter was renamed to `lastActiveTool` (it was already stored under that name on `appState.activeTool`, and is no longer eraser-specific).
196
+
197
+ - `getClosestElementBounds` is no longer exported from `@excalidraw/element`. Use `getCommonBounds` / `getElementBounds` from `@excalidraw/element`, or reimplement the closest-target distance check with `getElementBounds` if you need the same behavior [#11554](https://github.com/excalidraw/excalidraw/pull/11554).
198
+
16
199
  ## 0.18.0 (2025-03-11)
17
200
 
18
201
  ### Highlights
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Excalidraw
2
2
 
3
- **Excalidraw** is exported as a component to be directly embedded in your project.
3
+ **Excalidraw** is exported as a React component that you can embed directly in your app.
4
4
 
5
5
  ## Installation
6
6
 
7
- Use `npm` or `yarn` to install the package.
7
+ Install the package together with its React peer dependencies.
8
8
 
9
9
  ```bash
10
10
  npm install react react-dom @excalidraw/excalidraw
@@ -12,34 +12,131 @@ npm install react react-dom @excalidraw/excalidraw
12
12
  yarn add react react-dom @excalidraw/excalidraw
13
13
  ```
14
14
 
15
- > **Note**: If you don't want to wait for the next stable release and try out the unreleased changes, use `@excalidraw/excalidraw@next`.
15
+ > **Note**: If you want to try unreleased changes, use `@excalidraw/excalidraw@next`.
16
16
 
17
- #### Self-hosting fonts
17
+ ## Quick start
18
18
 
19
- By default, Excalidraw will try to download all the used fonts from the [CDN](https://esm.run/@excalidraw/excalidraw/dist/prod).
19
+ The minimum working setup has two easy-to-miss requirements:
20
20
 
21
- For self-hosting purposes, you'll have to copy the content of the folder `node_modules/@excalidraw/excalidraw/dist/prod/fonts` to the path where your assets should be served from (i.e. `public/` directory in your project). In that case, you should also set `window.EXCALIDRAW_ASSET_PATH` to the very same path, i.e. `/` in case it's in the root:
21
+ 1. Import the package CSS:
22
22
 
23
- ```js
24
- <script>window.EXCALIDRAW_ASSET_PATH = "/";</script>
23
+ ```ts
24
+ import "@excalidraw/excalidraw/index.css";
25
25
  ```
26
26
 
27
- ### Dimensions of Excalidraw
27
+ 2. Render Excalidraw inside a container with a non-zero height.
28
28
 
29
- Excalidraw takes _100%_ of `width` and `height` of the containing block so make sure the container in which you render Excalidraw has non zero dimensions.
29
+ ```tsx
30
+ import { Excalidraw } from "@excalidraw/excalidraw";
31
+ import "@excalidraw/excalidraw/index.css";
32
+
33
+ export default function App() {
34
+ return (
35
+ <div style={{ height: "100vh" }}>
36
+ <Excalidraw />
37
+ </div>
38
+ );
39
+ }
40
+ ```
41
+
42
+ Excalidraw fills `100%` of the width and height of its parent. If the parent has no height, the canvas will not be visible.
43
+
44
+ ## Next.js / SSR frameworks
45
+
46
+ Excalidraw should be rendered on the client. In SSR frameworks such as Next.js, use a client component and load it dynamically with SSR disabled.
47
+
48
+ ```tsx
49
+ // app/components/ExcalidrawClient.tsx
50
+ "use client";
51
+
52
+ import { Excalidraw } from "@excalidraw/excalidraw";
53
+ import "@excalidraw/excalidraw/index.css";
54
+
55
+ export default function ExcalidrawClient() {
56
+ return (
57
+ <div style={{ height: "100vh" }}>
58
+ <Excalidraw />
59
+ </div>
60
+ );
61
+ }
62
+ ```
63
+
64
+ ```tsx
65
+ // app/page.tsx
66
+ import dynamic from "next/dynamic";
67
+
68
+ const ExcalidrawClient = dynamic(
69
+ () => import("./components/ExcalidrawClient"),
70
+ { ssr: false },
71
+ );
72
+
73
+ export default function Page() {
74
+ return <ExcalidrawClient />;
75
+ }
76
+ ```
77
+
78
+ See the local examples for complete setups:
79
+
80
+ - [examples/with-nextjs](https://github.com/excalidraw/excalidraw/tree/master/examples/with-nextjs)
81
+ - [examples/with-script-in-browser](https://github.com/excalidraw/excalidraw/tree/master/examples/with-script-in-browser)
82
+
83
+ ## LLM / agent tips
84
+
85
+ If an LLM or coding agent is setting up Excalidraw, these shortcuts usually save more time than re-prompting:
86
+
87
+ - Start with a plain `<Excalidraw />` in a `100vh` container. Add refs, `initialData`, persistence, or custom UI only after the base embed works.
88
+ - If the canvas is blank, check the CSS import and parent height first. Those are the two most common integration failures.
89
+ - In Next.js or other SSR frameworks, assume client-only rendering first. Use `"use client"` and `dynamic(..., { ssr: false })` before debugging hydration or `window is not defined` errors.
90
+ - If imports or entrypoints are unclear, inspect `node_modules/@excalidraw/excalidraw/package.json`. The installed package exports are the source of truth.
91
+ - Do not set `window.EXCALIDRAW_ASSET_PATH` unless you are intentionally self-hosting fonts/assets.
92
+ - When docs and generated code drift, copy the nearest working example from this repo, especially `examples/with-nextjs` or `examples/with-script-in-browser`.
93
+
94
+ ## Migrating to `@excalidraw/excalidraw@0.18.x`
95
+
96
+ Version `0.18.x` removes the old `types/`-prefixed deep import paths. If you were importing types from `@excalidraw/excalidraw/types/...`, switch to the new type-only subpaths below.
97
+
98
+ | Old path | New path |
99
+ | --- | --- |
100
+ | `@excalidraw/excalidraw/types/data/transform.js` | `@excalidraw/excalidraw/element/transform` |
101
+ | `@excalidraw/excalidraw/types/data/types.js` | `@excalidraw/excalidraw/data/types` |
102
+ | `@excalidraw/excalidraw/types/element/types.js` | `@excalidraw/excalidraw/element/types` |
103
+ | `@excalidraw/excalidraw/types/utility-types.js` | `@excalidraw/excalidraw/common/utility-types` |
104
+ | `@excalidraw/excalidraw/types/types.js` | `@excalidraw/excalidraw/types` |
105
+
106
+ Drop the `.js` extension. The new package `exports` map resolves these paths without it.
107
+
108
+ These deep subpaths are for `import type` only. Runtime imports should come from the package root, plus `@excalidraw/excalidraw/index.css` for styles.
109
+
110
+ For example:
111
+
112
+ ```ts
113
+ import { exportToSvg } from "@excalidraw/excalidraw";
114
+ ```
115
+
116
+ ## Self-hosting fonts
117
+
118
+ By default, Excalidraw downloads the fonts it needs from the [CDN](https://esm.run/@excalidraw/excalidraw/dist/prod).
119
+
120
+ For self-hosting, copy the contents of `node_modules/@excalidraw/excalidraw/dist/prod/fonts` into the path where your app serves static assets, for example `public/`. Then set `window.EXCALIDRAW_ASSET_PATH` to that same path:
121
+
122
+ ```html
123
+ <script>
124
+ window.EXCALIDRAW_ASSET_PATH = "/";
125
+ </script>
126
+ ```
30
127
 
31
128
  ## Demo
32
129
 
33
- Go to [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser) example.
130
+ Try the [CodeSandbox example](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser).
34
131
 
35
132
  ## Integration
36
133
 
37
- Head over to the [docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/integration).
134
+ Read the [integration docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/integration).
38
135
 
39
136
  ## API
40
137
 
41
- Head over to the [docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api).
138
+ Read the [API docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api).
42
139
 
43
140
  ## Contributing
44
141
 
45
- Head over to the [docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/contributing).
142
+ Read the [contributing docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/contributing).