@excalidraw/excalidraw 0.18.0-b9d27d3 → 0.18.0-c141960

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 (411) hide show
  1. package/dist/dev/{chunk-QF5FRM6O.js → chunk-AWYOLLYX.js} +49 -26
  2. package/dist/dev/chunk-AWYOLLYX.js.map +7 -0
  3. package/dist/dev/chunk-PMQWN2AA.js +69 -0
  4. package/dist/dev/chunk-PMQWN2AA.js.map +7 -0
  5. package/dist/dev/{chunk-WWDIUJ2Q.js → chunk-SJTAY27F.js} +159 -366
  6. package/dist/dev/chunk-SJTAY27F.js.map +7 -0
  7. package/dist/dev/data/{image-VTYIFRQE.js → image-S2GFZH7W.js} +2 -2
  8. package/dist/dev/index.css +1107 -665
  9. package/dist/dev/index.css.map +3 -3
  10. package/dist/dev/index.js +9974 -7038
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{ar-SA-XORAP2EK.js → ar-SA-USQAA427.js} +299 -142
  13. package/dist/dev/locales/ar-SA-USQAA427.js.map +7 -0
  14. package/dist/dev/locales/{az-AZ-NAUU3Z4Y.js → az-AZ-CVQRXULV.js} +240 -83
  15. package/dist/dev/locales/az-AZ-CVQRXULV.js.map +7 -0
  16. package/dist/dev/locales/{bg-BG-AAABLFCY.js → bg-BG-E4I2JVOQ.js} +228 -71
  17. package/dist/dev/locales/bg-BG-E4I2JVOQ.js.map +7 -0
  18. package/dist/dev/locales/{bn-BD-PM4AC5WG.js → bn-BD-O55ROP2R.js} +208 -51
  19. package/dist/dev/locales/bn-BD-O55ROP2R.js.map +7 -0
  20. package/dist/dev/locales/bn-IN-OL7OUKTP.js +743 -0
  21. package/dist/dev/locales/bn-IN-OL7OUKTP.js.map +7 -0
  22. package/dist/dev/locales/{ca-ES-YNNMFRQX.js → ca-ES-73KY52DM.js} +274 -117
  23. package/dist/dev/locales/ca-ES-73KY52DM.js.map +7 -0
  24. package/dist/dev/locales/{cs-CZ-DGZA5IKG.js → cs-CZ-2YGHPQ24.js} +228 -71
  25. package/dist/dev/locales/cs-CZ-2YGHPQ24.js.map +7 -0
  26. package/dist/dev/locales/{da-DK-N76F4QAJ.js → da-DK-OEIZIPJU.js} +297 -140
  27. package/dist/dev/locales/da-DK-OEIZIPJU.js.map +7 -0
  28. package/dist/dev/locales/de-CH-4GJTW23D.js +743 -0
  29. package/dist/dev/locales/de-CH-4GJTW23D.js.map +7 -0
  30. package/dist/dev/locales/{de-DE-DMRXZ2SZ.js → de-DE-YRH6WMM5.js} +198 -41
  31. package/dist/dev/locales/de-DE-YRH6WMM5.js.map +7 -0
  32. package/dist/dev/locales/{el-GR-HIKPLEXI.js → el-GR-W7S64QNM.js} +273 -116
  33. package/dist/dev/locales/el-GR-W7S64QNM.js.map +7 -0
  34. package/dist/dev/locales/{en-SMAPCEOQ.js → en-ZO6QSABV.js} +4 -2
  35. package/dist/dev/locales/{es-ES-AQYVXC32.js → es-ES-7JEN5PTZ.js} +211 -54
  36. package/dist/dev/locales/es-ES-7JEN5PTZ.js.map +7 -0
  37. package/dist/dev/locales/{eu-ES-3TOEU5DE.js → eu-ES-HQNHU6VR.js} +209 -52
  38. package/dist/dev/locales/eu-ES-HQNHU6VR.js.map +7 -0
  39. package/dist/dev/locales/{fa-IR-527GAKUP.js → fa-IR-IN6XOPA6.js} +285 -128
  40. package/dist/dev/locales/fa-IR-IN6XOPA6.js.map +7 -0
  41. package/dist/dev/locales/{fi-FI-M3WLVDFP.js → fi-FI-5BAAYJDZ.js} +239 -82
  42. package/dist/dev/locales/fi-FI-5BAAYJDZ.js.map +7 -0
  43. package/dist/dev/locales/{fr-FR-YE4VDJFI.js → fr-FR-KCXBY2R4.js} +202 -45
  44. package/dist/dev/locales/fr-FR-KCXBY2R4.js.map +7 -0
  45. package/dist/dev/locales/{gl-ES-KMXUYGUN.js → gl-ES-5OPGWS6N.js} +211 -54
  46. package/dist/dev/locales/gl-ES-5OPGWS6N.js.map +7 -0
  47. package/dist/dev/locales/he-IL-3A6ZWK6L.js +743 -0
  48. package/dist/dev/locales/he-IL-3A6ZWK6L.js.map +7 -0
  49. package/dist/dev/locales/hi-IN-HZTBH6EG.js +743 -0
  50. package/dist/dev/locales/hi-IN-HZTBH6EG.js.map +7 -0
  51. package/dist/dev/locales/{hu-HU-VIYZI3X4.js → hu-HU-52IRZEAZ.js} +237 -80
  52. package/dist/dev/locales/hu-HU-52IRZEAZ.js.map +7 -0
  53. package/dist/dev/locales/{id-ID-22TWZNLA.js → id-ID-W6HBGXTS.js} +244 -87
  54. package/dist/dev/locales/id-ID-W6HBGXTS.js.map +7 -0
  55. package/dist/dev/locales/{it-IT-MDEQ2SG3.js → it-IT-AV75ICYT.js} +201 -44
  56. package/dist/dev/locales/it-IT-AV75ICYT.js.map +7 -0
  57. package/dist/dev/locales/{ja-JP-K2DI4W6B.js → ja-JP-SS4G3ZXF.js} +246 -89
  58. package/dist/dev/locales/ja-JP-SS4G3ZXF.js.map +7 -0
  59. package/dist/dev/locales/{kaa-6BPSNM3R.js → kaa-Y5BBB3IW.js} +201 -44
  60. package/dist/dev/locales/kaa-Y5BBB3IW.js.map +7 -0
  61. package/dist/dev/locales/{kab-KAB-2S7ZURK7.js → kab-KAB-KDVZQXBT.js} +209 -52
  62. package/dist/dev/locales/kab-KAB-KDVZQXBT.js.map +7 -0
  63. package/dist/dev/locales/{kk-KZ-UJPYGRQQ.js → kk-KZ-762YODLJ.js} +174 -17
  64. package/dist/dev/locales/kk-KZ-762YODLJ.js.map +7 -0
  65. package/dist/dev/locales/{km-KH-M5T5JKUE.js → km-KH-K2TE5MIK.js} +197 -40
  66. package/dist/dev/locales/km-KH-K2TE5MIK.js.map +7 -0
  67. package/dist/dev/locales/{ko-KR-RQX37SNF.js → ko-KR-75RUMBCO.js} +217 -60
  68. package/dist/dev/locales/ko-KR-75RUMBCO.js.map +7 -0
  69. package/dist/dev/locales/{ku-TR-5XJDIERL.js → ku-TR-E6DJ6LYM.js} +197 -40
  70. package/dist/dev/locales/ku-TR-E6DJ6LYM.js.map +7 -0
  71. package/dist/dev/locales/{lt-LT-MGUBX6CA.js → lt-LT-BYS5DA45.js} +178 -21
  72. package/dist/dev/locales/lt-LT-BYS5DA45.js.map +7 -0
  73. package/dist/dev/locales/{lv-LV-MD7N5VHD.js → lv-LV-SPQ2VWX3.js} +195 -38
  74. package/dist/dev/locales/lv-LV-SPQ2VWX3.js.map +7 -0
  75. package/dist/dev/locales/{mr-IN-4XWMNGQC.js → mr-IN-2HLK6LUA.js} +203 -46
  76. package/dist/dev/locales/mr-IN-2HLK6LUA.js.map +7 -0
  77. package/dist/dev/locales/{my-MM-O4Z74GN5.js → my-MM-P2LR44WR.js} +180 -23
  78. package/dist/dev/locales/my-MM-P2LR44WR.js.map +7 -0
  79. package/dist/dev/locales/{nb-NO-BMB73KRH.js → nb-NO-7YZHFFVS.js} +219 -62
  80. package/dist/dev/locales/nb-NO-7YZHFFVS.js.map +7 -0
  81. package/dist/dev/locales/{nl-NL-F2257BLQ.js → nl-NL-TF2OVIKN.js} +217 -60
  82. package/dist/dev/locales/nl-NL-TF2OVIKN.js.map +7 -0
  83. package/dist/dev/locales/{nn-NO-NCORG7TS.js → nn-NO-2BWEL2IS.js} +200 -43
  84. package/dist/dev/locales/nn-NO-2BWEL2IS.js.map +7 -0
  85. package/dist/dev/locales/{oc-FR-ATFBDMF6.js → oc-FR-5JYIFGLE.js} +212 -55
  86. package/dist/dev/locales/oc-FR-5JYIFGLE.js.map +7 -0
  87. package/dist/dev/locales/{pa-IN-D2I375G4.js → pa-IN-KBBGER76.js} +189 -32
  88. package/dist/dev/locales/pa-IN-KBBGER76.js.map +7 -0
  89. package/dist/dev/locales/{percentages-YKFLWNK2.js → percentages-2RAYDWNS.js} +2 -2
  90. package/dist/dev/locales/{pl-PL-YJHOWAAW.js → pl-PL-BWZ2X734.js} +213 -56
  91. package/dist/dev/locales/pl-PL-BWZ2X734.js.map +7 -0
  92. package/dist/dev/locales/{pt-BR-APOPYZJ7.js → pt-BR-ERVIQI63.js} +236 -79
  93. package/dist/dev/locales/pt-BR-ERVIQI63.js.map +7 -0
  94. package/dist/dev/locales/pt-PT-ZNJ5NB5S.js +743 -0
  95. package/dist/dev/locales/pt-PT-ZNJ5NB5S.js.map +7 -0
  96. package/dist/dev/locales/{ro-RO-L575VRQA.js → ro-RO-UYNXGUB7.js} +202 -45
  97. package/dist/dev/locales/ro-RO-UYNXGUB7.js.map +7 -0
  98. package/dist/dev/locales/{ru-RU-BLG6HZG5.js → ru-RU-F7LPIMGQ.js} +252 -95
  99. package/dist/dev/locales/ru-RU-F7LPIMGQ.js.map +7 -0
  100. package/dist/dev/locales/si-LK-5GF2DJUH.js +743 -0
  101. package/dist/dev/locales/si-LK-5GF2DJUH.js.map +7 -0
  102. package/dist/dev/locales/{sk-SK-DY6IPO5U.js → sk-SK-H6WE7IJX.js} +199 -42
  103. package/dist/dev/locales/sk-SK-H6WE7IJX.js.map +7 -0
  104. package/dist/dev/locales/{sl-SI-5DZSRA47.js → sl-SI-4PJ6LBI7.js} +196 -39
  105. package/dist/dev/locales/sl-SI-4PJ6LBI7.js.map +7 -0
  106. package/dist/dev/locales/{sv-SE-V32YHALQ.js → sv-SE-E5VQLCRE.js} +201 -44
  107. package/dist/dev/locales/sv-SE-E5VQLCRE.js.map +7 -0
  108. package/dist/dev/locales/{ta-IN-5JRAGQAO.js → ta-IN-2YWIVLKF.js} +256 -99
  109. package/dist/dev/locales/ta-IN-2YWIVLKF.js.map +7 -0
  110. package/dist/dev/locales/{th-TH-55ACRHDJ.js → th-TH-IV7RUTDK.js} +288 -131
  111. package/dist/dev/locales/th-TH-IV7RUTDK.js.map +7 -0
  112. package/dist/dev/locales/{tr-TR-7QYBXDBO.js → tr-TR-LEQWIQH7.js} +256 -99
  113. package/dist/dev/locales/tr-TR-LEQWIQH7.js.map +7 -0
  114. package/dist/dev/locales/{uk-UA-TJS2TMRH.js → uk-UA-DWVOQPTB.js} +228 -71
  115. package/dist/dev/locales/uk-UA-DWVOQPTB.js.map +7 -0
  116. package/dist/dev/locales/{si-LK-KT7GGO6D.js → uz-UZ-CKXQ3QKG.js} +211 -54
  117. package/dist/dev/locales/uz-UZ-CKXQ3QKG.js.map +7 -0
  118. package/dist/dev/locales/vi-VN-3P6DZOGS.js +743 -0
  119. package/dist/dev/locales/vi-VN-3P6DZOGS.js.map +7 -0
  120. package/dist/dev/locales/{zh-CN-4MXUOFTH.js → zh-CN-XXVG53TQ.js} +198 -41
  121. package/dist/dev/locales/zh-CN-XXVG53TQ.js.map +7 -0
  122. package/dist/dev/locales/{zh-HK-RBTGIU3U.js → zh-HK-JCHGKEUE.js} +174 -17
  123. package/dist/dev/locales/zh-HK-JCHGKEUE.js.map +7 -0
  124. package/dist/dev/locales/{zh-TW-U5VF4CCU.js → zh-TW-ARVT7RZU.js} +203 -46
  125. package/dist/dev/locales/zh-TW-ARVT7RZU.js.map +7 -0
  126. package/dist/prod/chunk-KRJFZ5JQ.js +1 -0
  127. package/dist/prod/chunk-N7QNUCIG.js +12 -0
  128. package/dist/prod/chunk-XJNFOLHK.js +4 -0
  129. package/dist/prod/data/{image-YQ6UXXDA.js → image-SMWA6JLH.js} +1 -1
  130. package/dist/prod/index.css +1 -1
  131. package/dist/prod/index.js +23 -23
  132. package/dist/prod/locales/ar-SA-F62BVQMB.js +8 -0
  133. package/dist/prod/locales/az-AZ-7PGSKYOB.js +1 -0
  134. package/dist/prod/locales/bg-BG-AAEXMUQ4.js +5 -0
  135. package/dist/prod/locales/bn-BD-ONOFQYIQ.js +3 -0
  136. package/dist/prod/locales/bn-IN-YT3I2M3F.js +3 -0
  137. package/dist/prod/locales/ca-ES-GG4YH2FN.js +8 -0
  138. package/dist/prod/locales/cs-CZ-IS5VTBOP.js +7 -0
  139. package/dist/prod/locales/da-DK-VPQ2KWAY.js +2 -0
  140. package/dist/prod/locales/de-CH-G4Y2G6IS.js +7 -0
  141. package/dist/prod/locales/de-DE-RAT2LIDI.js +7 -0
  142. package/dist/prod/locales/el-GR-DNJB2AZO.js +7 -0
  143. package/dist/prod/locales/en-FOCNVEEU.js +1 -0
  144. package/dist/prod/locales/es-ES-IMTENLBU.js +7 -0
  145. package/dist/prod/locales/eu-ES-XLOS36YS.js +7 -0
  146. package/dist/prod/locales/fa-IR-J6Z2YOGX.js +9 -0
  147. package/dist/prod/locales/fi-FI-B2IQ7SBP.js +6 -0
  148. package/dist/prod/locales/fr-FR-N5BRDCMI.js +12 -0
  149. package/dist/prod/locales/gl-ES-BOYALFRN.js +6 -0
  150. package/dist/prod/locales/he-IL-H7M7HGY5.js +8 -0
  151. package/dist/prod/locales/hi-IN-7AB5CA2Q.js +3 -0
  152. package/dist/prod/locales/hu-HU-ZZM7UJLP.js +3 -0
  153. package/dist/prod/locales/id-ID-RZ7JNCXA.js +8 -0
  154. package/dist/prod/locales/it-IT-ZX7HN56D.js +8 -0
  155. package/dist/prod/locales/ja-JP-NBNBUHIR.js +7 -0
  156. package/dist/prod/locales/kaa-QWYSGEM7.js +1 -0
  157. package/dist/prod/locales/kab-KAB-Q3HBKQ5I.js +4 -0
  158. package/dist/prod/locales/kk-KZ-HF2NTCRX.js +1 -0
  159. package/dist/prod/locales/km-KH-CN6HHF5U.js +7 -0
  160. package/dist/prod/locales/ko-KR-SJQMUXM7.js +5 -0
  161. package/dist/prod/locales/ku-TR-VM4BHTPC.js +6 -0
  162. package/dist/prod/locales/lt-LT-QIWZQ7AG.js +3 -0
  163. package/dist/prod/locales/lv-LV-YQFCB4WZ.js +4 -0
  164. package/dist/prod/locales/mr-IN-GR2ZJPSQ.js +9 -0
  165. package/dist/prod/locales/my-MM-M5XJDJQ2.js +1 -0
  166. package/dist/prod/locales/nb-NO-2RU2YF7H.js +8 -0
  167. package/dist/prod/locales/nl-NL-MUHXDQFK.js +7 -0
  168. package/dist/prod/locales/nn-NO-72RCA552.js +4 -0
  169. package/dist/prod/locales/oc-FR-65ITQYQ2.js +4 -0
  170. package/dist/prod/locales/pa-IN-WESENMFH.js +4 -0
  171. package/dist/prod/locales/percentages-OEPNEGCM.js +1 -0
  172. package/dist/prod/locales/pl-PL-7C4NGVUA.js +12 -0
  173. package/dist/prod/locales/pt-BR-QH23C2IX.js +6 -0
  174. package/dist/prod/locales/pt-PT-O5XBATXI.js +8 -0
  175. package/dist/prod/locales/ro-RO-QHCHEGM5.js +12 -0
  176. package/dist/prod/locales/ru-RU-FUMQ2LLB.js +6 -0
  177. package/dist/prod/locales/si-LK-JYUINGNN.js +1 -0
  178. package/dist/prod/locales/sk-SK-R25O52BS.js +7 -0
  179. package/dist/prod/locales/sl-SI-5KPVX4FS.js +6 -0
  180. package/dist/prod/locales/sv-SE-MVMXV6O4.js +8 -0
  181. package/dist/prod/locales/ta-IN-A32FQB4D.js +6 -0
  182. package/dist/prod/locales/th-TH-CXMWNVBY.js +1 -0
  183. package/dist/prod/locales/tr-TR-YHFI3W2D.js +4 -0
  184. package/dist/prod/locales/uk-UA-UTJIIKT5.js +6 -0
  185. package/dist/prod/locales/uz-UZ-H4EGTR7D.js +1 -0
  186. package/dist/prod/locales/vi-VN-XBV2ESZM.js +7 -0
  187. package/dist/prod/locales/zh-CN-CKCJ4HAO.js +11 -0
  188. package/dist/prod/locales/zh-HK-ISASRRMF.js +1 -0
  189. package/dist/prod/locales/zh-TW-KYRW5V3R.js +9 -0
  190. package/dist/types/common/src/constants.d.ts +9 -13
  191. package/dist/types/common/src/editorInterface.d.ts +34 -0
  192. package/dist/types/common/src/index.d.ts +2 -0
  193. package/dist/types/common/src/utils.d.ts +9 -3
  194. package/dist/types/common/src/visualdebug.d.ts +41 -0
  195. package/dist/types/element/src/binding.d.ts +55 -43
  196. package/dist/types/element/src/collision.d.ts +6 -2
  197. package/dist/types/element/src/index.d.ts +0 -3
  198. package/dist/types/element/src/linearElementEditor.d.ts +15 -18
  199. package/dist/types/element/src/renderElement.d.ts +5 -2
  200. package/dist/types/element/src/resizeTest.d.ts +5 -4
  201. package/dist/types/element/src/transformHandles.d.ts +5 -4
  202. package/dist/types/element/src/typeChecks.d.ts +2 -3
  203. package/dist/types/element/src/types.d.ts +7 -11
  204. package/dist/types/element/src/utils.d.ts +2 -1
  205. package/dist/types/element/src/zindex.d.ts +7 -1
  206. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +34 -13
  207. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  208. package/dist/types/excalidraw/actions/actionBoundText.d.ts +25 -11
  209. package/dist/types/excalidraw/actions/actionCanvas.d.ts +152 -275
  210. package/dist/types/excalidraw/actions/actionClipboard.d.ts +46 -773
  211. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -5
  212. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +42 -23
  213. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  214. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  215. package/dist/types/excalidraw/actions/actionElementLink.d.ts +11 -6
  216. package/dist/types/excalidraw/actions/actionElementLock.d.ts +23 -9
  217. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +12 -5
  218. package/dist/types/excalidraw/actions/actionExport.d.ts +68 -943
  219. package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -393
  220. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -2
  221. package/dist/types/excalidraw/actions/actionFrame.d.ts +50 -24
  222. package/dist/types/excalidraw/actions/actionGroup.d.ts +24 -10
  223. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +22 -19
  224. package/dist/types/excalidraw/actions/actionLink.d.ts +9 -2
  225. package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -371
  226. package/dist/types/excalidraw/actions/actionNavigate.d.ts +21 -359
  227. package/dist/types/excalidraw/actions/actionProperties.d.ts +87 -2403
  228. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +12 -5
  229. package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -6
  230. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  231. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +11 -4
  232. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +11 -4
  233. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -5
  234. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  235. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +11 -4
  236. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +11 -4
  237. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -5
  238. package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -2
  239. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  240. package/dist/types/excalidraw/actions/manager.d.ts +1 -1
  241. package/dist/types/excalidraw/actions/register.d.ts +1 -1
  242. package/dist/types/excalidraw/actions/types.d.ts +4 -4
  243. package/dist/types/excalidraw/appState.d.ts +9 -4
  244. package/dist/types/excalidraw/clipboard.d.ts +2 -0
  245. package/dist/types/excalidraw/components/Actions.d.ts +21 -4
  246. package/dist/types/excalidraw/components/App.d.ts +26 -19
  247. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  248. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
  249. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  250. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  251. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -2
  252. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  253. package/dist/types/excalidraw/components/FilledButton.d.ts +1 -1
  254. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  255. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  256. package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
  257. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  258. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  259. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  260. package/dist/types/excalidraw/components/LinkButton.d.ts +4 -0
  261. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  262. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  263. package/dist/types/excalidraw/components/Popover.d.ts +2 -1
  264. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  265. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  266. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  267. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  268. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  269. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +6 -3
  270. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  271. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  272. package/dist/types/excalidraw/components/icons.d.ts +10 -0
  273. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +13 -1
  274. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
  275. package/dist/types/excalidraw/data/blob.d.ts +2 -2
  276. package/dist/types/excalidraw/data/restore.d.ts +3 -3
  277. package/dist/types/excalidraw/data/types.d.ts +4 -1
  278. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  279. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
  280. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  281. package/dist/types/excalidraw/index.d.ts +2 -3
  282. package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
  283. package/dist/types/excalidraw/renderer/helpers.d.ts +1 -5
  284. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +5 -13
  285. package/dist/types/excalidraw/scene/types.d.ts +15 -3
  286. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  287. package/dist/types/excalidraw/types.d.ts +31 -21
  288. package/dist/types/math/src/segment.d.ts +1 -0
  289. package/package.json +5 -5
  290. package/dist/dev/chunk-MFAYKRVR.js +0 -66
  291. package/dist/dev/chunk-MFAYKRVR.js.map +0 -7
  292. package/dist/dev/chunk-QF5FRM6O.js.map +0 -7
  293. package/dist/dev/chunk-WWDIUJ2Q.js.map +0 -7
  294. package/dist/dev/locales/ar-SA-XORAP2EK.js.map +0 -7
  295. package/dist/dev/locales/az-AZ-NAUU3Z4Y.js.map +0 -7
  296. package/dist/dev/locales/bg-BG-AAABLFCY.js.map +0 -7
  297. package/dist/dev/locales/bn-BD-PM4AC5WG.js.map +0 -7
  298. package/dist/dev/locales/ca-ES-YNNMFRQX.js.map +0 -7
  299. package/dist/dev/locales/cs-CZ-DGZA5IKG.js.map +0 -7
  300. package/dist/dev/locales/da-DK-N76F4QAJ.js.map +0 -7
  301. package/dist/dev/locales/de-DE-DMRXZ2SZ.js.map +0 -7
  302. package/dist/dev/locales/el-GR-HIKPLEXI.js.map +0 -7
  303. package/dist/dev/locales/es-ES-AQYVXC32.js.map +0 -7
  304. package/dist/dev/locales/eu-ES-3TOEU5DE.js.map +0 -7
  305. package/dist/dev/locales/fa-IR-527GAKUP.js.map +0 -7
  306. package/dist/dev/locales/fi-FI-M3WLVDFP.js.map +0 -7
  307. package/dist/dev/locales/fr-FR-YE4VDJFI.js.map +0 -7
  308. package/dist/dev/locales/gl-ES-KMXUYGUN.js.map +0 -7
  309. package/dist/dev/locales/he-IL-4MU5N22B.js +0 -586
  310. package/dist/dev/locales/he-IL-4MU5N22B.js.map +0 -7
  311. package/dist/dev/locales/hi-IN-ZHZNZWFC.js +0 -586
  312. package/dist/dev/locales/hi-IN-ZHZNZWFC.js.map +0 -7
  313. package/dist/dev/locales/hu-HU-VIYZI3X4.js.map +0 -7
  314. package/dist/dev/locales/id-ID-22TWZNLA.js.map +0 -7
  315. package/dist/dev/locales/it-IT-MDEQ2SG3.js.map +0 -7
  316. package/dist/dev/locales/ja-JP-K2DI4W6B.js.map +0 -7
  317. package/dist/dev/locales/kaa-6BPSNM3R.js.map +0 -7
  318. package/dist/dev/locales/kab-KAB-2S7ZURK7.js.map +0 -7
  319. package/dist/dev/locales/kk-KZ-UJPYGRQQ.js.map +0 -7
  320. package/dist/dev/locales/km-KH-M5T5JKUE.js.map +0 -7
  321. package/dist/dev/locales/ko-KR-RQX37SNF.js.map +0 -7
  322. package/dist/dev/locales/ku-TR-5XJDIERL.js.map +0 -7
  323. package/dist/dev/locales/lt-LT-MGUBX6CA.js.map +0 -7
  324. package/dist/dev/locales/lv-LV-MD7N5VHD.js.map +0 -7
  325. package/dist/dev/locales/mr-IN-4XWMNGQC.js.map +0 -7
  326. package/dist/dev/locales/my-MM-O4Z74GN5.js.map +0 -7
  327. package/dist/dev/locales/nb-NO-BMB73KRH.js.map +0 -7
  328. package/dist/dev/locales/nl-NL-F2257BLQ.js.map +0 -7
  329. package/dist/dev/locales/nn-NO-NCORG7TS.js.map +0 -7
  330. package/dist/dev/locales/oc-FR-ATFBDMF6.js.map +0 -7
  331. package/dist/dev/locales/pa-IN-D2I375G4.js.map +0 -7
  332. package/dist/dev/locales/pl-PL-YJHOWAAW.js.map +0 -7
  333. package/dist/dev/locales/pt-BR-APOPYZJ7.js.map +0 -7
  334. package/dist/dev/locales/pt-PT-W56WCN7P.js +0 -586
  335. package/dist/dev/locales/pt-PT-W56WCN7P.js.map +0 -7
  336. package/dist/dev/locales/ro-RO-L575VRQA.js.map +0 -7
  337. package/dist/dev/locales/ru-RU-BLG6HZG5.js.map +0 -7
  338. package/dist/dev/locales/si-LK-KT7GGO6D.js.map +0 -7
  339. package/dist/dev/locales/sk-SK-DY6IPO5U.js.map +0 -7
  340. package/dist/dev/locales/sl-SI-5DZSRA47.js.map +0 -7
  341. package/dist/dev/locales/sv-SE-V32YHALQ.js.map +0 -7
  342. package/dist/dev/locales/ta-IN-5JRAGQAO.js.map +0 -7
  343. package/dist/dev/locales/th-TH-55ACRHDJ.js.map +0 -7
  344. package/dist/dev/locales/tr-TR-7QYBXDBO.js.map +0 -7
  345. package/dist/dev/locales/uk-UA-TJS2TMRH.js.map +0 -7
  346. package/dist/dev/locales/vi-VN-Y5CQ2EKQ.js +0 -586
  347. package/dist/dev/locales/vi-VN-Y5CQ2EKQ.js.map +0 -7
  348. package/dist/dev/locales/zh-CN-4MXUOFTH.js.map +0 -7
  349. package/dist/dev/locales/zh-HK-RBTGIU3U.js.map +0 -7
  350. package/dist/dev/locales/zh-TW-U5VF4CCU.js.map +0 -7
  351. package/dist/prod/chunk-I4UNSFV6.js +0 -12
  352. package/dist/prod/chunk-VTWWEYSQ.js +0 -4
  353. package/dist/prod/chunk-Z3N5DIM6.js +0 -1
  354. package/dist/prod/locales/ar-SA-G6X2FPQ2.js +0 -10
  355. package/dist/prod/locales/az-AZ-76LH7QW2.js +0 -1
  356. package/dist/prod/locales/bg-BG-XCXSNQG7.js +0 -5
  357. package/dist/prod/locales/bn-BD-2XOGV67Q.js +0 -5
  358. package/dist/prod/locales/ca-ES-6MX7JW3Y.js +0 -8
  359. package/dist/prod/locales/cs-CZ-2BRQDIVT.js +0 -11
  360. package/dist/prod/locales/da-DK-5WZEPLOC.js +0 -5
  361. package/dist/prod/locales/de-DE-XR44H4JA.js +0 -8
  362. package/dist/prod/locales/el-GR-BZB4AONW.js +0 -10
  363. package/dist/prod/locales/en-TYY6KWIJ.js +0 -1
  364. package/dist/prod/locales/es-ES-U4NZUMDT.js +0 -9
  365. package/dist/prod/locales/eu-ES-A7QVB2H4.js +0 -11
  366. package/dist/prod/locales/fa-IR-HGAKTJCU.js +0 -8
  367. package/dist/prod/locales/fi-FI-Z5N7JZ37.js +0 -6
  368. package/dist/prod/locales/fr-FR-RHASNOE6.js +0 -9
  369. package/dist/prod/locales/gl-ES-HMX3MZ6V.js +0 -10
  370. package/dist/prod/locales/he-IL-6SHJWFNN.js +0 -10
  371. package/dist/prod/locales/hi-IN-IWLTKZ5I.js +0 -4
  372. package/dist/prod/locales/hu-HU-A5ZG7DT2.js +0 -7
  373. package/dist/prod/locales/id-ID-SAP4L64H.js +0 -10
  374. package/dist/prod/locales/it-IT-JPQ66NNP.js +0 -11
  375. package/dist/prod/locales/ja-JP-DBVTYXUO.js +0 -8
  376. package/dist/prod/locales/kaa-6HZHGXH3.js +0 -1
  377. package/dist/prod/locales/kab-KAB-ZGHBKWFO.js +0 -8
  378. package/dist/prod/locales/kk-KZ-P5N5QNE5.js +0 -1
  379. package/dist/prod/locales/km-KH-HSX4SM5Z.js +0 -11
  380. package/dist/prod/locales/ko-KR-MTYHY66A.js +0 -9
  381. package/dist/prod/locales/ku-TR-6OUDTVRD.js +0 -9
  382. package/dist/prod/locales/lt-LT-XHIRWOB4.js +0 -3
  383. package/dist/prod/locales/lv-LV-5QDEKY6T.js +0 -7
  384. package/dist/prod/locales/mr-IN-CRQNXWMA.js +0 -13
  385. package/dist/prod/locales/my-MM-5M5IBNSE.js +0 -1
  386. package/dist/prod/locales/nb-NO-T6EIAALU.js +0 -10
  387. package/dist/prod/locales/nl-NL-IS3SIHDZ.js +0 -8
  388. package/dist/prod/locales/nn-NO-6E72VCQL.js +0 -8
  389. package/dist/prod/locales/oc-FR-POXYY2M6.js +0 -8
  390. package/dist/prod/locales/pa-IN-N4M65BXN.js +0 -4
  391. package/dist/prod/locales/percentages-BXMCSKIN.js +0 -1
  392. package/dist/prod/locales/pl-PL-T2D74RX3.js +0 -9
  393. package/dist/prod/locales/pt-BR-5N22H2LF.js +0 -9
  394. package/dist/prod/locales/pt-PT-UZXXM6DQ.js +0 -9
  395. package/dist/prod/locales/ro-RO-JPDTUUEW.js +0 -11
  396. package/dist/prod/locales/ru-RU-B4JR7IUQ.js +0 -9
  397. package/dist/prod/locales/si-LK-N5RQ5JYF.js +0 -1
  398. package/dist/prod/locales/sk-SK-C5VTKIMK.js +0 -6
  399. package/dist/prod/locales/sl-SI-NN7IZMDC.js +0 -6
  400. package/dist/prod/locales/sv-SE-XGPEYMSR.js +0 -10
  401. package/dist/prod/locales/ta-IN-2NMHFXQM.js +0 -9
  402. package/dist/prod/locales/th-TH-HPSO5L25.js +0 -2
  403. package/dist/prod/locales/tr-TR-DEFEU3FU.js +0 -7
  404. package/dist/prod/locales/uk-UA-QMV73CPH.js +0 -6
  405. package/dist/prod/locales/vi-VN-M7AON7JQ.js +0 -5
  406. package/dist/prod/locales/zh-CN-LNUGB5OW.js +0 -10
  407. package/dist/prod/locales/zh-HK-E62DVLB3.js +0 -1
  408. package/dist/prod/locales/zh-TW-RAJ6MFWO.js +0 -9
  409. /package/dist/dev/data/{image-VTYIFRQE.js.map → image-S2GFZH7W.js.map} +0 -0
  410. /package/dist/dev/locales/{en-SMAPCEOQ.js.map → en-ZO6QSABV.js.map} +0 -0
  411. /package/dist/dev/locales/{percentages-YKFLWNK2.js.map → percentages-2RAYDWNS.js.map} +0 -0
@@ -1,14 +1,5 @@
1
1
  import type { ExcalidrawElement, FontFamilyValues } from "@excalidraw/element/types";
2
2
  import type { AppProps, AppState } from "@excalidraw/excalidraw/types";
3
- export declare const isDarwin: boolean;
4
- export declare const isWindows: boolean;
5
- export declare const isAndroid: boolean;
6
- export declare const isFirefox: boolean;
7
- export declare const isChrome: boolean;
8
- export declare const isSafari: boolean;
9
- export declare const isIOS: boolean;
10
- export declare const isBrave: () => boolean;
11
- export declare const isMobile: boolean;
12
3
  export declare const supportsResizeObserver: boolean;
13
4
  export declare const APP_NAME = "Excalidraw";
14
5
  export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
@@ -87,10 +78,13 @@ export declare const ENV: {
87
78
  PRODUCTION: string;
88
79
  };
89
80
  export declare const CLASSES: {
81
+ SIDEBAR: string;
90
82
  SHAPE_ACTIONS_MENU: string;
91
83
  ZOOM_ACTIONS: string;
92
84
  SEARCH_MENU_INPUT_WRAPPER: string;
93
85
  CONVERT_ELEMENT_TYPE_POPUP: string;
86
+ SHAPE_ACTIONS_THEME_SCOPE: string;
87
+ FRAME_NAME: string;
94
88
  };
95
89
  export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
96
90
  export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
@@ -182,6 +176,7 @@ export declare const STRING_MIME_TYPES: {
182
176
  readonly json: "application/json";
183
177
  readonly excalidraw: "application/vnd.excalidraw+json";
184
178
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
179
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
185
180
  };
186
181
  export declare const MIME_TYPES: {
187
182
  readonly svg: "image/svg+xml";
@@ -201,6 +196,7 @@ export declare const MIME_TYPES: {
201
196
  readonly json: "application/json";
202
197
  readonly excalidraw: "application/vnd.excalidraw+json";
203
198
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
199
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
204
200
  };
205
201
  export declare const ALLOWED_PASTE_MIME_TYPES: readonly ["text/plain", "text/html", ...("image/svg+xml" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/bmp" | "image/x-icon" | "image/avif" | "image/jfif")[]];
206
202
  export declare const EXPORT_IMAGE_TYPES: {
@@ -235,10 +231,6 @@ export declare const URL_HASH_KEYS: {
235
231
  readonly addLibrary: "addLibrary";
236
232
  };
237
233
  export declare const DEFAULT_UI_OPTIONS: AppProps["UIOptions"];
238
- export declare const MQ_MAX_WIDTH_PORTRAIT = 730;
239
- export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
240
- export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
241
- export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
242
234
  export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
243
235
  export declare const EXPORT_SCALES: number[];
244
236
  export declare const DEFAULT_EXPORT_PADDING = 10;
@@ -351,3 +343,7 @@ export declare enum UserIdleState {
351
343
  */
352
344
  export declare const LINE_POLYGON_POINT_MERGE_DISTANCE = 20;
353
345
  export declare const DOUBLE_TAP_POSITION_THRESHOLD = 35;
346
+ export declare const BIND_MODE_TIMEOUT = 700;
347
+ export declare const MOBILE_ACTION_BUTTON_BG: {
348
+ readonly background: "var(--mobile-action-button-bg)";
349
+ };
@@ -0,0 +1,34 @@
1
+ export type StylesPanelMode = "compact" | "full" | "mobile";
2
+ export type EditorInterface = Readonly<{
3
+ formFactor: "phone" | "tablet" | "desktop";
4
+ desktopUIMode: "compact" | "full";
5
+ userAgent: Readonly<{
6
+ isMobileDevice: boolean;
7
+ platform: "ios" | "android" | "other" | "unknown";
8
+ }>;
9
+ isTouchScreen: boolean;
10
+ canFitSidebar: boolean;
11
+ isLandscape: boolean;
12
+ }>;
13
+ export declare const MQ_MAX_MOBILE = 599;
14
+ export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
15
+ export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
16
+ export declare const MQ_MIN_TABLET: number;
17
+ export declare const MQ_MAX_TABLET = 1400;
18
+ export declare const MQ_MIN_WIDTH_DESKTOP = 1440;
19
+ export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
20
+ export declare const isDarwin: boolean;
21
+ export declare const isWindows: boolean;
22
+ export declare const isAndroid: boolean;
23
+ export declare const isFirefox: boolean;
24
+ export declare const isChrome: boolean;
25
+ export declare const isSafari: boolean;
26
+ export declare const isIOS: boolean;
27
+ export declare const isBrave: () => boolean;
28
+ export declare const isMobileBreakpoint: (width: number, height: number) => boolean;
29
+ export declare const isTabletBreakpoint: (editorWidth: number, editorHeight: number) => boolean;
30
+ export declare const getFormFactor: (editorWidth: number, editorHeight: number) => EditorInterface["formFactor"];
31
+ export declare const deriveStylesPanelMode: (editorInterface: EditorInterface) => StylesPanelMode;
32
+ export declare const createUserAgentDescriptor: (userAgentString: string) => EditorInterface["userAgent"];
33
+ export declare const loadDesktopUIModePreference: () => "compact" | "full" | null;
34
+ export declare const setDesktopUIMode: (mode: EditorInterface["desktopUIMode"]) => "compact" | "full" | undefined;
@@ -10,3 +10,5 @@ export * from "./random";
10
10
  export * from "./url";
11
11
  export * from "./utils";
12
12
  export * from "./emitter";
13
+ export * from "./visualdebug";
14
+ export * from "./editorInterface";
@@ -1,4 +1,4 @@
1
- import type { ExcalidrawBindableElement, FontFamilyValues, FontString } from "@excalidraw/element/types";
1
+ import type { FontFamilyValues, FontString } from "@excalidraw/element/types";
2
2
  import type { ActiveTool, AppState, ToolType, UnsubscribeCallback, Zoom } from "@excalidraw/excalidraw/types";
3
3
  import type { MaybePromise } from "./utility-types";
4
4
  import type { EVENT } from "./constants";
@@ -17,6 +17,8 @@ export declare const getFontString: ({ fontSize, fontFamily, }: {
17
17
  fontSize: number;
18
18
  fontFamily: FontFamilyValues;
19
19
  }) => FontString;
20
+ /** executes callback in the frame that's after the current one */
21
+ export declare const nextAnimationFrame: (cb: () => any) => Promise<void>;
20
22
  export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeout: number) => {
21
23
  (...args: T): void;
22
24
  flush(): void;
@@ -80,6 +82,7 @@ export declare const chunk: <T extends unknown>(array: readonly T[], size: numbe
80
82
  export declare const selectNode: (node: Element) => void;
81
83
  export declare const removeSelection: () => void;
82
84
  export declare const distance: (x: number, y: number) => number;
85
+ export declare const isSelectionLikeTool: (type: ToolType | "custom") => boolean;
83
86
  export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: (({
84
87
  type: ToolType;
85
88
  } | {
@@ -94,7 +97,6 @@ export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">,
94
97
  export declare const isFullScreen: () => boolean;
95
98
  export declare const allowFullScreen: () => Promise<void>;
96
99
  export declare const exitFullScreen: () => Promise<void>;
97
- export declare const getShortcutKey: (shortcut: string) => string;
98
100
  export declare const viewportCoordsToSceneCoords: ({ clientX, clientY }: {
99
101
  clientX: number;
100
102
  clientY: number;
@@ -140,7 +142,6 @@ export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, in
140
142
  /** returns the first non-null mapped value */
141
143
  export declare const mapFind: <T, K>(collection: readonly T[], iteratee: (value: T, index: number) => K | null | undefined) => K | undefined;
142
144
  export declare const isTransparent: (color: string) => boolean;
143
- export declare const isBindingFallthroughEnabled: (el: ExcalidrawBindableElement) => boolean;
144
145
  export type ResolvablePromise<T> = Promise<T> & {
145
146
  resolve: [T] extends [undefined] ? (value?: MaybePromise<Awaited<T>>) => void : (value: MaybePromise<Awaited<T>>) => void;
146
147
  reject: (error: Error) => void;
@@ -264,4 +265,9 @@ export declare const castArray: <T>(value: T | T[]) => T[];
264
265
  export declare const isReadonlyArray: (value?: any) => value is readonly any[];
265
266
  export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
266
267
  export declare const reduceToCommonValue: <T, R = T>(collection: ReadonlySet<T> | readonly T[], getValue?: ((item: T) => R) | undefined) => R | null;
268
+ type FEATURE_FLAGS = {
269
+ COMPLEX_BINDINGS: boolean;
270
+ };
271
+ export declare const getFeatureFlag: <F extends "COMPLEX_BINDINGS">(flag: F) => FEATURE_FLAGS[F];
272
+ export declare const setFeatureFlag: <F extends "COMPLEX_BINDINGS">(flag: F, value: FEATURE_FLAGS[F]) => void;
267
273
  export {};
@@ -0,0 +1,41 @@
1
+ import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
2
+ import type { Curve } from "@excalidraw/math";
3
+ import type { LineSegment } from "@excalidraw/utils";
4
+ import type { Bounds } from "@excalidraw/element";
5
+ declare global {
6
+ interface Window {
7
+ visualDebug?: {
8
+ data: DebugElement[][];
9
+ currentFrame?: number;
10
+ };
11
+ }
12
+ }
13
+ export type DebugElement = {
14
+ color: string;
15
+ data: LineSegment<GlobalPoint> | Curve<GlobalPoint>;
16
+ permanent: boolean;
17
+ };
18
+ export declare const debugDrawCubicBezier: (c: Curve<GlobalPoint>, opts?: {
19
+ color?: string;
20
+ permanent?: boolean;
21
+ }) => void;
22
+ export declare const debugDrawLine: (segment: LineSegment<GlobalPoint> | LineSegment<GlobalPoint>[], opts?: {
23
+ color?: string;
24
+ permanent?: boolean;
25
+ }) => void;
26
+ export declare const debugDrawPoint: (p: GlobalPoint, opts?: {
27
+ color?: string;
28
+ permanent?: boolean;
29
+ fuzzy?: boolean;
30
+ }) => void;
31
+ export declare const debugDrawBounds: (box: Bounds | Bounds[], opts?: {
32
+ color?: string;
33
+ permanent?: boolean;
34
+ }) => void;
35
+ export declare const debugDrawPoints: ({ x, y, points, }: {
36
+ x: number;
37
+ y: number;
38
+ points: readonly LocalPoint[];
39
+ }, options?: any) => void;
40
+ export declare const debugCloseFrame: () => void;
41
+ export declare const debugClear: () => void;
@@ -1,68 +1,80 @@
1
1
  import { type GlobalPoint } from "@excalidraw/math";
2
- import type { LocalPoint } from "@excalidraw/math";
2
+ import type { LineSegment, LocalPoint } from "@excalidraw/math";
3
3
  import type { AppState } from "@excalidraw/excalidraw/types";
4
4
  import { type Heading } from "./heading";
5
5
  import type { Scene } from "./Scene";
6
6
  import type { Bounds } from "./bounds";
7
7
  import type { ElementUpdate } from "./mutateElement";
8
- import type { ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, ExcalidrawLinearElement, NonDeletedExcalidrawElement, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, FixedPoint } from "./types";
9
- export type SuggestedBinding = NonDeleted<ExcalidrawBindableElement> | SuggestedPointBinding;
10
- export type SuggestedPointBinding = [
11
- NonDeleted<ExcalidrawLinearElement>,
12
- "start" | "end" | "both",
13
- NonDeleted<ExcalidrawBindableElement>
14
- ];
8
+ import type { BindMode, ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElbowArrowElement, ExcalidrawElement, FixedPoint, FixedPointBinding, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered, PointsPositionUpdates } from "./types";
9
+ export type BindingStrategy = {
10
+ mode: BindMode;
11
+ element: NonDeleted<ExcalidrawBindableElement>;
12
+ focusPoint: GlobalPoint;
13
+ } | {
14
+ mode: null;
15
+ element?: undefined;
16
+ focusPoint?: undefined;
17
+ } | {
18
+ mode: undefined;
19
+ element?: undefined;
20
+ focusPoint?: undefined;
21
+ };
22
+ /**
23
+ * gaps exclude element strokeWidth
24
+ *
25
+ * IMPORTANT: currently must be > 0 (this also applies to the computed gap)
26
+ */
27
+ export declare const BASE_BINDING_GAP = 10;
28
+ export declare const BASE_BINDING_GAP_ELBOW = 5;
29
+ export declare const getBindingGap: (bindTarget: ExcalidrawBindableElement, opts: Pick<ExcalidrawArrowElement, "elbowed">) => number;
30
+ export declare const maxBindingDistance_simple: (zoom?: AppState["zoom"]) => number;
15
31
  export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<HTMLElement>) => boolean;
16
32
  export declare const isBindingEnabled: (appState: AppState) => boolean;
17
- export declare const FIXED_BINDING_DISTANCE = 5;
18
- export declare const BINDING_HIGHLIGHT_THICKNESS = 10;
19
- export declare const bindOrUnbindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, startBindingElement: ExcalidrawBindableElement | null | "keep", endBindingElement: ExcalidrawBindableElement | null | "keep", scene: Scene) => void;
20
- export declare const bindOrUnbindLinearElements: (selectedElements: NonDeleted<ExcalidrawLinearElement>[], isBindingEnabled: boolean, draggingPoints: readonly number[] | null, scene: Scene, zoom?: AppState["zoom"]) => void;
21
- export declare const getSuggestedBindingsForArrows: (selectedElements: NonDeleted<ExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, zoom: AppState["zoom"]) => SuggestedBinding[];
22
- export declare const maybeSuggestBindingsForLinearElementAtCoords: (linearElement: NonDeleted<ExcalidrawLinearElement>, pointerCoords: {
23
- x: number;
24
- y: number;
25
- }[], scene: Scene, zoom: AppState["zoom"], oppositeBindingBoundElement?: ExcalidrawBindableElement | null) => ExcalidrawBindableElement[];
26
- export declare const maybeBindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, appState: AppState, pointerCoords: {
27
- x: number;
28
- y: number;
29
- }, scene: Scene) => void;
30
- export declare const bindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", scene: Scene) => void;
31
- export declare const isLinearElementSimpleAndAlreadyBound: (linearElement: NonDeleted<ExcalidrawLinearElement>, alreadyBoundToId: ExcalidrawBindableElement["id"] | undefined, bindableElement: ExcalidrawBindableElement) => boolean;
32
- export declare const getHoveredElementForBinding: (pointerCoords: {
33
- x: number;
34
- y: number;
35
- }, elements: readonly NonDeletedExcalidrawElement[], elementsMap: NonDeletedSceneElementsMap, zoom?: AppState["zoom"], fullShape?: boolean, considerAllElements?: boolean) => NonDeleted<ExcalidrawBindableElement> | null;
33
+ export declare const bindOrUnbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, draggingPoints: PointsPositionUpdates, scene: Scene, appState: AppState, opts?: {
34
+ newArrow?: boolean;
35
+ altKey?: boolean;
36
+ initialBinding?: boolean;
37
+ }) => {
38
+ start: BindingStrategy;
39
+ end: BindingStrategy;
40
+ };
41
+ export declare const getBindingStrategyForDraggingBindingElementEndpoints: (arrow: NonDeleted<ExcalidrawArrowElement>, draggingPoints: PointsPositionUpdates, elementsMap: NonDeletedSceneElementsMap, elements: readonly Ordered<NonDeletedExcalidrawElement>[], appState: AppState, opts?: {
42
+ newArrow?: boolean;
43
+ shiftKey?: boolean;
44
+ altKey?: boolean;
45
+ finalize?: boolean;
46
+ initialBinding?: boolean;
47
+ zoom?: AppState["zoom"];
48
+ }) => {
49
+ start: BindingStrategy;
50
+ end: BindingStrategy;
51
+ };
52
+ export declare const bindOrUnbindBindingElements: (selectedArrows: NonDeleted<ExcalidrawArrowElement>[], scene: Scene, appState: AppState) => void;
53
+ export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint) => void;
54
+ export declare const unbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "start" | "end", scene: Scene) => ExcalidrawBindableElement["id"] | null;
36
55
  export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
37
56
  simultaneouslyUpdated?: readonly ExcalidrawElement[];
38
- newSize?: {
39
- width: number;
40
- height: number;
41
- };
42
57
  changedElements?: Map<string, ExcalidrawElement>;
43
58
  }) => void;
44
- export declare const updateBindings: (latestElement: ExcalidrawElement, scene: Scene, options?: {
59
+ export declare const updateBindings: (latestElement: ExcalidrawElement, scene: Scene, appState: AppState, options?: {
45
60
  simultaneouslyUpdated?: readonly ExcalidrawElement[];
46
61
  newSize?: {
47
62
  width: number;
48
63
  height: number;
49
64
  };
50
- zoom?: AppState["zoom"];
51
65
  }) => void;
52
66
  export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, origPoint: GlobalPoint, elementsMap: ElementsMap, zoom?: AppState["zoom"]) => Heading;
53
- export declare const bindPointToSnapToElementOutline: (arrow: ExcalidrawElbowArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => GlobalPoint;
54
- export declare const avoidRectangularCorner: (element: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint) => GlobalPoint;
55
- export declare const snapToMid: (element: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint, tolerance?: number) => GlobalPoint;
67
+ export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>) => GlobalPoint;
68
+ export declare const avoidRectangularCorner: (arrowElement: ExcalidrawArrowElement, bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint) => GlobalPoint;
69
+ export declare const updateBoundPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "startBinding" | "endBinding", binding: FixedPointBinding | null | undefined, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>) => LocalPoint | null;
56
70
  export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => {
57
71
  fixedPoint: FixedPoint;
58
72
  };
73
+ export declare const calculateFixedPointForNonElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, focusPoint?: GlobalPoint) => {
74
+ fixedPoint: FixedPoint;
75
+ };
59
76
  export declare const fixDuplicatedBindingsAfterDuplication: (duplicatedElements: ExcalidrawElement[], origIdToDuplicateId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>, duplicateElementsMap: NonDeletedSceneElementsMap) => void;
60
77
  export declare const fixBindingsAfterDeletion: (sceneElements: readonly ExcalidrawElement[], deletedElements: readonly ExcalidrawElement[]) => void;
61
- export declare const bindingBorderTest: (element: NonDeleted<ExcalidrawBindableElement>, { x, y }: {
62
- x: number;
63
- y: number;
64
- }, elementsMap: NonDeletedSceneElementsMap, zoom?: AppState["zoom"], fullShape?: boolean) => boolean;
65
- export declare const maxBindingGap: (element: ExcalidrawElement, elementWidth: number, elementHeight: number, zoom?: AppState["zoom"]) => number;
66
78
  export declare const bindingProperties: Set<BindableProp | BindingProp>;
67
79
  export type BindableProp = "boundElements";
68
80
  export type BindingProp = "frameId" | "containerId" | "startBinding" | "endBinding";
@@ -104,7 +116,7 @@ export declare class BindableElement {
104
116
  */
105
117
  static rebindAffected: (elements: ElementsMap, bindableElement: ExcalidrawElement | undefined, updateElementWith: (affected: ExcalidrawElement, updates: ElementUpdate<ExcalidrawElement>) => void) => void;
106
118
  }
107
- export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio: [number, number], element: ExcalidrawBindableElement, elementsMap: ElementsMap) => GlobalPoint;
108
- export declare const getGlobalFixedPoints: (arrow: ExcalidrawElbowArrowElement, elementsMap: ElementsMap) => [GlobalPoint, GlobalPoint];
119
+ export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio: FixedPoint, element: ExcalidrawBindableElement, elementsMap: ElementsMap) => GlobalPoint;
120
+ export declare const getGlobalFixedPoints: (arrow: ExcalidrawArrowElement, elementsMap: ElementsMap) => [GlobalPoint, GlobalPoint];
109
121
  export declare const getArrowLocalFixedPoints: (arrow: ExcalidrawElbowArrowElement, elementsMap: ElementsMap) => LocalPoint[];
110
122
  export declare const normalizeFixedPoint: <T extends FixedPoint | null>(fixedPoint: T) => T extends null ? null : FixedPoint;
@@ -1,6 +1,6 @@
1
1
  import type { GlobalPoint, LineSegment } from "@excalidraw/math";
2
2
  import type { FrameNameBounds } from "@excalidraw/excalidraw/types";
3
- import type { ElementsMap, ExcalidrawElement } from "./types";
3
+ import type { ElementsMap, ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered } from "./types";
4
4
  export declare const shouldTestInside: (element: ExcalidrawElement) => boolean;
5
5
  export type HitTestArgs = {
6
6
  point: GlobalPoint;
@@ -8,11 +8,14 @@ export type HitTestArgs = {
8
8
  threshold: number;
9
9
  elementsMap: ElementsMap;
10
10
  frameNameBound?: FrameNameBounds | null;
11
+ overrideShouldTestInside?: boolean;
11
12
  };
12
- export declare const hitElementItself: ({ point, element, threshold, elementsMap, frameNameBound, }: HitTestArgs) => boolean;
13
+ export declare const hitElementItself: ({ point, element, threshold, elementsMap, frameNameBound, overrideShouldTestInside, }: HitTestArgs) => boolean;
13
14
  export declare const hitElementBoundingBox: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap, tolerance?: number) => boolean;
14
15
  export declare const hitElementBoundingBoxOnly: (hitArgs: HitTestArgs, elementsMap: ElementsMap) => boolean;
15
16
  export declare const hitElementBoundText: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap) => boolean;
17
+ export declare const getAllHoveredElementAtPoint: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, toleranceFn?: ((element: ExcalidrawBindableElement) => number) | undefined) => NonDeleted<ExcalidrawBindableElement>[];
18
+ export declare const getHoveredElementForBinding: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, toleranceFn?: ((element: ExcalidrawBindableElement) => number) | undefined) => NonDeleted<ExcalidrawBindableElement> | null;
16
19
  /**
17
20
  * Intersect a line with an element for binding test
18
21
  *
@@ -30,3 +33,4 @@ export declare const intersectElementWithLineSegment: (element: ExcalidrawElemen
30
33
  * @returns
31
34
  */
32
35
  export declare const isPointInElement: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap) => boolean;
36
+ export declare const isBindableElementInsideOtherBindable: (innerElement: ExcalidrawBindableElement, outerElement: ExcalidrawBindableElement, elementsMap: ElementsMap) => boolean;
@@ -11,9 +11,6 @@ export declare const hashString: (s: string) => number;
11
11
  export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
12
12
  export declare const getNonDeletedElements: <T extends ExcalidrawElement>(elements: readonly T[]) => readonly NonDeleted<T>[];
13
13
  export declare const isNonDeletedElement: <T extends ExcalidrawElement>(element: T) => element is NonDeleted<T>;
14
- export declare const clearElementsForDatabase: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
15
- export declare const clearElementsForExport: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
16
- export declare const clearElementsForLocalStorage: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
17
14
  export * from "./align";
18
15
  export * from "./binding";
19
16
  export * from "./bounds";
@@ -4,42 +4,40 @@ import { type Store } from "@excalidraw/element";
4
4
  import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "@excalidraw/excalidraw/types";
5
5
  import type { Scene } from "./Scene";
6
6
  import type { Bounds } from "./bounds";
7
- import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, PointsPositionUpdates } from "./types";
7
+ import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, FixedPointBinding, ExcalidrawElbowArrowElement, PointsPositionUpdates } from "./types";
8
8
  export declare class LinearElementEditor {
9
9
  readonly elementId: ExcalidrawElement["id"] & {
10
10
  _brand: "excalidrawLinearElementId";
11
11
  };
12
12
  /** indices */
13
13
  readonly selectedPointsIndices: readonly number[] | null;
14
- readonly pointerDownState: Readonly<{
14
+ readonly initialState: Readonly<{
15
15
  prevSelectedPointsIndices: readonly number[] | null;
16
16
  /** index */
17
17
  lastClickedPoint: number;
18
- lastClickedIsEndPoint: boolean;
19
- origin: Readonly<{
20
- x: number;
21
- y: number;
22
- }> | null;
18
+ origin: Readonly<GlobalPoint> | null;
23
19
  segmentMidpoint: {
24
20
  value: GlobalPoint | null;
25
21
  index: number | null;
26
22
  added: boolean;
27
23
  };
24
+ arrowStartIsInside: boolean;
25
+ altFocusPoint: Readonly<GlobalPoint> | null;
28
26
  }>;
29
27
  /** whether you're dragging a point */
30
28
  readonly isDragging: boolean;
31
29
  readonly lastUncommittedPoint: LocalPoint | null;
30
+ readonly lastCommittedPoint: LocalPoint | null;
32
31
  readonly pointerOffset: Readonly<{
33
32
  x: number;
34
33
  y: number;
35
34
  }>;
36
- readonly startBindingElement: ExcalidrawBindableElement | null | "keep";
37
- readonly endBindingElement: ExcalidrawBindableElement | null | "keep";
38
35
  readonly hoverPointIndex: number;
39
36
  readonly segmentMidPointHoveredCoords: GlobalPoint | null;
40
37
  readonly elbowed: boolean;
41
38
  readonly customLineAngle: number | null;
42
39
  readonly isEditing: boolean;
40
+ readonly pointerDownState: never;
43
41
  constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, isEditing?: boolean);
44
42
  static POINT_HANDLE_SIZE: number;
45
43
  /**
@@ -48,10 +46,8 @@ export declare class LinearElementEditor {
48
46
  */
49
47
  static getElement<T extends ExcalidrawLinearElement>(id: InstanceType<typeof LinearElementEditor>["elementId"], elementsMap: ElementsMap): T | null;
50
48
  static handleBoxSelection(event: PointerEvent, appState: AppState, setState: React.Component<any, AppState>["setState"], elementsMap: NonDeletedSceneElementsMap): false | undefined;
51
- /**
52
- * @returns whether point was dragged
53
- */
54
- static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, keyof AppState> | null;
49
+ static handlePointerMove(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, "suggestedBinding" | "selectedLinearElement"> | null;
50
+ static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, "suggestedBinding" | "selectedLinearElement"> | null;
55
51
  static handlePointerUp(event: PointerEvent, editingLinearElement: LinearElementEditor, appState: AppState, scene: Scene): LinearElementEditor;
56
52
  static getEditorMidPoints: (element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, appState: InteractiveCanvasAppState) => (GlobalPoint | null)[];
57
53
  static getSegmentMidpointHitCoords: (linearElementEditor: LinearElementEditor, scenePointer: {
@@ -70,7 +66,7 @@ export declare class LinearElementEditor {
70
66
  linearElementEditor: LinearElementEditor | null;
71
67
  };
72
68
  static arePointsEqual<Point extends LocalPoint | GlobalPoint>(point1: Point | null, point2: Point | null): boolean;
73
- static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties): LinearElementEditor | null;
69
+ static handlePointerMoveInEditMode(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties): LinearElementEditor | null;
74
70
  /** scene coords */
75
71
  static getPointGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, p: LocalPoint, elementsMap: ElementsMap): GlobalPoint;
76
72
  /** scene coords */
@@ -96,12 +92,13 @@ export declare class LinearElementEditor {
96
92
  static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, app: AppClassProperties, pointIndices: readonly number[]): void;
97
93
  static addPoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, addedPoints: LocalPoint[]): void;
98
94
  static movePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, pointUpdates: PointsPositionUpdates, otherUpdates?: {
99
- startBinding?: PointBinding | null;
100
- endBinding?: PointBinding | null;
95
+ startBinding?: FixedPointBinding | null;
96
+ endBinding?: FixedPointBinding | null;
97
+ moveMidPointsWithElement?: boolean | null;
101
98
  }): void;
102
99
  static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
103
100
  static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
104
- pointerDownState: LinearElementEditor["pointerDownState"];
101
+ pointerDownState: LinearElementEditor["initialState"];
105
102
  selectedPointsIndices: LinearElementEditor["selectedPointsIndices"];
106
103
  } | undefined;
107
104
  private static _updatePoints;
@@ -112,6 +109,6 @@ export declare class LinearElementEditor {
112
109
  };
113
110
  static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, elementBounds: Bounds, boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
114
111
  static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, includeBoundText?: boolean) => [number, number, number, number, number, number];
115
- static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): LinearElementEditor;
112
+ static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): Pick<LinearElementEditor, "segmentMidPointHoveredCoords" | "initialState">;
116
113
  static deleteFixedSegment(element: ExcalidrawElbowArrowElement, scene: Scene, index: number): void;
117
114
  }
@@ -1,6 +1,7 @@
1
+ import { type GlobalPoint } from "@excalidraw/math";
1
2
  import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
2
3
  import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
3
- import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "./types";
4
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
4
5
  import type { RoughCanvas } from "roughjs/bin/canvas";
5
6
  export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
6
7
  export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
@@ -21,8 +22,10 @@ export interface ExcalidrawElementWithCanvas {
21
22
  export declare const DEFAULT_LINK_SIZE = 14;
22
23
  export declare const elementWithCanvasCache: WeakMap<ExcalidrawElement, ExcalidrawElementWithCanvas>;
23
24
  export declare const renderSelectionElement: (element: NonDeletedExcalidrawElement, context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState, selectionColor: InteractiveCanvasRenderConfig["selectionColor"]) => void;
24
- export declare const renderElement: (element: NonDeletedExcalidrawElement, elementsMap: RenderableElementsMap, allElementsMap: NonDeletedSceneElementsMap, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState) => void;
25
+ export declare const renderElement: (element: NonDeletedExcalidrawElement, elementsMap: RenderableElementsMap, allElementsMap: NonDeletedSceneElementsMap, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState | InteractiveCanvasAppState) => void;
25
26
  export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
26
27
  export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
27
28
  export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
28
29
  export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
30
+ export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
31
+ export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
@@ -1,14 +1,15 @@
1
+ import { type EditorInterface } from "@excalidraw/common";
1
2
  import type { GlobalPoint, LocalPoint } from "@excalidraw/math";
2
- import type { AppState, Device, Zoom } from "@excalidraw/excalidraw/types";
3
+ import type { AppState, Zoom } from "@excalidraw/excalidraw/types";
3
4
  import type { Bounds } from "./bounds";
4
5
  import type { MaybeTransformHandleType } from "./transformHandles";
5
6
  import type { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement, ElementsMap } from "./types";
6
- export declare const resizeTest: <Point extends GlobalPoint | LocalPoint>(element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
7
- export declare const getElementWithTransformHandleType: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, elementsMap: ElementsMap, device: Device) => {
7
+ export declare const resizeTest: <Point extends GlobalPoint | LocalPoint>(element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType, editorInterface: EditorInterface) => MaybeTransformHandleType;
8
+ export declare const getElementWithTransformHandleType: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, elementsMap: ElementsMap, editorInterface: EditorInterface) => {
8
9
  element: NonDeletedExcalidrawElement;
9
10
  transformHandleType: MaybeTransformHandleType;
10
11
  } | null;
11
- export declare const getTransformHandleTypeFromCoords: <Point extends GlobalPoint | LocalPoint>([x1, y1, x2, y2]: Bounds, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
12
+ export declare const getTransformHandleTypeFromCoords: <Point extends GlobalPoint | LocalPoint>([x1, y1, x2, y2]: Bounds, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, editorInterface: EditorInterface) => MaybeTransformHandleType;
12
13
  export declare const getCursorForResizingElement: (resizingElement: {
13
14
  element?: ExcalidrawElement;
14
15
  transformHandleType: MaybeTransformHandleType;
@@ -1,5 +1,6 @@
1
+ import { type EditorInterface } from "@excalidraw/common";
1
2
  import type { Radians } from "@excalidraw/math";
2
- import type { Device, InteractiveCanvasAppState, Zoom } from "@excalidraw/excalidraw/types";
3
+ import type { InteractiveCanvasAppState, Zoom } from "@excalidraw/excalidraw/types";
3
4
  import type { Bounds } from "./bounds";
4
5
  import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
5
6
  export type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
@@ -28,8 +29,8 @@ export declare const OMIT_SIDES_FOR_FRAME: {
28
29
  w: boolean;
29
30
  rotation: boolean;
30
31
  };
31
- export declare const canResizeFromSides: (device: Device) => boolean;
32
- export declare const getOmitSidesForDevice: (device: Device) => {};
32
+ export declare const canResizeFromSides: (editorInterface: EditorInterface) => boolean;
33
+ export declare const getOmitSidesForEditorInterface: (editorInterface: EditorInterface) => {};
33
34
  export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: Radians, zoom: Zoom, pointerType: PointerType, omitSides?: {
34
35
  s?: boolean | undefined;
35
36
  n?: boolean | undefined;
@@ -52,4 +53,4 @@ export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoo
52
53
  se?: boolean | undefined;
53
54
  rotation?: boolean | undefined;
54
55
  }) => TransformHandles;
55
- export declare const shouldShowBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
56
+ export declare const hasBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState, editorInterface: EditorInterface) => boolean;
@@ -1,7 +1,7 @@
1
1
  import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
2
2
  import type { MarkNonNullable } from "@excalidraw/common/utility-types";
3
3
  import type { Bounds } from "./bounds";
4
- import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType } from "./types";
4
+ import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType } from "./types";
5
5
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
6
6
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
7
7
  export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
@@ -24,7 +24,7 @@ export declare const isSimpleArrow: (element?: ExcalidrawElement) => element is
24
24
  export declare const isSharpArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
25
25
  export declare const isCurvedArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
26
26
  export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
27
- export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
27
+ export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawArrowElement;
28
28
  export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
29
29
  export declare const isBindableElement: (element: ExcalidrawElement | null | undefined, includeLocked?: boolean) => element is ExcalidrawBindableElement;
30
30
  export declare const isRectanguloidElement: (element?: ExcalidrawElement | null) => element is ExcalidrawBindableElement;
@@ -43,7 +43,6 @@ export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElem
43
43
  } | {
44
44
  type: 3;
45
45
  } | null;
46
- export declare const isFixedPointBinding: (binding: PointBinding | FixedPointBinding) => binding is FixedPointBinding;
47
46
  export declare const isBounds: (box: unknown) => box is Bounds;
48
47
  export declare const getLinearElementSubType: (element: ExcalidrawLinearElement) => ExcalidrawLinearElementSubType;
49
48
  /**
@@ -197,14 +197,12 @@ export type ExcalidrawTextElementWithContainer = {
197
197
  containerId: ExcalidrawTextContainer["id"];
198
198
  } & ExcalidrawTextElement;
199
199
  export type FixedPoint = [number, number];
200
- export type PointBinding = {
200
+ export type BindMode = "inside" | "orbit" | "skip";
201
+ export type FixedPointBinding = {
201
202
  elementId: ExcalidrawBindableElement["id"];
202
- focus: number;
203
- gap: number;
204
- };
205
- export type FixedPointBinding = Merge<PointBinding, {
206
203
  fixedPoint: FixedPoint;
207
- }>;
204
+ mode: BindMode;
205
+ };
208
206
  type Index = number;
209
207
  export type PointsPositionUpdates = Map<Index, {
210
208
  point: LocalPoint;
@@ -214,9 +212,8 @@ export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" |
214
212
  export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
215
213
  type: "line" | "arrow";
216
214
  points: readonly LocalPoint[];
217
- lastCommittedPoint: LocalPoint | null;
218
- startBinding: PointBinding | null;
219
- endBinding: PointBinding | null;
215
+ startBinding: FixedPointBinding | null;
216
+ endBinding: FixedPointBinding | null;
220
217
  startArrowhead: Arrowhead | null;
221
218
  endArrowhead: Arrowhead | null;
222
219
  }>;
@@ -235,9 +232,9 @@ export type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
235
232
  }>;
236
233
  export type ExcalidrawElbowArrowElement = Merge<ExcalidrawArrowElement, {
237
234
  elbowed: true;
235
+ fixedSegments: readonly FixedSegment[] | null;
238
236
  startBinding: FixedPointBinding | null;
239
237
  endBinding: FixedPointBinding | null;
240
- fixedSegments: readonly FixedSegment[] | null;
241
238
  /**
242
239
  * Marks that the 3rd point should be used as the 2nd point of the arrow in
243
240
  * order to temporarily hide the first segment of the arrow without losing
@@ -260,7 +257,6 @@ export type ExcalidrawFreeDrawElement = _ExcalidrawElementBase & Readonly<{
260
257
  points: readonly LocalPoint[];
261
258
  pressures: readonly number[];
262
259
  simulatePressure: boolean;
263
- lastCommittedPoint: LocalPoint | null;
264
260
  }>;
265
261
  export type FileId = string & {
266
262
  _brand: "FileId";