@myoc/excalidraw 0.19.521 → 0.19.522

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 (472) hide show
  1. package/CHANGELOG.md +227 -8
  2. package/dist/dev/{chunk-P7I4FGOG.js → chunk-6T5HZJCI.js} +2 -2
  3. package/dist/dev/chunk-72CYJXY3.js +69 -0
  4. package/dist/dev/chunk-72CYJXY3.js.map +7 -0
  5. package/dist/dev/{chunk-MN6E45MP.js → chunk-BCNQXIBK.js} +348 -85
  6. package/dist/dev/chunk-BCNQXIBK.js.map +7 -0
  7. package/dist/dev/{chunk-IU2VFRFU.js → chunk-SKCAT7JG.js} +19 -6
  8. package/dist/dev/chunk-SKCAT7JG.js.map +7 -0
  9. package/dist/dev/data/{image-ZYGVHYLC.js → image-NFLICJEW.js} +3 -3
  10. package/dist/dev/index.css +2198 -2250
  11. package/dist/dev/index.css.map +3 -3
  12. package/dist/dev/index.js +14897 -11932
  13. package/dist/dev/index.js.map +4 -4
  14. package/dist/dev/locales/{ar-SA-NFU76NHO.js → ar-SA-JEFXMY43.js} +69 -29
  15. package/dist/dev/locales/ar-SA-JEFXMY43.js.map +7 -0
  16. package/dist/dev/locales/{az-AZ-F7U432OF.js → az-AZ-K5GG7N2H.js} +47 -7
  17. package/dist/dev/locales/az-AZ-K5GG7N2H.js.map +7 -0
  18. package/dist/dev/locales/{bg-BG-VMJGHZ3R.js → bg-BG-YUNBCAUF.js} +47 -7
  19. package/dist/dev/locales/bg-BG-YUNBCAUF.js.map +7 -0
  20. package/dist/dev/locales/{bn-BD-ABWH5RGF.js → bn-BD-TASJ52R7.js} +47 -7
  21. package/dist/dev/locales/bn-BD-TASJ52R7.js.map +7 -0
  22. package/dist/dev/locales/{bn-IN-6FBCHDUY.js → bn-IN-CQJ5XUTI.js} +47 -7
  23. package/dist/dev/locales/bn-IN-CQJ5XUTI.js.map +7 -0
  24. package/dist/dev/locales/{ca-ES-UX7K2ENH.js → ca-ES-F62AQUFY.js} +47 -69
  25. package/dist/dev/locales/ca-ES-F62AQUFY.js.map +7 -0
  26. package/dist/dev/locales/{cs-CZ-TBYIRH36.js → cs-CZ-YHUNUU6P.js} +47 -69
  27. package/dist/dev/locales/cs-CZ-YHUNUU6P.js.map +7 -0
  28. package/dist/dev/locales/{da-DK-KW4TGU6O.js → da-DK-QU24E74Q.js} +47 -69
  29. package/dist/dev/locales/da-DK-QU24E74Q.js.map +7 -0
  30. package/dist/dev/locales/{de-CH-QSJHIHEN.js → de-CH-KLWBYLGC.js} +110 -132
  31. package/dist/dev/locales/de-CH-KLWBYLGC.js.map +7 -0
  32. package/dist/dev/locales/{de-DE-2WQ5IRPT.js → de-DE-UB755M7G.js} +110 -132
  33. package/dist/dev/locales/de-DE-UB755M7G.js.map +7 -0
  34. package/dist/dev/locales/{el-GR-N7JWYMV5.js → el-GR-J2BFDAEA.js} +47 -69
  35. package/dist/dev/locales/el-GR-J2BFDAEA.js.map +7 -0
  36. package/dist/dev/locales/{en-25BPHB4T.js → en-RETPDZ4S.js} +4 -2
  37. package/dist/dev/locales/{es-ES-37LJTLHM.js → es-ES-GL35U3D6.js} +97 -119
  38. package/dist/dev/locales/es-ES-GL35U3D6.js.map +7 -0
  39. package/dist/dev/locales/{eu-ES-2IFCUP7K.js → eu-ES-5LL7P4G7.js} +150 -172
  40. package/dist/dev/locales/eu-ES-5LL7P4G7.js.map +7 -0
  41. package/dist/dev/locales/{fa-IR-VDT7BNM4.js → fa-IR-2D6AXPSB.js} +52 -74
  42. package/dist/dev/locales/fa-IR-2D6AXPSB.js.map +7 -0
  43. package/dist/dev/locales/{fi-FI-HLYF5ISJ.js → fi-FI-WLH5PKEI.js} +47 -69
  44. package/dist/dev/locales/fi-FI-WLH5PKEI.js.map +7 -0
  45. package/dist/dev/locales/{fr-FR-5YNPDFPF.js → fr-FR-2OK3WPK2.js} +50 -72
  46. package/dist/dev/locales/fr-FR-2OK3WPK2.js.map +7 -0
  47. package/dist/dev/locales/{gl-ES-S56CRRSA.js → gl-ES-EZQPQSMM.js} +47 -69
  48. package/dist/dev/locales/gl-ES-EZQPQSMM.js.map +7 -0
  49. package/dist/dev/locales/{he-IL-7GR3BHPZ.js → he-IL-AZ66QXVH.js} +101 -123
  50. package/dist/dev/locales/he-IL-AZ66QXVH.js.map +7 -0
  51. package/dist/dev/locales/{hi-IN-AQ7X42V5.js → hi-IN-FLBMKLKL.js} +47 -69
  52. package/dist/dev/locales/hi-IN-FLBMKLKL.js.map +7 -0
  53. package/dist/dev/locales/{hu-HU-4HM3N3P3.js → hu-HU-VDOE4ASN.js} +47 -69
  54. package/dist/dev/locales/hu-HU-VDOE4ASN.js.map +7 -0
  55. package/dist/dev/locales/{id-ID-P7V2I35Q.js → id-ID-ONDPKYZS.js} +94 -116
  56. package/dist/dev/locales/id-ID-ONDPKYZS.js.map +7 -0
  57. package/dist/dev/locales/{it-IT-HUGIPGTB.js → it-IT-VBFSF2PC.js} +50 -72
  58. package/dist/dev/locales/it-IT-VBFSF2PC.js.map +7 -0
  59. package/dist/dev/locales/{ja-JP-XFX5V5ZL.js → ja-JP-HYYYQCGH.js} +141 -163
  60. package/dist/dev/locales/ja-JP-HYYYQCGH.js.map +7 -0
  61. package/dist/dev/locales/{kaa-X53Z7Q4I.js → kaa-TY3DGTWH.js} +47 -69
  62. package/dist/dev/locales/kaa-TY3DGTWH.js.map +7 -0
  63. package/dist/dev/locales/{kab-KAB-GGKAECT5.js → kab-KAB-IY5ZIQCV.js} +47 -69
  64. package/dist/dev/locales/kab-KAB-IY5ZIQCV.js.map +7 -0
  65. package/dist/dev/locales/{kk-KZ-Z6R3NY65.js → kk-KZ-XL46CODC.js} +47 -69
  66. package/dist/dev/locales/kk-KZ-XL46CODC.js.map +7 -0
  67. package/dist/dev/locales/{km-KH-DGK3UTBI.js → km-KH-SBKIWI6O.js} +47 -69
  68. package/dist/dev/locales/km-KH-SBKIWI6O.js.map +7 -0
  69. package/dist/dev/locales/{ko-KR-W7QZK3EC.js → ko-KR-G6PO3BPA.js} +109 -131
  70. package/dist/dev/locales/ko-KR-G6PO3BPA.js.map +7 -0
  71. package/dist/dev/locales/{ku-TR-3UJE7FNE.js → ku-TR-DCRJVW6B.js} +47 -69
  72. package/dist/dev/locales/ku-TR-DCRJVW6B.js.map +7 -0
  73. package/dist/dev/locales/{lt-LT-OTNQMXF6.js → lt-LT-HMDRWN2A.js} +47 -69
  74. package/dist/dev/locales/lt-LT-HMDRWN2A.js.map +7 -0
  75. package/dist/dev/locales/{lv-LV-Y44YX4AK.js → lv-LV-E7XBXM5Z.js} +47 -69
  76. package/dist/dev/locales/lv-LV-E7XBXM5Z.js.map +7 -0
  77. package/dist/dev/locales/{mr-IN-MT2HYNUI.js → mr-IN-7HMFEVFE.js} +48 -70
  78. package/dist/dev/locales/mr-IN-7HMFEVFE.js.map +7 -0
  79. package/dist/dev/locales/{my-MM-ZBRKQSW3.js → my-MM-L4VSI7TR.js} +47 -69
  80. package/dist/dev/locales/my-MM-L4VSI7TR.js.map +7 -0
  81. package/dist/dev/locales/{nb-NO-ZY7DB7O2.js → nb-NO-GBRDJCO7.js} +47 -69
  82. package/dist/dev/locales/nb-NO-GBRDJCO7.js.map +7 -0
  83. package/dist/dev/locales/{nl-NL-YLVMYG2H.js → nl-NL-Z3EVTIXJ.js} +52 -74
  84. package/dist/dev/locales/nl-NL-Z3EVTIXJ.js.map +7 -0
  85. package/dist/dev/locales/{nn-NO-4SXLBTTQ.js → nn-NO-WCTTYN3P.js} +47 -69
  86. package/dist/dev/locales/nn-NO-WCTTYN3P.js.map +7 -0
  87. package/dist/dev/locales/{oc-FR-NMOJCLB4.js → oc-FR-6IH2LZOZ.js} +47 -69
  88. package/dist/dev/locales/oc-FR-6IH2LZOZ.js.map +7 -0
  89. package/dist/dev/locales/{pa-IN-G5T3AUSW.js → pa-IN-3KCEDMBE.js} +47 -69
  90. package/dist/dev/locales/pa-IN-3KCEDMBE.js.map +7 -0
  91. package/dist/dev/locales/{percentages-ZRLRVMSI.js → percentages-DKKGPYTW.js} +2 -2
  92. package/dist/dev/locales/{pl-PL-TXUESISZ.js → pl-PL-OFE4QPOR.js} +47 -69
  93. package/dist/dev/locales/pl-PL-OFE4QPOR.js.map +7 -0
  94. package/dist/dev/locales/{pt-BR-KEMR6KPT.js → pt-BR-KFYVREQI.js} +94 -116
  95. package/dist/dev/locales/pt-BR-KFYVREQI.js.map +7 -0
  96. package/dist/dev/locales/{pt-PT-ZCG2G3PR.js → pt-PT-GZLT46KI.js} +92 -114
  97. package/dist/dev/locales/pt-PT-GZLT46KI.js.map +7 -0
  98. package/dist/dev/locales/{ro-RO-MDAUF4EM.js → ro-RO-DKVFNBHO.js} +50 -72
  99. package/dist/dev/locales/ro-RO-DKVFNBHO.js.map +7 -0
  100. package/dist/dev/locales/{ru-RU-ZIRVCAVQ.js → ru-RU-6JEBKTLT.js} +50 -72
  101. package/dist/dev/locales/ru-RU-6JEBKTLT.js.map +7 -0
  102. package/dist/dev/locales/{si-LK-FPEI3WT5.js → si-LK-6AKNCJA5.js} +47 -69
  103. package/dist/dev/locales/si-LK-6AKNCJA5.js.map +7 -0
  104. package/dist/dev/locales/{sk-SK-TZJ3W5LE.js → sk-SK-2ATL6K2E.js} +50 -72
  105. package/dist/dev/locales/sk-SK-2ATL6K2E.js.map +7 -0
  106. package/dist/dev/locales/{sl-SI-KIJ3UR57.js → sl-SI-YMMKUPW6.js} +47 -69
  107. package/dist/dev/locales/sl-SI-YMMKUPW6.js.map +7 -0
  108. package/dist/dev/locales/{sv-SE-WX2A2Y2N.js → sv-SE-WBMU72M2.js} +88 -110
  109. package/dist/dev/locales/sv-SE-WBMU72M2.js.map +7 -0
  110. package/dist/dev/locales/{ta-IN-ECFHL2WQ.js → ta-IN-OVDW7DBM.js} +47 -69
  111. package/dist/dev/locales/ta-IN-OVDW7DBM.js.map +7 -0
  112. package/dist/dev/locales/{th-TH-XIGNEM6A.js → th-TH-7L42SH4O.js} +73 -95
  113. package/dist/dev/locales/th-TH-7L42SH4O.js.map +7 -0
  114. package/dist/dev/locales/{tr-TR-RCLDMBSM.js → tr-TR-MPDZYTZ2.js} +83 -105
  115. package/dist/dev/locales/tr-TR-MPDZYTZ2.js.map +7 -0
  116. package/dist/dev/locales/{uk-UA-2ADII6GR.js → uk-UA-5SVBS74S.js} +66 -88
  117. package/dist/dev/locales/uk-UA-5SVBS74S.js.map +7 -0
  118. package/dist/dev/locales/{uz-UZ-COGLAKY3.js → uz-UZ-QYTGSZB2.js} +47 -69
  119. package/dist/dev/locales/uz-UZ-QYTGSZB2.js.map +7 -0
  120. package/dist/dev/locales/{vi-VN-QBW5T274.js → vi-VN-KMVP2XW5.js} +47 -69
  121. package/dist/dev/locales/vi-VN-KMVP2XW5.js.map +7 -0
  122. package/dist/dev/locales/{zh-CN-WONZCIPT.js → zh-CN-KR2L555J.js} +51 -73
  123. package/dist/dev/locales/zh-CN-KR2L555J.js.map +7 -0
  124. package/dist/dev/locales/{zh-HK-AJ2UN7VN.js → zh-HK-VFOCIZQM.js} +47 -69
  125. package/dist/dev/locales/zh-HK-VFOCIZQM.js.map +7 -0
  126. package/dist/dev/locales/{zh-TW-O73UCU5T.js → zh-TW-OIQ4BXFH.js} +91 -113
  127. package/dist/dev/locales/zh-TW-OIQ4BXFH.js.map +7 -0
  128. package/dist/dev/subset-shared.chunk.js +1 -1
  129. package/dist/dev/subset-worker.chunk.js +1 -1
  130. package/dist/prod/chunk-5XKZK2GL.js +1 -0
  131. package/dist/prod/chunk-66O5T5YX.js +4 -0
  132. package/dist/prod/chunk-DARW3V66.js +12 -0
  133. package/dist/prod/{chunk-ZYOK2JIN.js → chunk-SZWH77NQ.js} +1 -1
  134. package/dist/prod/data/image-AAJBLI3M.js +1 -0
  135. package/dist/prod/index.css +1 -1
  136. package/dist/prod/index.js +20 -111
  137. package/dist/prod/locales/ar-SA-E6E2KRZ5.js +10 -0
  138. package/dist/prod/locales/az-AZ-RDMGQYMZ.js +1 -0
  139. package/dist/prod/locales/bg-BG-CHUVCTEA.js +5 -0
  140. package/dist/prod/locales/bn-BD-ZMOEPIQW.js +3 -0
  141. package/dist/prod/locales/bn-IN-OHZAWF5C.js +3 -0
  142. package/dist/prod/locales/ca-ES-K4A7PUP4.js +8 -0
  143. package/dist/prod/locales/cs-CZ-RVP6YORC.js +7 -0
  144. package/dist/prod/locales/da-DK-ENJX4GIQ.js +2 -0
  145. package/dist/prod/locales/de-CH-VYBKDWRU.js +11 -0
  146. package/dist/prod/locales/de-DE-6MCXRRVA.js +11 -0
  147. package/dist/prod/locales/el-GR-WEDZAIPA.js +7 -0
  148. package/dist/prod/locales/en-RNZ7CUK6.js +1 -0
  149. package/dist/prod/locales/es-ES-LLEALNRO.js +11 -0
  150. package/dist/prod/locales/eu-ES-M4Y34NOW.js +8 -0
  151. package/dist/prod/locales/fa-IR-XSMVGGRV.js +9 -0
  152. package/dist/prod/locales/fi-FI-K2D3DDUS.js +6 -0
  153. package/dist/prod/locales/fr-FR-EQKMVJSO.js +12 -0
  154. package/dist/prod/locales/gl-ES-RCPQTYJV.js +6 -0
  155. package/dist/prod/locales/he-IL-RHAGKYKH.js +9 -0
  156. package/dist/prod/locales/hi-IN-3UDCLKHN.js +3 -0
  157. package/dist/prod/locales/hu-HU-T3REA7IL.js +3 -0
  158. package/dist/prod/locales/id-ID-KW4N25IN.js +8 -0
  159. package/dist/prod/locales/it-IT-LJVXK4LO.js +12 -0
  160. package/dist/prod/locales/ja-JP-GGGK3KPX.js +12 -0
  161. package/dist/prod/locales/kaa-TSEHAWJR.js +1 -0
  162. package/dist/prod/locales/kab-KAB-IWXTEINV.js +4 -0
  163. package/dist/prod/locales/kk-KZ-6GNYSAU7.js +1 -0
  164. package/dist/prod/locales/km-KH-ILUXSOEW.js +7 -0
  165. package/dist/prod/locales/ko-KR-FJWHM3OT.js +5 -0
  166. package/dist/prod/locales/ku-TR-DRDDAECA.js +6 -0
  167. package/dist/prod/locales/lt-LT-IYFIPPJI.js +3 -0
  168. package/dist/prod/locales/lv-LV-7F754RSS.js +4 -0
  169. package/dist/prod/locales/mr-IN-BYRIZ3PC.js +9 -0
  170. package/dist/prod/locales/my-MM-RBYJSIJ6.js +1 -0
  171. package/dist/prod/locales/nb-NO-EKTZIYSK.js +8 -0
  172. package/dist/prod/locales/nl-NL-UECYYIUK.js +13 -0
  173. package/dist/prod/locales/nn-NO-JPXGIDBA.js +4 -0
  174. package/dist/prod/locales/oc-FR-4RSIVDPZ.js +4 -0
  175. package/dist/prod/locales/pa-IN-GPHFXISR.js +4 -0
  176. package/dist/prod/locales/percentages-Q7USCRWZ.js +1 -0
  177. package/dist/prod/locales/pl-PL-HKHPAEVK.js +12 -0
  178. package/dist/prod/locales/pt-BR-UBWN6CKP.js +10 -0
  179. package/dist/prod/locales/pt-PT-XDY4S4SD.js +12 -0
  180. package/dist/prod/locales/ro-RO-2B3UXAQO.js +12 -0
  181. package/dist/prod/locales/ru-RU-EW52HAV3.js +10 -0
  182. package/dist/prod/locales/si-LK-PIEHI4JX.js +1 -0
  183. package/dist/prod/locales/sk-SK-TZXYYIFD.js +7 -0
  184. package/dist/prod/locales/sl-SI-VUDQNDF3.js +6 -0
  185. package/dist/prod/locales/sv-SE-IJTJRA7S.js +12 -0
  186. package/dist/prod/locales/ta-IN-Q5PXZT3U.js +6 -0
  187. package/dist/prod/locales/th-TH-HK66ZQXE.js +1 -0
  188. package/dist/prod/locales/tr-TR-CLYYPVPL.js +4 -0
  189. package/dist/prod/locales/uk-UA-YR4OMRYF.js +6 -0
  190. package/dist/prod/locales/uz-UZ-CY4LSY5Y.js +1 -0
  191. package/dist/prod/locales/vi-VN-UDAEMEBG.js +7 -0
  192. package/dist/prod/locales/zh-CN-EGBL23FT.js +11 -0
  193. package/dist/prod/locales/zh-HK-ZOJEG32A.js +1 -0
  194. package/dist/prod/locales/zh-TW-TM5HZP7M.js +13 -0
  195. package/dist/prod/subset-shared.chunk.js +1 -1
  196. package/dist/prod/subset-worker.chunk.js +1 -1
  197. package/dist/types/common/src/colors.d.ts +14 -0
  198. package/dist/types/common/src/constants.d.ts +3 -0
  199. package/dist/types/common/src/keys.d.ts +2 -0
  200. package/dist/types/common/src/points.d.ts +1 -1
  201. package/dist/types/common/src/utils.d.ts +1 -1
  202. package/dist/types/element/src/Scene.d.ts +1 -1
  203. package/dist/types/element/src/align.d.ts +2 -2
  204. package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
  205. package/dist/types/element/src/arrows/focus.d.ts +5 -2
  206. package/dist/types/element/src/binding.d.ts +17 -8
  207. package/dist/types/element/src/bounds.d.ts +5 -9
  208. package/dist/types/element/src/bucketFill.d.ts +110 -0
  209. package/dist/types/element/src/collision.d.ts +1 -1
  210. package/dist/types/element/src/comparisons.d.ts +4 -4
  211. package/dist/types/element/src/convertToShape.d.ts +23 -0
  212. package/dist/types/element/src/distribute.d.ts +2 -2
  213. package/dist/types/element/src/dragElements.d.ts +27 -0
  214. package/dist/types/element/src/duplicate.d.ts +3 -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 +4 -4
  219. package/dist/types/element/src/groups.d.ts +9 -9
  220. package/dist/types/element/src/index.d.ts +4 -1
  221. package/dist/types/element/src/linearElementEditor.d.ts +17 -10
  222. package/dist/types/element/src/newElement.d.ts +13 -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 +5 -5
  226. package/dist/types/element/src/shape.d.ts +12 -0
  227. package/dist/types/element/src/sortElements.d.ts +10 -0
  228. package/dist/types/element/src/textElement.d.ts +12 -9
  229. package/dist/types/element/src/transform.d.ts +2 -2
  230. package/dist/types/element/src/typeChecks.d.ts +25 -25
  231. package/dist/types/element/src/types.d.ts +2 -1
  232. package/dist/types/element/src/zindex.d.ts +2 -2
  233. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  234. package/dist/types/excalidraw/actions/actionBoundText.d.ts +24 -8
  235. package/dist/types/excalidraw/actions/actionCanvas.d.ts +128 -961
  236. package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -8
  237. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -4
  238. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +38 -13
  239. package/dist/types/excalidraw/actions/actionDeselect.d.ts +9 -4
  240. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  241. package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -4
  242. package/dist/types/excalidraw/actions/actionElementLock.d.ts +25 -9
  243. package/dist/types/excalidraw/actions/actionExport.d.ts +26 -10
  244. package/dist/types/excalidraw/actions/actionFrame.d.ts +47 -205
  245. package/dist/types/excalidraw/actions/actionGroup.d.ts +39 -23
  246. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -6
  247. package/dist/types/excalidraw/actions/actionLink.d.ts +13 -5
  248. package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -4
  249. package/dist/types/excalidraw/actions/actionProperties.d.ts +43 -24
  250. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +17 -9
  251. package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -4
  252. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  253. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +14 -6
  254. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -9
  255. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +13 -5
  256. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -5
  257. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -9
  258. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  259. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -5
  260. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -6
  261. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -5
  262. package/dist/types/excalidraw/actions/index.d.ts +1 -2
  263. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  264. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  265. package/dist/types/excalidraw/actions/types.d.ts +8 -4
  266. package/dist/types/excalidraw/appState.d.ts +10 -5
  267. package/dist/types/excalidraw/components/Actions.d.ts +17 -12
  268. package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
  269. package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
  270. package/dist/types/excalidraw/components/App.cursor.d.ts +30 -0
  271. package/dist/types/excalidraw/components/App.d.ts +384 -60
  272. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  273. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  274. package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
  275. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
  276. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  277. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
  278. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
  279. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
  280. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
  281. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
  282. package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
  283. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
  284. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  285. package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
  286. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  287. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  288. package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
  289. package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
  290. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
  291. package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
  292. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  293. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  294. package/dist/types/excalidraw/components/Popover.d.ts +1 -3
  295. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  296. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  297. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  298. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
  299. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  300. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  301. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  302. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  303. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  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 +146 -0
  307. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  308. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  309. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -0
  310. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  311. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
  312. package/dist/types/excalidraw/components/icons.d.ts +4 -1
  313. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  314. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  315. package/dist/types/excalidraw/context/tunnels.d.ts +0 -1
  316. package/dist/types/excalidraw/data/blob.d.ts +14 -6
  317. package/dist/types/excalidraw/data/index.d.ts +4 -4
  318. package/dist/types/excalidraw/data/json.d.ts +20 -12
  319. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  320. package/dist/types/excalidraw/index.d.ts +3 -3
  321. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  322. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +10 -3
  323. package/dist/types/excalidraw/scene/Renderer.d.ts +11 -11
  324. package/dist/types/excalidraw/scene/export.d.ts +3 -3
  325. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  326. package/dist/types/excalidraw/scene/types.d.ts +4 -3
  327. package/dist/types/excalidraw/snapping.d.ts +7 -7
  328. package/dist/types/excalidraw/types.d.ts +423 -27
  329. package/dist/types/excalidraw/viewport.d.ts +283 -0
  330. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
  331. package/dist/types/laser-pointer/src/state.d.ts +1 -0
  332. package/dist/types/math/src/index.d.ts +1 -0
  333. package/dist/types/math/src/pca.d.ts +79 -0
  334. package/dist/types/math/src/polygon.d.ts +25 -1
  335. package/dist/types/utils/src/export.d.ts +3 -3
  336. package/package.json +4 -4
  337. package/dist/dev/chunk-IU2VFRFU.js.map +0 -7
  338. package/dist/dev/chunk-MN6E45MP.js.map +0 -7
  339. package/dist/dev/chunk-URPEKBQ3.js +0 -69
  340. package/dist/dev/chunk-URPEKBQ3.js.map +0 -7
  341. package/dist/dev/locales/ar-SA-NFU76NHO.js.map +0 -7
  342. package/dist/dev/locales/az-AZ-F7U432OF.js.map +0 -7
  343. package/dist/dev/locales/bg-BG-VMJGHZ3R.js.map +0 -7
  344. package/dist/dev/locales/bn-BD-ABWH5RGF.js.map +0 -7
  345. package/dist/dev/locales/bn-IN-6FBCHDUY.js.map +0 -7
  346. package/dist/dev/locales/ca-ES-UX7K2ENH.js.map +0 -7
  347. package/dist/dev/locales/cs-CZ-TBYIRH36.js.map +0 -7
  348. package/dist/dev/locales/da-DK-KW4TGU6O.js.map +0 -7
  349. package/dist/dev/locales/de-CH-QSJHIHEN.js.map +0 -7
  350. package/dist/dev/locales/de-DE-2WQ5IRPT.js.map +0 -7
  351. package/dist/dev/locales/el-GR-N7JWYMV5.js.map +0 -7
  352. package/dist/dev/locales/es-ES-37LJTLHM.js.map +0 -7
  353. package/dist/dev/locales/eu-ES-2IFCUP7K.js.map +0 -7
  354. package/dist/dev/locales/fa-IR-VDT7BNM4.js.map +0 -7
  355. package/dist/dev/locales/fi-FI-HLYF5ISJ.js.map +0 -7
  356. package/dist/dev/locales/fr-FR-5YNPDFPF.js.map +0 -7
  357. package/dist/dev/locales/gl-ES-S56CRRSA.js.map +0 -7
  358. package/dist/dev/locales/he-IL-7GR3BHPZ.js.map +0 -7
  359. package/dist/dev/locales/hi-IN-AQ7X42V5.js.map +0 -7
  360. package/dist/dev/locales/hu-HU-4HM3N3P3.js.map +0 -7
  361. package/dist/dev/locales/id-ID-P7V2I35Q.js.map +0 -7
  362. package/dist/dev/locales/it-IT-HUGIPGTB.js.map +0 -7
  363. package/dist/dev/locales/ja-JP-XFX5V5ZL.js.map +0 -7
  364. package/dist/dev/locales/kaa-X53Z7Q4I.js.map +0 -7
  365. package/dist/dev/locales/kab-KAB-GGKAECT5.js.map +0 -7
  366. package/dist/dev/locales/kk-KZ-Z6R3NY65.js.map +0 -7
  367. package/dist/dev/locales/km-KH-DGK3UTBI.js.map +0 -7
  368. package/dist/dev/locales/ko-KR-W7QZK3EC.js.map +0 -7
  369. package/dist/dev/locales/ku-TR-3UJE7FNE.js.map +0 -7
  370. package/dist/dev/locales/lt-LT-OTNQMXF6.js.map +0 -7
  371. package/dist/dev/locales/lv-LV-Y44YX4AK.js.map +0 -7
  372. package/dist/dev/locales/mr-IN-MT2HYNUI.js.map +0 -7
  373. package/dist/dev/locales/my-MM-ZBRKQSW3.js.map +0 -7
  374. package/dist/dev/locales/nb-NO-ZY7DB7O2.js.map +0 -7
  375. package/dist/dev/locales/nl-NL-YLVMYG2H.js.map +0 -7
  376. package/dist/dev/locales/nn-NO-4SXLBTTQ.js.map +0 -7
  377. package/dist/dev/locales/oc-FR-NMOJCLB4.js.map +0 -7
  378. package/dist/dev/locales/pa-IN-G5T3AUSW.js.map +0 -7
  379. package/dist/dev/locales/pl-PL-TXUESISZ.js.map +0 -7
  380. package/dist/dev/locales/pt-BR-KEMR6KPT.js.map +0 -7
  381. package/dist/dev/locales/pt-PT-ZCG2G3PR.js.map +0 -7
  382. package/dist/dev/locales/ro-RO-MDAUF4EM.js.map +0 -7
  383. package/dist/dev/locales/ru-RU-ZIRVCAVQ.js.map +0 -7
  384. package/dist/dev/locales/si-LK-FPEI3WT5.js.map +0 -7
  385. package/dist/dev/locales/sk-SK-TZJ3W5LE.js.map +0 -7
  386. package/dist/dev/locales/sl-SI-KIJ3UR57.js.map +0 -7
  387. package/dist/dev/locales/sv-SE-WX2A2Y2N.js.map +0 -7
  388. package/dist/dev/locales/ta-IN-ECFHL2WQ.js.map +0 -7
  389. package/dist/dev/locales/th-TH-XIGNEM6A.js.map +0 -7
  390. package/dist/dev/locales/tr-TR-RCLDMBSM.js.map +0 -7
  391. package/dist/dev/locales/uk-UA-2ADII6GR.js.map +0 -7
  392. package/dist/dev/locales/uz-UZ-COGLAKY3.js.map +0 -7
  393. package/dist/dev/locales/vi-VN-QBW5T274.js.map +0 -7
  394. package/dist/dev/locales/zh-CN-WONZCIPT.js.map +0 -7
  395. package/dist/dev/locales/zh-HK-AJ2UN7VN.js.map +0 -7
  396. package/dist/dev/locales/zh-TW-O73UCU5T.js.map +0 -7
  397. package/dist/prod/chunk-3PELD44J.js +0 -1
  398. package/dist/prod/chunk-3UXKIWVY.js +0 -12
  399. package/dist/prod/chunk-BNYGVLQX.js +0 -4
  400. package/dist/prod/data/image-OFIWDJ6Z.js +0 -1
  401. package/dist/prod/locales/ar-SA-3G7FTBZJ.js +0 -8
  402. package/dist/prod/locales/az-AZ-HMFZUPFL.js +0 -1
  403. package/dist/prod/locales/bg-BG-Y7OZ2DXF.js +0 -5
  404. package/dist/prod/locales/bn-BD-36TGMEAF.js +0 -3
  405. package/dist/prod/locales/bn-IN-FALW4RB5.js +0 -3
  406. package/dist/prod/locales/ca-ES-MJRJ6GTN.js +0 -8
  407. package/dist/prod/locales/cs-CZ-52YM52ZO.js +0 -7
  408. package/dist/prod/locales/da-DK-QEP42HP6.js +0 -2
  409. package/dist/prod/locales/de-CH-LGHSGO4X.js +0 -7
  410. package/dist/prod/locales/de-DE-GHNPPGTN.js +0 -7
  411. package/dist/prod/locales/el-GR-2UZLGABX.js +0 -7
  412. package/dist/prod/locales/en-AH5BYWXT.js +0 -1
  413. package/dist/prod/locales/es-ES-2NUH2FTW.js +0 -7
  414. package/dist/prod/locales/eu-ES-LW4CGHUU.js +0 -7
  415. package/dist/prod/locales/fa-IR-U32PFECK.js +0 -9
  416. package/dist/prod/locales/fi-FI-G7756HAK.js +0 -6
  417. package/dist/prod/locales/fr-FR-VIEH4DTC.js +0 -12
  418. package/dist/prod/locales/gl-ES-JWQDRMPC.js +0 -6
  419. package/dist/prod/locales/he-IL-YYBNMYP4.js +0 -8
  420. package/dist/prod/locales/hi-IN-4J4RW5AN.js +0 -3
  421. package/dist/prod/locales/hu-HU-MBXXMHSF.js +0 -3
  422. package/dist/prod/locales/id-ID-5U764SVL.js +0 -8
  423. package/dist/prod/locales/it-IT-7BNDK63V.js +0 -12
  424. package/dist/prod/locales/ja-JP-4SLEHWLA.js +0 -7
  425. package/dist/prod/locales/kaa-YHCGFUY5.js +0 -1
  426. package/dist/prod/locales/kab-KAB-LSGAIMUB.js +0 -4
  427. package/dist/prod/locales/kk-KZ-3YNSB7GZ.js +0 -1
  428. package/dist/prod/locales/km-KH-7GXC5R4I.js +0 -7
  429. package/dist/prod/locales/ko-KR-B6Q6YTFE.js +0 -5
  430. package/dist/prod/locales/ku-TR-FBC7A657.js +0 -6
  431. package/dist/prod/locales/lt-LT-NTZ3RRBU.js +0 -3
  432. package/dist/prod/locales/lv-LV-G24LH3KG.js +0 -4
  433. package/dist/prod/locales/mr-IN-FMZEIYNW.js +0 -9
  434. package/dist/prod/locales/my-MM-B6EJQIQF.js +0 -1
  435. package/dist/prod/locales/nb-NO-GEP6ZOEM.js +0 -8
  436. package/dist/prod/locales/nl-NL-4QUIWSVP.js +0 -13
  437. package/dist/prod/locales/nn-NO-P32L2VHA.js +0 -4
  438. package/dist/prod/locales/oc-FR-QRACY6JR.js +0 -4
  439. package/dist/prod/locales/pa-IN-GBDTCDVG.js +0 -4
  440. package/dist/prod/locales/percentages-5DKR754L.js +0 -1
  441. package/dist/prod/locales/pl-PL-2Y6CXCHK.js +0 -12
  442. package/dist/prod/locales/pt-BR-FKWT7UFL.js +0 -6
  443. package/dist/prod/locales/pt-PT-6EMD7SCZ.js +0 -8
  444. package/dist/prod/locales/ro-RO-XERO3Y25.js +0 -12
  445. package/dist/prod/locales/ru-RU-XKTTT4QL.js +0 -10
  446. package/dist/prod/locales/si-LK-MGLC5APF.js +0 -1
  447. package/dist/prod/locales/sk-SK-BMCDJLZC.js +0 -7
  448. package/dist/prod/locales/sl-SI-LAWKY4LU.js +0 -6
  449. package/dist/prod/locales/sv-SE-X2ORO3SG.js +0 -8
  450. package/dist/prod/locales/ta-IN-RZDP4ZDC.js +0 -6
  451. package/dist/prod/locales/th-TH-GY4Y5ENV.js +0 -1
  452. package/dist/prod/locales/tr-TR-CT4QTEX3.js +0 -4
  453. package/dist/prod/locales/uk-UA-XEPSQF3S.js +0 -6
  454. package/dist/prod/locales/uz-UZ-WM3HHDOU.js +0 -1
  455. package/dist/prod/locales/vi-VN-RFG3SAMP.js +0 -7
  456. package/dist/prod/locales/zh-CN-2WGTQQH5.js +0 -11
  457. package/dist/prod/locales/zh-HK-J64WV2A2.js +0 -1
  458. package/dist/prod/locales/zh-TW-4JITCNYX.js +0 -9
  459. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -180
  460. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  461. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  462. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  463. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -12
  464. package/dist/types/excalidraw/components/shapes.d.ts +0 -270
  465. package/dist/types/excalidraw/cursor.d.ts +0 -5
  466. package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
  467. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  468. package/dist/types/excalidraw/scroll.d.ts +0 -46
  469. /package/dist/dev/{chunk-P7I4FGOG.js.map → chunk-6T5HZJCI.js.map} +0 -0
  470. /package/dist/dev/data/{image-ZYGVHYLC.js.map → image-NFLICJEW.js.map} +0 -0
  471. /package/dist/dev/locales/{en-25BPHB4T.js.map → en-RETPDZ4S.js.map} +0 -0
  472. /package/dist/dev/locales/{percentages-ZRLRVMSI.js.map → percentages-DKKGPYTW.js.map} +0 -0
@@ -1,22 +1,29 @@
1
1
  import React from "react";
2
2
  import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
3
- import { FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
- import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
5
- import type { ExcalidrawElement, NonDeleted, FileId, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
3
+ import { LinearElementEditor, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
+ import type { LocalPoint, Radians } from "@excalidraw/math";
5
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeleted, FileId, NonDeletedExcalidrawElement, ExcalidrawTextContainer, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
6
6
  import type { Mutable } from "@excalidraw/common/utility-types";
7
7
  import { ActionManager } from "../actions/manager";
8
8
  import { History } from "../history";
9
9
  import { Fonts } from "../fonts";
10
10
  import { type WritableAtom } from "../editor-jotai";
11
11
  import { Renderer } from "../scene/Renderer";
12
- import { type ScrollToContentOptions } from "../scroll";
12
+ import { type SetViewportOptions } from "../viewport";
13
13
  import { LaserTrails } from "../laserTrails";
14
14
  import { isOverScrollBars } from "../scene/scrollbars";
15
15
  import { LassoTrail } from "../lasso";
16
16
  import { EraserTrail } from "../eraser";
17
+ import { AppArrowText } from "./App.arrowText";
18
+ import { AppBucketFill } from "./App.bucketFill";
19
+ import { AppCursor } from "./App.cursor";
20
+ import { AppDrawShape } from "./App.drawshape";
21
+ import { AppFlowchart } from "./App.flowchart";
22
+ import { AppViewport } from "./App.viewport";
23
+ import { CursorHints } from "./CursorHint";
17
24
  import { type OnStateChange } from "./AppStateObserver";
18
25
  import type { ExportedElements } from "../data";
19
- import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
26
+ import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, NullableGridSize, UIConfig, ImageStatus } from "../types";
20
27
  import type { RoughCanvas } from "roughjs/bin/canvas";
21
28
  import type { ActionResult } from "../actions/types";
22
29
  declare const editorLifecycleEventBehavior: {
@@ -79,6 +86,9 @@ declare class App extends React.Component<AppProps, AppState> {
79
86
  fonts: Fonts;
80
87
  renderer: Renderer;
81
88
  visibleElements: readonly NonDeletedExcalidrawElement[];
89
+ /** whether the last render had any renderable elements (excludes e.g. the
90
+ * in-progress `newElement` and the edited text element) */
91
+ private hasRenderableElements;
82
92
  private resizeObserver;
83
93
  id: string;
84
94
  private store;
@@ -91,8 +101,9 @@ declare class App extends React.Component<AppProps, AppState> {
91
101
  imageCache: AppClassProperties["imageCache"];
92
102
  imageLoadingProgress: Map<FileId, number>;
93
103
  imageLoadingProgressEmitter: Emitter<[]>;
104
+ imageStatus: Map<FileId, ImageStatus>;
105
+ imageStatusEmitter: Emitter<[]>;
94
106
  imagePlaceholderUpdateEmitter: Emitter<[]>;
95
- private imageTransitionPlaceholders;
96
107
  private iFrameRefs;
97
108
  /**
98
109
  * Indicates whether the embeddable's url has been validated for rendering.
@@ -110,9 +121,17 @@ declare class App extends React.Component<AppProps, AppState> {
110
121
  onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
111
122
  private appStateObserver;
112
123
  onStateChange: OnStateChange;
113
- flowChartCreator: FlowChartCreator;
114
- private flowChartNavigator;
124
+ bucketFill: AppBucketFill;
125
+ flowchart: AppFlowchart;
126
+ cursor: AppCursor;
127
+ arrowText: AppArrowText;
128
+ viewport: AppViewport;
129
+ get lastViewportPosition(): {
130
+ x: number;
131
+ y: number;
132
+ };
115
133
  bindModeHandler: ReturnType<typeof setTimeout> | null;
134
+ private textWysiwygSubmitHandler;
116
135
  hitLinkElement?: NonDeletedExcalidrawElement;
117
136
  lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
118
137
  lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
@@ -129,13 +148,11 @@ declare class App extends React.Component<AppProps, AppState> {
129
148
  x: number;
130
149
  y: number;
131
150
  } | null;
132
- lastViewportPosition: {
133
- x: number;
134
- y: number;
135
- };
151
+ drawShape: AppDrawShape;
136
152
  laserTrails: LaserTrails;
137
153
  eraserTrail: EraserTrail;
138
154
  lassoTrail: LassoTrail;
155
+ cursorHints: CursorHints;
139
156
  onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
140
157
  onPointerDownEmitter: Emitter<[activeTool: {
141
158
  lastActiveTool: import("../types").ActiveTool | null;
@@ -268,9 +285,77 @@ declare class App extends React.Component<AppProps, AppState> {
268
285
  missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
269
286
  onRemoveEventListenersEmitter: Emitter<[]>;
270
287
  api: ExcalidrawImperativeAPI;
271
- addImageElementsToScene: ExcalidrawImperativeAPI["addImageElementsToScene"];
272
288
  private createExcalidrawAPI;
273
289
  constructor(props: AppProps);
290
+ /**
291
+ * Whether the editor accepts user input (pointer, keyboard, wheel, touch,
292
+ * clipboard, drag&drop). When `false`, the editor is fully inert for the
293
+ * user, but remains controllable through the imperative API.
294
+ *
295
+ * All user-input entry points must consult this getter (directly or by
296
+ * not being attached/rendered at all).
297
+ */
298
+ isInteractionEnabled(props?: Pick<AppProps, "interaction">): boolean;
299
+ /**
300
+ * Whether element links render their link icon and are clickable.
301
+ * True when fully interactive, or when `interaction: { enabled: { links:
302
+ * true } }`
303
+ * (in which case clicking anywhere on a linked element opens the link,
304
+ * same as in view mode).
305
+ */
306
+ isLinksEnabled(props?: Pick<AppProps, "interaction">): boolean;
307
+ /**
308
+ * Whether canvas navigation — panning & zooming, view-mode style — is
309
+ * enabled. True when fully interactive, or when `interaction: { enabled:
310
+ * { navigation: true } }`. Respects `appState.scrollConstraints`.
311
+ */
312
+ isNavigationEnabled(props?: Pick<AppProps, "interaction">): boolean;
313
+ /**
314
+ * Whether embeddable & iframe elements are interactive (hover & click to
315
+ * activate, view-mode style). True when fully interactive, or when
316
+ * allowed via `interaction.enabled.embeds` / `.interactiveContent`.
317
+ */
318
+ isEmbedsEnabled(props?: Pick<AppProps, "interaction">): boolean;
319
+ /**
320
+ * Whether the browser's own zoom (ctrl/cmd + wheel, pinch, keyboard
321
+ * shortcuts) stays available over the non-interactive editor.
322
+ * Prevented by default.
323
+ */
324
+ isBrowserZoomEnabled(props?: Pick<AppProps, "interaction">): boolean;
325
+ /**
326
+ * Whether the tool can be activated & driven by user input. False when
327
+ * disabled via `UIOptions.tools`, or when the editor is non-interactive
328
+ * and the tool isn't kept user-driven via `interaction.enabled.tools`.
329
+ *
330
+ * (Once UI tool availability is split from input availability — e.g.
331
+ * `props.ui.tools` vs `interaction.disabled.tools` — the UI axis moves
332
+ * out into its own predicate.)
333
+ *
334
+ * We purposely widen the `tool` type so this helper can be called with
335
+ * any tool without having to type check it.
336
+ */
337
+ isToolSupported: <T extends ToolType | "custom">(tool: T, props?: Pick<AppProps, "interaction" | "UIOptions">) => boolean;
338
+ /**
339
+ * Whether the active tool is locked in place — via the tool lock
340
+ * (padlock / Q) or by being host-forced (`props.activeTool`). A locked
341
+ * tool doesn't revert to the selection tool after use, and elements drawn
342
+ * with it aren't selected. Forcing deliberately does not mutate
343
+ * `activeTool.locked`, which is the user's persisted padlock preference.
344
+ */
345
+ isToolLocked(): boolean;
346
+ /**
347
+ * Whether the active tool captures the primary pointer instead of the
348
+ * view-mode drag-to-pan — the laser and host-implemented custom tools do;
349
+ * while non-interactive, any tool allowed via
350
+ * `interaction.enabled.tools` does. (Editing tools capture the pointer
351
+ * trivially since view mode implies they're not active; this predicate only
352
+ * matters where view-mode gates apply.)
353
+ */
354
+ isActiveToolPointerCapturing(): boolean;
355
+ /** Whether Excalidraw's full default UI is rendered. */
356
+ isDefaultUIEnabled(props?: Pick<AppProps, "ui">): boolean;
357
+ /** Whether an individual default UI control is rendered. */
358
+ isUIControlEnabled(control: keyof UIConfig["enabled"], props?: Pick<AppProps, "ui">): boolean;
274
359
  updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
275
360
  private onWindowMessage;
276
361
  private handleSkipBindMode;
@@ -305,25 +390,39 @@ declare class App extends React.Component<AppProps, AppState> {
305
390
  getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
306
391
  onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
307
392
  onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
308
- exportingFrame: ExcalidrawFrameLikeElement | null;
393
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
309
394
  }) => Promise<void>;
310
- private magicGenerations;
311
- private updateMagicGeneration;
312
- plugins: {
313
- diagramToCode?: {
314
- generate: GenerateDiagramToCode;
315
- };
316
- };
317
- setPlugins(plugins: Partial<App["plugins"]>): void;
318
- private onMagicFrameGenerate;
319
- private onIframeSrcCopy;
320
- onMagicframeToolSelect: () => void;
321
395
  private openEyeDropper;
322
396
  dismissLinearEditor: () => void;
323
397
  syncActionResult: (actionResult: ActionResult) => void;
398
+ scheduleCapture: () => void;
324
399
  private onBlur;
325
400
  private onUnload;
326
401
  private disableEvent;
402
+ private preventBrowserZoomWheel;
403
+ private handleNavigationModeKeyDown;
404
+ /**
405
+ * PageUp/PageDown scroll the canvas by a page — vertically, or
406
+ * horizontally with shift. Respects `appState.scrollConstraints`
407
+ * (via `viewport.translate`).
408
+ */
409
+ private maybeHandlePageScrollKeyDown;
410
+ private preventBrowserZoomKeyDown;
411
+ /** Ends active input sessions before switching to a view-mode/non-interactive
412
+ * mode. */
413
+ private terminateActiveInteraction;
414
+ private handleInteractionStateChange;
415
+ /** whether the two values reference the same tool (incl. custom subtype) */
416
+ private isSameForcedTool;
417
+ /**
418
+ * Keeps `state.activeTool` synced to the host-controlled
419
+ * `props.activeTool`. `setActiveTool` refuses non-matching activations
420
+ * while forced (user input, API); this backstop covers the writers that
421
+ * bypass the funnel (`actionFinalize`/`actionDeselect`, `restore()` on
422
+ * scene load, ...) and re-applies the tool once it becomes activatable
423
+ * (e.g. `interaction` config changes).
424
+ */
425
+ private handleForcedToolChange;
327
426
  private resetHistory;
328
427
  private resetStore;
329
428
  /**
@@ -355,6 +454,17 @@ declare class App extends React.Component<AppProps, AppState> {
355
454
  private onTouchEnd;
356
455
  private insertClipboardContent;
357
456
  pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
457
+ addElementsFromPasteOrLibrary: (opts: {
458
+ elements: readonly ExcalidrawElement[];
459
+ files: BinaryFiles | null;
460
+ position: {
461
+ clientX: number;
462
+ clientY: number;
463
+ } | "cursor" | "center";
464
+ retainSeed?: boolean;
465
+ fit?: SetViewportOptions["fit"];
466
+ preserveFrameChildrenOrder?: boolean;
467
+ }) => void;
358
468
  addElementsFromPaste: (opts: {
359
469
  elements: readonly ExcalidrawElement[];
360
470
  files: BinaryFiles | null;
@@ -373,39 +483,41 @@ declare class App extends React.Component<AppProps, AppState> {
373
483
  toggleLock: (source?: "keyboard" | "ui") => void;
374
484
  updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
375
485
  togglePenMode: (force: boolean | null) => void;
376
- onHandToolToggle: () => void;
377
- /**
378
- * Zooms on canvas viewport center
379
- */
380
- zoomCanvas: (
381
- /**
382
- * Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.
383
- * 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom
384
- */
385
- value: number) => void;
386
- private cancelInProgressAnimation;
486
+ revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
387
487
  scrollToViewport: (target: {
388
488
  scrollX: number;
389
489
  scrollY: number;
390
490
  zoom: number;
391
- }, opts?: {
491
+ }, _opts?: {
492
+ animate?: boolean;
493
+ duration?: number;
494
+ }) => void;
495
+ scrollToContent: (target?: SetViewportOptions["target"], opts?: {
392
496
  animate?: boolean;
393
497
  duration?: number;
498
+ fitToViewport?: boolean;
394
499
  }) => void;
395
- scrollToContent: (target?: string | ExcalidrawElement | readonly NonDeletedExcalidrawElement[], opts?: ScrollToContentOptions) => void;
396
- private maybeUnfollowRemoteUser;
397
- /** use when changing scrollX/scrollY/zoom based on user interaction */
398
- private translateCanvas;
500
+ /** emits a follow/unfollow intent to the host (which owns the
501
+ * `userToFollow` state) via both the `onUserFollow` prop and the
502
+ * imperative API emitter */
503
+ emitUserFollowIntent: (payload: OnUserFollowedPayload) => void;
504
+ /** emits an UNFOLLOW intent if currently following someone — use on
505
+ * user-initiated viewport changes which should break follow mode */
506
+ requestUnfollow: () => void;
399
507
  setToast: (toast: AppState["toast"]) => void;
400
- private handleToastClose;
401
508
  restoreFileFromShare: () => Promise<void>;
402
509
  /**
403
510
  * adds supplied files to existing files in the appState.
404
511
  * NOTE if file already exists in editor state, the file data is not updated
405
512
  * */
406
513
  addFiles: ExcalidrawImperativeAPI["addFiles"];
514
+ addImageElementsToScene: ExcalidrawImperativeAPI["addImageElementsToScene"];
407
515
  addImagePlaceholder: ExcalidrawImperativeAPI["addImagePlaceholder"];
408
- setImageLoadingProgress: ExcalidrawImperativeAPI["setImageLoadingProgress"];
516
+ setDownloadProgress: ExcalidrawImperativeAPI["setDownloadProgress"];
517
+ setDownloadError: ExcalidrawImperativeAPI["setDownloadError"];
518
+ setUploadProgress: ExcalidrawImperativeAPI["setUploadProgress"];
519
+ private updateImageStatus;
520
+ private areImageStatusesEqual;
409
521
  private clearImageLoadingProgress;
410
522
  private clearImageShapeCacheForFileId;
411
523
  private addMissingFiles;
@@ -428,7 +540,9 @@ declare class App extends React.Component<AppProps, AppState> {
428
540
  }) => void;
429
541
  applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
430
542
  mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
431
- private triggerRender;
543
+ triggerRender: (
544
+ /** force always re-renders canvas even if no change */
545
+ force?: boolean) => void;
432
546
  /**
433
547
  * @returns whether the menu was toggled on or off
434
548
  */
@@ -438,10 +552,8 @@ declare class App extends React.Component<AppProps, AppState> {
438
552
  force?: boolean;
439
553
  }) => boolean;
440
554
  private updateCurrentCursorPosition;
441
- getEditorUIOffsets: () => Offsets;
442
555
  private onKeyDown;
443
556
  private onKeyUp;
444
- private isToolSupported;
445
557
  setActiveTool: (tool: ({
446
558
  type: ToolType;
447
559
  } | {
@@ -450,10 +562,18 @@ declare class App extends React.Component<AppProps, AppState> {
450
562
  }) & {
451
563
  locked?: boolean;
452
564
  fromSelection?: boolean;
453
- }, keepSelection?: boolean) => void;
565
+ }, opts?: {
566
+ keepSelection?: boolean;
567
+ /**
568
+ * When `true`, re-activating an already-active toggle tool (see
569
+ * `TOGGLE_TOOLS`) switches back to the previously active tool.
570
+ * Activation is idempotent by default; toggle tools always record the
571
+ * previously active tool regardless (so ESC and the next `toggle`
572
+ * activation can switch back to it).
573
+ */
574
+ toggle?: boolean;
575
+ }) => void;
454
576
  setOpenDialog: (dialogType: AppState["openDialog"]) => void;
455
- private setCursor;
456
- private resetCursor;
457
577
  /**
458
578
  * returns whether user is making a gesture with >= 2 fingers (points)
459
579
  * on o touch screen (not on a trackpad). Currently only relates to Darwin
@@ -469,32 +589,229 @@ declare class App extends React.Component<AppProps, AppState> {
469
589
  private deselectElements;
470
590
  private getSelectedTextElement;
471
591
  private getSelectedTextEditingContainerAtPosition;
472
- private getTextElementAtPosition;
592
+ getTextElementAtPosition(x: number, y: number): NonDeleted<ExcalidrawTextElement> | null;
473
593
  private isHittingTextAutoResizeHandle;
474
594
  private handleTextAutoResizeHandlePointerDown;
475
- private getElementAtPosition;
595
+ getElementAtPosition(x: number, y: number, opts?: ({
596
+ includeBoundTextElement?: boolean;
597
+ includeLockedElements?: boolean;
598
+ } | {
599
+ allHitElements: NonDeleted<ExcalidrawElement>[];
600
+ }) & {
601
+ preferSelected?: boolean;
602
+ }): NonDeleted<ExcalidrawElement> | null;
476
603
  private getElementsAtPosition;
477
604
  getElementHitThreshold(element: ExcalidrawElement): number;
478
605
  private hitElement;
479
- private getTextBindableContainerAtPosition;
606
+ getTextBindableContainerAtPosition(x: number, y: number): (Readonly<{
607
+ id: string;
608
+ x: number;
609
+ y: number;
610
+ strokeColor: string;
611
+ backgroundColor: string;
612
+ fillStyle: import("@excalidraw/element/types").FillStyle;
613
+ strokeWidth: number;
614
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
615
+ roundness: null | {
616
+ type: import("@excalidraw/element/types").RoundnessType;
617
+ value?: number;
618
+ };
619
+ roughness: number;
620
+ opacity: number;
621
+ width: number;
622
+ height: number;
623
+ angle: Radians;
624
+ seed: number;
625
+ version: number;
626
+ versionNonce: number;
627
+ index: import("@excalidraw/element/types").FractionalIndex | null;
628
+ isDeleted: boolean;
629
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
630
+ frameId: string | null;
631
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
632
+ updated: number;
633
+ link: string | null;
634
+ locked: boolean;
635
+ customData?: Record<string, any>;
636
+ }> & {
637
+ type: "rectangle";
638
+ } & {
639
+ isDeleted: false;
640
+ }) | (Readonly<{
641
+ id: string;
642
+ x: number;
643
+ y: number;
644
+ strokeColor: string;
645
+ backgroundColor: string;
646
+ fillStyle: import("@excalidraw/element/types").FillStyle;
647
+ strokeWidth: number;
648
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
649
+ roundness: null | {
650
+ type: import("@excalidraw/element/types").RoundnessType;
651
+ value?: number;
652
+ };
653
+ roughness: number;
654
+ opacity: number;
655
+ width: number;
656
+ height: number;
657
+ angle: Radians;
658
+ seed: number;
659
+ version: number;
660
+ versionNonce: number;
661
+ index: import("@excalidraw/element/types").FractionalIndex | null;
662
+ isDeleted: boolean;
663
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
664
+ frameId: string | null;
665
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
666
+ updated: number;
667
+ link: string | null;
668
+ locked: boolean;
669
+ customData?: Record<string, any>;
670
+ }> & {
671
+ type: "diamond";
672
+ } & {
673
+ isDeleted: false;
674
+ }) | (Readonly<{
675
+ id: string;
676
+ x: number;
677
+ y: number;
678
+ strokeColor: string;
679
+ backgroundColor: string;
680
+ fillStyle: import("@excalidraw/element/types").FillStyle;
681
+ strokeWidth: number;
682
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
683
+ roundness: null | {
684
+ type: import("@excalidraw/element/types").RoundnessType;
685
+ value?: number;
686
+ };
687
+ roughness: number;
688
+ opacity: number;
689
+ width: number;
690
+ height: number;
691
+ angle: Radians;
692
+ seed: number;
693
+ version: number;
694
+ versionNonce: number;
695
+ index: import("@excalidraw/element/types").FractionalIndex | null;
696
+ isDeleted: boolean;
697
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
698
+ frameId: string | null;
699
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
700
+ updated: number;
701
+ link: string | null;
702
+ locked: boolean;
703
+ customData?: Record<string, any>;
704
+ }> & {
705
+ type: "ellipse";
706
+ } & {
707
+ isDeleted: false;
708
+ }) | (Readonly<{
709
+ id: string;
710
+ x: number;
711
+ y: number;
712
+ strokeColor: string;
713
+ backgroundColor: string;
714
+ fillStyle: import("@excalidraw/element/types").FillStyle;
715
+ strokeWidth: number;
716
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
717
+ roundness: null | {
718
+ type: import("@excalidraw/element/types").RoundnessType;
719
+ value?: number;
720
+ };
721
+ roughness: number;
722
+ opacity: number;
723
+ width: number;
724
+ height: number;
725
+ angle: Radians;
726
+ seed: number;
727
+ version: number;
728
+ versionNonce: number;
729
+ index: import("@excalidraw/element/types").FractionalIndex | null;
730
+ isDeleted: boolean;
731
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
732
+ frameId: string | null;
733
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
734
+ updated: number;
735
+ link: string | null;
736
+ locked: boolean;
737
+ customData?: Record<string, any>;
738
+ }> & Readonly<{
739
+ type: "line" | "arrow";
740
+ points: readonly LocalPoint[];
741
+ startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
742
+ endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
743
+ startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
744
+ endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
745
+ }> & Readonly<{
746
+ type: "arrow";
747
+ elbowed: boolean;
748
+ }> & {
749
+ isDeleted: false;
750
+ }) | null;
751
+ /**
752
+ * Whether a text element's content is still being authored.
753
+ *
754
+ * Creating a text reverts the tool to selection during pointerdown, so the
755
+ * pointerup that follows looks like an ordinary canvas click and would
756
+ * capture the still-empty element as a history entry of its own. Undo would
757
+ * then rewind only the typing, restoring an invisible, zero-content element
758
+ * (and, for an endpoint label, leaving the arrow bound to it) rather than
759
+ * removing it. The editor's own submit captures the finished text instead,
760
+ * so the whole create-and-type lands in a single entry.
761
+ */
762
+ private isEditingTextContent;
480
763
  private startTextEditing;
481
764
  private startImageCropping;
482
765
  private finishImageCropping;
483
766
  private shouldHandleBrowserCanvasDoubleClick;
484
767
  private handleCanvasDoubleClick;
485
768
  private handleCanvasClick;
769
+ private getImageStatusActionAtPosition;
770
+ private isPointInsideImageStatusOverlay;
486
771
  private getElementLinkAtPosition;
487
772
  private handleElementLinkClick;
488
- private openElementLink;
773
+ /**
774
+ * Applies (or clears) the element-link hover affordances — pointer cursor
775
+ * and tooltip — based on the current `hitLinkElement`. Returns whether a
776
+ * link is being hovered.
777
+ */
778
+ private applyElementLinkHoverAffordance;
779
+ /**
780
+ * On touchscreens (where no hover precedes the tap) re-derives
781
+ * `hitLinkElement`, then opens the hit element link, if any.
782
+ * Returns whether a link click was handled.
783
+ */
784
+ private maybeHandleElementLinkClick;
785
+ /**
786
+ * Restricted pointer handling for the non-interactive editor with links
787
+ * and/or embeds allowed (`interaction.enabled.links` / `.embeds` /
788
+ * `.interactiveContent`) — runs only the element-link & embed concerns
789
+ * (shared with the full pointer handlers above) so they behave like in
790
+ * view mode without the rest of the canvas pointer machinery.
791
+ */
792
+ private handleInteractiveContentPointerMove;
793
+ private handleInteractiveContentPointerUp;
489
794
  /**
490
795
  * finds candidate frame under cursor (when dragging frame children/elements
491
796
  * inside frames)
492
797
  */
493
- private getTopLayerFrameAtSceneCoords;
798
+ getTopLayerFrameAtSceneCoords: (
799
+ /**
800
+ * should be already grid aligned (basically should be what the call site
801
+ * sets the element's coords to, if applicable)
802
+ */
803
+ sceneCoords: {
804
+ x: number;
805
+ y: number;
806
+ }, opts?: {
807
+ /** to exclude selected elements when dragging, etc. */
808
+ excludeElementIds?: AppState["selectedElementIds"];
809
+ currentFrameId?: ExcalidrawElement["frameId"];
810
+ }) => NonDeleted<ExcalidrawFrameLikeElement> | null;
494
811
  private updateFrameToHighlight;
495
812
  private maybeUpdateFrameToHighlightOnPointerMove;
496
- private insertNewElements;
497
- private insertNewElement;
813
+ insertNewElements: (elements: readonly ExcalidrawElement[]) => void;
814
+ insertNewElement: (element: ExcalidrawElement) => void;
498
815
  private handleCanvasPointerMove;
499
816
  private handleEraser;
500
817
  private handleTouchMove;
@@ -509,10 +826,13 @@ declare class App extends React.Component<AppProps, AppState> {
509
826
  * pointerup handlers manually
510
827
  */
511
828
  private maybeCleanupAfterMissingPointerUp;
512
- private handleCanvasZoomUsingZDrag;
513
- private restoreCursorAfterZoomKey;
514
829
  handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
515
830
  private updateGestureOnPointerDown;
831
+ /**
832
+ * Tracks the pointer within the ongoing multi-touch gesture and applies
833
+ * the two-finger pinch zoom/pan, if any.
834
+ */
835
+ private updateMultiTouchGesture;
516
836
  private initialPointerDownState;
517
837
  private handleDraggingScrollBar;
518
838
  private clearSelectionIfNotUsingSelection;
@@ -577,9 +897,13 @@ declare class App extends React.Component<AppProps, AppState> {
577
897
  private maybeHandleCrop;
578
898
  private maybeHandleResize;
579
899
  private getContextMenuItems;
580
- private getImageContextMenuItems;
581
900
  private handleWheel;
582
- private getTextWysiwygSnappedToCenterPosition;
901
+ getTextWysiwygSnappedToCenterPosition(x: number, y: number, appState: AppState, container?: ExcalidrawTextContainer | null): {
902
+ viewportX: number;
903
+ viewportY: number;
904
+ elementCenterX: number;
905
+ elementCenterY: number;
906
+ } | undefined;
583
907
  private savePointer;
584
908
  private resetShouldCacheIgnoreZoomDebounced;
585
909
  private updateDOMRect;
@@ -0,0 +1,55 @@
1
+ import { DrawShapeTrail } from "../drawShapeTrail";
2
+ import type App from "./App";
3
+ import type { PointerDownState } from "../types";
4
+ /**
5
+ * Captures the App state management for the drawShape tool (free-form
6
+ * sketch converted into a recognized excalidraw element). Pointer events
7
+ * are piped here from App.
8
+ *
9
+ * The gesture is committed by `finalize()` — recognize → (maybe upgrade
10
+ * line to arrow) → insert → bind endpoints — which is invoked from within
11
+ * `actionFinalize`, the editor's single finalization funnel. Whatever
12
+ * triggers a finalize (the gesture's own pointerup, a mid-gesture paste
13
+ * switching tools, …), the pending sketch resolves there exactly once.
14
+ */
15
+ export declare class AppDrawShape {
16
+ private app;
17
+ trail: DrawShapeTrail;
18
+ /** a pointerdown started a sketch that `finalize()` hasn't resolved yet */
19
+ private gestureInProgress;
20
+ constructor(app: App);
21
+ stop: () => void;
22
+ hasPendingGesture: () => boolean;
23
+ handlePointerDown: (pointerDownState: PointerDownState) => void;
24
+ /** returns true when the pointermove was consumed by the shape preview */
25
+ handlePointerMove: (pointerCoords: {
26
+ x: number;
27
+ y: number;
28
+ }) => boolean;
29
+ /**
30
+ * Binds both endpoints of a freshly inserted drawShape arrow to the
31
+ * bindable elements they hover, if any.
32
+ *
33
+ * Endpoints bind in "orbit" mode — the arrow starts/ends at the target's
34
+ * outline — even when the stroke was started or released inside the shape
35
+ * (a sketched connector aims at the shape, not at a point inside it). The
36
+ * exception is a sketch contained in a single shape: both ends then bind
37
+ * "inside" and stay where they were drawn, like the interactive
38
+ * inside→inside flow.
39
+ */
40
+ private bindRecognizedArrow;
41
+ /**
42
+ * A sketched line that connects a bindable element with something else —
43
+ * another element or blank canvas — was meant as a connector: upgrade it
44
+ * to an arrow (called before insertion). A line touching no shape, or
45
+ * contained in a single shape (an annotation, not a connector), stays a
46
+ * line.
47
+ */
48
+ private maybeUpgradeLineToArrow;
49
+ /**
50
+ * Commits the pending sketch, if any, and clears the trail. Invoked from
51
+ * within `actionFinalize` — never call directly, execute `actionFinalize`
52
+ * instead so element insertion flows into the action's returned elements.
53
+ */
54
+ finalize: () => void;
55
+ }