@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,7 +1,7 @@
1
1
  import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES, ColorTuple, EditorInterface, StrokeWidthKey } from "@excalidraw/common";
2
2
  import type { LinearElementEditor } from "@excalidraw/element";
3
3
  import type { MaybeTransformHandleType } from "@excalidraw/element";
4
- import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, ArrangeAlgorithms, BindMode, ExcalidrawTextElement, StrokeVariability } from "@excalidraw/element/types";
4
+ import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, ExcalidrawArrowElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, ArrangeAlgorithms, BindMode, ExcalidrawTextElement, StrokeVariability } from "@excalidraw/element/types";
5
5
  import type { Merge, MaybePromise, ValueOf, MakeBrand } from "@excalidraw/common/utility-types";
6
6
  import type { CaptureUpdateActionType, DurableIncrement, EphemeralIncrement } from "@excalidraw/element";
7
7
  import type { GlobalPoint } from "@excalidraw/math";
@@ -12,6 +12,7 @@ import type App from "./components/App";
12
12
  import type { ContextMenuCustomItem, ContextMenuItems } from "./components/ContextMenu";
13
13
  import type { SnapLine } from "./snapping";
14
14
  import type { ImportedDataState } from "./data/types";
15
+ import type { SetViewportOptions } from "./viewport";
15
16
  import type { Language } from "./i18n";
16
17
  import type { isOverScrollBars } from "./scene/scrollbars";
17
18
  import type React from "react";
@@ -87,7 +88,35 @@ export type BinaryFileData = {
87
88
  export type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
88
89
  export type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
89
90
  export type ImageContextMenuItem = ContextMenuCustomItem;
90
- export type ToolType = "selection" | "lasso" | "rectangle" | "diamond" | "ellipse" | "arrow" | "line" | "freedraw" | "text" | "image" | "eraser" | "hand" | "frame" | "magicframe" | "embeddable" | "laser";
91
+ export type ImageStatusStyle = {
92
+ backgroundColor?: string;
93
+ color?: string;
94
+ trackColor?: string;
95
+ };
96
+ export type ImageDownloadErrorStatus = ImageStatusStyle & {
97
+ /** Optional error message rendered below the error icon. */
98
+ text?: string;
99
+ /** Makes the rendered download error icon actionable when supplied. */
100
+ onClick?: (fileId: FileId) => void;
101
+ };
102
+ export type ImageUploadProgressStatus = ImageStatusStyle & {
103
+ /**
104
+ * `pending` renders the cloud indicator before upload starts.
105
+ * `uploading` renders the progress ring around the cloud.
106
+ * `error` renders the cloud warning indicator.
107
+ */
108
+ state?: "pending" | "uploading" | "error";
109
+ progress?: number;
110
+ /** Optional upload error message for host-owned UI/toasts. */
111
+ text?: string;
112
+ /** Makes the rendered upload progress indicator actionable when supplied. */
113
+ onClick?: (fileId: FileId) => void;
114
+ };
115
+ export type ImageStatus = {
116
+ downloadError?: ImageDownloadErrorStatus | null;
117
+ uploadProgress?: ImageUploadProgressStatus | null;
118
+ };
119
+ export type ToolType = "selection" | "lasso" | "rectangle" | "diamond" | "ellipse" | "arrow" | "line" | "freedraw" | "text" | "image" | "eraser" | "hand" | "frame" | "magicframe" | "embeddable" | "laser" | "autoshape" | "bucketfill";
91
120
  export type ElementOrToolType = ExcalidrawElementType | ToolType | "custom";
92
121
  export type ActiveTool = {
93
122
  type: ToolType;
@@ -141,7 +170,9 @@ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
141
170
  newElement: AppState["newElement"];
142
171
  isBindingEnabled: AppState["isBindingEnabled"];
143
172
  isMidpointSnappingEnabled: AppState["isMidpointSnappingEnabled"];
173
+ gridModeEnabled: AppState["gridModeEnabled"];
144
174
  suggestedBinding: AppState["suggestedBinding"];
175
+ hoveredArrowTextAnchor: AppState["hoveredArrowTextAnchor"];
145
176
  isRotating: AppState["isRotating"];
146
177
  elementsToHighlight: AppState["elementsToHighlight"];
147
178
  collaborators: AppState["collaborators"];
@@ -197,6 +228,41 @@ export type EditorPreferences = {
197
228
  normalise?: NormalisePreferences;
198
229
  };
199
230
  export type BoxSelectionMode = "contain" | "overlap";
231
+ /**
232
+ * A box, in scene coordinates, that pan & zoom are constrained to.
233
+ *
234
+ * This is a private type. For public API, only use specific properties,
235
+ * needed.
236
+ */
237
+ export type ScrollConstraints = {
238
+ x: number;
239
+ y: number;
240
+ width: number;
241
+ height: number;
242
+ /** when set, panning is constrained so the viewport stays within the box */
243
+ lockScroll: boolean;
244
+ /** when set, the viewport cannot zoom out below `zoom` */
245
+ lockZoom: boolean;
246
+ /**
247
+ * The zoom resolved after the `setViewport` navigation settled.
248
+ */
249
+ zoom: number;
250
+ /**
251
+ * Pixel amount the viewport may overscroll past its resting clamp before
252
+ * snapping back (rubberband). Screen pixels, zoom-independent. Resolved
253
+ * from `lock.overscroll` at the time the lock was installed (`true` →
254
+ * default give, `false` → 0).
255
+ */
256
+ overscroll: number;
257
+ /**
258
+ * Extra scrollable margin around the box (CSS-style), letting the viewport
259
+ * scroll past each box edge to reveal that much empty space. Values are
260
+ * viewport pixels and zoom-independent (a fixed on-screen distance).
261
+ * Resolved from the `offsets` passed to `setViewport` (see
262
+ * {@link ViewportOffsets}) at the time the lock was installed.
263
+ */
264
+ offsets?: Offsets;
265
+ };
200
266
  export interface AppState {
201
267
  contextMenu: {
202
268
  items: ContextMenuItems;
@@ -261,6 +327,15 @@ export interface AppState {
261
327
  element: NonDeleted<ExcalidrawBindableElement>;
262
328
  midPoint?: GlobalPoint;
263
329
  } | null;
330
+ /**
331
+ * Where on a hovered arrow the text tool would attach text if clicked —
332
+ * a free endpoint (binds the arrow to a new text element positioned against
333
+ * that endpoint) or the arrow's midpoint (adds a label bound to the arrow).
334
+ */
335
+ hoveredArrowTextAnchor: {
336
+ elementId: ExcalidrawArrowElement["id"];
337
+ anchor: "start" | "end" | "label";
338
+ } | null;
264
339
  frameToHighlight: NonDeleted<ExcalidrawFrameLikeElement> | null;
265
340
  frameRendering: {
266
341
  enabled: boolean;
@@ -268,8 +343,11 @@ export interface AppState {
268
343
  outline: boolean;
269
344
  clip: boolean;
270
345
  };
271
- editingFrame: string | null;
272
- elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
346
+ /**
347
+ * frame-like element whose name is currently being edited
348
+ */
349
+ editingFrame: ExcalidrawFrameLikeElement["id"] | null;
350
+ elementsToHighlight: readonly NonDeletedExcalidrawElement[] | null;
273
351
  /**
274
352
  * set when a new text is created or when an existing text is being edited
275
353
  */
@@ -312,6 +390,7 @@ export interface AppState {
312
390
  viewBackgroundColor: string;
313
391
  scrollX: number;
314
392
  scrollY: number;
393
+ scrollConstraints: ScrollConstraints | null;
315
394
  cursorButton: "up" | "down";
316
395
  scrolledOutside: boolean;
317
396
  name: string | null;
@@ -395,10 +474,6 @@ export interface AppState {
395
474
  y: number;
396
475
  } | null;
397
476
  objectsSnapModeEnabled: boolean;
398
- /** the user's socket id & username who is being followed on the canvas */
399
- userToFollow: UserToFollow | null;
400
- /** the socket ids of the users following the current user */
401
- followedBy: Set<SocketId>;
402
477
  /** image cropping */
403
478
  isCropping: boolean;
404
479
  croppingElementId: ExcalidrawElement["id"] | null;
@@ -413,6 +488,17 @@ export interface AppState {
413
488
  [groupId: string]: true;
414
489
  };
415
490
  bindMode: BindMode;
491
+ /** user-customized color-picker top picks (pinned via drag & drop from the
492
+ * color picker popup). `null` means no customization (defaults, or
493
+ * host-supplied `topPicks`, are used). Kept per picker. */
494
+ colorTopPicks: {
495
+ elementStroke: readonly string[] | null;
496
+ elementBackground: readonly string[] | null;
497
+ /** the bucket-fill tool keeps a list separate from `elementBackground`
498
+ * even though both drive `currentItemBackgroundColor` (its defaults and
499
+ * use case differ — no transparent) */
500
+ bucketFill: readonly string[] | null;
501
+ };
416
502
  }
417
503
  export type SearchMatch = {
418
504
  id: string;
@@ -425,7 +511,7 @@ export type SearchMatch = {
425
511
  showOnCanvas: boolean;
426
512
  }[];
427
513
  };
428
- export type UIAppState = Omit<AppState, "cursorButton" | "scrollX" | "scrollY">;
514
+ export type UIAppState = Omit<AppState, "cursorButton" | "scrollX" | "scrollY" | "zoom" | "shouldCacheIgnoreZoom" | "snapLines" | "originSnapOffset" | "suggestedBinding" | "hoveredArrowTextAnchor" | "frameToHighlight" | "elementsToHighlight">;
429
515
  export type NormalizedZoomValue = number & {
430
516
  _brand: "normalizedZoom";
431
517
  };
@@ -450,10 +536,30 @@ export declare class GestureEvent extends UIEvent {
450
536
  readonly scale: number;
451
537
  }
452
538
  export type ExcalidrawInitialDataState = ImportedDataState;
539
+ export type ExcalidrawInitialState = {
540
+ viewport?: Omit<SetViewportOptions, "animation">;
541
+ };
453
542
  export type OnUserFollowedPayload = {
454
543
  userToFollow: UserToFollow;
455
544
  action: "FOLLOW" | "UNFOLLOW";
456
545
  };
546
+ export type ViewportStatusFrame = {
547
+ /** the badge (bottom-center pill) */
548
+ label?: {
549
+ label: React.ReactNode;
550
+ icon?: React.ReactNode;
551
+ /** badge background; defaults to var(--color-primary-hover) */
552
+ background?: string;
553
+ /** badge text color; defaults to var(--color-primary-light) */
554
+ color?: string;
555
+ /** makes the badge label interactive */
556
+ onClick?: () => void;
557
+ /** renders a close button when set */
558
+ onClose?: () => void;
559
+ };
560
+ /** viewport-edge border: CSS color, or `false` for none */
561
+ border: false | string;
562
+ };
457
563
  export type OnExportProgress = {
458
564
  type: "progress";
459
565
  message?: React.ReactNode;
@@ -466,7 +572,113 @@ export type CompressImageFileOpts = {
466
572
  maxWidthOrHeight: number;
467
573
  };
468
574
  export type CompressImageFile = (file: File, opts: CompressImageFileOpts) => Promise<File>;
575
+ export type InteractionConfig = {
576
+ /**
577
+ * Interactions that stay enabled while the editor is otherwise
578
+ * non-interactive. Opt-in: anything omitted or `false` is disabled.
579
+ */
580
+ enabled?: {
581
+ /**
582
+ * Element links render their link icon and stay clickable — clicking
583
+ * anywhere on a linked element opens the link, same as in view mode.
584
+ * When disabled, link icons are not rendered at all.
585
+ *
586
+ * @default false
587
+ */
588
+ links?: boolean;
589
+ /**
590
+ * Embeddable & iframe elements stay interactive — hovering & clicking
591
+ * activates them so their content can be used, same as in view mode.
592
+ *
593
+ * @default false
594
+ */
595
+ embeds?: boolean;
596
+ /**
597
+ * Umbrella for all interactive content on canvas — shorthand for
598
+ * enabling `links` & `embeds` (and future interactive content kinds)
599
+ * together. Additive: `interactiveContent: true` enables them
600
+ * regardless of their individual values.
601
+ *
602
+ * @default false
603
+ */
604
+ interactiveContent?: boolean;
605
+ /**
606
+ * Canvas navigation — panning (pointer drag, wheel, PageUp/PageDown)
607
+ * and zooming (ctrl/cmd + wheel, pinch, and the canvas zoom &
608
+ * zoom-to-fit shortcuts: ctrl/cmd +/-/0, shift+1/2/3), same as in view
609
+ * mode. Respects `appState.scrollConstraints` if set, so it composes
610
+ * with viewport locking. The rest of the keyboard stays disabled. Note
611
+ * the editor consumes wheel & touch input again when enabled, so the
612
+ * page no longer scrolls over the editor.
613
+ *
614
+ * @default false
615
+ */
616
+ navigation?: boolean;
617
+ /**
618
+ * Whether the browser's own zoom remains available over the editor —
619
+ * ctrl/cmd + wheel, pinch, and (while the editor has focus)
620
+ * ctrl/cmd +/-/0 shortcuts. Prevented by default, mirroring the
621
+ * interactive editor. Regular page scrolling stays available either way.
622
+ * With `navigation` enabled, the zoom input (wheel, pinch, keyboard
623
+ * shortcuts) zooms the canvas instead either way, making this moot.
624
+ *
625
+ * @default false
626
+ */
627
+ browserZoom?: boolean;
628
+ /**
629
+ * Tools that stay user-driven while the editor is otherwise
630
+ * non-interactive: pointer input keeps driving the listed tool when it's
631
+ * the active tool. Does not enable user-driven tool *switching* — the
632
+ * keyboard stays disabled and tool selection remains host-driven
633
+ * (`ExcalidrawAPI.setActiveTool`).
634
+ *
635
+ * Composes with `navigation`: the enabled tool wins the primary-pointer
636
+ * drag, while wheel input (and wheel-button drag) still pans/zooms.
637
+ */
638
+ tools?: {
639
+ /**
640
+ * The laser pointer stays usable — pointer strokes draw laser trails
641
+ * and pointer positions keep broadcasting via `onPointerUpdate`, so
642
+ * e.g. collaborators see a presenter's laser & cursor.
643
+ *
644
+ * @default false
645
+ */
646
+ laser?: boolean;
647
+ /**
648
+ * Custom tools (`activeTool.type === "custom"`) stay usable — the
649
+ * editor keeps dispatching `onPointerDown` / `onPointerUp` for them.
650
+ * Tool behavior is host-implemented; activate custom tools with
651
+ * `locked: true` or they revert to the selection tool (and go inert)
652
+ * after the first pointer interaction.
653
+ *
654
+ * @default false
655
+ */
656
+ custom?: boolean;
657
+ };
658
+ };
659
+ };
660
+ export type UIConfig = {
661
+ /**
662
+ * Default UI controls that stay enabled while the rest of Excalidraw's
663
+ * default UI is hidden. Opt-in: anything omitted or `false` is disabled.
664
+ */
665
+ enabled: {
666
+ /**
667
+ * The zoom-out, reset-zoom, and zoom-in controls.
668
+ *
669
+ * @default false
670
+ */
671
+ zoom?: boolean;
672
+ /**
673
+ * The button shown when the viewport is scrolled away from all content.
674
+ *
675
+ * @default false
676
+ */
677
+ scrollBackToContent?: boolean;
678
+ };
679
+ };
469
680
  export interface ExcalidrawProps {
681
+ className?: string;
470
682
  onChange?: (elements: readonly OrderedExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
471
683
  onThemeChange?: (theme: Theme | "system") => void;
472
684
  /**
@@ -474,6 +686,7 @@ export interface ExcalidrawProps {
474
686
  */
475
687
  onIncrement?: (event: DurableIncrement | EphemeralIncrement) => void;
476
688
  initialData?: (() => MaybePromise<ExcalidrawInitialDataState | null>) | MaybePromise<ExcalidrawInitialDataState | null>;
689
+ initialState?: ExcalidrawInitialState;
477
690
  /**
478
691
  * Invoked as soon as the Excalidraw API is available
479
692
  * NOTE editor is not yet mounted, and state is not yet initialized
@@ -520,6 +733,70 @@ export interface ExcalidrawProps {
520
733
  langCode?: Language["code"];
521
734
  viewModeEnabled?: boolean;
522
735
  viewModeOnly?: boolean;
736
+ /**
737
+ * Whether the editor accepts user input (pointer, keyboard, wheel, touch,
738
+ * clipboard, drag&drop). When `false`, the scene still renders and reacts
739
+ * to programmatic updates (imperative API), but the user cannot affect it
740
+ * in any way. Implies view mode.
741
+ *
742
+ * Pass a config object to keep specific interactions enabled while the
743
+ * editor is otherwise non-interactive (see `InteractionConfig`):
744
+ *
745
+ * ```tsx
746
+ * <Excalidraw interaction={{ enabled: { links: true } }} />
747
+ * ```
748
+ *
749
+ * @default true
750
+ */
751
+ interaction?: boolean | InteractionConfig;
752
+ /**
753
+ * Whether Excalidraw's default UI is rendered — toolbar, default menus,
754
+ * footer controls, sidebars, and canvas popups. Host UI passed through
755
+ * children (including exported components such as `MainMenu` and `Footer`)
756
+ * or render props continues to render, together with any supporting dialogs
757
+ * it opens.
758
+ *
759
+ * Canvas content (elements, text editing surface, frame names, embeds) still
760
+ * renders, and the editor remains interactive unless `interaction` is set to
761
+ * `false`.
762
+ *
763
+ * Pass a config object to keep specific default controls rendered while the
764
+ * rest of the default UI is hidden (see `UIConfig`):
765
+ *
766
+ * ```tsx
767
+ * <Excalidraw ui={{ enabled: { zoom: true } }} />
768
+ * ```
769
+ *
770
+ * NOTE: this is WIP and what default UI is/is not rendered when ui=false
771
+ * may yet change.
772
+ *
773
+ * @default true
774
+ */
775
+ ui?: boolean | UIConfig;
776
+ /**
777
+ * Forces the active editor tool (controlled). While set, user- and
778
+ * API-driven tool switching is ignored — `setActiveTool` refuses with a
779
+ * console warning, non-forced toolbar buttons render disabled — and the
780
+ * editor snaps back if internal flows reset the tool. The forced tool
781
+ * behaves as if locked (see the tool lock / padlock): it doesn't revert to
782
+ * the selection tool after use, and elements drawn with it aren't
783
+ * auto-selected — without mutating `appState.activeTool.locked`, so the
784
+ * user's persisted padlock preference stays untouched. Unset to return
785
+ * tool control to the editor (the current tool stays active).
786
+ *
787
+ * The forced tool must be activatable to take effect: not disabled via
788
+ * `UIOptions.tools`, and — while the editor is non-interactive — allowed
789
+ * via `interaction.enabled.tools`. Otherwise the editor stays on (or, when
790
+ * non-interactive, resets to) the `selection` tool, and the forced tool is
791
+ * applied once it becomes activatable. `image` cannot be forced (its
792
+ * activation opens the file picker).
793
+ */
794
+ activeTool?: {
795
+ type: Exclude<ToolType, "image">;
796
+ } | {
797
+ type: "custom";
798
+ customType: string;
799
+ };
523
800
  zenModeEnabled?: boolean;
524
801
  gridModeEnabled?: boolean;
525
802
  objectsSnapModeEnabled?: boolean;
@@ -536,7 +813,7 @@ export interface ExcalidrawProps {
536
813
  detectScroll?: boolean;
537
814
  handleKeyboardGlobally?: boolean;
538
815
  autoFocus?: boolean;
539
- compressImageFile: CompressImageFile;
816
+ compressImageFile?: CompressImageFile;
540
817
  generateIdForFile?: (file: File) => string | Promise<string>;
541
818
  generateLinkForSelection?: (id: string, type: "element" | "group") => string;
542
819
  onLinkOpen?: (element: NonDeletedExcalidrawElement, event: CustomEvent<{
@@ -557,6 +834,21 @@ export interface ExcalidrawProps {
557
834
  strokeColorTopPicks?: ColorTuple;
558
835
  backgroundColorTopPicks?: ColorTuple;
559
836
  renderScrollbars?: boolean;
837
+ viewportStatusFrame?: ViewportStatusFrame | null;
838
+ /**
839
+ * Rendered inside the UserList "who's here" dropdown (desktop) and inline
840
+ * in the mobile menu's collaborators section, below a divider. Accepts a
841
+ * render function — called with `isMobile` so hosts can render different
842
+ * UI for each surface — in addition to a plain node.
843
+ */
844
+ currentUserControls?: React.ReactNode | ((isMobile: boolean) => React.ReactNode);
845
+ /**
846
+ * The user being followed on the canvas, if any. Controlled by the host —
847
+ * the editor never sets it; it emits follow/unfollow intents via
848
+ * `onUserFollow` (prop or imperative API) and renders the followed
849
+ * user's avatar highlight from this value.
850
+ */
851
+ userToFollow?: UserToFollow | null;
560
852
  /**
561
853
  * Called before exporting to a file.
562
854
  *
@@ -632,11 +924,11 @@ export type AppProps = Merge<ExcalidrawProps, {
632
924
  };
633
925
  }>;
634
926
  imageOptions: Required<ImageOptions>;
635
- wheelZoomsOnDefault?: boolean;
636
927
  detectScroll: boolean;
637
928
  handleKeyboardGlobally: boolean;
638
929
  isCollaborating: boolean;
639
930
  children?: React.ReactNode;
931
+ wheelZoomsOnDefault?: boolean;
640
932
  }>;
641
933
  /** A subset of App class properties that we need to use elsewhere
642
934
  * in the app, eg Manager. Factored out into a separate type to keep DRY. */
@@ -658,6 +950,8 @@ export type AppClassProperties = {
658
950
  }>;
659
951
  imageLoadingProgress: App["imageLoadingProgress"];
660
952
  imageLoadingProgressEmitter: App["imageLoadingProgressEmitter"];
953
+ imageStatus: App["imageStatus"];
954
+ imageStatusEmitter: App["imageStatusEmitter"];
661
955
  imagePlaceholderUpdateEmitter: App["imagePlaceholderUpdateEmitter"];
662
956
  files: BinaryFiles;
663
957
  editorInterface: App["editorInterface"];
@@ -668,6 +962,7 @@ export type AppClassProperties = {
668
962
  id: App["id"];
669
963
  onInsertElements: App["onInsertElements"];
670
964
  onExportImage: App["onExportImage"];
965
+ viewport: App["viewport"];
671
966
  lastViewportPosition: App["lastViewportPosition"];
672
967
  scrollToViewport: App["scrollToViewport"];
673
968
  scrollToContent: App["scrollToContent"];
@@ -678,14 +973,14 @@ export type AppClassProperties = {
678
973
  setActiveTool: App["setActiveTool"];
679
974
  setOpenDialog: App["setOpenDialog"];
680
975
  insertEmbeddableElement: App["insertEmbeddableElement"];
681
- onMagicframeToolSelect: App["onMagicframeToolSelect"];
682
976
  getName: App["getName"];
683
977
  dismissLinearEditor: App["dismissLinearEditor"];
684
- flowChartCreator: App["flowChartCreator"];
978
+ flowchart: App["flowchart"];
979
+ drawShape: App["drawShape"];
980
+ cursor: App["cursor"];
981
+ bucketFill: App["bucketFill"];
982
+ isToolLocked: App["isToolLocked"];
685
983
  getEffectiveGridSize: App["getEffectiveGridSize"];
686
- setPlugins: App["setPlugins"];
687
- plugins: App["plugins"];
688
- getEditorUIOffsets: App["getEditorUIOffsets"];
689
984
  visibleElements: App["visibleElements"];
690
985
  excalidrawContainerValue: App["excalidrawContainerValue"];
691
986
  onPointerUpEmitter: App["onPointerUpEmitter"];
@@ -694,8 +989,13 @@ export type AppClassProperties = {
694
989
  onEvent: App["onEvent"];
695
990
  onStateChange: App["onStateChange"];
696
991
  lastPointerMoveCoords: App["lastPointerMoveCoords"];
992
+ lastPointerMoveEvent: App["lastPointerMoveEvent"];
697
993
  bindModeHandler: App["bindModeHandler"];
994
+ emitUserFollowIntent: App["emitUserFollowIntent"];
995
+ requestUnfollow: App["requestUnfollow"];
698
996
  setAppState: App["setAppState"];
997
+ isInteractionEnabled: App["isInteractionEnabled"];
998
+ isNavigationEnabled: App["isNavigationEnabled"];
699
999
  };
700
1000
  export type PointerDownState = Readonly<{
701
1001
  origin: Readonly<{
@@ -783,20 +1083,24 @@ export interface ExcalidrawImperativeAPI {
783
1083
  getName: InstanceType<typeof App>["getName"];
784
1084
  scrollToViewport: InstanceType<typeof App>["scrollToViewport"];
785
1085
  scrollToContent: InstanceType<typeof App>["scrollToContent"];
1086
+ setViewport: InstanceType<typeof App>["viewport"]["setViewport"];
1087
+ getViewportOffsets: InstanceType<typeof App>["viewport"]["getOffsets"];
786
1088
  registerAction: (action: Action) => void;
787
1089
  refresh: InstanceType<typeof App>["refresh"];
788
1090
  setToast: InstanceType<typeof App>["setToast"];
789
1091
  addFiles: (data: BinaryFileData[]) => void;
790
1092
  addImagePlaceholder: (fileId: FileId, file: File) => Promise<void>;
791
- setImageLoadingProgress: (fileId: FileId, progress: number | null) => void;
1093
+ setDownloadProgress: (fileId: FileId, progress: number | null) => void;
1094
+ setDownloadError: (fileId: FileId, error: boolean | ImageDownloadErrorStatus | null) => void;
1095
+ setUploadProgress: (fileId: FileId, progress: number | "pending" | "error" | null, status?: Omit<ImageUploadProgressStatus, "progress"> | null) => void;
792
1096
  addImageElementsToScene: (imageFiles: {
793
1097
  file: File;
794
1098
  customData: Record<string, any>;
795
1099
  }[], sceneX: number, sceneY: number) => Promise<void>;
796
1100
  id: string;
797
1101
  setActiveTool: InstanceType<typeof App>["setActiveTool"];
798
- setCursor: InstanceType<typeof App>["setCursor"];
799
- resetCursor: InstanceType<typeof App>["resetCursor"];
1102
+ setCursor: InstanceType<typeof App>["cursor"]["set"];
1103
+ resetCursor: InstanceType<typeof App>["cursor"]["reset"];
800
1104
  toggleSidebar: InstanceType<typeof App>["toggleSidebar"];
801
1105
  getEditorInterface: () => EditorInterface;
802
1106
  /**
@@ -819,7 +1123,6 @@ export type FrameNameBounds = {
819
1123
  y: number;
820
1124
  width: number;
821
1125
  height: number;
822
- angle: number;
823
1126
  };
824
1127
  export type FrameNameBoundsCache = {
825
1128
  get: (frameElement: ExcalidrawFrameLikeElement | ExcalidrawMagicFrameElement) => FrameNameBounds | null;
@@ -838,18 +1141,111 @@ export type Primitive = number | string | boolean | bigint | symbol | null | und
838
1141
  export type JSONValue = string | number | boolean | null | object;
839
1142
  export type EmbedsValidationStatus = Map<ExcalidrawIframeLikeElement["id"], boolean>;
840
1143
  export type ElementsPendingErasure = Set<ExcalidrawElement["id"]>;
841
- export type PendingExcalidrawElements = ExcalidrawElement[];
1144
+ export type PendingExcalidrawElements = NonDeletedExcalidrawElement[];
842
1145
  /** Runtime gridSize value. Null indicates disabled grid. */
843
1146
  export type NullableGridSize = (AppState["gridSize"] & MakeBrand<"NullableGridSize">) | null;
844
- export type GenerateDiagramToCode = (props: {
845
- frame: ExcalidrawMagicFrameElement;
846
- children: readonly ExcalidrawElement[];
847
- }) => MaybePromise<{
848
- html: string;
849
- }>;
850
1147
  export type Offsets = Partial<{
851
1148
  top: number;
852
1149
  right: number;
853
1150
  bottom: number;
854
1151
  left: number;
855
1152
  }>;
1153
+ /**
1154
+ * Value of the `data-viewport-ui` attribute, marking a DOM node as a UI
1155
+ * surface that occludes the canvas. Such nodes are measured by
1156
+ * `getViewportOffsets` to compute the default per-side viewport offsets:
1157
+ *
1158
+ * - `top` / `bottom` — offsets that side by the node's bottom/top edge
1159
+ * - `side` — a panel hugging the left or right edge. Which side is not
1160
+ * declared but resolved geometrically: if the node's horizontal center
1161
+ * lies in the left half of the viewport it counts against the left
1162
+ * offset (by its right edge), otherwise against the right offset (by
1163
+ * `viewportWidth - left edge`). Measuring the rendered position instead
1164
+ * of declaring a side means RTL layouts and host-configurable docking
1165
+ * (e.g. sidebar side) are handled for free — but it assumes the surface
1166
+ * actually hugs one edge; don't mark a centered/near-full-width node as
1167
+ * `side` (its midpoint would classify it to one side and the offset
1168
+ * would swallow most of the viewport).
1169
+ *
1170
+ * The attribute should only be present while the surface is actually
1171
+ * rendered — omit it (don't just hide the node) when the surface shouldn't
1172
+ * push the viewport around.
1173
+ */
1174
+ export type ViewportUIDock = "top" | "bottom" | "side";
1175
+ /**
1176
+ * Options for `getViewportOffsets` (and the `ui` key of
1177
+ * {@link ViewportOffsets}), controlling how offsets are derived from the
1178
+ * currently rendered editor UI.
1179
+ *
1180
+ * NOTE unlike the physical sides of {@link Offsets}, the horizontal values
1181
+ * here are logical, i.e. flipped in RTL layouts (`left` refers to the
1182
+ * reading-direction start side).
1183
+ */
1184
+ export type ViewportOffsetsOptions = {
1185
+ /** padding added to each measured side (default 24) */
1186
+ padding?: number;
1187
+ paddingTop?: number;
1188
+ paddingRight?: number;
1189
+ paddingBottom?: number;
1190
+ paddingLeft?: number;
1191
+ /** final value for the given side, replacing the measured UI size
1192
+ * (padding is not added on top) */
1193
+ top?: number;
1194
+ bottom?: number;
1195
+ left?: number;
1196
+ right?: number;
1197
+ /**
1198
+ * Reserve space for the given conditionally-rendered surfaces even while
1199
+ * they're hidden, so the resulting offsets don't shift when they
1200
+ * (dis)appear. Uses the surface's last-measured footprint, falling back
1201
+ * to an approximate default if it hasn't been rendered yet. Ignored on
1202
+ * phones (where these surfaces never occlude the canvas).
1203
+ */
1204
+ reserve?: {
1205
+ /** styles panel (rendered when a tool or selection is active) */
1206
+ stylesPanel?: boolean;
1207
+ /** sidebar (e.g. library) */
1208
+ sidebar?: boolean;
1209
+ };
1210
+ };
1211
+ /**
1212
+ * Viewport offsets accepted by the `setViewport`-family APIs (`setViewport`,
1213
+ * `props.initialState.viewport`), insetting the usable viewport area per
1214
+ * side so the target isn't fitted/centered underneath overlaid UI.
1215
+ *
1216
+ * Two (combinable) ways to specify:
1217
+ *
1218
+ * - **Static sides** (`top`/`right`/`bottom`/`left`) — absolute pixel
1219
+ * values, used as-is: physical (not flipped in RTL), zoom-independent,
1220
+ * no padding added. Sides not specified default to `0` (unless `ui` is
1221
+ * set, see below).
1222
+ *
1223
+ * - **`ui`** — derive the offsets from the editor UI (toolbar, styles
1224
+ * panel, sidebar...) as rendered at the time the viewport is set,
1225
+ * equivalent to calling `getViewportOffsets()`. Pass `true` for the
1226
+ * defaults, or options ({@link ViewportOffsetsOptions}) to customize
1227
+ * padding or reserve space for currently-hidden surfaces.
1228
+ *
1229
+ * When both are given, a static side always wins for that side — it
1230
+ * replaces whatever `ui` would yield (including `ui`'s own side overrides,
1231
+ * which — unlike the physical static sides — are RTL-relative). The
1232
+ * remaining sides fall back to the `ui`-derived values.
1233
+ *
1234
+ * @example
1235
+ * { top: 40 } // top 40px, other sides 0
1236
+ * { ui: true } // measured UI + default padding
1237
+ * { ui: { reserve: { stylesPanel: true } } } // + keep space for hidden panel
1238
+ * { top: 40, ui: true } // top exactly 40px, rest from UI
1239
+ */
1240
+ export type ViewportOffsets = Offsets & {
1241
+ ui?: true | ViewportOffsetsOptions;
1242
+ };
1243
+ /**
1244
+ * Value of the `data-viewport-ui-name` attribute, identifying a
1245
+ * conditionally-rendered surface (marked with `data-viewport-ui`) so that
1246
+ * `getViewportOffsets` can reserve space for it while it's hidden (see the
1247
+ * `reserve` option). Whenever a named surface is rendered, its measured
1248
+ * footprint is remembered; reserving uses that remembered footprint, or an
1249
+ * approximate default if the surface hasn't been rendered yet.
1250
+ */
1251
+ export type ViewportUIName = "sidebar" | "stylesPanel";