@excalidraw/excalidraw 0.18.0-2b1c2a9 → 0.18.0-2c3dcc0

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 (491) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/dev/chunk-4S62H332.js +69 -0
  3. package/dist/dev/chunk-4S62H332.js.map +7 -0
  4. package/dist/dev/chunk-CB5LBNRX.js +385 -0
  5. package/dist/dev/chunk-CB5LBNRX.js.map +7 -0
  6. package/dist/dev/{chunk-KKZSEXXE.js → chunk-PMHQMXJL.js} +2583 -1415
  7. package/dist/dev/chunk-PMHQMXJL.js.map +7 -0
  8. package/dist/dev/{chunk-ZQ2W3FVU.js → chunk-TG4M5ORT.js} +55 -7
  9. package/dist/dev/chunk-TG4M5ORT.js.map +7 -0
  10. package/dist/dev/data/{image-ORD6XJVB.js → image-MEFJ53NR.js} +2 -2
  11. package/dist/dev/index.css +636 -170
  12. package/dist/dev/index.css.map +3 -3
  13. package/dist/dev/index.js +16941 -11815
  14. package/dist/dev/index.js.map +4 -4
  15. package/dist/dev/locales/{ar-SA-EW44IW4V.js → ar-SA-YR7MCNK4.js} +139 -91
  16. package/dist/dev/locales/ar-SA-YR7MCNK4.js.map +7 -0
  17. package/dist/dev/locales/{az-AZ-AI7WAYA2.js → az-AZ-ZBXCKPE2.js} +86 -38
  18. package/dist/dev/locales/az-AZ-ZBXCKPE2.js.map +7 -0
  19. package/dist/dev/locales/{bg-BG-43ZNGDXF.js → bg-BG-2ZAAYJML.js} +53 -5
  20. package/dist/dev/locales/bg-BG-2ZAAYJML.js.map +7 -0
  21. package/dist/dev/locales/{bn-BD-PU4CN7NP.js → bn-BD-GV6U222M.js} +53 -5
  22. package/dist/dev/locales/bn-BD-GV6U222M.js.map +7 -0
  23. package/dist/dev/locales/{bn-IN-54CF43JL.js → bn-IN-VWHFNEO6.js} +53 -5
  24. package/dist/dev/locales/bn-IN-VWHFNEO6.js.map +7 -0
  25. package/dist/dev/locales/{ca-ES-RHJO3QDO.js → ca-ES-EX2VSRUJ.js} +53 -5
  26. package/dist/dev/locales/ca-ES-EX2VSRUJ.js.map +7 -0
  27. package/dist/dev/locales/{cs-CZ-ZRSAO3BA.js → cs-CZ-ZKHL5BC4.js} +236 -188
  28. package/dist/dev/locales/cs-CZ-ZKHL5BC4.js.map +7 -0
  29. package/dist/dev/locales/da-DK-GWXMAGLS.js +891 -0
  30. package/dist/dev/locales/da-DK-GWXMAGLS.js.map +7 -0
  31. package/dist/dev/locales/{de-CH-QF7JLXTF.js → de-CH-ZYE4KIVF.js} +74 -26
  32. package/dist/dev/locales/de-CH-ZYE4KIVF.js.map +7 -0
  33. package/dist/dev/locales/{de-DE-5ZO4KOPT.js → de-DE-W5KZA3XL.js} +74 -26
  34. package/dist/dev/locales/de-DE-W5KZA3XL.js.map +7 -0
  35. package/dist/dev/locales/{el-GR-F74ZSUEO.js → el-GR-LNENOXDS.js} +53 -5
  36. package/dist/dev/locales/el-GR-LNENOXDS.js.map +7 -0
  37. package/dist/dev/locales/{en-DSRJ5DKP.js → en-S76M77LQ.js} +6 -2
  38. package/dist/dev/locales/{es-ES-3B3IENPS.js → es-ES-KVQKK6BK.js} +76 -28
  39. package/dist/dev/locales/es-ES-KVQKK6BK.js.map +7 -0
  40. package/dist/dev/locales/{eu-ES-NH447TVU.js → eu-ES-K74P2OHT.js} +55 -7
  41. package/dist/dev/locales/eu-ES-K74P2OHT.js.map +7 -0
  42. package/dist/dev/locales/{fa-IR-GHKV6Q2J.js → fa-IR-UVPVVOK6.js} +174 -126
  43. package/dist/dev/locales/fa-IR-UVPVVOK6.js.map +7 -0
  44. package/dist/dev/locales/{fi-FI-ZXSYWCC4.js → fi-FI-5IH5HHFB.js} +53 -5
  45. package/dist/dev/locales/fi-FI-5IH5HHFB.js.map +7 -0
  46. package/dist/dev/locales/{fr-FR-RJSOSEYS.js → fr-FR-6TIQQ2YA.js} +62 -14
  47. package/dist/dev/locales/fr-FR-6TIQQ2YA.js.map +7 -0
  48. package/dist/dev/locales/{gl-ES-NAUVMVFY.js → gl-ES-BFS3F2IP.js} +53 -5
  49. package/dist/dev/locales/gl-ES-BFS3F2IP.js.map +7 -0
  50. package/dist/dev/locales/{he-IL-JBKWWR75.js → he-IL-XFUVMK5F.js} +57 -9
  51. package/dist/dev/locales/he-IL-XFUVMK5F.js.map +7 -0
  52. package/dist/dev/locales/{hi-IN-SD773MVZ.js → hi-IN-KWN5S7EG.js} +167 -119
  53. package/dist/dev/locales/hi-IN-KWN5S7EG.js.map +7 -0
  54. package/dist/dev/locales/{hu-HU-OTA7GOAV.js → hu-HU-XILWCIZQ.js} +277 -229
  55. package/dist/dev/locales/hu-HU-XILWCIZQ.js.map +7 -0
  56. package/dist/dev/locales/{id-ID-2JAZWVTQ.js → id-ID-FNUVAAM3.js} +60 -12
  57. package/dist/dev/locales/id-ID-FNUVAAM3.js.map +7 -0
  58. package/dist/dev/locales/{it-IT-GHWUAT77.js → it-IT-P6FPL2AC.js} +56 -8
  59. package/dist/dev/locales/it-IT-P6FPL2AC.js.map +7 -0
  60. package/dist/dev/locales/{ja-JP-YMGRGBPS.js → ja-JP-6PNFICRT.js} +97 -49
  61. package/dist/dev/locales/ja-JP-6PNFICRT.js.map +7 -0
  62. package/dist/dev/locales/{kaa-RRE7XUCW.js → kaa-J7KKY4JW.js} +53 -5
  63. package/dist/dev/locales/kaa-J7KKY4JW.js.map +7 -0
  64. package/dist/dev/locales/{kab-KAB-ZCYVOJU4.js → kab-KAB-44EE672Q.js} +53 -5
  65. package/dist/dev/locales/kab-KAB-44EE672Q.js.map +7 -0
  66. package/dist/dev/locales/{kk-KZ-TO6XEFJC.js → kk-KZ-M3SY27TR.js} +54 -6
  67. package/dist/dev/locales/kk-KZ-M3SY27TR.js.map +7 -0
  68. package/dist/dev/locales/{km-KH-3HTDL5HB.js → km-KH-BH436F3B.js} +53 -5
  69. package/dist/dev/locales/km-KH-BH436F3B.js.map +7 -0
  70. package/dist/dev/locales/{ko-KR-O4L4O7L6.js → ko-KR-OCUNIAMU.js} +140 -92
  71. package/dist/dev/locales/ko-KR-OCUNIAMU.js.map +7 -0
  72. package/dist/dev/locales/{ku-TR-AFJWDY67.js → ku-TR-DG5I2OEB.js} +54 -6
  73. package/dist/dev/locales/ku-TR-DG5I2OEB.js.map +7 -0
  74. package/dist/dev/locales/{lt-LT-7QOT2VDQ.js → lt-LT-CFE6GJFO.js} +53 -5
  75. package/dist/dev/locales/lt-LT-CFE6GJFO.js.map +7 -0
  76. package/dist/dev/locales/{lv-LV-WV6C4NYF.js → lv-LV-5UXRK5LK.js} +53 -5
  77. package/dist/dev/locales/lv-LV-5UXRK5LK.js.map +7 -0
  78. package/dist/dev/locales/{mr-IN-3TLYWOEI.js → mr-IN-JJJ7JEIQ.js} +54 -6
  79. package/dist/dev/locales/mr-IN-JJJ7JEIQ.js.map +7 -0
  80. package/dist/dev/locales/{my-MM-NNL2QJT3.js → my-MM-6Y5MTUYZ.js} +54 -6
  81. package/dist/dev/locales/my-MM-6Y5MTUYZ.js.map +7 -0
  82. package/dist/dev/locales/{nb-NO-PG3XLMEV.js → nb-NO-OJ2J57UW.js} +175 -127
  83. package/dist/dev/locales/nb-NO-OJ2J57UW.js.map +7 -0
  84. package/dist/dev/locales/{nl-NL-MMOYEKKQ.js → nl-NL-ZMGK5L2A.js} +116 -68
  85. package/dist/dev/locales/nl-NL-ZMGK5L2A.js.map +7 -0
  86. package/dist/dev/locales/nn-NO-DILC455A.js +891 -0
  87. package/dist/dev/locales/nn-NO-DILC455A.js.map +7 -0
  88. package/dist/dev/locales/{oc-FR-SR6MFB4N.js → oc-FR-TBAPFIFP.js} +53 -5
  89. package/dist/dev/locales/oc-FR-TBAPFIFP.js.map +7 -0
  90. package/dist/dev/locales/{pa-IN-ADGMQLQI.js → pa-IN-H7KGTW7K.js} +53 -5
  91. package/dist/dev/locales/pa-IN-H7KGTW7K.js.map +7 -0
  92. package/dist/dev/locales/{percentages-DKKGPYTW.js → percentages-7WBDDXTY.js} +2 -2
  93. package/dist/dev/locales/{pl-PL-FNIPTMVP.js → pl-PL-6ZGDB43Y.js} +129 -81
  94. package/dist/dev/locales/pl-PL-6ZGDB43Y.js.map +7 -0
  95. package/dist/dev/locales/{pt-BR-67FMCDNE.js → pt-BR-4CXNOML2.js} +75 -27
  96. package/dist/dev/locales/pt-BR-4CXNOML2.js.map +7 -0
  97. package/dist/dev/locales/{pt-PT-4G3GI4SF.js → pt-PT-TOMIGAYH.js} +55 -7
  98. package/dist/dev/locales/pt-PT-TOMIGAYH.js.map +7 -0
  99. package/dist/dev/locales/{ro-RO-CUZFN555.js → ro-RO-DOXV5F2Q.js} +55 -7
  100. package/dist/dev/locales/ro-RO-DOXV5F2Q.js.map +7 -0
  101. package/dist/dev/locales/{ru-RU-4GHINTII.js → ru-RU-5U265TMV.js} +75 -27
  102. package/dist/dev/locales/ru-RU-5U265TMV.js.map +7 -0
  103. package/dist/dev/locales/{si-LK-SSNT7T4A.js → si-LK-OGZXL3BT.js} +53 -5
  104. package/dist/dev/locales/si-LK-OGZXL3BT.js.map +7 -0
  105. package/dist/dev/locales/{sk-SK-J7TKZQEH.js → sk-SK-JG2AKJPH.js} +55 -7
  106. package/dist/dev/locales/sk-SK-JG2AKJPH.js.map +7 -0
  107. package/dist/dev/locales/{sl-SI-SIBF67NE.js → sl-SI-54ZO5ZSD.js} +174 -126
  108. package/dist/dev/locales/sl-SI-54ZO5ZSD.js.map +7 -0
  109. package/dist/dev/locales/{sv-SE-YTR46NVM.js → sv-SE-3POS3WZH.js} +75 -27
  110. package/dist/dev/locales/sv-SE-3POS3WZH.js.map +7 -0
  111. package/dist/dev/locales/{ta-IN-7AW6CTGA.js → ta-IN-Y4IRR3JL.js} +53 -5
  112. package/dist/dev/locales/ta-IN-Y4IRR3JL.js.map +7 -0
  113. package/dist/dev/locales/th-TH-PFUZOVDY.js +891 -0
  114. package/dist/dev/locales/th-TH-PFUZOVDY.js.map +7 -0
  115. package/dist/dev/locales/{tr-TR-UDQGNXAG.js → tr-TR-TO5WQZYI.js} +55 -7
  116. package/dist/dev/locales/tr-TR-TO5WQZYI.js.map +7 -0
  117. package/dist/dev/locales/{uk-UA-25HL2NCU.js → uk-UA-ZAXUXI3N.js} +112 -64
  118. package/dist/dev/locales/uk-UA-ZAXUXI3N.js.map +7 -0
  119. package/dist/dev/locales/{uz-UZ-OPSBAY4H.js → uz-UZ-CPWHQIND.js} +55 -7
  120. package/dist/dev/locales/uz-UZ-CPWHQIND.js.map +7 -0
  121. package/dist/dev/locales/{vi-VN-DK367UGA.js → vi-VN-KOPFLJUU.js} +53 -5
  122. package/dist/dev/locales/vi-VN-KOPFLJUU.js.map +7 -0
  123. package/dist/dev/locales/{zh-CN-QCVKNWUH.js → zh-CN-GULBHSU5.js} +75 -27
  124. package/dist/dev/locales/zh-CN-GULBHSU5.js.map +7 -0
  125. package/dist/dev/locales/{zh-HK-WFGYHWPG.js → zh-HK-BQEHPCOZ.js} +53 -5
  126. package/dist/dev/locales/zh-HK-BQEHPCOZ.js.map +7 -0
  127. package/dist/dev/locales/{zh-TW-WHQS4ZSD.js → zh-TW-CKEFVLXW.js} +56 -8
  128. package/dist/dev/locales/zh-TW-CKEFVLXW.js.map +7 -0
  129. package/dist/dev/minimap-controller.chunk.js +516 -0
  130. package/dist/dev/minimap-controller.chunk.js.map +7 -0
  131. package/dist/dev/minimap-shared.chunk.js +19 -0
  132. package/dist/dev/minimap-shared.chunk.js.map +7 -0
  133. package/dist/dev/minimap-worker.chunk.js +20 -0
  134. package/dist/dev/minimap-worker.chunk.js.map +7 -0
  135. package/dist/prod/chunk-FPHVY4UD.js +1 -0
  136. package/dist/prod/chunk-HMEZQHLQ.js +5 -0
  137. package/dist/prod/chunk-PEPMNMTR.js +12 -0
  138. package/dist/prod/chunk-TLY2GM7R.js +1 -0
  139. package/dist/prod/data/{image-52MW35OO.js → image-CRT43OWP.js} +1 -1
  140. package/dist/prod/index.css +1 -1
  141. package/dist/prod/index.js +41 -38
  142. package/dist/prod/locales/ar-SA-5PG7V5EO.js +12 -0
  143. package/dist/prod/locales/az-AZ-R5PIN4QX.js +1 -0
  144. package/dist/prod/locales/bg-BG-7O26EXOO.js +5 -0
  145. package/dist/prod/locales/bn-BD-HFUYVZBL.js +3 -0
  146. package/dist/prod/locales/bn-IN-CGKI7RJZ.js +3 -0
  147. package/dist/prod/locales/ca-ES-2XVDQTRM.js +8 -0
  148. package/dist/prod/locales/cs-CZ-LYQQVZTU.js +12 -0
  149. package/dist/prod/locales/da-DK-74L3IIHC.js +12 -0
  150. package/dist/prod/locales/de-CH-ESDMSEY2.js +11 -0
  151. package/dist/prod/locales/de-DE-AWQAQ5MM.js +11 -0
  152. package/dist/prod/locales/el-GR-XKFHXYJL.js +7 -0
  153. package/dist/prod/locales/en-ZE5S2LAG.js +1 -0
  154. package/dist/prod/locales/es-ES-7FASZ2HS.js +12 -0
  155. package/dist/prod/locales/eu-ES-XQCVGEM7.js +8 -0
  156. package/dist/prod/locales/fa-IR-WCOKBPIV.js +13 -0
  157. package/dist/prod/locales/fi-FI-D27CLN2M.js +6 -0
  158. package/dist/prod/locales/fr-FR-3R3JUNNU.js +12 -0
  159. package/dist/prod/locales/gl-ES-QWUPPZGY.js +6 -0
  160. package/dist/prod/locales/he-IL-WG32KK3Y.js +9 -0
  161. package/dist/prod/locales/hi-IN-2KMQE37Z.js +7 -0
  162. package/dist/prod/locales/hu-HU-LNQSDLNX.js +10 -0
  163. package/dist/prod/locales/id-ID-VKXDAHVE.js +8 -0
  164. package/dist/prod/locales/it-IT-Y2AQYZ6X.js +12 -0
  165. package/dist/prod/locales/ja-JP-DKRHFBGJ.js +12 -0
  166. package/dist/prod/locales/kaa-MBUZHFTE.js +1 -0
  167. package/dist/prod/locales/kab-KAB-YRKCE6RZ.js +4 -0
  168. package/dist/prod/locales/kk-KZ-OL5E5FB2.js +1 -0
  169. package/dist/prod/locales/{km-KH-IHMV2US7.js → km-KH-3C3DBY4D.js} +4 -4
  170. package/dist/prod/locales/ko-KR-252XVXUO.js +6 -0
  171. package/dist/prod/locales/ku-TR-S47WOAKQ.js +6 -0
  172. package/dist/prod/locales/lt-LT-N4MVADKY.js +3 -0
  173. package/dist/prod/locales/lv-LV-MKWAOMCV.js +4 -0
  174. package/dist/prod/locales/mr-IN-5ZQ2KKKF.js +9 -0
  175. package/dist/prod/locales/my-MM-CQPBAZ3C.js +1 -0
  176. package/dist/prod/locales/nb-NO-LS7WR2LB.js +12 -0
  177. package/dist/prod/locales/nl-NL-ZFIUCB43.js +13 -0
  178. package/dist/prod/locales/nn-NO-C6VZYYA6.js +12 -0
  179. package/dist/prod/locales/oc-FR-HKE2Q4EB.js +4 -0
  180. package/dist/prod/locales/pa-IN-VRRGDGPO.js +4 -0
  181. package/dist/prod/locales/percentages-GNMENYOM.js +1 -0
  182. package/dist/prod/locales/pl-PL-IKDJKYZ6.js +12 -0
  183. package/dist/prod/locales/pt-BR-3SLYBSE5.js +10 -0
  184. package/dist/prod/locales/pt-PT-IYSDXHUK.js +12 -0
  185. package/dist/prod/locales/ro-RO-UJRVVPIC.js +12 -0
  186. package/dist/prod/locales/ru-RU-HZIM2YEB.js +10 -0
  187. package/dist/prod/locales/si-LK-2245BBTR.js +1 -0
  188. package/dist/prod/locales/sk-SK-3XJXPZL2.js +7 -0
  189. package/dist/prod/locales/sl-SI-ZG25RUOF.js +8 -0
  190. package/dist/prod/locales/sv-SE-AMO52AAG.js +12 -0
  191. package/dist/prod/locales/ta-IN-XBEQL7OQ.js +6 -0
  192. package/dist/prod/locales/th-TH-4B4GT7FX.js +12 -0
  193. package/dist/prod/locales/tr-TR-XTNMRUZW.js +4 -0
  194. package/dist/prod/locales/uk-UA-5VOP37JY.js +10 -0
  195. package/dist/prod/locales/uz-UZ-5K434UFF.js +1 -0
  196. package/dist/prod/locales/vi-VN-FWZOJUQD.js +7 -0
  197. package/dist/prod/locales/zh-CN-P75PHRVR.js +11 -0
  198. package/dist/prod/locales/zh-HK-5LPNYYDF.js +1 -0
  199. package/dist/prod/locales/zh-TW-GELCCBTD.js +13 -0
  200. package/dist/prod/minimap-controller.chunk.js +1 -0
  201. package/dist/prod/minimap-shared.chunk.js +1 -0
  202. package/dist/prod/minimap-worker.chunk.js +1 -0
  203. package/dist/types/common/src/colors.d.ts +3 -0
  204. package/dist/types/common/src/constants.d.ts +56 -0
  205. package/dist/types/common/src/keys.d.ts +4 -0
  206. package/dist/types/common/src/random.d.ts +7 -0
  207. package/dist/types/common/src/utils.d.ts +12 -1
  208. package/dist/types/element/src/Scene.d.ts +1 -1
  209. package/dist/types/element/src/align.d.ts +4 -1
  210. package/dist/types/element/src/binding.d.ts +75 -7
  211. package/dist/types/element/src/bounds.d.ts +10 -2
  212. package/dist/types/element/src/collision.d.ts +21 -5
  213. package/dist/types/element/src/comparisons.d.ts +5 -3
  214. package/dist/types/element/src/cropElement.d.ts +36 -4
  215. package/dist/types/element/src/delta.d.ts +30 -2
  216. package/dist/types/element/src/distribute.d.ts +4 -1
  217. package/dist/types/element/src/dragElements.d.ts +8 -3
  218. package/dist/types/element/src/duplicate.d.ts +60 -0
  219. package/dist/types/element/src/elbowArrow.d.ts +5 -0
  220. package/dist/types/element/src/embeddable.d.ts +2 -1
  221. package/dist/types/element/src/flowchart.d.ts +6 -8
  222. package/dist/types/element/src/frame.d.ts +21 -3
  223. package/dist/types/element/src/groups.d.ts +1 -6
  224. package/dist/types/element/src/image.d.ts +5 -2
  225. package/dist/types/element/src/index.d.ts +3 -0
  226. package/dist/types/element/src/linearElementEditor.d.ts +4 -1
  227. package/dist/types/element/src/listMarker.d.ts +39 -0
  228. package/dist/types/element/src/mutateElement.d.ts +1 -1
  229. package/dist/types/element/src/newElement.d.ts +40 -3
  230. package/dist/types/element/src/renderElement.d.ts +31 -4
  231. package/dist/types/element/src/renderEnvironment.d.ts +66 -0
  232. package/dist/types/element/src/resizeElements.d.ts +15 -5
  233. package/dist/types/element/src/selection.d.ts +4 -10
  234. package/dist/types/element/src/shape.d.ts +17 -1
  235. package/dist/types/element/src/sizeHelpers.d.ts +6 -0
  236. package/dist/types/element/src/stickyNote.d.ts +191 -0
  237. package/dist/types/element/src/textElement.d.ts +10 -2
  238. package/dist/types/element/src/textMeasurements.d.ts +15 -11
  239. package/dist/types/element/src/textWrapping.d.ts +3 -2
  240. package/dist/types/element/src/transform.d.ts +30 -7
  241. package/dist/types/element/src/typeChecks.d.ts +3 -2
  242. package/dist/types/element/src/types.d.ts +28 -6
  243. package/dist/types/element/src/utils.d.ts +8 -1
  244. package/dist/types/element/src/zindex.d.ts +1 -1
  245. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +48 -3
  246. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  247. package/dist/types/excalidraw/actions/actionBoundText.d.ts +62 -208
  248. package/dist/types/excalidraw/actions/actionCanvas.d.ts +121 -16
  249. package/dist/types/excalidraw/actions/actionClipboard.d.ts +32 -2
  250. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +16 -1
  251. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -546
  252. package/dist/types/excalidraw/actions/actionDeselect.d.ts +20 -2
  253. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  254. package/dist/types/excalidraw/actions/actionElementLink.d.ts +16 -1
  255. package/dist/types/excalidraw/actions/actionElementLock.d.ts +32 -2
  256. package/dist/types/excalidraw/actions/actionExport.d.ts +39 -9
  257. package/dist/types/excalidraw/actions/actionFrame.d.ts +92 -479
  258. package/dist/types/excalidraw/actions/actionGroup.d.ts +34 -4
  259. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +66 -2
  260. package/dist/types/excalidraw/actions/actionLink.d.ts +16 -1
  261. package/dist/types/excalidraw/actions/actionMenu.d.ts +16 -1
  262. package/dist/types/excalidraw/actions/actionProperties.d.ts +42 -8
  263. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +17 -2
  264. package/dist/types/excalidraw/actions/actionStyles.d.ts +17 -2
  265. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +452 -6
  266. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +16 -1
  267. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -1
  268. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +16 -1
  269. package/dist/types/excalidraw/actions/actionToggleMinimap.d.ts +201 -0
  270. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +16 -1
  271. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -1
  272. package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +198 -0
  273. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +16 -1
  274. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +16 -1
  275. package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
  276. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +16 -1
  277. package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
  278. package/dist/types/excalidraw/actions/index.d.ts +3 -0
  279. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  280. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  281. package/dist/types/excalidraw/appState.d.ts +26 -8
  282. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -1
  283. package/dist/types/excalidraw/charts/charts.helpers.d.ts +6 -5
  284. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -1
  285. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -1
  286. package/dist/types/excalidraw/charts/index.d.ts +2 -1
  287. package/dist/types/excalidraw/components/Actions.d.ts +10 -2
  288. package/dist/types/excalidraw/components/App.arrowText.d.ts +5 -39
  289. package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
  290. package/dist/types/excalidraw/components/App.d.ts +129 -218
  291. package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
  292. package/dist/types/excalidraw/components/App.host.d.ts +102 -0
  293. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  294. package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
  295. package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
  296. package/dist/types/excalidraw/components/App.selectionTool.d.ts +94 -0
  297. package/dist/types/excalidraw/components/App.text.d.ts +194 -0
  298. package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
  299. package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
  300. package/dist/types/excalidraw/components/App.viewport.d.ts +64 -4
  301. package/dist/types/excalidraw/components/App.wheel.d.ts +30 -0
  302. package/dist/types/excalidraw/components/App.wrap.d.ts +39 -0
  303. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  304. package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
  305. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -1
  306. package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
  307. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +4 -1
  308. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
  309. package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
  310. package/dist/types/excalidraw/components/IconButton.d.ts +2 -0
  311. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
  312. package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
  313. package/dist/types/excalidraw/components/Minimap/Minimap.d.ts +15 -0
  314. package/dist/types/excalidraw/components/Minimap/MinimapAnnouncementDot.d.ts +10 -0
  315. package/dist/types/excalidraw/components/Minimap/minimap-controller.chunk.d.ts +90 -0
  316. package/dist/types/excalidraw/components/Minimap/minimap-shared.chunk.d.ts +122 -0
  317. package/dist/types/excalidraw/components/Minimap/minimap-worker.chunk.d.ts +12 -0
  318. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -2
  319. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +2 -1
  320. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  321. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +5 -2
  322. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
  323. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +4 -1
  324. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +3 -2
  325. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +14 -1
  326. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +16 -0
  327. package/dist/types/excalidraw/components/Tools.d.ts +7 -2
  328. package/dist/types/excalidraw/components/Tooltip.d.ts +26 -2
  329. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
  330. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
  331. package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
  332. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -1
  333. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +2 -0
  334. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  335. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  336. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +13 -2
  337. package/dist/types/excalidraw/components/icons.d.ts +2 -0
  338. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +3 -0
  339. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +2 -2
  340. package/dist/types/excalidraw/data/blob.d.ts +46 -16
  341. package/dist/types/excalidraw/data/index.d.ts +3 -3
  342. package/dist/types/excalidraw/data/json.d.ts +23 -8
  343. package/dist/types/excalidraw/fonts/Fonts.d.ts +9 -6
  344. package/dist/types/excalidraw/history.d.ts +10 -4
  345. package/dist/types/excalidraw/index.d.ts +4 -2
  346. package/dist/types/excalidraw/mermaid.d.ts +7 -0
  347. package/dist/types/excalidraw/reactUtils.d.ts +1 -1
  348. package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
  349. package/dist/types/excalidraw/renderer/animation.d.ts +11 -4
  350. package/dist/types/excalidraw/renderer/helpers.d.ts +18 -0
  351. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  352. package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
  353. package/dist/types/excalidraw/scene/Renderer.d.ts +64 -3
  354. package/dist/types/excalidraw/scene/export.d.ts +343 -20
  355. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  356. package/dist/types/excalidraw/scene/types.d.ts +26 -2
  357. package/dist/types/excalidraw/types.d.ts +191 -22
  358. package/dist/types/excalidraw/viewport.d.ts +29 -1
  359. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -1
  360. package/dist/types/utils/src/index.d.ts +3 -1
  361. package/dist/types/utils/src/shape.d.ts +2 -2
  362. package/history.ts +29 -4
  363. package/package.json +6 -6
  364. package/dist/dev/chunk-72CYJXY3.js +0 -69
  365. package/dist/dev/chunk-72CYJXY3.js.map +0 -7
  366. package/dist/dev/chunk-KKZSEXXE.js.map +0 -7
  367. package/dist/dev/chunk-ZQ2W3FVU.js.map +0 -7
  368. package/dist/dev/locales/ar-SA-EW44IW4V.js.map +0 -7
  369. package/dist/dev/locales/az-AZ-AI7WAYA2.js.map +0 -7
  370. package/dist/dev/locales/bg-BG-43ZNGDXF.js.map +0 -7
  371. package/dist/dev/locales/bn-BD-PU4CN7NP.js.map +0 -7
  372. package/dist/dev/locales/bn-IN-54CF43JL.js.map +0 -7
  373. package/dist/dev/locales/ca-ES-RHJO3QDO.js.map +0 -7
  374. package/dist/dev/locales/cs-CZ-ZRSAO3BA.js.map +0 -7
  375. package/dist/dev/locales/da-DK-OAB6DEJX.js +0 -843
  376. package/dist/dev/locales/da-DK-OAB6DEJX.js.map +0 -7
  377. package/dist/dev/locales/de-CH-QF7JLXTF.js.map +0 -7
  378. package/dist/dev/locales/de-DE-5ZO4KOPT.js.map +0 -7
  379. package/dist/dev/locales/el-GR-F74ZSUEO.js.map +0 -7
  380. package/dist/dev/locales/es-ES-3B3IENPS.js.map +0 -7
  381. package/dist/dev/locales/eu-ES-NH447TVU.js.map +0 -7
  382. package/dist/dev/locales/fa-IR-GHKV6Q2J.js.map +0 -7
  383. package/dist/dev/locales/fi-FI-ZXSYWCC4.js.map +0 -7
  384. package/dist/dev/locales/fr-FR-RJSOSEYS.js.map +0 -7
  385. package/dist/dev/locales/gl-ES-NAUVMVFY.js.map +0 -7
  386. package/dist/dev/locales/he-IL-JBKWWR75.js.map +0 -7
  387. package/dist/dev/locales/hi-IN-SD773MVZ.js.map +0 -7
  388. package/dist/dev/locales/hu-HU-OTA7GOAV.js.map +0 -7
  389. package/dist/dev/locales/id-ID-2JAZWVTQ.js.map +0 -7
  390. package/dist/dev/locales/it-IT-GHWUAT77.js.map +0 -7
  391. package/dist/dev/locales/ja-JP-YMGRGBPS.js.map +0 -7
  392. package/dist/dev/locales/kaa-RRE7XUCW.js.map +0 -7
  393. package/dist/dev/locales/kab-KAB-ZCYVOJU4.js.map +0 -7
  394. package/dist/dev/locales/kk-KZ-TO6XEFJC.js.map +0 -7
  395. package/dist/dev/locales/km-KH-3HTDL5HB.js.map +0 -7
  396. package/dist/dev/locales/ko-KR-O4L4O7L6.js.map +0 -7
  397. package/dist/dev/locales/ku-TR-AFJWDY67.js.map +0 -7
  398. package/dist/dev/locales/lt-LT-7QOT2VDQ.js.map +0 -7
  399. package/dist/dev/locales/lv-LV-WV6C4NYF.js.map +0 -7
  400. package/dist/dev/locales/mr-IN-3TLYWOEI.js.map +0 -7
  401. package/dist/dev/locales/my-MM-NNL2QJT3.js.map +0 -7
  402. package/dist/dev/locales/nb-NO-PG3XLMEV.js.map +0 -7
  403. package/dist/dev/locales/nl-NL-MMOYEKKQ.js.map +0 -7
  404. package/dist/dev/locales/nn-NO-AAC2I2YX.js +0 -843
  405. package/dist/dev/locales/nn-NO-AAC2I2YX.js.map +0 -7
  406. package/dist/dev/locales/oc-FR-SR6MFB4N.js.map +0 -7
  407. package/dist/dev/locales/pa-IN-ADGMQLQI.js.map +0 -7
  408. package/dist/dev/locales/pl-PL-FNIPTMVP.js.map +0 -7
  409. package/dist/dev/locales/pt-BR-67FMCDNE.js.map +0 -7
  410. package/dist/dev/locales/pt-PT-4G3GI4SF.js.map +0 -7
  411. package/dist/dev/locales/ro-RO-CUZFN555.js.map +0 -7
  412. package/dist/dev/locales/ru-RU-4GHINTII.js.map +0 -7
  413. package/dist/dev/locales/si-LK-SSNT7T4A.js.map +0 -7
  414. package/dist/dev/locales/sk-SK-J7TKZQEH.js.map +0 -7
  415. package/dist/dev/locales/sl-SI-SIBF67NE.js.map +0 -7
  416. package/dist/dev/locales/sv-SE-YTR46NVM.js.map +0 -7
  417. package/dist/dev/locales/ta-IN-7AW6CTGA.js.map +0 -7
  418. package/dist/dev/locales/th-TH-DTLYJYKV.js +0 -843
  419. package/dist/dev/locales/th-TH-DTLYJYKV.js.map +0 -7
  420. package/dist/dev/locales/tr-TR-UDQGNXAG.js.map +0 -7
  421. package/dist/dev/locales/uk-UA-25HL2NCU.js.map +0 -7
  422. package/dist/dev/locales/uz-UZ-OPSBAY4H.js.map +0 -7
  423. package/dist/dev/locales/vi-VN-DK367UGA.js.map +0 -7
  424. package/dist/dev/locales/zh-CN-QCVKNWUH.js.map +0 -7
  425. package/dist/dev/locales/zh-HK-WFGYHWPG.js.map +0 -7
  426. package/dist/dev/locales/zh-TW-WHQS4ZSD.js.map +0 -7
  427. package/dist/prod/chunk-5XKZK2GL.js +0 -1
  428. package/dist/prod/chunk-COKSSPJQ.js +0 -4
  429. package/dist/prod/chunk-ZPMXAHWN.js +0 -12
  430. package/dist/prod/locales/ar-SA-5WIASEJP.js +0 -10
  431. package/dist/prod/locales/az-AZ-V5EUQD6C.js +0 -1
  432. package/dist/prod/locales/bg-BG-EXASCMTR.js +0 -5
  433. package/dist/prod/locales/bn-BD-U4SYNFCO.js +0 -3
  434. package/dist/prod/locales/bn-IN-HKDJIITE.js +0 -3
  435. package/dist/prod/locales/ca-ES-2KGUU5XB.js +0 -8
  436. package/dist/prod/locales/cs-CZ-VUCGPRML.js +0 -7
  437. package/dist/prod/locales/da-DK-NNDP2IVP.js +0 -2
  438. package/dist/prod/locales/de-CH-I7RAVIZN.js +0 -11
  439. package/dist/prod/locales/de-DE-WBQ3DQLR.js +0 -11
  440. package/dist/prod/locales/el-GR-TYQHVGXW.js +0 -7
  441. package/dist/prod/locales/en-2RFA324Y.js +0 -1
  442. package/dist/prod/locales/es-ES-JEUOREKJ.js +0 -12
  443. package/dist/prod/locales/eu-ES-SO5DEEAN.js +0 -8
  444. package/dist/prod/locales/fa-IR-FIYUE2GQ.js +0 -9
  445. package/dist/prod/locales/fi-FI-REAEF6HQ.js +0 -6
  446. package/dist/prod/locales/fr-FR-SUCL7J6B.js +0 -12
  447. package/dist/prod/locales/gl-ES-KHCSOGVH.js +0 -6
  448. package/dist/prod/locales/he-IL-JYXVXV2Q.js +0 -9
  449. package/dist/prod/locales/hi-IN-BU52H3BO.js +0 -3
  450. package/dist/prod/locales/hu-HU-OWADXDQ3.js +0 -3
  451. package/dist/prod/locales/id-ID-EOMR5R3I.js +0 -8
  452. package/dist/prod/locales/it-IT-FC2VTM3L.js +0 -12
  453. package/dist/prod/locales/ja-JP-JBNTKYP4.js +0 -12
  454. package/dist/prod/locales/kaa-TC3VIB7V.js +0 -1
  455. package/dist/prod/locales/kab-KAB-UOUDSQKM.js +0 -4
  456. package/dist/prod/locales/kk-KZ-P5H2X7YS.js +0 -1
  457. package/dist/prod/locales/ko-KR-ZTMANIDF.js +0 -5
  458. package/dist/prod/locales/ku-TR-GPJTRB5G.js +0 -6
  459. package/dist/prod/locales/lt-LT-V3XDOK3P.js +0 -3
  460. package/dist/prod/locales/lv-LV-DVQ3FADO.js +0 -4
  461. package/dist/prod/locales/mr-IN-VZ6HH5FE.js +0 -9
  462. package/dist/prod/locales/my-MM-XYKWHRK6.js +0 -1
  463. package/dist/prod/locales/nb-NO-UNO2GGZJ.js +0 -8
  464. package/dist/prod/locales/nl-NL-76EFHT4P.js +0 -13
  465. package/dist/prod/locales/nn-NO-CFKD7ABE.js +0 -4
  466. package/dist/prod/locales/oc-FR-YBJTCJ3J.js +0 -4
  467. package/dist/prod/locales/pa-IN-SNOXSMRV.js +0 -4
  468. package/dist/prod/locales/percentages-Q7USCRWZ.js +0 -1
  469. package/dist/prod/locales/pl-PL-BSY6YFZ3.js +0 -12
  470. package/dist/prod/locales/pt-BR-CZDV62R3.js +0 -10
  471. package/dist/prod/locales/pt-PT-JO57XJJW.js +0 -12
  472. package/dist/prod/locales/ro-RO-UZ5ICYYN.js +0 -12
  473. package/dist/prod/locales/ru-RU-AN7JPREC.js +0 -10
  474. package/dist/prod/locales/si-LK-7CBLD6QQ.js +0 -1
  475. package/dist/prod/locales/sk-SK-SWR6DKBI.js +0 -7
  476. package/dist/prod/locales/sl-SI-JRML4FIH.js +0 -6
  477. package/dist/prod/locales/sv-SE-4ZPKFFXF.js +0 -12
  478. package/dist/prod/locales/ta-IN-V6NHHU6Z.js +0 -6
  479. package/dist/prod/locales/th-TH-P7CTMGDK.js +0 -1
  480. package/dist/prod/locales/tr-TR-GUFYG22B.js +0 -4
  481. package/dist/prod/locales/uk-UA-K6SV5NFQ.js +0 -6
  482. package/dist/prod/locales/uz-UZ-TVKTZO2G.js +0 -1
  483. package/dist/prod/locales/vi-VN-7FKFXJNO.js +0 -7
  484. package/dist/prod/locales/zh-CN-AOKVLNNK.js +0 -11
  485. package/dist/prod/locales/zh-HK-CDKPF5DC.js +0 -1
  486. package/dist/prod/locales/zh-TW-ZVGYESGW.js +0 -13
  487. package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +0 -31
  488. package/dist/types/utils/src/export.d.ts +0 -35
  489. /package/dist/dev/data/{image-ORD6XJVB.js.map → image-MEFJ53NR.js.map} +0 -0
  490. /package/dist/dev/locales/{en-DSRJ5DKP.js.map → en-S76M77LQ.js.map} +0 -0
  491. /package/dist/dev/locales/{percentages-DKKGPYTW.js.map → percentages-7WBDDXTY.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -13,8 +13,89 @@ Please add the latest change on the top under the correct section.
13
13
 
14
14
  ## Unreleased
15
15
 
16
+ ### Minimap, zoom menu and `ui.disabled` (2026-11-12) [#12605](https://github.com/excalidraw/excalidraw/pull/12605), [#12606](https://github.com/excalidraw/excalidraw/pull/12606)
17
+
18
+ - A toggleable minimap above the bottom-left canvas actions: drag its viewport (or press outside of it) to pan, wheel over it to zoom. Toggled from the footer button next to the zoom level, the Preferences menu, the command palette and the context menu; stored as `appState.minimapEnabled` (in the browser, not in exported files). Not shown on phones or in editors shorter than 500px.
19
+ - The zoom out / zoom in buttons are replaced by a zoom menu on the zoom level (zoom in and out, zoom to fit, zoom to selection, reset zoom), sharing the footer island with the minimap toggle. The zoom in, zoom out and reset zoom actions are unchanged.
20
+ - New `ui={{ disabled: { minimap: true } }}`, the opt-out form of the `ui` prop: the full default UI minus the listed controls. It removes the minimap and every way to toggle it.
21
+ - Without the minimap toggle (`ui.disabled.minimap`, or the reduced UI of `ui={{ enabled: { zoom: true } }}`), the zoom controls stay the zoom out / zoom level / zoom in buttons.
22
+
23
+ ### Arrows aren't clipped to frames (2026-10-31) [#12516](https://github.com/excalidraw/excalidraw/pull/12516)
24
+
25
+ - Arrows and their labels are no longer clipped to the frame they belong to, so they can connect elements across and out of frames, and their part outside the frame can be selected. They still belong to their frame, so they're moved, copied and deleted with it, but only while one of their ends is in it (bound to an element in the frame, or inside it). An arrow whose ends both leave its frame (moved, bound to elements outside it, or with the elements it's bound to) leaves the frame.
26
+ - Exporting a frame (and `getElementsOverlappingFrame`) now includes other frames' arrows that reach into it, like other elements overlapping it.
27
+ - Moving a frame (dragging it, with the arrow keys or from the stats panel) keeps its arrows bound to the elements that don't move with it, instead of unbinding them.
28
+
29
+ ### Flowchart navigation (2026-10-30) [#12502](https://github.com/excalidraw/excalidraw/pull/12502)
30
+
31
+ - Alt+arrow keys move the selection to the flowchart node that's visually next in that direction, whether or not it's linked to the selected node. They used to follow only the arrows bound to the pressed side, cycle through siblings on repeated presses, and fall back to any linked node when nothing was that way.
32
+ - The nearest node of the first non-empty tier wins: nodes in line (sharing the row for ←/→, the column for ↑/↓), then linked nodes whose center lies past the selected node's edge, then nodes whose center lies within the 45° cone of the pressed direction, then any node whose center lies past that edge. Near-ties go to linked nodes, then the node more level with the selected one's center, then reading order.
33
+ - Nodes connected by plain (non-elbow) arrows now count as part of the flowchart too, both for Alt+arrow navigation and for the nodes Ctrl+arrows keeps new nodes clear of.
34
+
35
+ ### Export API: `exportScene` (2026-10-18) [#12347](https://github.com/excalidraw/excalidraw/pull/12347)
36
+
37
+ Breaking. `exportToCanvas`, `exportToBlob` and `exportToSvg` (in both `@excalidraw/excalidraw` and `@excalidraw/utils`) are replaced by a single `exportScene`, and every rendering option moved from `appState` into an explicit `config`.
38
+
39
+ - `exportScene({ type, data, config })` with `type` `"canvas"`, `"png"`, `"jpeg"` or `"svg"` resolves to an `HTMLCanvasElement`, a `Blob` or an `SVGSVGElement`. `exportToClipboard({ type: "png" | "svg" | "json", data, config })` stays. Types: `ExportSceneData`, `ExportSceneConfig`, `ExportSceneOptions`.
40
+ - `data` is `{ elements, appState?, files? }`, the shape of a `.excalidraw` file. Only the scene settings a file stores are read from `appState`: `viewBackgroundColor` as the default background, and the grid settings that `embedScene` embeds. Any other key is ignored, so passing a live `appState` can't affect the output.
41
+ - Migration:
42
+
43
+ | Before | Now |
44
+ | --- | --- |
45
+ | `exportToCanvas({ elements, appState, files, … })` | `exportScene({ type: "canvas", data: { elements, appState, files }, config })` |
46
+ | `exportToBlob({ …, mimeType, quality })` | `exportScene({ type: "png" \| "jpeg", …, config })` — `quality` is JPEG-only |
47
+ | `exportToSvg({ … })` | `exportScene({ type: "svg", … })` |
48
+ | `appState.exportBackground: false` | `config.canvasBackgroundColor: false` (a color string overrides the background; JPEG always gets one) |
49
+ | `appState.exportWithDarkMode` | `config.theme: "dark"` |
50
+ | `appState.exportScale` | `config.scale` (also multiplies a `maxWidthOrHeight` result) |
51
+ | `appState.exportEmbedScene` | `config.embedScene` (png, svg) |
52
+ | `appState.frameRendering` | `config.frames: { name?, outline?, clip? }` |
53
+ | `exportPadding` | `config.padding` (default 10, as before) |
54
+ | `getDimensions: (w, h) => ({ width, height, scale })` | `config.width`/`height`, `maxWidthOrHeight` or `widthOrHeight`, plus `config.scale` — a number, or `(width, height) => number` receiving the export size at scale 1 (padding included), e.g. to cap the output by a pixel budget |
55
+ | `maxWidthOrHeight`, `exportingFrame`, `renderEmbeddables`, `skipInliningFonts`, `reuseImages` | same names, in `config` |
56
+
57
+ - New sizing options: `width`/`height` (only one given: the other follows the content's aspect ratio), `widthOrHeight` (scales the longest side to exactly that size), `fit: "contain" | "none"` and `position: "center" | "topLeft"` within a `width`/`height` frame, and `x`/`y`/`origin` to export a region (cropped, with padding on all sides). The size options are mutually exclusive in the types, and `fit`, `position` and `x`/`y` only combine with `width`/`height`.
58
+ - `config.environment` for non-browser hosts and other windows, the same for every format: `createCanvas` (e.g. `node-canvas`), `createImage`, `createPath`, `document` (the one SVG is built in, e.g. `linkedom`), `textMetrics` and `loadFonts`.
59
+ - Canvas dimensions are rounded instead of truncated, so float noise no longer costs a pixel (a 20.5px frame-label band now rounds up), and are at least 1px (flat content with no padding used to produce an empty canvas that couldn't be encoded).
60
+ - In dark exports, frame names now use the editor's dark frame-name color (they were dark-filtered twice and came out lighter).
61
+
62
+ ### Selection API (2026-10-10) [#12258](https://github.com/excalidraw/excalidraw/pull/12258)
63
+
64
+ - New `excalidrawAPI.selection`: `select(elements, opts?)`, `add(elements, opts?)`, `remove(elements, opts?)` and `clear(opts?)`, taking elements or their ids, one or many. Missing and deleted elements are skipped.
65
+ - It follows the editor's rules: an element is selected with its group, a frame and its children aren't selected at the same time, and locked elements are skipped. Text editing and cropping end, and the link popup of a lone selected element with a link shows.
66
+ - Options: `deep` selects the elements themselves rather than their groups, editing their group if they share one (as Ctrl/Cmd+click does); `includeLocked` selects locked elements too; `captureUpdate` records the change for undo as for `updateScene()` — by default it's recorded along with the next undoable change.
67
+ - Like `updateScene()`, the change applies on the next render: read it back through `onChange()` or `getAppState()` after that. It works in view mode too, where the selection shows without the transform handles.
68
+
69
+ ### Wheel navigation (2026-09-13) [#12099](https://github.com/excalidraw/excalidraw/pull/12099)
70
+
71
+ - Scrolling while holding the wheel (middle) mouse button zooms the canvas around the pointer, the same as ctrl/cmd+wheel — a wheel-button pan can be zoomed one-handed, without reaching for a modifier.
72
+ - New `appState.inputDevice` preference (`"auto" | "mouse" | "trackpad"`, default `"auto"`, persisted in browser storage) selecting the wheel mappings. With `"trackpad"` a plain wheel pans; with `"mouse"` a plain wheel zooms. Ctrl/cmd+wheel (how a pinch is delivered) zooms with either device. Shift+wheel pans horizontally, and ctrl/cmd+shift+wheel pans vertically. The wheel-button zoom above is unaffected. `"auto"` is reserved for detecting the device from the wheel events and resolves to `"trackpad"` until that is implemented (`resolveInputDevice()`). Set it from the new "Input device" radio in the main menu's preferences submenu, also exposed as `MainMenu.DefaultItems.Preferences.InputDevice`.
73
+
74
+ ### Sticky notes (2026-09-06) [#12064](https://github.com/excalidraw/excalidraw/pull/12064)
75
+
76
+ - New `stickynote` element type and toolbar tool (`N`): an always-filled, flat-rendered note whose label auto-fits — the font shrinks from the user's size down to a minimum, and only then does the note grow in height (it never shrinks below the height the user gave it). Click to place a 250×250 note, drag to size it (previewed at the dragged size, snapped to a font-aware minimum on release); text editing starts right away.
77
+ - Element model: the note carries `baseHeight` (the user's height; `height ≥ baseHeight`), its label carries `baseFontSize` (the user's font ceiling, `null`/absent on any other text) while `fontSize` holds the fitted size. Read a text element's user-facing size through `getBaseFontSize(text, elementsMap)`.
78
+ - Sticky notes are their own color domain: new `appState.currentItemStickynoteStrokeColor` (the note's text color) and `appState.currentItemStickynoteBackgroundColor` defaults, and new customizable top-pick slots `appState.colorTopPicks.stickyNoteStroke` / `stickyNoteBackground`. The stroke and background pickers, both eyedroppers and paste-styles resolve their target (regular / sticky / mixed) at execution time. A note and its label share one ink (the stroke picker reads "Text color" for notes): coloring the label while editing colors the note too, binding a colored text gives the note its color, and the creation-date footer always paints in that ink.
79
+ - Skeleton API: `convertToExcalidrawElements([{ type: "stickynote", x, y, label?: { text, fontSize? } }])` creates a note (and fitted label); see the element-skeleton docs.
80
+ - Tools can be dragged out of the toolbar: drag the sticky note button onto the canvas to drop a default-sized note where you release it, previewed translucently while dragging (nothing reaches the scene, history or collaborators until the drop; Escape cancels). The mechanism is generic — other tools can opt in.
81
+ - Toolbar: on desktop and tablet the image tool moved into the "More tools" menu (still `9`; `UIOptions.tools.image` keeps hiding it; the mobile toolbar keeps its image slot), and tool badges now show the letter shortcuts (`R`, `T`, `N`, …) instead of the numbers, which are no longer contiguous. The number keys keep working.
82
+ - Each note shows its creation date (`element.created`) in a footer band — "7 Sep", or "7 Sep 2025" once the year differs — on canvas and in SVG/PNG exports. The band is reserved in the note's layout, so the label never overlaps it; notes without a timestamp keep the band empty.
83
+ - Resize semantics: a note's corners resize proportionally by default and scale the label's font ceiling with the note (Shift frees them); its edges resize freely by default (Shift constrains them). Drag-creation is proportional by default too (Shift frees it) and never touches the font ceiling. Width-only gestures keep the base height, height gestures set it, aspect-locked multi-select and Stats group edits scale the ceiling; flips preserve everything. Arrows bound to a note follow it as it grows.
84
+
16
85
  ## Excalidraw API
17
86
 
87
+ ### `setViewport` stops following a collaborator (2026-09-26) [#12184](https://github.com/excalidraw/excalidraw/pull/12184)
88
+
89
+ - `setViewport` now asks to stop following a collaborator whenever it navigates (`onUserFollow` with `action: "UNFOLLOW"`, if `userToFollow` is set), as a user's pan or zoom does. `setViewport(null)` (clearing a lock) and a target that doesn't resolve don't navigate, and leave following alone.
90
+
91
+ ### `onDuplicate` can replace and veto duplicates (2026-09-18) [#12124](https://github.com/excalidraw/excalidraw/pull/12124)
92
+
93
+ - `props.onDuplicate` may now return new objects for the duplicated elements in every duplication path. Previously the editor kept using the objects it created, so on paste (and library insert) the frame assignment and bound text redraw went to objects that were no longer in the scene, and alt-drag dragged an element that wasn't in the scene. The returned changes are now merged into the editor's duplicates, so they're part of the duplication's own undo entry and durable increment (no follow-up `updateScene` needed).
94
+ - When pasting or inserting onto a frame, the duplicates passed to `onDuplicate` already have their `frameId` set (and are ordered under the frame).
95
+ - Omitting a duplicate from the returned array (or returning it as deleted) now reliably prevents that element from being duplicated — previously pasting over a frame brought it back, and alt-drag broke. References to it from the remaining duplicates (bindings, `boundElements`, `frameId`) are cleared, and a bound text isn't duplicated without its container. If no duplicate remains, the duplication is cancelled and the returned elements are ignored: paste and the duplicate action do nothing, and alt-drag moves the original elements instead. When only some duplicates are vetoed during alt-drag, their originals stay where they were.
96
+ - `onDuplicate` may return `false` to prevent the duplication as a whole (same as omitting every duplicate, without having to find them).
97
+ - `onDuplicate` receives a third argument with lookups covering just the elements taking part in the duplication, so you don't have to derive them by scanning the scene: `{ duplicateElements, originalElements, origIdToDuplicateId, duplicateIdToOrigId }` — the duplicates by id, the elements they were made from by id, and their ids mapped in both directions (`duplicateIdToOrigId` to look up a duplicate's original while modifying it, `origIdToDuplicateId` e.g. for remapping element ids you keep in `customData`). On paste and library insert the originals are the inserted elements, which aren't part of the scene. The maps are read-only.
98
+
18
99
  ### Host-controlled active tool (2026-07-14) [#11665](https://github.com/excalidraw/excalidraw/pull/11665)
19
100
 
20
101
  - Added `activeTool` prop (`{ type: ToolType } | { type: "custom"; customType: string }`) for forcing the active editor tool (controlled). While set, user- and API-driven tool switching is ignored — `setActiveTool` refuses non-matching activations with a console warning, non-forced toolbar buttons render disabled, and the tool-lock toggle (`Q`) is inert — and the editor snaps back if internal flows reset the tool (e.g. `restore()` on scene load). The forced tool behaves as if locked — it doesn't revert to selection after use and drawn elements aren't auto-selected — without mutating `appState.activeTool.locked`, so the user's persisted padlock preference stays untouched. Unset the prop to return tool control to the editor (the current tool stays active). The forced tool must be activatable to take effect — not disabled via `UIOptions.tools`, and (while non-interactive) allowed via `interaction.enabled.tools`; otherwise the editor stays on the `selection` tool and applies the forced tool once it becomes activatable. `image` cannot be forced (its activation opens the file picker). Composes with `interaction.enabled.tools` for presentation-style hosts: force `laser` for the presenter, `selection` + `interaction={false}` for viewers.
@@ -100,6 +181,8 @@ The toolbar UI was rewritten from hidden radio/checkbox inputs to real `<button>
100
181
 
101
182
  ### Other Breaking changes
102
183
 
184
+ - `convertToExcalidrawElements()` places bound arrows where their bindings put them, as the editor does whenever it updates their bindings (e.g. on undo/redo, or moving what they're bound to), instead of keeping their ends exactly where given. An end given just short of what it's bound to is extended onto it, and one beyond its binding area is unbound. Shapes created from an arrow's `start`/`end` are placed along its end segment. [#12425](https://github.com/excalidraw/excalidraw/pull/12425)
185
+
103
186
  - `UIAppState` no longer includes `zoom`, `shouldCacheIgnoreZoom`, and the canvas-interaction transients `snapLines`, `originSnapOffset`, `suggestedBinding`, `frameToHighlight`, and `elementsToHighlight`. These update per pointermove or per animation frame and no longer re-render the editor UI, so UI render props receiving `UIAppState` (`renderCustomStats`, custom `<Footer/>` content, etc.) don't receive them anymore and would render stale values if they read them off the full `AppState`. Subscribe through `useExcalidrawStateValue` instead — the component re-renders only when the selected value changes:
104
187
 
105
188
  ```tsx
@@ -133,6 +216,10 @@ The toolbar UI was rewritten from hidden radio/checkbox inputs to real `<button>
133
216
 
134
217
  ### Other Features
135
218
 
219
+ - Mermaid diagrams (in the TTD dialog and on paste) are converted with `@excalidraw/mermaid-to-excalidraw` v3, which lays them out with [Pele](https://pele.run) instead of Mermaid, no longer bundled. Layouts differ from before, `swimlane-beta` diagrams are supported, and Gantt charts, quadrant charts and timelines are converted to elements instead of an image. Each diagram type's code is loaded the first time one is converted. Flowchart edges are elbow arrows, unless the definition sets its own curve (in its front matter or `%%{init}%%`), and class diagram namespaces are drawn as boxes like flowchart subgraphs. [#12480](https://github.com/excalidraw/excalidraw/pull/12480), [#12481](https://github.com/excalidraw/excalidraw/pull/12481), [#12535](https://github.com/excalidraw/excalidraw/pull/12535)
220
+
221
+ - `label.labelPosition` (0–1) of skeleton arrows places their label along the arrow, instead of halfway. [#12425](https://github.com/excalidraw/excalidraw/pull/12425)
222
+
136
223
  - Added `ExcalidrawAPI.isDestroyed` flag. Set to `true` once the editor unmounts. Calling any `get*` method, `onStateChange`, or `onEvent` on a destroyed API instance will throw in development and `console.error` in production. The `ExcalidrawAPI` will be reset to `null` on unmount, but to be extra safe, you should check `ExcalidrawAPI.isDestroyed` before calling these methods to guard against subtle race conditions in your code.
137
224
 
138
225
  - Added `onMount`, `onInitialize`, and `onUnmount` props. `onMount` receives `{ excalidrawAPI, container }` once the editor root is mounted. `onInitialize` fires once the initial scene has loaded. `onUnmount` fires just before unmounting.
@@ -0,0 +1,69 @@
1
+ // locales/percentages.json
2
+ var en = 100;
3
+ var kaa = 19;
4
+ var percentages_default = {
5
+ "ar-SA": 100,
6
+ "az-AZ": 27,
7
+ "bg-BG": 59,
8
+ "bn-BD": 34,
9
+ "bn-IN": 34,
10
+ "ca-ES": 76,
11
+ "cs-CZ": 100,
12
+ "da-DK": 100,
13
+ "de-CH": 100,
14
+ "de-DE": 100,
15
+ "el-GR": 72,
16
+ en,
17
+ "es-ES": 100,
18
+ "eu-ES": 91,
19
+ "fa-IR": 100,
20
+ "fi-FI": 56,
21
+ "fr-FR": 100,
22
+ "gl-ES": 57,
23
+ "he-IL": 94,
24
+ "hi-IN": 100,
25
+ "hu-HU": 100,
26
+ "id-ID": 94,
27
+ "it-IT": 100,
28
+ "ja-JP": 100,
29
+ kaa,
30
+ "kab-KAB": 51,
31
+ "kk-KZ": 13,
32
+ "km-KH": 50,
33
+ "ko-KR": 100,
34
+ "ku-TR": 54,
35
+ "lt-LT": 32,
36
+ "lv-LV": 48,
37
+ "mr-IN": 76,
38
+ "my-MM": 24,
39
+ "nb-NO": 98,
40
+ "nl-NL": 100,
41
+ "nn-NO": 98,
42
+ "oc-FR": 71,
43
+ "pa-IN": 49,
44
+ "pl-PL": 100,
45
+ "pt-BR": 100,
46
+ "pt-PT": 91,
47
+ "ro-RO": 100,
48
+ "ru-RU": 100,
49
+ "si-LK": 61,
50
+ "sk-SK": 91,
51
+ "sl-SI": 94,
52
+ "sv-SE": 96,
53
+ "ta-IN": 71,
54
+ "th-TH": 98,
55
+ "tr-TR": 90,
56
+ "uk-UA": 100,
57
+ "uz-UZ": 0,
58
+ "vi-VN": 63,
59
+ "zh-CN": 100,
60
+ "zh-HK": 14,
61
+ "zh-TW": 94
62
+ };
63
+
64
+ export {
65
+ en,
66
+ kaa,
67
+ percentages_default
68
+ };
69
+ //# sourceMappingURL=chunk-4S62H332.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../locales/percentages.json"],
4
+ "sourcesContent": ["{\n \"ar-SA\": 100,\n \"az-AZ\": 27,\n \"bg-BG\": 59,\n \"bn-BD\": 34,\n \"bn-IN\": 34,\n \"ca-ES\": 76,\n \"cs-CZ\": 100,\n \"da-DK\": 100,\n \"de-CH\": 100,\n \"de-DE\": 100,\n \"el-GR\": 72,\n \"en\": 100,\n \"es-ES\": 100,\n \"eu-ES\": 91,\n \"fa-IR\": 100,\n \"fi-FI\": 56,\n \"fr-FR\": 100,\n \"gl-ES\": 57,\n \"he-IL\": 94,\n \"hi-IN\": 100,\n \"hu-HU\": 100,\n \"id-ID\": 94,\n \"it-IT\": 100,\n \"ja-JP\": 100,\n \"kaa\": 19,\n \"kab-KAB\": 51,\n \"kk-KZ\": 13,\n \"km-KH\": 50,\n \"ko-KR\": 100,\n \"ku-TR\": 54,\n \"lt-LT\": 32,\n \"lv-LV\": 48,\n \"mr-IN\": 76,\n \"my-MM\": 24,\n \"nb-NO\": 98,\n \"nl-NL\": 100,\n \"nn-NO\": 98,\n \"oc-FR\": 71,\n \"pa-IN\": 49,\n \"pl-PL\": 100,\n \"pt-BR\": 100,\n \"pt-PT\": 91,\n \"ro-RO\": 100,\n \"ru-RU\": 100,\n \"si-LK\": 61,\n \"sk-SK\": 91,\n \"sl-SI\": 94,\n \"sv-SE\": 96,\n \"ta-IN\": 71,\n \"th-TH\": 98,\n \"tr-TR\": 90,\n \"uk-UA\": 100,\n \"uz-UZ\": 0,\n \"vi-VN\": 63,\n \"zh-CN\": 100,\n \"zh-HK\": 14,\n \"zh-TW\": 94\n}\n"],
5
+ "mappings": ";AAYE,SAAM;AAaN,UAAO;AAzBT;AAAA,EACE,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT;AAAA,EACA,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT;AAAA,EACA,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,385 @@
1
+ import {
2
+ __publicField
3
+ } from "./chunk-XDFCUUT6.js";
4
+
5
+ // components/Minimap/minimap-shared.chunk.ts
6
+ var MinimapRecord = {
7
+ /** drawn as a filled block */
8
+ BOX: 0,
9
+ /** drawn as an outline, so that it doesn't cover its children */
10
+ FRAME: 1,
11
+ /** drawn as a polyline */
12
+ PATH: 2
13
+ };
14
+ var MINIMAP_BOX_RECORD_SIZE = 6;
15
+ var MINIMAP_PATH_RECORD_HEADER_SIZE = 5;
16
+ var PADDING = 8;
17
+ var MIN_BLOCK_SIZE = 1.5;
18
+ var MINIMAP_MIN_VIEWPORT_SIZE = 6;
19
+ var PATH_WIDTH = 1.25;
20
+ var VIEWPORT_ALPHA = 0.25;
21
+ var VIEWPORT_OPAQUE_SIZE = 0.05;
22
+ var VIEWPORT_TRANSLUCENT_SIZE = 0.12;
23
+ var isSameTransform = (a, b) => !!a && a.scale === b.scale && a.translateX === b.translateX && a.translateY === b.translateY;
24
+ var getMinimapViewportRect = (viewport, transform) => {
25
+ const width = Math.max(
26
+ viewport.width * transform.scale,
27
+ MINIMAP_MIN_VIEWPORT_SIZE
28
+ );
29
+ const height = Math.max(
30
+ viewport.height * transform.scale,
31
+ MINIMAP_MIN_VIEWPORT_SIZE
32
+ );
33
+ return {
34
+ x: (viewport.x + viewport.width / 2) * transform.scale + transform.translateX - width / 2,
35
+ y: (viewport.y + viewport.height / 2) * transform.scale + transform.translateY - height / 2,
36
+ width,
37
+ height
38
+ };
39
+ };
40
+ var getRecordsBounds = (records) => {
41
+ let minX = Infinity;
42
+ let minY = Infinity;
43
+ let maxX = -Infinity;
44
+ let maxY = -Infinity;
45
+ const extend = (x1, y1, x2, y2, angle) => {
46
+ if (angle) {
47
+ const cos = Math.abs(Math.cos(angle));
48
+ const sin = Math.abs(Math.sin(angle));
49
+ const cx = (x1 + x2) / 2;
50
+ const cy = (y1 + y2) / 2;
51
+ const halfWidth = (x2 - x1) / 2;
52
+ const halfHeight = (y2 - y1) / 2;
53
+ const extentX = halfWidth * cos + halfHeight * sin;
54
+ const extentY = halfWidth * sin + halfHeight * cos;
55
+ x1 = cx - extentX;
56
+ x2 = cx + extentX;
57
+ y1 = cy - extentY;
58
+ y2 = cy + extentY;
59
+ }
60
+ minX = Math.min(minX, x1);
61
+ minY = Math.min(minY, y1);
62
+ maxX = Math.max(maxX, x2);
63
+ maxY = Math.max(maxY, y2);
64
+ };
65
+ let i = 0;
66
+ while (i < records.length) {
67
+ if (records[i] === MinimapRecord.PATH) {
68
+ const [x1, y1, x2, y2] = getPathBounds(records, i);
69
+ extend(x1, y1, x2, y2, records[i + 3]);
70
+ i += MINIMAP_PATH_RECORD_HEADER_SIZE + records[i + 4] * 2;
71
+ } else {
72
+ const x = records[i + 1];
73
+ const y = records[i + 2];
74
+ const width = records[i + 3];
75
+ const height = records[i + 4];
76
+ extend(
77
+ Math.min(x, x + width),
78
+ Math.min(y, y + height),
79
+ Math.max(x, x + width),
80
+ Math.max(y, y + height),
81
+ records[i + 5]
82
+ );
83
+ i += MINIMAP_BOX_RECORD_SIZE;
84
+ }
85
+ }
86
+ return Number.isFinite(minX) ? [minX, minY, maxX, maxY] : null;
87
+ };
88
+ var getPathBounds = (records, offset) => {
89
+ const x = records[offset + 1];
90
+ const y = records[offset + 2];
91
+ const count = records[offset + 4];
92
+ let minX = Infinity;
93
+ let minY = Infinity;
94
+ let maxX = -Infinity;
95
+ let maxY = -Infinity;
96
+ for (let p = 0; p < count; p++) {
97
+ const px = records[offset + MINIMAP_PATH_RECORD_HEADER_SIZE + p * 2];
98
+ const py = records[offset + MINIMAP_PATH_RECORD_HEADER_SIZE + p * 2 + 1];
99
+ minX = Math.min(minX, px);
100
+ minY = Math.min(minY, py);
101
+ maxX = Math.max(maxX, px);
102
+ maxY = Math.max(maxY, py);
103
+ }
104
+ if (!count) {
105
+ return [x, y, x, y];
106
+ }
107
+ return [x + minX, y + minY, x + maxX, y + maxY];
108
+ };
109
+ var MinimapRenderer = class {
110
+ constructor(canvas, config) {
111
+ this.canvas = canvas;
112
+ this.config = config;
113
+ __publicField(this, "context");
114
+ /**
115
+ * The elements rendered with `layerTransform`, so that viewport-only
116
+ * changes (panning, zooming) don't redraw every element.
117
+ */
118
+ __publicField(this, "layer");
119
+ __publicField(this, "layerContext");
120
+ __publicField(this, "layerTransform", null);
121
+ __publicField(this, "records", new Float32Array(0));
122
+ __publicField(this, "contentBounds", null);
123
+ __publicField(this, "viewport", null);
124
+ __publicField(this, "lockedTransform", null);
125
+ this.context = canvas.getContext("2d");
126
+ this.layer = typeof OffscreenCanvas !== "undefined" ? new OffscreenCanvas(1, 1) : canvas.ownerDocument.createElement("canvas");
127
+ this.layerContext = this.layer.getContext("2d");
128
+ this.resize();
129
+ }
130
+ setConfig(config) {
131
+ this.config = config;
132
+ this.resize();
133
+ }
134
+ setElements(records) {
135
+ this.records = records;
136
+ this.contentBounds = getRecordsBounds(records);
137
+ this.layerTransform = null;
138
+ }
139
+ setViewport(viewport) {
140
+ this.viewport = viewport;
141
+ }
142
+ getContentBounds() {
143
+ return this.contentBounds;
144
+ }
145
+ setLockedTransform(transform) {
146
+ this.lockedTransform = transform;
147
+ }
148
+ resize() {
149
+ const { width, height, devicePixelRatio } = this.config;
150
+ for (const canvas of [this.canvas, this.layer]) {
151
+ canvas.width = Math.max(1, Math.round(width * devicePixelRatio));
152
+ canvas.height = Math.max(1, Math.round(height * devicePixelRatio));
153
+ }
154
+ this.layerTransform = null;
155
+ }
156
+ /** fits the content along with the viewport into the minimap */
157
+ getTransform() {
158
+ if (this.lockedTransform) {
159
+ return this.lockedTransform;
160
+ }
161
+ let [minX, minY, maxX, maxY] = this.contentBounds ?? [
162
+ Infinity,
163
+ Infinity,
164
+ -Infinity,
165
+ -Infinity
166
+ ];
167
+ if (this.viewport) {
168
+ minX = Math.min(minX, this.viewport.x);
169
+ minY = Math.min(minY, this.viewport.y);
170
+ maxX = Math.max(maxX, this.viewport.x + this.viewport.width);
171
+ maxY = Math.max(maxY, this.viewport.y + this.viewport.height);
172
+ }
173
+ const { width, height } = this.config;
174
+ if (!Number.isFinite(minX)) {
175
+ return { scale: 1, translateX: width / 2, translateY: height / 2 };
176
+ }
177
+ const scale = Math.min(
178
+ Math.max(width - PADDING * 2, 1) / Math.max(maxX - minX, 1),
179
+ Math.max(height - PADDING * 2, 1) / Math.max(maxY - minY, 1)
180
+ );
181
+ return {
182
+ scale,
183
+ translateX: width / 2 - (minX + maxX) / 2 * scale,
184
+ translateY: height / 2 - (minY + maxY) / 2 * scale
185
+ };
186
+ }
187
+ renderLayer(transform) {
188
+ const context = this.layerContext;
189
+ if (!context) {
190
+ return;
191
+ }
192
+ const { devicePixelRatio, colors } = this.config;
193
+ const { scale, translateX, translateY } = transform;
194
+ const { records } = this;
195
+ context.setTransform(1, 0, 0, 1, 0, 0);
196
+ context.clearRect(0, 0, this.layer.width, this.layer.height);
197
+ context.fillStyle = colors.element;
198
+ context.strokeStyle = colors.element;
199
+ context.lineWidth = PATH_WIDTH;
200
+ context.lineJoin = "round";
201
+ context.lineCap = "round";
202
+ const resetTransform = () => context.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0);
203
+ const rotate = (angle, cx, cy) => {
204
+ context.translate(cx, cy);
205
+ context.rotate(angle);
206
+ context.translate(-cx, -cy);
207
+ };
208
+ resetTransform();
209
+ let i = 0;
210
+ while (i < records.length) {
211
+ const kind = records[i];
212
+ if (kind === MinimapRecord.PATH) {
213
+ const count = records[i + 4];
214
+ const angle2 = records[i + 3];
215
+ const originX = records[i + 1] * scale + translateX;
216
+ const originY = records[i + 2] * scale + translateY;
217
+ const points = i + MINIMAP_PATH_RECORD_HEADER_SIZE;
218
+ if (angle2) {
219
+ const [x1, y1, x2, y2] = getPathBounds(records, i);
220
+ rotate(
221
+ angle2,
222
+ (x1 + x2) / 2 * scale + translateX,
223
+ (y1 + y2) / 2 * scale + translateY
224
+ );
225
+ }
226
+ context.beginPath();
227
+ for (let p = 0; p < count; p++) {
228
+ const x = originX + records[points + p * 2] * scale;
229
+ const y = originY + records[points + p * 2 + 1] * scale;
230
+ if (p === 0) {
231
+ context.moveTo(x, y);
232
+ } else {
233
+ context.lineTo(x, y);
234
+ }
235
+ }
236
+ if (count === 1) {
237
+ context.lineTo(originX, originY);
238
+ }
239
+ context.stroke();
240
+ if (angle2) {
241
+ resetTransform();
242
+ }
243
+ i += MINIMAP_PATH_RECORD_HEADER_SIZE + count * 2;
244
+ continue;
245
+ }
246
+ const angle = records[i + 5];
247
+ const width = Math.max(Math.abs(records[i + 3]) * scale, MIN_BLOCK_SIZE);
248
+ const height = Math.max(Math.abs(records[i + 4]) * scale, MIN_BLOCK_SIZE);
249
+ const cx = (records[i + 1] + records[i + 3] / 2) * scale + translateX;
250
+ const cy = (records[i + 2] + records[i + 4] / 2) * scale + translateY;
251
+ if (angle) {
252
+ rotate(angle, cx, cy);
253
+ }
254
+ if (kind === MinimapRecord.FRAME) {
255
+ context.strokeRect(cx - width / 2, cy - height / 2, width, height);
256
+ } else {
257
+ context.fillRect(cx - width / 2, cy - height / 2, width, height);
258
+ }
259
+ if (angle) {
260
+ resetTransform();
261
+ }
262
+ i += MINIMAP_BOX_RECORD_SIZE;
263
+ }
264
+ this.layerTransform = transform;
265
+ }
266
+ render() {
267
+ const transform = this.getTransform();
268
+ const context = this.context;
269
+ if (!context) {
270
+ return transform;
271
+ }
272
+ if (!isSameTransform(this.layerTransform, transform)) {
273
+ this.renderLayer(transform);
274
+ }
275
+ const { devicePixelRatio, colors } = this.config;
276
+ context.setTransform(1, 0, 0, 1, 0, 0);
277
+ context.clearRect(0, 0, this.canvas.width, this.canvas.height);
278
+ context.drawImage(this.layer, 0, 0);
279
+ if (this.viewport) {
280
+ const { x, y, width, height } = getMinimapViewportRect(
281
+ this.viewport,
282
+ transform
283
+ );
284
+ const size = Math.max(
285
+ width / this.config.width,
286
+ height / this.config.height
287
+ );
288
+ const translucency = Math.min(
289
+ Math.max(
290
+ (size - VIEWPORT_OPAQUE_SIZE) / (VIEWPORT_TRANSLUCENT_SIZE - VIEWPORT_OPAQUE_SIZE),
291
+ 0
292
+ ),
293
+ 1
294
+ );
295
+ context.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0);
296
+ context.globalAlpha = 1 - translucency * (1 - VIEWPORT_ALPHA);
297
+ context.fillStyle = colors.viewport;
298
+ context.beginPath();
299
+ if (context.roundRect) {
300
+ context.roundRect(x, y, width, height, 2);
301
+ } else {
302
+ context.rect(x, y, width, height);
303
+ }
304
+ context.fill();
305
+ context.globalAlpha = 1;
306
+ }
307
+ return transform;
308
+ }
309
+ };
310
+ var defaultScheduler = {
311
+ requestFrame: (callback) => typeof requestAnimationFrame === "function" ? requestAnimationFrame(callback) : setTimeout(callback, 16),
312
+ cancelFrame: (id) => {
313
+ if (typeof cancelAnimationFrame === "function") {
314
+ cancelAnimationFrame(id);
315
+ } else {
316
+ clearTimeout(id);
317
+ }
318
+ }
319
+ };
320
+ var createMinimapEndpoint = (postMessage, { requestFrame, cancelFrame } = defaultScheduler) => {
321
+ let renderer = null;
322
+ let frameId = null;
323
+ let elementsSeq = -1;
324
+ let reportedSeq = -1;
325
+ let reportedTransform = null;
326
+ const render = () => {
327
+ frameId = null;
328
+ if (!renderer || elementsSeq < 0) {
329
+ return;
330
+ }
331
+ const transform = renderer.render();
332
+ if (reportedSeq !== elementsSeq || !isSameTransform(reportedTransform, transform)) {
333
+ reportedSeq = elementsSeq;
334
+ reportedTransform = transform;
335
+ postMessage({
336
+ type: "frame",
337
+ transform,
338
+ elementsSeq,
339
+ contentBounds: renderer.getContentBounds()
340
+ });
341
+ }
342
+ };
343
+ return {
344
+ handle: (message) => {
345
+ switch (message.type) {
346
+ case "init":
347
+ renderer = new MinimapRenderer(message.canvas, message.config);
348
+ break;
349
+ case "config":
350
+ renderer?.setConfig(message.config);
351
+ break;
352
+ case "elements":
353
+ elementsSeq = message.seq;
354
+ renderer?.setElements(message.records);
355
+ break;
356
+ case "viewport":
357
+ renderer?.setViewport(message.viewport);
358
+ break;
359
+ case "lock":
360
+ renderer?.setLockedTransform(message.transform);
361
+ break;
362
+ }
363
+ if (frameId === null) {
364
+ frameId = requestFrame(render);
365
+ }
366
+ },
367
+ destroy: () => {
368
+ if (frameId !== null) {
369
+ cancelFrame(frameId);
370
+ frameId = null;
371
+ }
372
+ renderer = null;
373
+ }
374
+ };
375
+ };
376
+
377
+ export {
378
+ MinimapRecord,
379
+ MINIMAP_BOX_RECORD_SIZE,
380
+ MINIMAP_PATH_RECORD_HEADER_SIZE,
381
+ MINIMAP_MIN_VIEWPORT_SIZE,
382
+ getMinimapViewportRect,
383
+ createMinimapEndpoint
384
+ };
385
+ //# sourceMappingURL=chunk-CB5LBNRX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../components/Minimap/minimap-shared.chunk.ts"],
4
+ "sourcesContent": ["/**\n * Minimap renderer & message protocol, shared by the worker and by the\n * main-thread fallback.\n *\n * DON'T depend on anything from the outside, as this module is part of a\n * separate lazy-loaded chunk that's also loaded by the worker \u2014 including\n * anything from the main chunk would pull the whole editor into the worker.\n */\n\n// -----------------------------------------------------------------------------\n// protocol\n// -----------------------------------------------------------------------------\n\n/**\n * Elements are sent as a flat Float32Array of records, so that the main\n * thread only copies a few numbers per element and everything else (bounds,\n * transform, drawing) happens off the main thread. Each record starts with\n * its kind:\n *\n * - `BOX` & `FRAME`: `kind, x, y, width, height, angle`\n * - `PATH`: `kind, x, y, angle, pointsCount, ...[pointX, pointY]` (points\n * are relative to `x`/`y`, same as on linear elements)\n */\nexport const MinimapRecord = {\n /** drawn as a filled block */\n BOX: 0,\n /** drawn as an outline, so that it doesn't cover its children */\n FRAME: 1,\n /** drawn as a polyline */\n PATH: 2,\n} as const;\n\nexport const MINIMAP_BOX_RECORD_SIZE = 6;\nexport const MINIMAP_PATH_RECORD_HEADER_SIZE = 5;\n\n/** scene \u2192 minimap (CSS pixels): `minimap = scene * scale + translate` */\nexport type MinimapTransform = {\n scale: number;\n translateX: number;\n translateY: number;\n};\n\n/** in scene coordinates */\nexport type MinimapViewport = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type MinimapColors = {\n element: string;\n viewport: string;\n};\n\nexport type MinimapConfig = {\n /** CSS pixels */\n width: number;\n /** CSS pixels */\n height: number;\n devicePixelRatio: number;\n colors: MinimapColors;\n};\n\ntype MinimapCanvas = OffscreenCanvas | HTMLCanvasElement;\n\nexport type MinimapInMessage =\n | { type: \"init\"; canvas: MinimapCanvas; config: MinimapConfig }\n | { type: \"config\"; config: MinimapConfig }\n | { type: \"elements\"; seq: number; records: Float32Array }\n | { type: \"viewport\"; viewport: MinimapViewport }\n /**\n * While a transform is supplied, it's used as is instead of being fitted\n * to the content. Used while dragging the viewport of a locked (scroll-\n * constrained) editor, so that the minimap doesn't rescale as the viewport\n * rubberbands past the lock.\n */\n | { type: \"lock\"; transform: MinimapTransform | null };\n\nexport type MinimapOutMessage = {\n type: \"frame\";\n /** the transform the frame was rendered with */\n transform: MinimapTransform;\n /** `seq` of the elements the frame was rendered with */\n elementsSeq: number;\n /** bounds of those elements, in scene coordinates (null if there are none) */\n contentBounds: MinimapBounds | null;\n};\n\n// -----------------------------------------------------------------------------\n// renderer\n// -----------------------------------------------------------------------------\n\n/** CSS pixels */\nconst PADDING = 8;\n/** CSS pixels. Keeps tiny elements visible. */\nconst MIN_BLOCK_SIZE = 1.5;\n/** CSS pixels. Keeps the viewport visible (and grabbable) when tiny. */\nexport const MINIMAP_MIN_VIEWPORT_SIZE = 6;\n/** CSS pixels */\nconst PATH_WIDTH = 1.25;\n/**\n * The viewport is a translucent overlay, so that the elements in it show\n * through...\n */\nconst VIEWPORT_ALPHA = 0.25;\n/**\n * ...but the smaller it is, the more opaque \u2014 it'd otherwise get lost among\n * the elements. As fractions of the minimap's size (the viewport's larger\n * side to the minimap's respective one): fully opaque at the first and below,\n * at the regular opacity from the second up.\n */\nconst VIEWPORT_OPAQUE_SIZE = 0.05;\nconst VIEWPORT_TRANSLUCENT_SIZE = 0.12;\nexport type MinimapBounds = [\n minX: number,\n minY: number,\n maxX: number,\n maxY: number,\n];\ntype Bounds = MinimapBounds;\n\nconst isSameTransform = (a: MinimapTransform | null, b: MinimapTransform) =>\n !!a &&\n a.scale === b.scale &&\n a.translateX === b.translateX &&\n a.translateY === b.translateY;\n\n/**\n * The on-minimap rect of the viewport, grown to the minimum size around its\n * center.\n */\nexport const getMinimapViewportRect = (\n viewport: MinimapViewport,\n transform: MinimapTransform,\n) => {\n const width = Math.max(\n viewport.width * transform.scale,\n MINIMAP_MIN_VIEWPORT_SIZE,\n );\n const height = Math.max(\n viewport.height * transform.scale,\n MINIMAP_MIN_VIEWPORT_SIZE,\n );\n return {\n x:\n (viewport.x + viewport.width / 2) * transform.scale +\n transform.translateX -\n width / 2,\n y:\n (viewport.y + viewport.height / 2) * transform.scale +\n transform.translateY -\n height / 2,\n width,\n height,\n };\n};\n\nconst getRecordsBounds = (records: Float32Array): Bounds | null => {\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n const extend = (\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n angle: number,\n ) => {\n if (angle) {\n // AABB of the rect rotated around its center\n const cos = Math.abs(Math.cos(angle));\n const sin = Math.abs(Math.sin(angle));\n const cx = (x1 + x2) / 2;\n const cy = (y1 + y2) / 2;\n const halfWidth = (x2 - x1) / 2;\n const halfHeight = (y2 - y1) / 2;\n const extentX = halfWidth * cos + halfHeight * sin;\n const extentY = halfWidth * sin + halfHeight * cos;\n x1 = cx - extentX;\n x2 = cx + extentX;\n y1 = cy - extentY;\n y2 = cy + extentY;\n }\n minX = Math.min(minX, x1);\n minY = Math.min(minY, y1);\n maxX = Math.max(maxX, x2);\n maxY = Math.max(maxY, y2);\n };\n\n let i = 0;\n while (i < records.length) {\n if (records[i] === MinimapRecord.PATH) {\n const [x1, y1, x2, y2] = getPathBounds(records, i);\n extend(x1, y1, x2, y2, records[i + 3]);\n i += MINIMAP_PATH_RECORD_HEADER_SIZE + records[i + 4] * 2;\n } else {\n const x = records[i + 1];\n const y = records[i + 2];\n const width = records[i + 3];\n const height = records[i + 4];\n // elements being drawn can have negative dimensions\n extend(\n Math.min(x, x + width),\n Math.min(y, y + height),\n Math.max(x, x + width),\n Math.max(y, y + height),\n records[i + 5],\n );\n i += MINIMAP_BOX_RECORD_SIZE;\n }\n }\n\n return Number.isFinite(minX) ? [minX, minY, maxX, maxY] : null;\n};\n\n/** unrotated bounds of the PATH record at `offset` */\nconst getPathBounds = (records: Float32Array, offset: number): Bounds => {\n const x = records[offset + 1];\n const y = records[offset + 2];\n const count = records[offset + 4];\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (let p = 0; p < count; p++) {\n const px = records[offset + MINIMAP_PATH_RECORD_HEADER_SIZE + p * 2];\n const py = records[offset + MINIMAP_PATH_RECORD_HEADER_SIZE + p * 2 + 1];\n minX = Math.min(minX, px);\n minY = Math.min(minY, py);\n maxX = Math.max(maxX, px);\n maxY = Math.max(maxY, py);\n }\n if (!count) {\n return [x, y, x, y];\n }\n return [x + minX, y + minY, x + maxX, y + maxY];\n};\n\ntype Context2D =\n | OffscreenCanvasRenderingContext2D\n | CanvasRenderingContext2D\n | null;\n\nclass MinimapRenderer {\n private context: Context2D;\n /**\n * The elements rendered with `layerTransform`, so that viewport-only\n * changes (panning, zooming) don't redraw every element.\n */\n private layer: MinimapCanvas;\n private layerContext: Context2D;\n private layerTransform: MinimapTransform | null = null;\n\n private records: Float32Array = new Float32Array(0);\n private contentBounds: Bounds | null = null;\n private viewport: MinimapViewport | null = null;\n private lockedTransform: MinimapTransform | null = null;\n\n constructor(private canvas: MinimapCanvas, private config: MinimapConfig) {\n this.context = canvas.getContext(\"2d\") as Context2D;\n this.layer =\n typeof OffscreenCanvas !== \"undefined\"\n ? new OffscreenCanvas(1, 1)\n : (canvas as HTMLCanvasElement).ownerDocument.createElement(\"canvas\");\n this.layerContext = this.layer.getContext(\"2d\") as Context2D;\n this.resize();\n }\n\n setConfig(config: MinimapConfig) {\n this.config = config;\n this.resize();\n }\n\n setElements(records: Float32Array) {\n this.records = records;\n this.contentBounds = getRecordsBounds(records);\n this.layerTransform = null;\n }\n\n setViewport(viewport: MinimapViewport) {\n this.viewport = viewport;\n }\n\n getContentBounds() {\n return this.contentBounds;\n }\n\n setLockedTransform(transform: MinimapTransform | null) {\n this.lockedTransform = transform;\n }\n\n private resize() {\n const { width, height, devicePixelRatio } = this.config;\n for (const canvas of [this.canvas, this.layer]) {\n canvas.width = Math.max(1, Math.round(width * devicePixelRatio));\n canvas.height = Math.max(1, Math.round(height * devicePixelRatio));\n }\n this.layerTransform = null;\n }\n\n /** fits the content along with the viewport into the minimap */\n private getTransform(): MinimapTransform {\n if (this.lockedTransform) {\n return this.lockedTransform;\n }\n\n let [minX, minY, maxX, maxY] = this.contentBounds ?? [\n Infinity,\n Infinity,\n -Infinity,\n -Infinity,\n ];\n if (this.viewport) {\n minX = Math.min(minX, this.viewport.x);\n minY = Math.min(minY, this.viewport.y);\n maxX = Math.max(maxX, this.viewport.x + this.viewport.width);\n maxY = Math.max(maxY, this.viewport.y + this.viewport.height);\n }\n\n const { width, height } = this.config;\n if (!Number.isFinite(minX)) {\n return { scale: 1, translateX: width / 2, translateY: height / 2 };\n }\n\n const scale = Math.min(\n Math.max(width - PADDING * 2, 1) / Math.max(maxX - minX, 1),\n Math.max(height - PADDING * 2, 1) / Math.max(maxY - minY, 1),\n );\n\n return {\n scale,\n translateX: width / 2 - ((minX + maxX) / 2) * scale,\n translateY: height / 2 - ((minY + maxY) / 2) * scale,\n };\n }\n\n private renderLayer(transform: MinimapTransform) {\n const context = this.layerContext;\n if (!context) {\n return;\n }\n const { devicePixelRatio, colors } = this.config;\n const { scale, translateX, translateY } = transform;\n const { records } = this;\n\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.clearRect(0, 0, this.layer.width, this.layer.height);\n context.fillStyle = colors.element;\n context.strokeStyle = colors.element;\n context.lineWidth = PATH_WIDTH;\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n\n const resetTransform = () =>\n context.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0);\n const rotate = (angle: number, cx: number, cy: number) => {\n context.translate(cx, cy);\n context.rotate(angle);\n context.translate(-cx, -cy);\n };\n resetTransform();\n\n let i = 0;\n while (i < records.length) {\n const kind = records[i];\n\n if (kind === MinimapRecord.PATH) {\n const count = records[i + 4];\n const angle = records[i + 3];\n const originX = records[i + 1] * scale + translateX;\n const originY = records[i + 2] * scale + translateY;\n const points = i + MINIMAP_PATH_RECORD_HEADER_SIZE;\n\n if (angle) {\n const [x1, y1, x2, y2] = getPathBounds(records, i);\n rotate(\n angle,\n ((x1 + x2) / 2) * scale + translateX,\n ((y1 + y2) / 2) * scale + translateY,\n );\n }\n context.beginPath();\n for (let p = 0; p < count; p++) {\n const x = originX + records[points + p * 2] * scale;\n const y = originY + records[points + p * 2 + 1] * scale;\n if (p === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n if (count === 1) {\n // a dot\n context.lineTo(originX, originY);\n }\n context.stroke();\n if (angle) {\n resetTransform();\n }\n\n i += MINIMAP_PATH_RECORD_HEADER_SIZE + count * 2;\n continue;\n }\n\n const angle = records[i + 5];\n const width = Math.max(Math.abs(records[i + 3]) * scale, MIN_BLOCK_SIZE);\n const height = Math.max(Math.abs(records[i + 4]) * scale, MIN_BLOCK_SIZE);\n const cx = (records[i + 1] + records[i + 3] / 2) * scale + translateX;\n const cy = (records[i + 2] + records[i + 4] / 2) * scale + translateY;\n\n if (angle) {\n rotate(angle, cx, cy);\n }\n if (kind === MinimapRecord.FRAME) {\n context.strokeRect(cx - width / 2, cy - height / 2, width, height);\n } else {\n context.fillRect(cx - width / 2, cy - height / 2, width, height);\n }\n if (angle) {\n resetTransform();\n }\n\n i += MINIMAP_BOX_RECORD_SIZE;\n }\n\n this.layerTransform = transform;\n }\n\n render(): MinimapTransform {\n const transform = this.getTransform();\n const context = this.context;\n if (!context) {\n return transform;\n }\n\n if (!isSameTransform(this.layerTransform, transform)) {\n this.renderLayer(transform);\n }\n\n const { devicePixelRatio, colors } = this.config;\n\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.drawImage(this.layer, 0, 0);\n\n if (this.viewport) {\n const { x, y, width, height } = getMinimapViewportRect(\n this.viewport,\n transform,\n );\n const size = Math.max(\n width / this.config.width,\n height / this.config.height,\n );\n const translucency = Math.min(\n Math.max(\n (size - VIEWPORT_OPAQUE_SIZE) /\n (VIEWPORT_TRANSLUCENT_SIZE - VIEWPORT_OPAQUE_SIZE),\n 0,\n ),\n 1,\n );\n\n context.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0);\n context.globalAlpha = 1 - translucency * (1 - VIEWPORT_ALPHA);\n context.fillStyle = colors.viewport;\n context.beginPath();\n if (context.roundRect) {\n context.roundRect(x, y, width, height, 2);\n } else {\n context.rect(x, y, width, height);\n }\n context.fill();\n context.globalAlpha = 1;\n }\n\n return transform;\n }\n}\n\n// -----------------------------------------------------------------------------\n// endpoint\n// -----------------------------------------------------------------------------\n\nexport type MinimapScheduler = {\n requestFrame: (callback: () => void) => number;\n cancelFrame: (id: number) => void;\n};\n\n/** that of the global scope, i.e. of the worker */\nconst defaultScheduler: MinimapScheduler = {\n requestFrame: (callback) =>\n typeof requestAnimationFrame === \"function\"\n ? requestAnimationFrame(callback)\n : (setTimeout(callback, 16) as unknown as number),\n cancelFrame: (id) => {\n if (typeof cancelAnimationFrame === \"function\") {\n cancelAnimationFrame(id);\n } else {\n clearTimeout(id);\n }\n },\n};\n\n/**\n * Receives the messages of the editor and renders at most once per frame.\n * Runs in the worker, or on the main thread where workers (or\n * OffscreenCanvas) aren't available \u2014 there, supply the scheduler of the\n * window the minimap is rendered in, which may not be the one the code runs\n * in (an editor mounted into a pop-out window).\n */\nexport const createMinimapEndpoint = (\n postMessage: (message: MinimapOutMessage) => void,\n { requestFrame, cancelFrame }: MinimapScheduler = defaultScheduler,\n) => {\n let renderer: MinimapRenderer | null = null;\n let frameId: number | null = null;\n let elementsSeq = -1;\n let reportedSeq = -1;\n let reportedTransform: MinimapTransform | null = null;\n\n const render = () => {\n frameId = null;\n // nothing is drawn (nor reported) until the first elements arrive: a\n // minimap fitted to the viewport alone would only flash by, and couldn't\n // be dragged in for the lack of content bounds\n if (!renderer || elementsSeq < 0) {\n return;\n }\n const transform = renderer.render();\n // the editor only needs to know about new elements being rendered (so it\n // can send the next ones) and about the transform changing (to map the\n // pointer). Don't wake it up otherwise, e.g. on each panned frame.\n if (\n reportedSeq !== elementsSeq ||\n !isSameTransform(reportedTransform, transform)\n ) {\n reportedSeq = elementsSeq;\n reportedTransform = transform;\n postMessage({\n type: \"frame\",\n transform,\n elementsSeq,\n contentBounds: renderer.getContentBounds(),\n });\n }\n };\n\n return {\n handle: (message: MinimapInMessage) => {\n switch (message.type) {\n case \"init\":\n renderer = new MinimapRenderer(message.canvas, message.config);\n break;\n case \"config\":\n renderer?.setConfig(message.config);\n break;\n case \"elements\":\n elementsSeq = message.seq;\n renderer?.setElements(message.records);\n break;\n case \"viewport\":\n renderer?.setViewport(message.viewport);\n break;\n case \"lock\":\n renderer?.setLockedTransform(message.transform);\n break;\n }\n if (frameId === null) {\n frameId = requestFrame(render);\n }\n },\n destroy: () => {\n if (frameId !== null) {\n cancelFrame(frameId);\n frameId = null;\n }\n renderer = null;\n },\n };\n};\n"],
5
+ "mappings": ";;;;;AAuBO,IAAM,gBAAgB;AAAA;AAAA,EAE3B,KAAK;AAAA;AAAA,EAEL,OAAO;AAAA;AAAA,EAEP,MAAM;AACR;AAEO,IAAM,0BAA0B;AAChC,IAAM,kCAAkC;AA6D/C,IAAM,UAAU;AAEhB,IAAM,iBAAiB;AAEhB,IAAM,4BAA4B;AAEzC,IAAM,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