@excalidraw/excalidraw 0.3.1 → 0.3.78-no-custom

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 (541) hide show
  1. package/CHANGELOG.md +1197 -1
  2. package/README.md +1080 -148
  3. package/dist/excalidraw-assets/Virgil.woff2 +0 -0
  4. package/dist/excalidraw-assets/locales/ar-SA-json-3f3939003e50137eb96e.js +1 -0
  5. package/dist/excalidraw-assets/locales/bg-BG-json-41978e51de89ecb69832.js +1 -0
  6. package/dist/excalidraw-assets/locales/bn-BD-json-270049304edfc328feb0.js +1 -0
  7. package/dist/excalidraw-assets/locales/ca-ES-json-2e2ec4a6db0dadecd932.js +1 -0
  8. package/dist/excalidraw-assets/locales/cs-CZ-json-294f73284f7603f8b308.js +1 -0
  9. package/dist/excalidraw-assets/locales/da-DK-json-7cec75a31335c8eaab69.js +1 -0
  10. package/dist/excalidraw-assets/locales/de-DE-json-b972f335652b31abc478.js +1 -0
  11. package/dist/excalidraw-assets/locales/el-GR-json-0a17ab9d0298049bcf5f.js +1 -0
  12. package/dist/excalidraw-assets/locales/es-ES-json-2a821ff3ff417c43b325.js +1 -0
  13. package/dist/excalidraw-assets/locales/eu-ES-json-807880ff10379aea34f5.js +1 -0
  14. package/dist/excalidraw-assets/locales/fa-IR-json-30ce6b716d375cd90b9b.js +1 -0
  15. package/dist/excalidraw-assets/locales/fi-FI-json-d71c23aabcb9ca7449d9.js +1 -0
  16. package/dist/excalidraw-assets/locales/fr-FR-json-d53486b6942cd134938f.js +1 -0
  17. package/dist/excalidraw-assets/locales/gl-ES-json-24b9a50f57184ae44f99.js +1 -0
  18. package/dist/excalidraw-assets/locales/he-IL-json-f91ace474afb01d8f3ed.js +1 -0
  19. package/dist/excalidraw-assets/locales/hi-IN-json-9af974be0987a846db82.js +1 -0
  20. package/dist/excalidraw-assets/locales/hu-HU-json-dd5d9a15eb412598f794.js +1 -0
  21. package/dist/excalidraw-assets/locales/id-ID-json-acdf1f60176cd026af64.js +1 -0
  22. package/dist/excalidraw-assets/locales/it-IT-json-790983f96414735e8451.js +1 -0
  23. package/dist/excalidraw-assets/locales/ja-JP-json-b57e6afb227d9247b3c8.js +1 -0
  24. package/dist/excalidraw-assets/locales/kab-KAB-json-b3aced3d4ddccfb4127d.js +1 -0
  25. package/dist/excalidraw-assets/locales/kk-KZ-json-6f477840db7f293c3ff3.js +1 -0
  26. package/dist/excalidraw-assets/locales/ko-KR-json-d2e67336d6b43a42ff1e.js +1 -0
  27. package/dist/excalidraw-assets/locales/lt-LT-json-1a57a9a7596eb235b3e5.js +1 -0
  28. package/dist/excalidraw-assets/locales/lv-LV-json-40863b1530d2015aa72e.js +1 -0
  29. package/dist/excalidraw-assets/locales/mr-IN-json-3295641c432b154ab60f.js +1 -0
  30. package/dist/excalidraw-assets/locales/my-MM-json-dc1320c2d6c1adca77d0.js +1 -0
  31. package/dist/excalidraw-assets/locales/nb-NO-json-f073266126f35722bd87.js +1 -0
  32. package/dist/excalidraw-assets/locales/nl-NL-json-5d4a291a77a27fadddc1.js +1 -0
  33. package/dist/excalidraw-assets/locales/nn-NO-json-9fe14d0a715c691bb9aa.js +1 -0
  34. package/dist/excalidraw-assets/locales/oc-FR-json-b7a10ed3433fcb6dd59a.js +1 -0
  35. package/dist/excalidraw-assets/locales/pa-IN-json-e11565cbf1ccc3a53a3b.js +1 -0
  36. package/dist/excalidraw-assets/locales/pl-PL-json-843eb6fd0616dace3255.js +1 -0
  37. package/dist/excalidraw-assets/locales/pt-BR-json-e24132703235bd25ba2f.js +1 -0
  38. package/dist/excalidraw-assets/locales/pt-PT-json-0501abbca76504a7d110.js +1 -0
  39. package/dist/excalidraw-assets/locales/ro-RO-json-79dbe0225dfe06a010a6.js +1 -0
  40. package/dist/excalidraw-assets/locales/ru-RU-json-1d73c3f8bae6d1f3d779.js +1 -0
  41. package/dist/excalidraw-assets/locales/si-LK-json-dfe5be591dc8bbe15cd1.js +1 -0
  42. package/dist/excalidraw-assets/locales/sk-SK-json-bd7dbe4c1e42c016fcb5.js +1 -0
  43. package/dist/excalidraw-assets/locales/sl-SI-json-85c2d64d8aa86fcd537e.js +1 -0
  44. package/dist/excalidraw-assets/locales/sv-SE-json-74107fd3674c60fbe593.js +1 -0
  45. package/dist/excalidraw-assets/locales/ta-IN-json-c5b41d8c83aab479a2c6.js +1 -0
  46. package/dist/excalidraw-assets/locales/tr-TR-json-75f46a2579a01cf32ba7.js +1 -0
  47. package/dist/excalidraw-assets/locales/uk-UA-json-f5b7b281f867489710d7.js +1 -0
  48. package/dist/excalidraw-assets/locales/vi-VN-json-a56a1980b98f933cd604.js +1 -0
  49. package/dist/excalidraw-assets/locales/zh-CN-json-af7e4dc6eb1d97a22272.js +1 -0
  50. package/dist/excalidraw-assets/locales/zh-HK-json-d0511bd8842fe92cc42e.js +1 -0
  51. package/dist/excalidraw-assets/locales/zh-TW-json-43bef01a6edb6e4da73c.js +1 -0
  52. package/dist/excalidraw-assets/vendor-b9b3a25c026c138e55b2.js +2 -0
  53. package/dist/excalidraw-assets/vendor-b9b3a25c026c138e55b2.js.LICENSE.txt +6 -0
  54. package/dist/excalidraw-assets-dev/Cascadia.woff2 +0 -0
  55. package/dist/excalidraw-assets-dev/Virgil.woff2 +0 -0
  56. package/dist/excalidraw-assets-dev/locales/ar-SA-json-684b5e25f971902bd933.js +22 -0
  57. package/dist/excalidraw-assets-dev/locales/bg-BG-json-d78c84e8962f5d754019.js +22 -0
  58. package/dist/excalidraw-assets-dev/locales/bn-BD-json-79007d6cd3d09b6c1e82.js +22 -0
  59. package/dist/excalidraw-assets-dev/locales/ca-ES-json-84b33ecd3096b99533c1.js +22 -0
  60. package/dist/excalidraw-assets-dev/locales/cs-CZ-json-1d48380fd54bd715a21c.js +22 -0
  61. package/dist/excalidraw-assets-dev/locales/da-DK-json-9dc062ac2b2aee3ad4ec.js +22 -0
  62. package/dist/excalidraw-assets-dev/locales/de-DE-json-2d48c0ec0901cee81272.js +22 -0
  63. package/dist/excalidraw-assets-dev/locales/el-GR-json-8ec22bd0cbf376e3ba5d.js +22 -0
  64. package/dist/excalidraw-assets-dev/locales/es-ES-json-5dd577ba17baf0f4382c.js +22 -0
  65. package/dist/excalidraw-assets-dev/locales/eu-ES-json-9ba2e12372db6b5be813.js +22 -0
  66. package/dist/excalidraw-assets-dev/locales/fa-IR-json-9866fde07b07d55f2cb9.js +22 -0
  67. package/dist/excalidraw-assets-dev/locales/fi-FI-json-2dcf087c4ff34b8a8ad7.js +22 -0
  68. package/dist/excalidraw-assets-dev/locales/fr-FR-json-e4bbc872fed09a689b27.js +22 -0
  69. package/dist/excalidraw-assets-dev/locales/gl-ES-json-4ab7103bd7905741cf7e.js +22 -0
  70. package/dist/excalidraw-assets-dev/locales/he-IL-json-abac6b158c54984aecba.js +22 -0
  71. package/dist/excalidraw-assets-dev/locales/hi-IN-json-3aba9d37f6dae9ca2445.js +22 -0
  72. package/dist/excalidraw-assets-dev/locales/hu-HU-json-8d604fcc349f93bc4440.js +22 -0
  73. package/dist/excalidraw-assets-dev/locales/id-ID-json-6d9b771568900ad6f055.js +22 -0
  74. package/dist/excalidraw-assets-dev/locales/it-IT-json-7086cd6c6f1f61016ba1.js +22 -0
  75. package/dist/excalidraw-assets-dev/locales/ja-JP-json-d864fb849b2a3874b290.js +22 -0
  76. package/dist/excalidraw-assets-dev/locales/kab-KAB-json-c69f8a1079a411de837c.js +22 -0
  77. package/dist/excalidraw-assets-dev/locales/kk-KZ-json-8c7f34edcdac22c11c72.js +22 -0
  78. package/dist/excalidraw-assets-dev/locales/ko-KR-json-c80065dfa01e02f28695.js +22 -0
  79. package/dist/excalidraw-assets-dev/locales/lt-LT-json-edaae0abc84fb205ee70.js +22 -0
  80. package/dist/excalidraw-assets-dev/locales/lv-LV-json-21cc252dcf4524c98e55.js +22 -0
  81. package/dist/excalidraw-assets-dev/locales/mr-IN-json-d28b9664c21ee08d79eb.js +22 -0
  82. package/dist/excalidraw-assets-dev/locales/my-MM-json-56d51a30e815283e7260.js +22 -0
  83. package/dist/excalidraw-assets-dev/locales/nb-NO-json-827603cac737fb4bb00f.js +22 -0
  84. package/dist/excalidraw-assets-dev/locales/nl-NL-json-9c5c4b7bfbfe3328e561.js +22 -0
  85. package/dist/excalidraw-assets-dev/locales/nn-NO-json-cb21e50c1afeb6a8f01d.js +22 -0
  86. package/dist/excalidraw-assets-dev/locales/oc-FR-json-bec2ee705e7d3980fd61.js +22 -0
  87. package/dist/excalidraw-assets-dev/locales/pa-IN-json-189c7e5cad9e781f0ce5.js +22 -0
  88. package/dist/excalidraw-assets-dev/locales/pl-PL-json-9cc770276a511a05e638.js +22 -0
  89. package/dist/excalidraw-assets-dev/locales/pt-BR-json-788b2c323ae4afd36853.js +22 -0
  90. package/dist/excalidraw-assets-dev/locales/pt-PT-json-4f16b87e256eb838c91a.js +22 -0
  91. package/dist/excalidraw-assets-dev/locales/ro-RO-json-9ac079b4af3b20377160.js +22 -0
  92. package/dist/excalidraw-assets-dev/locales/ru-RU-json-eda247a0b10c11a51eec.js +22 -0
  93. package/dist/excalidraw-assets-dev/locales/si-LK-json-ee3083905b0cf879022d.js +22 -0
  94. package/dist/excalidraw-assets-dev/locales/sk-SK-json-03a80aeb3e09f77b1be6.js +22 -0
  95. package/dist/excalidraw-assets-dev/locales/sl-SI-json-55f372eebf814a422031.js +22 -0
  96. package/dist/excalidraw-assets-dev/locales/sv-SE-json-ca85dde4f9c34d5ee346.js +22 -0
  97. package/dist/excalidraw-assets-dev/locales/ta-IN-json-f9d1822384bc4ce086b6.js +22 -0
  98. package/dist/excalidraw-assets-dev/locales/tr-TR-json-30a4d84bda3152292dbe.js +22 -0
  99. package/dist/excalidraw-assets-dev/locales/uk-UA-json-b271ae2bf2e210aa582b.js +22 -0
  100. package/dist/excalidraw-assets-dev/locales/vi-VN-json-9a1f8e4ce0b77e05baa7.js +22 -0
  101. package/dist/excalidraw-assets-dev/locales/zh-CN-json-29856d6541bf2cbd6aea.js +22 -0
  102. package/dist/excalidraw-assets-dev/locales/zh-HK-json-8bb0f0928ccbce98f995.js +22 -0
  103. package/dist/excalidraw-assets-dev/locales/zh-TW-json-517b39d1a3184844b4d7.js +22 -0
  104. package/dist/excalidraw-assets-dev/vendor-33bd21df77fc9cda16d2.js +98 -0
  105. package/dist/excalidraw.development.js +3812 -0
  106. package/dist/excalidraw.production.min.js +2 -0
  107. package/dist/excalidraw.production.min.js.LICENSE.txt +14 -0
  108. package/main.js +5 -0
  109. package/package.json +37 -26
  110. package/types/actions/actionAddToLibrary.d.ts +308 -0
  111. package/types/actions/actionAlign.d.ts +91 -0
  112. package/types/actions/actionBoundText.d.ts +127 -0
  113. package/types/actions/actionCanvas.d.ts +893 -0
  114. package/types/actions/actionClipboard.d.ts +583 -0
  115. package/types/actions/actionDeleteSelected.d.ts +335 -0
  116. package/types/actions/actionDistribute.d.ts +33 -0
  117. package/types/actions/actionDuplicateSelection.d.ts +22 -0
  118. package/types/actions/actionExport.d.ts +991 -0
  119. package/types/actions/actionFinalize.d.ts +214 -0
  120. package/types/actions/actionFlip.d.ts +35 -0
  121. package/types/actions/actionGroup.d.ts +45 -0
  122. package/types/actions/actionHistory.d.ts +6 -0
  123. package/types/actions/actionMenu.d.ts +346 -0
  124. package/types/actions/actionNavigate.d.ts +14 -0
  125. package/types/actions/actionProperties.d.ts +1441 -0
  126. package/types/actions/actionSelectAll.d.ts +16 -0
  127. package/types/actions/actionStyles.d.ts +128 -0
  128. package/types/actions/actionToggleGridMode.d.ts +115 -0
  129. package/types/actions/actionToggleLock.d.ts +17 -0
  130. package/types/actions/actionToggleStats.d.ts +113 -0
  131. package/types/actions/actionToggleViewMode.d.ts +114 -0
  132. package/types/actions/actionToggleZenMode.d.ts +114 -0
  133. package/types/actions/actionUnbindText.d.ts +11 -0
  134. package/types/actions/actionZindex.d.ts +67 -0
  135. package/types/actions/index.d.ts +23 -0
  136. package/types/actions/manager.d.ts +20 -0
  137. package/types/actions/register.d.ts +5 -0
  138. package/types/actions/shortcuts.d.ts +3 -0
  139. package/types/actions/types.d.ts +40 -0
  140. package/types/align.d.ts +6 -0
  141. package/types/analytics.d.ts +1 -0
  142. package/types/appState.d.ts +75 -0
  143. package/types/charts.d.ts +27 -0
  144. package/types/clients.d.ts +6 -0
  145. package/types/clipboard.d.ts +20 -0
  146. package/types/colors.d.ts +6 -0
  147. package/types/components/Actions.d.ts +23 -0
  148. package/types/components/ActiveFile.d.ts +8 -0
  149. package/types/components/App.d.ts +209 -0
  150. package/types/components/Avatar.d.ts +11 -0
  151. package/types/components/BackgroundPickerAndDarkModeToggle.d.ts +9 -0
  152. package/types/components/ButtonIconSelect.d.ts +12 -0
  153. package/types/components/Card.d.ts +6 -0
  154. package/types/components/CheckboxItem.d.ts +7 -0
  155. package/types/components/ClearCanvas.d.ts +5 -0
  156. package/types/components/CollabButton.d.ts +8 -0
  157. package/types/components/ColorPicker.d.ts +15 -0
  158. package/types/components/ConfirmDialog.d.ts +11 -0
  159. package/types/components/ContextMenu.d.ts +28 -0
  160. package/types/components/DarkModeToggle.d.ts +8 -0
  161. package/types/components/Dialog.d.ts +14 -0
  162. package/types/components/ErrorDialog.d.ts +5 -0
  163. package/types/components/FixedSideContainer.d.ts +9 -0
  164. package/types/components/HelpDialog.d.ts +5 -0
  165. package/types/components/HelpIcon.d.ts +9 -0
  166. package/types/components/HintViewer.d.ts +11 -0
  167. package/types/components/IconPicker.d.ts +14 -0
  168. package/types/components/ImageExportDialog.d.ts +17 -0
  169. package/types/components/InitializeApp.d.ts +8 -0
  170. package/types/components/Island.d.ts +10 -0
  171. package/types/components/JSONExportDialog.d.ts +14 -0
  172. package/types/components/LayerUI.d.ts +37 -0
  173. package/types/components/LibraryButton.d.ts +7 -0
  174. package/types/components/LibraryMenu.d.ts +18 -0
  175. package/types/components/LibraryMenuItems.d.ts +24 -0
  176. package/types/components/LibraryUnit.d.ts +13 -0
  177. package/types/components/LoadingMessage.d.ts +4 -0
  178. package/types/components/LockButton.d.ts +12 -0
  179. package/types/components/MobileMenu.d.ts +27 -0
  180. package/types/components/Modal.d.ts +12 -0
  181. package/types/components/PasteChartDialog.d.ts +9 -0
  182. package/types/components/PenModeButton.d.ts +13 -0
  183. package/types/components/Popover.d.ts +15 -0
  184. package/types/components/ProjectName.d.ts +11 -0
  185. package/types/components/PublishLibrary.d.ts +17 -0
  186. package/types/components/Section.d.ts +7 -0
  187. package/types/components/SidebarLockButton.d.ts +9 -0
  188. package/types/components/SingleLibraryItem.d.ts +11 -0
  189. package/types/components/Spinner.d.ts +7 -0
  190. package/types/components/Stack.d.ts +15 -0
  191. package/types/components/Stats.d.ts +11 -0
  192. package/types/components/Toast.d.ts +8 -0
  193. package/types/components/ToolButton.d.ts +46 -0
  194. package/types/components/Tooltip.d.ts +17 -0
  195. package/types/components/UserList.d.ts +10 -0
  196. package/types/components/icons.d.ts +179 -0
  197. package/types/constants.d.ts +145 -0
  198. package/types/data/blob.d.ts +47 -0
  199. package/types/data/encode.d.ts +53 -0
  200. package/types/data/encryption.d.ts +9 -0
  201. package/types/data/filesystem.d.ts +18 -0
  202. package/types/data/image.d.ts +15 -0
  203. package/types/data/index.d.ts +13 -0
  204. package/types/data/json.d.ts +16 -0
  205. package/types/data/library.d.ts +96 -0
  206. package/types/data/resave.d.ts +5 -0
  207. package/types/data/restore.d.ts +15 -0
  208. package/types/data/types.d.ts +32 -0
  209. package/types/disitrubte.d.ts +6 -0
  210. package/types/distribute.d.ts +6 -0
  211. package/types/element/Hyperlink.d.ts +135 -0
  212. package/types/element/binding.d.ts +33 -0
  213. package/types/element/bounds.d.ts +27 -0
  214. package/types/element/collision.d.ts +21 -0
  215. package/types/element/dragElements.d.ts +5 -0
  216. package/types/element/image.d.ts +22 -0
  217. package/types/element/index.d.ts +20 -0
  218. package/types/element/linearElementEditor.d.ts +199 -0
  219. package/types/element/mutateElement.d.ts +11 -0
  220. package/types/element/newElement.d.ts +50 -0
  221. package/types/element/resizeElements.d.ts +9 -0
  222. package/types/element/resizeTest.d.ts +13 -0
  223. package/types/element/showSelectedShapeActions.d.ts +3 -0
  224. package/types/element/sizeHelpers.d.ts +17 -0
  225. package/types/element/textElement.d.ts +26 -0
  226. package/types/element/textWysiwyg.d.ts +16 -0
  227. package/types/element/transformHandles.d.ts +28 -0
  228. package/types/element/typeChecks.d.ts +17 -0
  229. package/types/element/types.d.ts +133 -0
  230. package/types/emitter.d.ts +21 -0
  231. package/types/errors.d.ts +8 -0
  232. package/types/ga.d.ts +63 -0
  233. package/types/gadirections.d.ts +8 -0
  234. package/types/galines.d.ts +22 -0
  235. package/types/gapoints.d.ts +7 -0
  236. package/types/gatransforms.d.ts +10 -0
  237. package/types/gesture.d.ts +6 -0
  238. package/types/groups.d.ts +27 -0
  239. package/types/history.d.ts +52 -0
  240. package/types/hooks/useCallbackRefState.d.ts +1 -0
  241. package/types/i18n.d.ts +15 -0
  242. package/types/jotai.d.ts +122 -0
  243. package/types/keys.d.ts +68 -0
  244. package/types/math.d.ts +20 -0
  245. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ar-SA-json-9a3fdf94110439c2826a.d.ts +0 -0
  246. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ar-SA-json-efd63375f9605b72c4af.d.ts +0 -0
  247. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-bg-BG-json-047db6df7a74c0298938.d.ts +0 -0
  248. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-bg-BG-json-35c0e8b92b0dba8a4e6d.d.ts +0 -0
  249. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ca-ES-json-6acefe26cfe1d2f12349.d.ts +0 -0
  250. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ca-ES-json-9924fbd53652d5f15134.d.ts +0 -0
  251. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-cs-CZ-json-85a469d813bb069829e7.d.ts +0 -0
  252. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-de-DE-json-a52c17c4bd1b1db22464.d.ts +0 -0
  253. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-de-DE-json-f85a8a52534c04c3f3b8.d.ts +0 -0
  254. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-el-GR-json-060595a09e0004e33936.d.ts +0 -0
  255. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-el-GR-json-3b209ec86ca2ce69bdfa.d.ts +0 -0
  256. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-es-ES-json-32dc3bf0f789ef18e65d.d.ts +0 -0
  257. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-es-ES-json-af5c541f9ac1526a9eb7.d.ts +0 -0
  258. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fa-IR-json-7ee232d4ef08da0903f6.d.ts +0 -0
  259. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fa-IR-json-c732ff7772327332c259.d.ts +0 -0
  260. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fi-FI-json-46abeda8d809d4091924.d.ts +0 -0
  261. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fi-FI-json-c1d5c5510660a11a428e.d.ts +0 -0
  262. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fr-FR-json-6a418571305eecefe9bc.d.ts +0 -0
  263. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fr-FR-json-79fa555bfea0a356f393.d.ts +0 -0
  264. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-he-IL-json-157ae036fcf470528687.d.ts +0 -0
  265. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-he-IL-json-d006423b531ab062bb85.d.ts +0 -0
  266. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hi-IN-json-3035c3b3ab3ce981dbc7.d.ts +0 -0
  267. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hi-IN-json-d959b869453c591a8861.d.ts +0 -0
  268. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hu-HU-json-50a13e322a60bb701615.d.ts +0 -0
  269. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hu-HU-json-a366989217753fe3d02b.d.ts +0 -0
  270. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-id-ID-json-87212daac6113b5bf808.d.ts +0 -0
  271. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-id-ID-json-8d13d29ee41be15a1f99.d.ts +0 -0
  272. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-it-IT-json-59f2e9d3dac07f3264cb.d.ts +0 -0
  273. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-it-IT-json-90283cd2809f4165506b.d.ts +0 -0
  274. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ja-JP-json-9e0a78ddb43d5709fb29.d.ts +0 -0
  275. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ja-JP-json-ccb5ffd0f8a0980c2ec0.d.ts +0 -0
  276. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-kab-KAB-json-d9acc7b8ee952e356d06.d.ts +0 -0
  277. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-kab-KAB-json-dac787e0446cdb747fe1.d.ts +0 -0
  278. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ko-KR-json-d61af373bea59d1ff4c6.d.ts +0 -0
  279. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ko-KR-json-e42ededaa35032a201b9.d.ts +0 -0
  280. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-lv-LV-json-07f6bffcb44fdd9aad4f.d.ts +0 -0
  281. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-lv-LV-json-7eea5c4054f8418fdd10.d.ts +0 -0
  282. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-my-MM-json-26d1e27bab3b8ac4a3e6.d.ts +0 -0
  283. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-my-MM-json-a8f9bb37a7b947e9dfba.d.ts +0 -0
  284. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nb-NO-json-8ce0749d46f0b4a8defb.d.ts +0 -0
  285. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nb-NO-json-c01fab8602e1b658d5d1.d.ts +0 -0
  286. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nl-NL-json-23fdfd9f11bc8efbaf56.d.ts +0 -0
  287. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nl-NL-json-cf922daa828029c1aff5.d.ts +0 -0
  288. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nn-NO-json-b5931de6e1ed336bf087.d.ts +0 -0
  289. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nn-NO-json-d363be6b3dcdbf3a868a.d.ts +0 -0
  290. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-oc-FR-json-29d6193adb907d4f5890.d.ts +0 -0
  291. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-oc-FR-json-c6414107ad634b113aba.d.ts +0 -0
  292. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pa-IN-json-27063e4865142ac11b1a.d.ts +0 -0
  293. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pa-IN-json-f0c779291da384fb5173.d.ts +0 -0
  294. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pl-PL-json-16af1b83ac16af57ad07.d.ts +0 -0
  295. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pl-PL-json-a4a5c6e0a9877c43476a.d.ts +0 -0
  296. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-BR-json-03a046855063512eb9ff.d.ts +0 -0
  297. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-BR-json-db86828d6e3ced9f9854.d.ts +0 -0
  298. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-PT-json-7ed352e9de6dc74ef503.d.ts +0 -0
  299. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-PT-json-bc0cd589bd87a3079407.d.ts +0 -0
  300. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ro-RO-json-75692b7a0166d6ad27a4.d.ts +0 -0
  301. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ro-RO-json-f13a2e7b7a63fbfb6ae7.d.ts +0 -0
  302. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ru-RU-json-69b1a919b7f42adfd6ec.d.ts +0 -0
  303. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ru-RU-json-7c2a2061d0ca99cf7007.d.ts +0 -0
  304. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sk-SK-json-0ef09f90308059d22ae8.d.ts +0 -0
  305. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sk-SK-json-4757551ceb15fa0a29a9.d.ts +0 -0
  306. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sv-SE-json-dc7718d79b9bf93a4ba4.d.ts +0 -0
  307. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sv-SE-json-fa5bd09f128972b13ac2.d.ts +0 -0
  308. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-tr-TR-json-b574833ee1c2f58fd24e.d.ts +0 -0
  309. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-tr-TR-json-cba7e62d9610795a5ac3.d.ts +0 -0
  310. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-uk-UA-json-a9a8ea7adb95c0a03680.d.ts +0 -0
  311. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-uk-UA-json-f0cab296bdc4089ffa77.d.ts +0 -0
  312. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-CN-json-45da9983459601b845e8.d.ts +0 -0
  313. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-CN-json-94f562845a945a45e385.d.ts +0 -0
  314. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-TW-json-0e77c896018bcd221bf6.d.ts +0 -0
  315. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-TW-json-7dd3d9ba72493687c286.d.ts +0 -0
  316. package/types/packages/excalidraw/dist/excalidraw-assets/image-02a1f3ecd6baf42daaa6.d.ts +0 -0
  317. package/types/packages/excalidraw/dist/excalidraw-assets/image-0db17e06143a31f9772b.d.ts +0 -0
  318. package/types/packages/excalidraw/dist/excalidraw-assets/image-2be1c869cd5bacebdc3c.d.ts +0 -0
  319. package/types/packages/excalidraw/dist/excalidraw-assets/image-46f5e8e621bfedbf6d91.d.ts +0 -0
  320. package/types/packages/excalidraw/dist/excalidraw-assets/image-6f8d3b9873832b5f7a67.d.ts +0 -0
  321. package/types/packages/excalidraw/dist/excalidraw-assets/image-8e0c265e832504f62477.d.ts +0 -0
  322. package/types/packages/excalidraw/dist/excalidraw-assets/image-9592159c56d563857679.d.ts +0 -0
  323. package/types/packages/excalidraw/dist/excalidraw-assets/image-98a7b39bd21998c69c4b.d.ts +0 -0
  324. package/types/packages/excalidraw/dist/excalidraw-assets/image-a26261fb8a718f15853e.d.ts +0 -0
  325. package/types/packages/excalidraw/dist/excalidraw-assets/image-a97adda58b4c4d8d0107.d.ts +0 -0
  326. package/types/packages/excalidraw/dist/excalidraw-assets/image-af02967a8a4c328f2713.d.ts +0 -0
  327. package/types/packages/excalidraw/dist/excalidraw-assets/image-bd5991c772b4867c8d27.d.ts +0 -0
  328. package/types/packages/excalidraw/dist/excalidraw-assets/image-c198828284ec0dba28dc.d.ts +0 -0
  329. package/types/packages/excalidraw/dist/excalidraw-assets/image-eac20119cbc2ceb81523.d.ts +0 -0
  330. package/types/packages/excalidraw/dist/excalidraw-assets/image-eafab0c39ce13f7fea67.d.ts +0 -0
  331. package/types/packages/excalidraw/dist/excalidraw-assets/locales/ar-SA-json-3f3939003e50137eb96e.d.ts +0 -0
  332. package/types/packages/excalidraw/dist/excalidraw-assets/locales/bg-BG-json-41978e51de89ecb69832.d.ts +0 -0
  333. package/types/packages/excalidraw/dist/excalidraw-assets/locales/bn-BD-json-270049304edfc328feb0.d.ts +0 -0
  334. package/types/packages/excalidraw/dist/excalidraw-assets/locales/ca-ES-json-2e2ec4a6db0dadecd932.d.ts +0 -0
  335. package/types/packages/excalidraw/dist/excalidraw-assets/locales/cs-CZ-json-294f73284f7603f8b308.d.ts +0 -0
  336. package/types/packages/excalidraw/dist/excalidraw-assets/locales/da-DK-json-7cec75a31335c8eaab69.d.ts +0 -0
  337. package/types/packages/excalidraw/dist/excalidraw-assets/locales/de-DE-json-b972f335652b31abc478.d.ts +0 -0
  338. package/types/packages/excalidraw/dist/excalidraw-assets/locales/el-GR-json-0a17ab9d0298049bcf5f.d.ts +0 -0
  339. package/types/packages/excalidraw/dist/excalidraw-assets/locales/es-ES-json-2a821ff3ff417c43b325.d.ts +0 -0
  340. package/types/packages/excalidraw/dist/excalidraw-assets/locales/eu-ES-json-807880ff10379aea34f5.d.ts +0 -0
  341. package/types/packages/excalidraw/dist/excalidraw-assets/locales/fa-IR-json-30ce6b716d375cd90b9b.d.ts +0 -0
  342. package/types/packages/excalidraw/dist/excalidraw-assets/locales/fi-FI-json-d71c23aabcb9ca7449d9.d.ts +0 -0
  343. package/types/packages/excalidraw/dist/excalidraw-assets/locales/fr-FR-json-d53486b6942cd134938f.d.ts +0 -0
  344. package/types/packages/excalidraw/dist/excalidraw-assets/locales/gl-ES-json-24b9a50f57184ae44f99.d.ts +0 -0
  345. package/types/packages/excalidraw/dist/excalidraw-assets/locales/he-IL-json-f91ace474afb01d8f3ed.d.ts +0 -0
  346. package/types/packages/excalidraw/dist/excalidraw-assets/locales/hi-IN-json-9af974be0987a846db82.d.ts +0 -0
  347. package/types/packages/excalidraw/dist/excalidraw-assets/locales/hu-HU-json-dd5d9a15eb412598f794.d.ts +0 -0
  348. package/types/packages/excalidraw/dist/excalidraw-assets/locales/id-ID-json-acdf1f60176cd026af64.d.ts +0 -0
  349. package/types/packages/excalidraw/dist/excalidraw-assets/locales/it-IT-json-790983f96414735e8451.d.ts +0 -0
  350. package/types/packages/excalidraw/dist/excalidraw-assets/locales/ja-JP-json-b57e6afb227d9247b3c8.d.ts +0 -0
  351. package/types/packages/excalidraw/dist/excalidraw-assets/locales/kab-KAB-json-b3aced3d4ddccfb4127d.d.ts +0 -0
  352. package/types/packages/excalidraw/dist/excalidraw-assets/locales/kk-KZ-json-6f477840db7f293c3ff3.d.ts +0 -0
  353. package/types/packages/excalidraw/dist/excalidraw-assets/locales/ko-KR-json-d2e67336d6b43a42ff1e.d.ts +0 -0
  354. package/types/packages/excalidraw/dist/excalidraw-assets/locales/lt-LT-json-1a57a9a7596eb235b3e5.d.ts +0 -0
  355. package/types/packages/excalidraw/dist/excalidraw-assets/locales/lv-LV-json-40863b1530d2015aa72e.d.ts +0 -0
  356. package/types/packages/excalidraw/dist/excalidraw-assets/locales/mr-IN-json-3295641c432b154ab60f.d.ts +0 -0
  357. package/types/packages/excalidraw/dist/excalidraw-assets/locales/my-MM-json-dc1320c2d6c1adca77d0.d.ts +0 -0
  358. package/types/packages/excalidraw/dist/excalidraw-assets/locales/nb-NO-json-f073266126f35722bd87.d.ts +0 -0
  359. package/types/packages/excalidraw/dist/excalidraw-assets/locales/nl-NL-json-5d4a291a77a27fadddc1.d.ts +0 -0
  360. package/types/packages/excalidraw/dist/excalidraw-assets/locales/nn-NO-json-9fe14d0a715c691bb9aa.d.ts +0 -0
  361. package/types/packages/excalidraw/dist/excalidraw-assets/locales/oc-FR-json-b7a10ed3433fcb6dd59a.d.ts +0 -0
  362. package/types/packages/excalidraw/dist/excalidraw-assets/locales/pa-IN-json-e11565cbf1ccc3a53a3b.d.ts +0 -0
  363. package/types/packages/excalidraw/dist/excalidraw-assets/locales/pl-PL-json-843eb6fd0616dace3255.d.ts +0 -0
  364. package/types/packages/excalidraw/dist/excalidraw-assets/locales/pt-BR-json-e24132703235bd25ba2f.d.ts +0 -0
  365. package/types/packages/excalidraw/dist/excalidraw-assets/locales/pt-PT-json-0501abbca76504a7d110.d.ts +0 -0
  366. package/types/packages/excalidraw/dist/excalidraw-assets/locales/ro-RO-json-79dbe0225dfe06a010a6.d.ts +0 -0
  367. package/types/packages/excalidraw/dist/excalidraw-assets/locales/ru-RU-json-1d73c3f8bae6d1f3d779.d.ts +0 -0
  368. package/types/packages/excalidraw/dist/excalidraw-assets/locales/si-LK-json-dfe5be591dc8bbe15cd1.d.ts +0 -0
  369. package/types/packages/excalidraw/dist/excalidraw-assets/locales/sk-SK-json-bd7dbe4c1e42c016fcb5.d.ts +0 -0
  370. package/types/packages/excalidraw/dist/excalidraw-assets/locales/sl-SI-json-85c2d64d8aa86fcd537e.d.ts +0 -0
  371. package/types/packages/excalidraw/dist/excalidraw-assets/locales/sv-SE-json-74107fd3674c60fbe593.d.ts +0 -0
  372. package/types/packages/excalidraw/dist/excalidraw-assets/locales/ta-IN-json-c5b41d8c83aab479a2c6.d.ts +0 -0
  373. package/types/packages/excalidraw/dist/excalidraw-assets/locales/tr-TR-json-75f46a2579a01cf32ba7.d.ts +0 -0
  374. package/types/packages/excalidraw/dist/excalidraw-assets/locales/uk-UA-json-f5b7b281f867489710d7.d.ts +0 -0
  375. package/types/packages/excalidraw/dist/excalidraw-assets/locales/vi-VN-json-a56a1980b98f933cd604.d.ts +0 -0
  376. package/types/packages/excalidraw/dist/excalidraw-assets/locales/zh-CN-json-af7e4dc6eb1d97a22272.d.ts +0 -0
  377. package/types/packages/excalidraw/dist/excalidraw-assets/locales/zh-HK-json-d0511bd8842fe92cc42e.d.ts +0 -0
  378. package/types/packages/excalidraw/dist/excalidraw-assets/locales/zh-TW-json-43bef01a6edb6e4da73c.d.ts +0 -0
  379. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-0e2ecbd1f46fc190ec01.d.ts +0 -0
  380. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-1018b0a7e7e60d808384.d.ts +0 -0
  381. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-405364e1fdefedf5d3d7.d.ts +0 -0
  382. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-448ccb79e58765b61834.d.ts +0 -0
  383. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-585a4c89d479fd91edeb.d.ts +0 -0
  384. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-64ea3ed78bc76a895e61.d.ts +0 -0
  385. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-6644c8f79d52085cf653.d.ts +0 -0
  386. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-807e23d7531555236936.d.ts +0 -0
  387. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-8698157b56eb5e0ee549.d.ts +0 -0
  388. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-aed19b6e017f9f736254.d.ts +0 -0
  389. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-b088910ac1ba8853a571.d.ts +0 -0
  390. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-b9b3a25c026c138e55b2.d.ts +0 -0
  391. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-cb708a4580b007d81177.d.ts +0 -0
  392. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-ce466849186c701b6c48.d.ts +0 -0
  393. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-e5c6cd57013e8e575a61.d.ts +0 -0
  394. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-028ba554a42cc8a4995a.d.ts +0 -0
  395. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-469d5bd946743969995a.d.ts +0 -0
  396. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-664005f0b02c93342b89.d.ts +0 -0
  397. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-73be8b3c1837ea26950c.d.ts +0 -0
  398. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-821afe7d20de2d2ca898.d.ts +0 -0
  399. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-8825d180ee32659f8996.d.ts +0 -0
  400. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-89cddf27ef982ca154dc.d.ts +0 -0
  401. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-9f771c114a0a3ad7b334.d.ts +0 -0
  402. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-a98d24ea9aa42940a0df.d.ts +0 -0
  403. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-b2befe1e2a0424a41fb3.d.ts +0 -0
  404. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-cacb3d0c02eb2e346ecc.d.ts +0 -0
  405. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-d7e941a51c2e0a7b3c23.d.ts +0 -0
  406. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-e50a452aa26d28419e39.d.ts +0 -0
  407. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-eddc6ed66acd3a3f3d46.d.ts +0 -0
  408. package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-f696fa36e3535df5e97a.d.ts +0 -0
  409. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/ar-SA-json-684b5e25f971902bd933.d.ts +2 -0
  410. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/bg-BG-json-d78c84e8962f5d754019.d.ts +2 -0
  411. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/bn-BD-json-79007d6cd3d09b6c1e82.d.ts +2 -0
  412. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/ca-ES-json-84b33ecd3096b99533c1.d.ts +2 -0
  413. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/cs-CZ-json-1d48380fd54bd715a21c.d.ts +2 -0
  414. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/da-DK-json-9dc062ac2b2aee3ad4ec.d.ts +2 -0
  415. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/de-DE-json-2d48c0ec0901cee81272.d.ts +2 -0
  416. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/el-GR-json-8ec22bd0cbf376e3ba5d.d.ts +2 -0
  417. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/es-ES-json-5dd577ba17baf0f4382c.d.ts +2 -0
  418. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/eu-ES-json-9ba2e12372db6b5be813.d.ts +2 -0
  419. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/fa-IR-json-9866fde07b07d55f2cb9.d.ts +2 -0
  420. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/fi-FI-json-2dcf087c4ff34b8a8ad7.d.ts +2 -0
  421. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/fr-FR-json-e4bbc872fed09a689b27.d.ts +2 -0
  422. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/gl-ES-json-4ab7103bd7905741cf7e.d.ts +2 -0
  423. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/he-IL-json-abac6b158c54984aecba.d.ts +2 -0
  424. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/hi-IN-json-3aba9d37f6dae9ca2445.d.ts +2 -0
  425. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/hu-HU-json-8d604fcc349f93bc4440.d.ts +2 -0
  426. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/id-ID-json-6d9b771568900ad6f055.d.ts +2 -0
  427. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/it-IT-json-7086cd6c6f1f61016ba1.d.ts +2 -0
  428. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/ja-JP-json-d864fb849b2a3874b290.d.ts +2 -0
  429. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/kab-KAB-json-c69f8a1079a411de837c.d.ts +2 -0
  430. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/kk-KZ-json-8c7f34edcdac22c11c72.d.ts +2 -0
  431. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/ko-KR-json-c80065dfa01e02f28695.d.ts +2 -0
  432. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/lt-LT-json-edaae0abc84fb205ee70.d.ts +2 -0
  433. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/lv-LV-json-21cc252dcf4524c98e55.d.ts +2 -0
  434. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/mr-IN-json-d28b9664c21ee08d79eb.d.ts +2 -0
  435. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/my-MM-json-56d51a30e815283e7260.d.ts +2 -0
  436. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/nb-NO-json-827603cac737fb4bb00f.d.ts +2 -0
  437. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/nl-NL-json-9c5c4b7bfbfe3328e561.d.ts +2 -0
  438. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/nn-NO-json-cb21e50c1afeb6a8f01d.d.ts +2 -0
  439. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/oc-FR-json-bec2ee705e7d3980fd61.d.ts +2 -0
  440. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/pa-IN-json-189c7e5cad9e781f0ce5.d.ts +2 -0
  441. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/pl-PL-json-9cc770276a511a05e638.d.ts +2 -0
  442. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/pt-BR-json-788b2c323ae4afd36853.d.ts +2 -0
  443. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/pt-PT-json-4f16b87e256eb838c91a.d.ts +2 -0
  444. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/ro-RO-json-9ac079b4af3b20377160.d.ts +2 -0
  445. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/ru-RU-json-eda247a0b10c11a51eec.d.ts +2 -0
  446. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/si-LK-json-ee3083905b0cf879022d.d.ts +2 -0
  447. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/sk-SK-json-03a80aeb3e09f77b1be6.d.ts +2 -0
  448. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/sl-SI-json-55f372eebf814a422031.d.ts +2 -0
  449. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/sv-SE-json-ca85dde4f9c34d5ee346.d.ts +2 -0
  450. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/ta-IN-json-f9d1822384bc4ce086b6.d.ts +2 -0
  451. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/tr-TR-json-30a4d84bda3152292dbe.d.ts +2 -0
  452. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/uk-UA-json-b271ae2bf2e210aa582b.d.ts +2 -0
  453. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/vi-VN-json-9a1f8e4ce0b77e05baa7.d.ts +2 -0
  454. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/zh-CN-json-29856d6541bf2cbd6aea.d.ts +2 -0
  455. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/zh-HK-json-8bb0f0928ccbce98f995.d.ts +2 -0
  456. package/types/packages/excalidraw/dist/excalidraw-assets-dev/locales/zh-TW-json-517b39d1a3184844b4d7.d.ts +2 -0
  457. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-0454f90696ac835aeb45.d.ts +0 -0
  458. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-1bc8ceaafd8623c96dd4.d.ts +0 -0
  459. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-26ccabf52930f0ce0ffd.d.ts +0 -0
  460. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-33bd21df77fc9cda16d2.d.ts +0 -0
  461. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-4534d6e506404cef7a9e.d.ts +0 -0
  462. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-5d1c4700bd0fa2109ab5.d.ts +0 -0
  463. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-7664c12c379862ed98a5.d.ts +0 -0
  464. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-7fcb99cece261da4983f.d.ts +0 -0
  465. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-86b56a69e7dddcf8f70d.d.ts +0 -0
  466. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-a449655791956f151f51.d.ts +0 -0
  467. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-bb07a412033591d5470d.d.ts +0 -0
  468. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-ec7db14ff9ba640888c4.d.ts +0 -0
  469. package/types/packages/excalidraw/dist/excalidraw.development.d.ts +2 -0
  470. package/types/packages/excalidraw/dist/excalidraw.production.min.d.ts +5 -0
  471. package/types/packages/excalidraw/entry.d.ts +1 -0
  472. package/types/packages/excalidraw/env.d.ts +1 -0
  473. package/types/packages/excalidraw/example/App.d.ts +8 -0
  474. package/types/packages/excalidraw/example/index.d.ts +1 -0
  475. package/types/packages/excalidraw/example/initialData.d.ts +172 -0
  476. package/types/packages/excalidraw/example/sidebar/Sidebar.d.ts +5 -0
  477. package/types/packages/excalidraw/index.d.ts +15 -0
  478. package/types/packages/excalidraw/main.d.ts +2 -0
  479. package/types/packages/excalidraw/publicPath.d.ts +1 -0
  480. package/types/packages/excalidraw/webpack.dev-server.config.d.ts +19 -0
  481. package/types/packages/excalidraw/webpack.dev.config.d.ts +79 -0
  482. package/types/packages/excalidraw/webpack.prod.config.d.ts +92 -0
  483. package/types/packages/utils.d.ts +32 -0
  484. package/types/points.d.ts +6 -0
  485. package/types/random.d.ts +3 -0
  486. package/types/renderer/index.d.ts +1 -0
  487. package/types/renderer/renderElement.d.ts +34 -0
  488. package/types/renderer/renderScene.d.ts +25 -0
  489. package/types/renderer/roundRect.d.ts +11 -0
  490. package/types/scene/Scene.d.ts +25 -0
  491. package/types/scene/comparisons.d.ts +11 -0
  492. package/types/scene/export.d.ts +20 -0
  493. package/types/scene/index.d.ts +5 -0
  494. package/types/scene/scroll.d.ts +17 -0
  495. package/types/scene/scrollbars.d.ts +16 -0
  496. package/types/scene/selection.d.ts +11 -0
  497. package/types/scene/types.d.ts +58 -0
  498. package/types/scene/zoom.d.ts +13 -0
  499. package/types/shapes.d.ts +39 -0
  500. package/types/types.d.ts +379 -0
  501. package/types/utils.d.ts +136 -0
  502. package/types/zindex.d.ts +6 -0
  503. package/dist/excalidraw-assets/FG_Virgil.woff2 +0 -0
  504. package/dist/excalidraw-assets/i18n-ar-SA-json.js +0 -1
  505. package/dist/excalidraw-assets/i18n-bg-BG-json.js +0 -1
  506. package/dist/excalidraw-assets/i18n-ca-ES-json.js +0 -1
  507. package/dist/excalidraw-assets/i18n-de-DE-json.js +0 -1
  508. package/dist/excalidraw-assets/i18n-el-GR-json.js +0 -1
  509. package/dist/excalidraw-assets/i18n-es-ES-json.js +0 -1
  510. package/dist/excalidraw-assets/i18n-fa-IR-json.js +0 -1
  511. package/dist/excalidraw-assets/i18n-fi-FI-json.js +0 -1
  512. package/dist/excalidraw-assets/i18n-fr-FR-json.js +0 -1
  513. package/dist/excalidraw-assets/i18n-he-IL-json.js +0 -1
  514. package/dist/excalidraw-assets/i18n-hi-IN-json.js +0 -1
  515. package/dist/excalidraw-assets/i18n-hu-HU-json.js +0 -1
  516. package/dist/excalidraw-assets/i18n-id-ID-json.js +0 -1
  517. package/dist/excalidraw-assets/i18n-it-IT-json.js +0 -1
  518. package/dist/excalidraw-assets/i18n-ja-JP-json.js +0 -1
  519. package/dist/excalidraw-assets/i18n-kab-KAB-json.js +0 -1
  520. package/dist/excalidraw-assets/i18n-ko-KR-json.js +0 -1
  521. package/dist/excalidraw-assets/i18n-my-MM-json.js +0 -1
  522. package/dist/excalidraw-assets/i18n-nb-NO-json.js +0 -1
  523. package/dist/excalidraw-assets/i18n-nl-NL-json.js +0 -1
  524. package/dist/excalidraw-assets/i18n-nn-NO-json.js +0 -1
  525. package/dist/excalidraw-assets/i18n-pa-IN-json.js +0 -1
  526. package/dist/excalidraw-assets/i18n-pl-PL-json.js +0 -1
  527. package/dist/excalidraw-assets/i18n-pt-BR-json.js +0 -1
  528. package/dist/excalidraw-assets/i18n-pt-PT-json.js +0 -1
  529. package/dist/excalidraw-assets/i18n-ro-RO-json.js +0 -1
  530. package/dist/excalidraw-assets/i18n-ru-RU-json.js +0 -1
  531. package/dist/excalidraw-assets/i18n-sk-SK-json.js +0 -1
  532. package/dist/excalidraw-assets/i18n-sv-SE-json.js +0 -1
  533. package/dist/excalidraw-assets/i18n-tr-TR-json.js +0 -1
  534. package/dist/excalidraw-assets/i18n-uk-UA-json.js +0 -1
  535. package/dist/excalidraw-assets/i18n-zh-CN-json.js +0 -1
  536. package/dist/excalidraw-assets/i18n-zh-TW-json.js +0 -1
  537. package/dist/excalidraw-assets/image.js +0 -1
  538. package/dist/excalidraw-assets/vendor.js +0 -2
  539. package/dist/excalidraw-assets/vendor.js.LICENSE.txt +0 -1
  540. package/dist/excalidraw.min.js +0 -2
  541. package/dist/excalidraw.min.js.LICENSE.txt +0 -1
package/README.md CHANGED
@@ -1,6 +1,10 @@
1
+ #### Note
2
+
3
+ ⚠️ ⚠️ ⚠️ You are viewing the docs for the **next** release, in case you want to check the docs for the stable release, you can view it [here](https://www.npmjs.com/package/@excalidraw/excalidraw).
4
+
1
5
  ### Excalidraw
2
6
 
3
- Excalidraw exported as a component to directly embed in your projects
7
+ Excalidraw exported as a component to directly embed in your projects.
4
8
 
5
9
  ### Installation
6
10
 
@@ -16,17 +20,17 @@ or via yarn
16
20
  yarn add react react-dom @excalidraw/excalidraw
17
21
  ```
18
22
 
19
- After installation you will see a folder `excalidraw-assets` in `dist` directory which contains the assets needed for this app.
23
+ After installation you will see a folder `excalidraw-assets` and `excalidraw-assets-dev` in `dist` directory which contains the assets needed for this app in prod and dev mode respectively.
20
24
 
21
- Move the folder `excalidraw-assets` to the path where your assets are served.
25
+ Move the folder `excalidraw-assets` and `excalidraw-assets-dev` to the path where your assets are served.
22
26
 
23
- By default it will try to load the files from `{rootUrl}/excalidraw-assets/`
27
+ By default it will try to load the files from `https://unpkg.com/@excalidraw/excalidraw/dist/`
24
28
 
25
- With **Webpack**, if you want to load the files from different path you can use <pre><a href="https://webpack.js.org/guides/public-path/#on-the-fly">`__webpack_public_path__`</a></pre>.
29
+ If you want to load assets from a different path you can set a variable `window.EXCALIDRAW_ASSET_PATH` depending on environment (for example if you have different URL's for dev and prod) to the url from where you want to load the assets.
26
30
 
27
- With **create-react-app**, the assets can be served from `public/static/js/excalidraw-assets`since CRA tries to load the assets from `{rootUrl}/static/js` path by default.
31
+ #### Note
28
32
 
29
- You can update the value of `PUBLIC_URL` if you want to serve it from a different URL.
33
+ **If you don't want to wait for the next stable release and try out the unreleased changes you can use `@excalidraw/excalidraw@next`.**
30
34
 
31
35
  ### Demo
32
36
 
@@ -34,44 +38,26 @@ You can update the value of `PUBLIC_URL` if you want to serve it from a differen
34
38
 
35
39
  ### Usage
36
40
 
37
- 1. If you are using a Web bundler (for instance, Webpack), you can import it as an ES6 module as shown below
41
+ #### Using Web Bundler
42
+
43
+ If you are using a Web bundler (for instance, Webpack), you can import it as an ES6 module as shown below
44
+
45
+ <details><summary><strong>View Example</strong></summary>
38
46
 
39
47
  ```js
40
- import React, { useEffect, useState, createRef } from "react";
41
- import Excalidraw from "@excalidraw/excalidraw";
48
+ import React, { useEffect, useState, useRef } from "react";
49
+ import { Excalidraw } from "@excalidraw/excalidraw";
42
50
  import InitialData from "./initialData";
43
51
 
44
- import "./styles.css";
52
+ import "./styles.scss";
45
53
 
46
54
  export default function App() {
47
55
  const excalidrawRef = useRef(null);
48
- const excalidrawWrapperRef = useRef(null);
49
- const [dimensions, setDimensions] = useState({
50
- width: undefined,
51
- height: undefined,
52
- });
53
56
 
54
57
  const [viewModeEnabled, setViewModeEnabled] = useState(false);
55
58
  const [zenModeEnabled, setZenModeEnabled] = useState(false);
56
59
  const [gridModeEnabled, setGridModeEnabled] = useState(false);
57
60
 
58
- useEffect(() => {
59
- setDimensions({
60
- width: excalidrawWrapperRef.current.getBoundingClientRect().width,
61
- height: excalidrawWrapperRef.current.getBoundingClientRect().height,
62
- });
63
- const onResize = () => {
64
- setDimensions({
65
- width: excalidrawWrapperRef.current.getBoundingClientRect().width,
66
- height: excalidrawWrapperRef.current.getBoundingClientRect().height,
67
- });
68
- };
69
-
70
- window.addEventListener("resize", onResize);
71
-
72
- return () => window.removeEventListener("resize", onResize);
73
- }, [excalidrawWrapperRef]);
74
-
75
61
  const updateScene = () => {
76
62
  const sceneData = {
77
63
  elements: [
@@ -144,11 +130,9 @@ export default function App() {
144
130
  Grid mode
145
131
  </label>
146
132
  </div>
147
- <div className="excalidraw-wrapper" ref={excalidrawWrapperRef}>
133
+ <div className="excalidraw-wrapper">
148
134
  <Excalidraw
149
135
  ref={excalidrawRef}
150
- width={dimensions.width}
151
- height={dimensions.height}
152
136
  initialData={InitialData}
153
137
  onChange={(elements, state) =>
154
138
  console.log("Elements :", elements, "State : ", state)
@@ -167,11 +151,52 @@ export default function App() {
167
151
  }
168
152
  ```
169
153
 
154
+ To view the full example visit :point_down:
155
+
170
156
  [![Edit excalidraw](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/excalidraw-ehlz3?fontsize=14&hidenavigation=1&theme=dark)
171
157
 
172
- 2. To use it in a browser directly:
158
+ </details>
159
+
160
+ Since Excalidraw doesn't support server side rendering yet, you should render the component once the host is mounted.
161
+
162
+ ```js
163
+ import { useState, useEffect } from "react";
164
+ export default function IndexPage() {
165
+ const [Comp, setComp] = useState(null);
166
+ useEffect(() => {
167
+ import("@excalidraw/excalidraw").then((comp) => setComp(comp.default));
168
+ }, []);
169
+ return <>{Comp && <Comp />}</>;
170
+ }
171
+ ```
172
+
173
+ The `types` are available at `@excalidraw/excalidraw/types`, you can view [example for typescript](https://codesandbox.io/s/excalidraw-types-9h2dm)
174
+
175
+ #### In Browser
176
+
177
+ To use it in a browser directly:
178
+
179
+ For development use :point_down:
180
+
181
+ ```js
182
+ <script
183
+ type="text/javascript"
184
+ src="https://unpkg.com/@excalidraw/excalidraw/dist/excalidraw.development.js"
185
+ ></script>
186
+ ```
187
+
188
+ For production use :point_down:
189
+
190
+ ```js
191
+ <script
192
+ type="text/javascript"
193
+ src="https://unpkg.com/@excalidraw/excalidraw/dist/excalidraw.production.min.js"
194
+ ></script>
195
+ ```
196
+
197
+ You will need to make sure `react`, `react-dom` is available as shown in the below example. For prod please use the production versions of `react`, `react-dom`.
173
198
 
174
- You will need to make sure `react`, `react-dom` is available as shown below.
199
+ <details><summary><strong>View Example</strong></summary>
175
200
 
176
201
  ```html
177
202
  <!DOCTYPE html>
@@ -181,149 +206,224 @@ You will need to make sure `react`, `react-dom` is available as shown below.
181
206
  <meta charset="UTF-8" />
182
207
  <script src="https://unpkg.com/react@16.14.0/umd/react.development.js"></script>
183
208
  <script src="https://unpkg.com/react-dom@16.13.1/umd/react-dom.development.js"></script>
209
+
184
210
  <script
185
211
  type="text/javascript"
186
- src="https://unpkg.com/@excalidraw/excalidraw@0.2.2/dist/excalidraw.min.js"
212
+ src="https://unpkg.com/@excalidraw/excalidraw/dist/excalidraw.development.js"
187
213
  ></script>
188
214
  </head>
189
215
 
190
216
  <body>
191
217
  <div class="container">
192
- <h4>Excalidraw Embed Example</h4>
218
+ <h1>Excalidraw Embed Example</h1>
193
219
  <div id="app"></div>
194
220
  </div>
195
-
196
221
  <script type="text/javascript" src="src/index.js"></script>
197
222
  </body>
198
223
  </html>
199
224
  ```
200
225
 
201
226
  ```js
227
+ /*eslint-disable */
202
228
  import "./styles.css";
229
+ import InitialData from "./initialData";
203
230
 
204
- const excalidrawWrapper = document.getElementById("app");
231
+ const App = () => {
232
+ const excalidrawRef = React.useRef(null);
205
233
 
206
- const props = {
207
- onChange: (data, appState) => {
208
- console.log(data, appState);
209
- },
234
+ const [viewModeEnabled, setViewModeEnabled] = React.useState(false);
235
+ const [zenModeEnabled, setZenModeEnabled] = React.useState(false);
236
+ const [gridModeEnabled, setGridModeEnabled] = React.useState(false);
237
+
238
+ const updateScene = () => {
239
+ const sceneData = {
240
+ elements: [
241
+ {
242
+ type: "rectangle",
243
+ version: 141,
244
+ versionNonce: 361174001,
245
+ isDeleted: false,
246
+ id: "oDVXy8D6rom3H1-LLH2-f",
247
+ fillStyle: "hachure",
248
+ strokeWidth: 1,
249
+ strokeStyle: "solid",
250
+ roughness: 1,
251
+ opacity: 100,
252
+ angle: 0,
253
+ x: 100.50390625,
254
+ y: 93.67578125,
255
+ strokeColor: "#c92a2a",
256
+ backgroundColor: "transparent",
257
+ width: 186.47265625,
258
+ height: 141.9765625,
259
+ seed: 1968410350,
260
+ groupIds: [],
261
+ },
262
+ ],
263
+ appState: {
264
+ viewBackgroundColor: "#edf2ff",
265
+ },
266
+ };
267
+ excalidrawRef.current.updateScene(sceneData);
268
+ };
269
+
270
+ return React.createElement(
271
+ React.Fragment,
272
+ null,
273
+ React.createElement(
274
+ "div",
275
+ { className: "button-wrapper" },
276
+ React.createElement(
277
+ "button",
278
+ {
279
+ className: "update-scene",
280
+ onClick: updateScene,
281
+ },
282
+ "Update Scene",
283
+ ),
284
+ React.createElement(
285
+ "button",
286
+ {
287
+ className: "reset-scene",
288
+ onClick: () => excalidrawRef.current.resetScene(),
289
+ },
290
+ "Reset Scene",
291
+ ),
292
+ React.createElement(
293
+ "label",
294
+ null,
295
+ React.createElement("input", {
296
+ type: "checkbox",
297
+ checked: viewModeEnabled,
298
+ onChange: () => setViewModeEnabled(!viewModeEnabled),
299
+ }),
300
+ "View mode",
301
+ ),
302
+ React.createElement(
303
+ "label",
304
+ null,
305
+ React.createElement("input", {
306
+ type: "checkbox",
307
+ checked: zenModeEnabled,
308
+ onChange: () => setZenModeEnabled(!zenModeEnabled),
309
+ }),
310
+ "Zen mode",
311
+ ),
312
+ React.createElement(
313
+ "label",
314
+ null,
315
+ React.createElement("input", {
316
+ type: "checkbox",
317
+ checked: gridModeEnabled,
318
+ onChange: () => setGridModeEnabled(!gridModeEnabled),
319
+ }),
320
+ "Grid mode",
321
+ ),
322
+ ),
323
+ React.createElement(
324
+ "div",
325
+ {
326
+ className: "excalidraw-wrapper",
327
+ ref: excalidrawWrapperRef,
328
+ },
329
+ React.createElement(ExcalidrawLib.Excalidraw, {
330
+ initialData: InitialData,
331
+ onChange: (elements, state) =>
332
+ console.log("Elements :", elements, "State : ", state),
333
+ onPointerUpdate: (payload) => console.log(payload),
334
+ onCollabButtonClick: () => window.alert("You clicked on collab button"),
335
+ viewModeEnabled: viewModeEnabled,
336
+ zenModeEnabled: zenModeEnabled,
337
+ gridModeEnabled: gridModeEnabled,
338
+ }),
339
+ ),
340
+ );
210
341
  };
211
342
 
212
- /*eslint-disable */
213
- ReactDOM.render(
214
- React.createElement(Excalidraw.default, props),
215
- excalidrawWrapper,
216
- );
343
+ const excalidrawWrapper = document.getElementById("app");
344
+
345
+ ReactDOM.render(React.createElement(App), excalidrawWrapper);
217
346
  ```
218
347
 
348
+ To view the full example visit :point_down:
349
+
219
350
  [![Edit excalidraw-in-browser](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/excalidraw-in-browser-tlqom?fontsize=14&hidenavigation=1&theme=dark)
220
351
 
221
- Since Excalidraw doesn't support server side rendering yet so you will have to make sure the component is rendered once host is mounted.
352
+ </details>
222
353
 
223
- ```js
224
- import { useState, useEffect } from "react";
225
- export default function IndexPage() {
226
- const [Comp, setComp] = useState(null);
227
- useEffect(() => {
228
- import("@excalidraw/excalidraw").then((comp) => setComp(comp.default));
229
- });
230
- return <>{Comp && <Comp />}</>;
354
+ ### Customizing styles
355
+
356
+ Excalidraw is using CSS variables to style certain components. To override them, you should set your own on the `.excalidraw` and `.excalidraw.theme--dark` (for dark mode variables) selectors.
357
+
358
+ Make sure the selector has higher specificity, e.g. by prefixing it with your app's selector:
359
+
360
+ ```css
361
+ .your-app .excalidraw {
362
+ --color-primary: red;
363
+ }
364
+ .your-app .excalidraw.theme--dark {
365
+ --color-primary: pink;
231
366
  }
232
367
  ```
233
368
 
369
+ Most notably, you can customize the primary colors, by overriding these variables:
370
+
371
+ - `--color-primary`
372
+ - `--color-primary-darker`
373
+ - `--color-primary-darkest`
374
+ - `--color-primary-light`
375
+ - `--color-primary-contrast-offset` — a slightly darker (in light mode), or lighter (in dark mode) `--color-primary` color to fix contrast issues (see [Chubb illusion](https://en.wikipedia.org/wiki/Chubb_illusion)). It will fall back to `--color-primary` if not present.
376
+
377
+ For a complete list of variables, check [theme.scss](https://github.com/excalidraw/excalidraw/blob/master/src/css/theme.scss), though most of them will not make sense to override.
378
+
234
379
  ### Props
235
380
 
236
381
  | Name | Type | Default | Description |
237
382
  | --- | --- | --- | --- |
238
- | [`width`](#width) | Number | `window.innerWidth` | The width of Excalidraw component |
239
- | [`height`](#height) | Number | `window.innerHeight` | The height of Excalidraw component |
240
- | [`offsetLeft`](#offsetLeft) | Number | `0` | left position relative to which Excalidraw should be rendered |
241
- | [`offsetTop`](#offsetTop) | Number | `0` | top position relative to which Excalidraw should render |
242
383
  | [`onChange`](#onChange) | Function | | This callback is triggered whenever the component updates due to any change. This callback will receive the excalidraw elements and the current app state. |
243
- | [`initialData`](#initialData) | <pre>{elements?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>, appState?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L37">AppState<a> } </pre> | null | The initial data with which app loads. |
244
- | [`excalidrawRef`](#excalidrawRef) | [`createRef`](https://reactjs.org/docs/refs-and-the-dom.html#creating-refs) or [`callbackRef`](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) or <pre>{ current: { readyPromise: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/utils.ts#L317">resolvablePromise</a> } }</pre> | | Ref to be passed to Excalidraw |
384
+ | [`initialData`](#initialData) | <pre>{elements?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>, appState?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState<a> } </pre> | null | The initial data with which app loads. |
385
+ | [`ref`](#ref) | [`createRef`](https://reactjs.org/docs/refs-and-the-dom.html#creating-refs) &#124; [`useRef`](https://reactjs.org/docs/hooks-reference.html#useref) &#124; [`callbackRef`](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) &#124; <pre>{ current: { readyPromise: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/utils.ts#L317">resolvablePromise</a> } }</pre> | | Ref to be passed to Excalidraw |
245
386
  | [`onCollabButtonClick`](#onCollabButtonClick) | Function | | Callback to be triggered when the collab button is clicked |
246
387
  | [`isCollaborating`](#isCollaborating) | `boolean` | | This implies if the app is in collaboration mode |
247
388
  | [`onPointerUpdate`](#onPointerUpdate) | Function | | Callback triggered when mouse pointer is updated. |
248
- | [`onExportToBackend`](#onExportToBackend) | Function | | Callback triggered when link button is clicked on export dialog |
249
389
  | [`langCode`](#langCode) | string | `en` | Language code string |
390
+ | [`renderTopRightUI`](#renderTopRightUI) | Function | | Function that renders custom UI in top right corner |
250
391
  | [`renderFooter `](#renderFooter) | Function | | Function that renders custom UI footer |
392
+ | [`renderCustomStats`](#renderCustomStats) | Function | | Function that can be used to render custom stats on the stats dialog. |
251
393
  | [`viewModeEnabled`](#viewModeEnabled) | boolean | | This implies if the app is in view mode. |
252
394
  | [`zenModeEnabled`](#zenModeEnabled) | boolean | | This implies if the zen mode is enabled |
253
395
  | [`gridModeEnabled`](#gridModeEnabled) | boolean | | This implies if the grid mode is enabled |
254
-
255
- ### `Extra API's`
256
-
257
- #### `getSceneVersion`
258
-
259
- **How to use**
260
-
261
- <pre>
262
- import { getSceneVersion } from "@excalidraw/excalidraw";
263
- getSceneVersion(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>)
264
- </pre>
265
-
266
- This function returns the current scene version.
267
-
268
- #### `getSyncableElements`
269
-
270
- **_Signature_**
271
-
272
- <pre>
273
- getSyncableElements(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>):<a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>
274
- </pre>
275
-
276
- **How to use**
277
-
278
- ```js
279
- import { getSyncableElements } from "@excalidraw/excalidraw";
280
- ```
281
-
282
- This function returns all the deleted elements of the scene.
283
-
284
- ### `getElementMap`
285
-
286
- **_Signature_**
287
-
288
- <pre>
289
- getElementsMap(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>): {[id: string]: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>}
290
- </pre>
291
-
292
- **How to use**
293
-
294
- ```js
295
- import { getElementsMap } from "@excalidraw/excalidraw";
296
- ```
297
-
298
- This function returns an object where each element is mapped to its id.
299
-
300
- #### `width`
301
-
302
- This props defines the `width` of the Excalidraw component. Defaults to `window.innerWidth` if not passed.
303
-
304
- #### `height`
305
-
306
- This props defines the `height` of the Excalidraw component. Defaults to `window.innerHeight` if not passed.
307
-
308
- #### `offsetLeft`
309
-
310
- This prop defines `left` position relative to which Excalidraw should be rendered. Defaults to `0` if not passed.
311
-
312
- #### `offsetTop`
313
-
314
- This prop defines `top` position relative to which Excalidraw should be rendered. Defaults to `0` if not passed.
396
+ | [`libraryReturnUrl`](#libraryReturnUrl) | string | | What URL should [libraries.excalidraw.com](https://libraries.excalidraw.com) be installed to |
397
+ | [`theme`](#theme) | [THEME.LIGHT](#THEME-1) &#124; [THEME.LIGHT](#THEME-1) | [THEME.LIGHT](#THEME-1) | The theme of the Excalidraw component |
398
+ | [`name`](#name) | string | | Name of the drawing |
399
+ | [`UIOptions`](#UIOptions) | <pre>{ canvasActions: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L208"> CanvasActions<a/> }</pre> | [DEFAULT UI OPTIONS](https://github.com/excalidraw/excalidraw/blob/master/src/constants.ts#L129) | To customise UI options. Currently we support customising [`canvas actions`](#canvasActions) |
400
+ | [`onPaste`](#onPaste) | <pre>(data: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/clipboard.ts#L21">ClipboardData</a>, event: ClipboardEvent &#124; null) => boolean</pre> | | Callback to be triggered if passed when the something is pasted in to the scene |
401
+ | [`detectScroll`](#detectScroll) | boolean | true | Indicates whether to update the offsets when nearest ancestor is scrolled. |
402
+ | [`handleKeyboardGlobally`](#handleKeyboardGlobally) | boolean | false | Indicates whether to bind the keyboard events to document. |
403
+ | [`onLibraryChange`](#onLibraryChange) | <pre>(items: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>) => void &#124; Promise&lt;any&gt; </pre> | | The callback if supplied is triggered when the library is updated and receives the library items. |
404
+ | [`autoFocus`](#autoFocus) | boolean | false | Implies whether to focus the Excalidraw component on page load |
405
+ | [`generateIdForFile`](#generateIdForFile) | `(file: File) => string | Promise<string>` | Allows you to override `id` generation for files added on canvas |
406
+ | [`onLinkOpen`](#onLinkOpen) | <pre>(element: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">NonDeletedExcalidrawElement</a>, event: CustomEvent) </pre> | | This prop if passed will be triggered when link of an element is clicked. |
407
+ | [`onPointerDown`](#onPointerDown) | <pre>(activeTool: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L93"> AppState["activeTool"]</a>, pointerDownState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L365">PointerDownState</a>) => void</pre> | | This prop if passed gets triggered on pointer down evenets |
408
+ | [`onScrollChange`](#onScrollChange) | (scrollX: number, scrollY: number) | | This prop if passed gets triggered when scrolling the canvas. |
409
+
410
+ ### Dimensions of Excalidraw
411
+
412
+ Excalidraw takes `100%` of `width` and `height` of the containing block so make sure the container in which you render Excalidraw has non zero dimensions.
315
413
 
316
414
  #### `onChange`
317
415
 
318
416
  Every time component updates, this callback if passed will get triggered and has the below signature.
319
417
 
320
418
  ```js
321
- (excalidrawElements, appState) => void;
419
+ (excalidrawElements, appState, files) => void;
322
420
  ```
323
421
 
324
- 1.`excalidrawElements`: Array of [excalidrawElements](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78) in the scene.
422
+ 1.`excalidrawElements`: Array of [excalidrawElements](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106) in the scene.
423
+
424
+ 2.`appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) of the scene.
325
425
 
326
- 2.`appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L37) of the scene
426
+ 3. `files`: The [`BinaryFiles`]([BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64) which are added to the scene.
327
427
 
328
428
  Here you can try saving the data to your backend or local storage for example.
329
429
 
@@ -331,10 +431,13 @@ Here you can try saving the data to your backend or local storage for example.
331
431
 
332
432
  This helps to load Excalidraw with `initialData`. It must be an object or a [promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise) which resolves to an object containing the below optional fields.
333
433
 
334
- | name | type |
335
- | --- | --- |
336
- | elements | [ExcalidrawElement[]](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78) |
337
- | appState | [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L37) |
434
+ | Name | Type | Description |
435
+ | --- | --- | --- |
436
+ | `elements` | [ExcalidrawElement[]](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106) | The elements with which Excalidraw should be mounted. |
437
+ | `appState` | [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) | The App state with which Excalidraw should be mounted. |
438
+ | `scrollToContent` | boolean | This attribute implies whether to scroll to the nearest element to center once Excalidraw is mounted. By default, it will not scroll the nearest element to the center. Make sure you pass `initialData.appState.scrollX` and `initialData.appState.scrollY` when `scrollToContent` is false so that scroll positions are retained |
439
+ | `libraryItems` | [LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200) &#124; Promise<[LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200)> | This library items with which Excalidraw should be mounted. |
440
+ | `files` | [BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64) | The files added to the scene. |
338
441
 
339
442
  ```json
340
443
  {
@@ -367,21 +470,31 @@ This helps to load Excalidraw with `initialData`. It must be an object or a [pro
367
470
 
368
471
  You might want to use this when you want to load excalidraw with some initial elements and app state.
369
472
 
370
- #### `excalidrawRef`
473
+ #### `ref`
371
474
 
372
475
  You can pass a `ref` when you want to access some excalidraw APIs. We expose the below APIs:
373
476
 
374
477
  | API | signature | Usage |
375
- | --- | --- | --- |
478
+ | --- | --- | --- | --- |
376
479
  | ready | `boolean` | This is set to true once Excalidraw is rendered |
377
480
  | readyPromise | [resolvablePromise](https://github.com/excalidraw/excalidraw/blob/master/src/utils.ts#L317) | This promise will be resolved with the api once excalidraw has rendered. This will be helpful when you want do some action on the host app once this promise resolves. For this to work you will have to pass ref as shown [here](#readyPromise) |
378
- | updateScene | <pre>(<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L192">sceneData</a>)) => void </pre> | updates the scene with the sceneData |
481
+ | [updateScene](#updateScene) | <code>(scene: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L207">sceneData</a>) => void </code> | updates the scene with the sceneData |
482
+ | [updateLibrary](#updateLibrary) | <code>(<a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/library.ts#L136">opts</a>) => Promise<<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>> </code> | updates the scene with the sceneData |
483
+ | [addFiles](#addFiles) | <code>(files: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts">BinaryFileData</a>) => void </code> | add files data to the appState |
379
484
  | resetScene | `({ resetLoadingState: boolean }) => void` | Resets the scene. If `resetLoadingState` is passed as true then it will also force set the loading state to false. |
380
- | getSceneElementsIncludingDeleted | <pre> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a></pre> | Returns all the elements including the deleted in the scene |
381
- | getSceneElements | <pre> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a></pre> | Returns all the elements excluding the deleted in the scene |
382
- | getAppState | <pre> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L37">AppState</a></pre> | Returns current appState |
485
+ | getSceneElementsIncludingDeleted | <code> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a></code> | Returns all the elements including the deleted in the scene |
486
+ | getSceneElements | <code> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a></code> | Returns all the elements excluding the deleted in the scene |
487
+ | getAppState | <code> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L66">AppState</a></code> | Returns current appState |
383
488
  | history | `{ clear: () => void }` | This is the history API. `history.clear()` will clear the history |
384
- | setScrollToCenter | <pre> (<a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>) => void </pre> | sets the elements to center |
489
+ | scrollToContent | <code> (target?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement</a> &#124; <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement</a>[]) => void </code> | Scroll the nearest element out of the elements supplied to the center. Defaults to the elements on the scene. |
490
+ | refresh | `() => void` | Updates the offsets for the Excalidraw component so that the coordinates are computed correctly (for example the cursor position). You don't have to call this when the position is changed on page scroll or when the excalidraw container resizes (we handle that ourselves). For any other cases if the position of excalidraw is updated (example due to scroll on parent container and not page scroll) you should call this API. |
491
+ | [importLibrary](#importlibrary) | `(url: string, token?: string) => void` | Imports library from given URL |
492
+ | [setToast](#setToast) | `({message: string, closable?:boolean, duration?:number} | null) => void` | This API can be used to show the toast with custom message. |
493
+ | [id](#id) | string | Unique ID for the excalidraw component. |
494
+ | [getFiles](#getFiles) | <code>() => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64">files</a> </code> | This API can be used to get the files present in the scene. It may contain files that aren't referenced by any element, so if you're persisting the files to a storage, you should compare them against stored elements. |
495
+ | [setActiveTool](#setActiveTool) | <code>(tool: { type: typeof <a href="https://github.com/excalidraw/excalidraw/blob/master/src/shapes.tsx#L4">SHAPES</a>[number]["value"] &#124; "eraser" } &#124; { type: "custom"; customType: string }) => void</code> | This API can be used to set the active tool |
496
+ | [setCursor](#setCursor) | <code>(cursor: string) => void </code> | This API can be used to set customise the mouse cursor on the canvas |
497
+ | [resetCursor](#resetCursor) | <code>() => void </code> | This API can be used to reset to default mouse cursor on the canvas |
385
498
 
386
499
  #### `readyPromise`
387
500
 
@@ -389,6 +502,52 @@ You can pass a `ref` when you want to access some excalidraw APIs. We expose the
389
502
  const excalidrawRef = { current: { readyPromise: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/utils.ts#L317">resolvablePromise</a>}}
390
503
  </pre>
391
504
 
505
+ Since plain object is passed as a `ref`, the `readyPromise` is resolved as soon as the component is mounted. Most of the time you will not need this unless you have a specific use case where you can't pass the `ref` in the react way and want to do some action on the host when this promise resolves. You can check the [example](https://codesandbox.io/s/eexcalidraw-resolvable-promise-d0qg3?file=/src/App.js) for the usage.
506
+
507
+ ### `updateScene`
508
+
509
+ <pre>
510
+ (scene: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L207">sceneData</a>) => void
511
+ </pre>
512
+
513
+ You can use this function to update the scene with the sceneData. It accepts the below attributes.
514
+
515
+ | Name | Type | Description |
516
+ | --- | --- | --- |
517
+ | `elements` | [`ImportedDataState["elements"]`](https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L17) | The `elements` to be updated in the scene |
518
+ | `appState` | [`ImportedDataState["appState"]`](https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L18) | The `appState` to be updated in the scene. |
519
+ | `collaborators` | <pre>Map<string, <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L35">Collaborator></a></pre> | The list of collaborators to be updated in the scene. |
520
+ | `commitToHistory` | `boolean` | Implies if the `history (undo/redo)` should be recorded. Defaults to `false`. |
521
+ | `libraryItems` | [LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200) &#124; Promise<[LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200)> &#124; ((currentItems: [LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200)>) => [LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200) &#124; Promise<[LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200)>) | The `libraryItems` to be update in the scene. |
522
+
523
+ ### `updateLibrary`
524
+
525
+ <pre>
526
+ (opts: {
527
+ libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L224">LibraryItemsSource</a>;
528
+ merge?: boolean;
529
+ prompt?: boolean;
530
+ openLibraryMenu?: boolean;
531
+ defaultStatus?: "unpublished" | "published";
532
+ }) => Promise<<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>>
533
+ </pre>
534
+
535
+ You can use this function to update the library. It accepts the below attributes.
536
+
537
+ | Name | Type | Default | Description |
538
+ | --- | --- | --- | --- |
539
+ | `libraryItems` | | [LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L224) | The `libraryItems` to be replaced/merged with current library |
540
+ | `merge` | boolean | `false` | Whether to merge with existing library items. |
541
+ | `prompt` | boolean | `false` | Whether to prompt user for confirmation. |
542
+ | `openLibraryMenu` | boolean | `false` | Whether to open the library menu before importing. |
543
+ | `defaultStatus` | <code>"unpublished" &#124; "published"</code> | `"unpublished"` | Default library item's `status` if not present. |
544
+
545
+ ### `addFiles`
546
+
547
+ <pre>(files: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts">BinaryFileData</a>) => void </pre>
548
+
549
+ Adds supplied files data to the `appState.files` cache on top of existing files present in the cache.
550
+
392
551
  #### `onCollabButtonClick`
393
552
 
394
553
  This callback is triggered when clicked on the collab button in excalidraw. If not supplied, the collab dialog button is not rendered.
@@ -411,16 +570,12 @@ This callback is triggered when mouse pointer is updated.
411
570
 
412
571
  3.`pointersMap`: [`pointers map`](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L131) of the scene
413
572
 
414
- #### `onExportToBackend`
415
-
416
- This callback is triggered when the shareable-link button is clicked in the export dialog. The link button will only be shown if this callback is passed.
417
-
418
573
  ```js
419
574
  (exportedElements, appState, canvas) => void
420
575
  ```
421
576
 
422
577
  1. `exportedElements`: An array of [non deleted elements](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L87) which needs to be exported.
423
- 2. `appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L37) of the scene.
578
+ 2. `appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) of the scene.
424
579
  3. `canvas`: The `HTMLCanvasElement` of the scene.
425
580
 
426
581
  #### `langCode`
@@ -436,9 +591,25 @@ import { defaultLang, languages } from "@excalidraw/excalidraw";
436
591
  | defaultLang | string |
437
592
  | languages | [Language[]](https://github.com/excalidraw/excalidraw/blob/master/src/i18n.ts#L8) |
438
593
 
594
+ #### `renderTopRightUI`
595
+
596
+ <pre>
597
+ (isMobile: boolean, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>) => JSX | null
598
+ </pre>
599
+
600
+ A function returning JSX to render custom UI in the top right corner of the app.
601
+
439
602
  #### `renderFooter`
440
603
 
441
- A function that renders (returns JSX) custom UI footer. For example, you can use this to render a language picker that was previously being rendered by Excalidraw itself (for now, you'll need to implement your own language picker).
604
+ <pre>
605
+ (isMobile: boolean, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>) => JSX | null
606
+ </pre>
607
+
608
+ A function returning JSX to render custom UI footer. For example, you can use this to render a language picker that was previously being rendered by Excalidraw itself (for now, you'll need to implement your own language picker).
609
+
610
+ #### `renderCustomStats`
611
+
612
+ A function that can be used to render custom stats (returns JSX) in the nerd stats dialog. For example you can use this prop to render the size of the elements in the storage.
442
613
 
443
614
  #### `viewModeEnabled`
444
615
 
@@ -451,3 +622,764 @@ This prop indicates whether the app is in `zen mode`. When supplied, the value t
451
622
  #### `gridModeEnabled`
452
623
 
453
624
  This prop indicates whether the shows the grid. When supplied, the value takes precedence over `intialData.appState.gridModeEnabled`, the grid will be fully controlled by the host app, and users won't be able to toggle it from within the app.
625
+
626
+ #### `libraryReturnUrl`
627
+
628
+ If supplied, this URL will be used when user tries to install a library from [libraries.excalidraw.com](https://libraries.excalidraw.com). Defaults to `window.location.origin + window.location.pathname`. To install the libraries in the same tab from which it was opened, you need to set `window.name` (to any alphanumeric string) — if it's not set it will open in a new tab.
629
+
630
+ #### `theme`
631
+
632
+ This prop controls Excalidraw's theme. When supplied, the value takes precedence over `intialData.appState.theme`, the theme will be fully controlled by the host app, and users won't be able to toggle it from within the app. You can use [`THEME`](#THEME-1) to specify the theme.
633
+
634
+ #### `name`
635
+
636
+ This prop sets the name of the drawing which will be used when exporting the drawing. When supplied, the value takes precedence over `intialData.appState.name`, the `name` will be fully controlled by host app and the users won't be able to edit from within Excalidraw.
637
+
638
+ #### `UIOptions`
639
+
640
+ This prop can be used to customise UI of Excalidraw. Currently we support customising [`canvasActions`](#canvasActions) and [`dockedSidebarBreakpoint`](dockedSidebarBreakpoint). It accepts the below parameters
641
+
642
+ <pre>
643
+ { canvasActions: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L208"> CanvasActions<a/> }
644
+ </pre>
645
+
646
+ ##### canvasActions
647
+
648
+ | Attribute | Type | Default | Description |
649
+ | --- | --- | --- | --- |
650
+ | `changeViewBackgroundColor` | boolean | true | Implies whether to show `Background color picker` |
651
+ | `clearCanvas` | boolean | true | Implies whether to show `Clear canvas button` |
652
+ | `export` | false &#124; [exportOpts](#exportOpts) | <pre>{ saveFileToDisk: true }</pre> | This prop allows to customize the UI inside the export dialog. By default it shows the "saveFileToDisk". If this prop is `false` the export button will not be rendered. For more details visit [`exportOpts`](#exportOpts). |
653
+ | `loadScene` | boolean | true | Implies whether to show `Load button` |
654
+ | `saveToActiveFile` | boolean | true | Implies whether to show `Save button` to save to current file |
655
+ | `theme` | boolean | true | Implies whether to show `Theme toggle` |
656
+ | `saveAsImage` | boolean | true | Implies whether to show `Save as image button` |
657
+
658
+ ##### `dockedSidebarBreakpoint`
659
+
660
+ This prop indicates at what point should we break to a docked, permanent sidebar. If not passed it defaults to [`MQ_RIGHT_SIDEBAR_MAX_WIDTH_PORTRAIT`](https://github.com/excalidraw/excalidraw/blob/master/src/constants.ts#L167). If the `width` of the `excalidraw` container exceeds `dockedSidebarBreakpoint`, the sidebar will be dockable. If user choses to dock the sidebar, it will push the right part of the UI towards the left, making space for the sidebar as shown below.
661
+
662
+ ![image](https://user-images.githubusercontent.com/11256141/174664866-c698c3fa-197b-43ff-956c-d79852c7b326.png)
663
+
664
+ #### `exportOpts`
665
+
666
+ The below attributes can be set in `UIOptions.canvasActions.export` to customize the export dialog. If `UIOptions.canvasActions.export` is `false` the export button will not be rendered.
667
+
668
+ | Attribute | Type | Default | Description |
669
+ | --- | --- | --- | --- |
670
+ | `saveFileToDisk` | boolean | true | Implies if save file to disk button should be shown |
671
+ | `onExportToBackend` | <pre> (exportedElements: readonly NonDeletedExcalidrawElement[],appState: AppState,canvas: HTMLCanvasElement &#124; null) => void </pre> | | This callback is triggered when the shareable-link button is clicked in the export dialog. The link button will only be shown if this callback is passed. |
672
+ | `renderCustomUI` | <pre> (exportedElements: readonly NonDeletedExcalidrawElement[],appState: AppState,canvas: HTMLCanvasElement &#124; null) => void </pre> | | This callback should be supplied if you want to render custom UI in the export dialog. |
673
+
674
+ #### `onPaste`
675
+
676
+ This callback is triggered if passed when something is pasted into the scene. You can use this callback in case you want to do something additional when the paste event occurs.
677
+
678
+ <pre>
679
+ (data: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/clipboard.ts#L21">ClipboardData</a>, event: ClipboardEvent &#124; null) => boolean
680
+ </pre>
681
+
682
+ This callback must return a `boolean` value or a [promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise) which resolves to a boolean value.
683
+
684
+ In case you want to prevent the excalidraw paste action you must return `false`, it will stop the native excalidraw clipboard management flow (nothing will be pasted into the scene).
685
+
686
+ #### `importLibrary`
687
+
688
+ Imports library from given URL. You should call this on `hashchange`, passing the `addLibrary` value if you detect it as shown below. Optionally pass a CSRF `token` to skip prompting during installation (retrievable via `token` key from the url coming from [https://libraries.excalidraw.com](https://libraries.excalidraw.com/)).
689
+
690
+ ```js
691
+ useEffect(() => {
692
+ const onHashChange = () => {
693
+ const hash = new URLSearchParams(window.location.hash.slice(1));
694
+ const libraryUrl = hash.get("addLibrary");
695
+ if (libraryUrl) {
696
+ excalidrawRef.current.importLibrary(libraryUrl, hash.get("token"));
697
+ }
698
+ };
699
+ window.addEventListener("hashchange", onHashChange, false);
700
+ return () => {
701
+ window.removeEventListener("hashchange", onHashChange);
702
+ };
703
+ }, []);
704
+ ```
705
+
706
+ Try out the [Demo](#Demo) to see it in action.
707
+
708
+ #### `setToast`
709
+
710
+ This API can be used to show the toast with custom message.
711
+
712
+ <pre>
713
+ ({ message: string,
714
+ closable?:boolean,
715
+ duration?:number } | null) => void
716
+ </pre>
717
+
718
+ | Attribute | type | Description |
719
+ | --- | --- | --- |
720
+ | message | string | The message to be shown on the toast. |
721
+ | closable | boolean | Indicates whether to show the closable button on toast to dismiss the toast. |
722
+ | duration | number | Determines the duration after which the toast should auto dismiss. To prevent autodimiss you can pass `Infinity`. |
723
+
724
+ To dismiss an existing toast you can simple pass `null`
725
+
726
+ ```js
727
+ setToast(null);
728
+ ```
729
+
730
+ #### `setActiveTool`
731
+
732
+ This API has the below signature. It sets the `tool` passed in param as the active tool.
733
+
734
+ <pre>
735
+ (tool: { type: typeof <a href="https://github.com/excalidraw/excalidraw/blob/master/src/shapes.tsx#L4">SHAPES</a>[number]["value"] &#124; "eraser" } &#124; { type: "custom"; customType: string }) => void
736
+ </pre>
737
+
738
+ #### `setCursor`
739
+
740
+ This API can be used to customise the mouse cursor on the canvas and has the below signature. It sets the mouse cursor to the cursor passed in param.
741
+
742
+ <pre>
743
+ (cursor: string) => void
744
+ </pre>
745
+
746
+ #### `resetCursor`
747
+
748
+ This API can be used to reset to default mouse cursor.
749
+
750
+ #### `detectScroll`
751
+
752
+ Indicates whether Excalidraw should listen for `scroll` event on the nearest scrollable container in the DOM tree and recompute the coordinates (e.g. to correctly handle the cursor) when the component's position changes. You can disable this when you either know this doesn't affect your app or you want to take care of it yourself (calling the [`refresh()`](#ref) method).
753
+
754
+ #### `handleKeyboardGlobally`
755
+
756
+ Indicates whether to bind keyboard events to `document`. Disabled by default, meaning the keyboard events are bound to the Excalidraw component. This allows for multiple Excalidraw components to live on the same page, and ensures that Excalidraw keyboard handling doesn't collide with your app's (or the browser) when the component isn't focused.
757
+
758
+ Enable this if you want Excalidraw to handle keyboard even if the component isn't focused (e.g. a user is interacting with the navbar, sidebar, or similar).
759
+
760
+ #### `onLibraryChange`
761
+
762
+ This callback if supplied will get triggered when the library is updated and has the below signature.
763
+
764
+ <pre>
765
+ (items: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>) => void | Promise<any>
766
+ </pre>
767
+
768
+ It is invoked with empty items when user clears the library. You can use this callback when you want to do something additional when library is updated for example persisting it to local storage.
769
+
770
+ #### `id`
771
+
772
+ The unique id of the excalidraw component. This can be used to identify the excalidraw component, for example importing the library items to the excalidraw component from where it was initiated when you have multiple excalidraw components rendered on the same page as shown in [multiple excalidraw demo](https://codesandbox.io/s/multiple-excalidraw-k1xx5).
773
+
774
+ #### `autoFocus`
775
+
776
+ This prop implies whether to focus the Excalidraw component on page load. Defaults to false.
777
+
778
+ #### `generateIdForFile`
779
+
780
+ Allows you to override `id` generation for files added on canvas (images). By default, an SHA-1 digest of the file is used.
781
+
782
+ ```
783
+ (file: File) => string | Promise<string>
784
+ ```
785
+
786
+ #### `onLinkOpen`
787
+
788
+ This prop if passed will be triggered when clicked on link. To handle the redirect yourself (such as when using your own router for internal links), you must call `event.preventDefault()`.
789
+
790
+ ```
791
+ (element: ExcalidrawElement, event: CustomEvent<{ nativeEvent: MouseEvent }>) => void
792
+ ```
793
+
794
+ Example:
795
+
796
+ ```ts
797
+ const history = useHistory();
798
+
799
+ // open internal links using the app's router, but opens external links in
800
+ // a new tab/window
801
+ const onLinkOpen: ExcalidrawProps["onLinkOpen"] = useCallback(
802
+ (element, event) => {
803
+ const link = element.link;
804
+ const { nativeEvent } = event.detail;
805
+ const isNewTab = nativeEvent.ctrlKey || nativeEvent.metaKey;
806
+ const isNewWindow = nativeEvent.shiftKey;
807
+ const isInternalLink =
808
+ link.startsWith("/") || link.includes(window.location.origin);
809
+ if (isInternalLink && !isNewTab && !isNewWindow) {
810
+ history.push(link.replace(window.location.origin, ""));
811
+ // signal that we're handling the redirect ourselves
812
+ event.preventDefault();
813
+ }
814
+ },
815
+ [history],
816
+ );
817
+ ```
818
+
819
+ #### `onPointerDown`
820
+
821
+ This prop if passed will be triggered on pointer down events and has the below signature.
822
+
823
+ <pre>
824
+ (activeTool: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L93"> AppState["activeTool"]</a>, pointerDownState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L365">PointerDownState</a>) => void
825
+ </pre>
826
+
827
+ #### `onScrollChange`
828
+
829
+ This prop if passed will be triggered when canvas is scrolled and has the below signature.
830
+
831
+ ```ts
832
+ (scrollX: number, scrollY: number) => void
833
+ ```
834
+
835
+ ### Does it support collaboration ?
836
+
837
+ No, Excalidraw package doesn't come with collaboration built in, since the implementation is specific to each host app. We expose APIs which you can use to communicate with Excalidraw which you can use to implement it. You can check our own implementation [here](https://github.com/excalidraw/excalidraw/blob/master/src/excalidraw-app/index.tsx).
838
+
839
+ ### Restore utilities
840
+
841
+ #### `restoreAppState`
842
+
843
+ **_Signature_**
844
+
845
+ <pre>
846
+ restoreAppState(appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L17">ImportedDataState["appState"]</a>, localAppState: Partial<<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>> | null): <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>
847
+ </pre>
848
+
849
+ **_How to use_**
850
+
851
+ ```js
852
+ import { restoreAppState } from "@excalidraw/excalidraw";
853
+ ```
854
+
855
+ This function will make sure all the keys have appropriate values in [appState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) and if any key is missing, it will be set to default value.
856
+
857
+ When `localAppState` is supplied, it's used in place of values that are missing (`undefined`) in `appState` instead of defaults. Use this as a way to not override user's defaults if you persist them. Required: supply `null`/`undefined` if not applicable.
858
+
859
+ #### `restoreElements`
860
+
861
+ **_Signature_**
862
+
863
+ <pre>
864
+ restoreElements(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L16">ImportedDataState["elements"]</a>, localElements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L16">ExcalidrawElement[]</a> | null | undefined): <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>
865
+ </pre>
866
+
867
+ **_How to use_**
868
+
869
+ ```js
870
+ import { restoreElements } from "@excalidraw/excalidraw";
871
+ ```
872
+
873
+ This function will make sure all properties of element is correctly set and if any attribute is missing, it will be set to default value.
874
+
875
+ When `localElements` are supplied, they are used to ensure that existing restored elements reuse `version` (and increment it), and regenerate `versionNonce`. Use this when you import elements which may already be present in the scene to ensure that you do not disregard the newly imported elements if you're using element version to detect the updates.
876
+
877
+ #### `restore`
878
+
879
+ **_Signature_**
880
+
881
+ <pre>
882
+ restoreElements(data: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L12">ImportedDataState</a>, localAppState: Partial<<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>> | null | undefined, localElements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L16">ExcalidrawElement[]</a> | null | undefined): <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L4">DataState</a>
883
+ </pre>
884
+
885
+ See [`restoreAppState()`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#restoreAppState) about `localAppState`, and [`restoreElements()`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#restoreElements) about `localElements`.
886
+
887
+ **_How to use_**
888
+
889
+ ```js
890
+ import { restore } from "@excalidraw/excalidraw";
891
+ ```
892
+
893
+ This function makes sure elements and state is set to appropriate values and set to default value if not present. It is a combination of [restoreElements](#restoreElements) and [restoreAppState](#restoreAppState).
894
+
895
+ #### `restoreLibraryItems`
896
+
897
+ **_Signature_**
898
+
899
+ <pre>
900
+ restoreLibraryItems(libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L22">ImportedDataState["libraryItems"]</a>, defaultStatus: "published" | "unpublished")
901
+ </pre>
902
+
903
+ **_How to use_**
904
+
905
+ ```js
906
+ import { restoreLibraryItems } from "@excalidraw/excalidraw";
907
+
908
+ restoreLibraryItems(libraryItems, "unpublished");
909
+ ```
910
+
911
+ This function normalizes library items elements, adding missing values when needed.
912
+
913
+ ### Export utilities
914
+
915
+ #### `exportToCanvas`
916
+
917
+ **_Signature_**
918
+
919
+ <pre
920
+ >exportToCanvas({
921
+ elements,
922
+ appState
923
+ getDimensions,
924
+ files
925
+ }: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L12">ExportOpts</a>
926
+ </pre>
927
+
928
+ | Name | Type | Default | Description |
929
+ | --- | --- | --- | --- |
930
+ | elements | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/src/element/types) | | The elements to be exported to canvas |
931
+ | appState | [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L12) | [defaultAppState](https://github.com/excalidraw/excalidraw/blob/master/src/appState.ts#L11) | The app state of the scene |
932
+ | getDimensions | `(width: number, height: number) => { width: number, height: number, scale?: number }` | undefined | A function which returns the `width`, `height`, and optionally `scale` (defaults `1`), with which canvas is to be exported. |
933
+ | maxWidthOrHeight | `number` | undefined | The maximum width or height of the exported image. If provided, `getDimensions` is ignored. |
934
+ | files | [BinaryFiles](The [`BinaryFiles`](<[BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64)>) | undefined | The files added to the scene. |
935
+
936
+ **How to use**
937
+
938
+ ```js
939
+ import { exportToCanvas } from "@excalidraw/excalidraw";
940
+ ```
941
+
942
+ This function returns the canvas with the exported elements, appState and dimensions.
943
+
944
+ #### `exportToBlob`
945
+
946
+ **_Signature_**
947
+
948
+ <pre>
949
+ exportToBlob(
950
+ opts: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L14">ExportOpts</a> & {
951
+ mimeType?: string,
952
+ quality?: number;
953
+ })
954
+ </pre>
955
+
956
+ | Name | Type | Default | Description |
957
+ | --- | --- | --- | --- |
958
+ | opts | | | This param is passed to `exportToCanvas`. You can refer to [`exportToCanvas`](#exportToCanvas) |
959
+ | mimeType | string | "image/png" | Indicates the image format |
960
+ | quality | number | 0.92 | A value between 0 and 1 indicating the [image quality](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#parameters). Applies only to `image/jpeg`/`image/webp` MIME types. |
961
+
962
+ **How to use**
963
+
964
+ ```js
965
+ import { exportToBlob } from "@excalidraw/excalidraw";
966
+ ```
967
+
968
+ Returns a promise which resolves with a [blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob). It internally uses [canvas.ToBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob).
969
+
970
+ #### `exportToSvg`
971
+
972
+ **_Signature_**
973
+
974
+ <pre>
975
+ exportToSvg({
976
+ elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>,
977
+ appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>,
978
+ exportPadding?: number,
979
+ metadata?: string,
980
+ files?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64">BinaryFiles</a>
981
+ })
982
+ </pre>
983
+
984
+ | Name | Type | Default | Description |
985
+ | --- | --- | --- | --- |
986
+ | elements | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106) | | The elements to exported as svg |
987
+ | appState | [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) | [defaultAppState](https://github.com/excalidraw/excalidraw/blob/master/src/appState.ts#L11) | The app state of the scene |
988
+ | exportPadding | number | 10 | The padding to be added on canvas |
989
+ | files | [BinaryFiles](The [`BinaryFiles`](<[BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64)>) | undefined | The files added to the scene. |
990
+
991
+ This function returns a promise which resolves to svg of the exported drawing.
992
+
993
+ #### `exportToClipboard`
994
+
995
+ **_Signature_**
996
+
997
+ <pre>
998
+ exportToClipboard(
999
+ opts: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L14">ExportOpts</a> & {
1000
+ mimeType?: string,
1001
+ quality?: number;
1002
+ type: 'png' | 'svg' |'json'
1003
+ })
1004
+ </pre>
1005
+
1006
+ | Name | Type | Default | Description |
1007
+ | --- | --- | --- | --- | --- | --- |
1008
+ | opts | | | This param is same as the params passed to `exportToCanvas`. You can refer to [`exportToCanvas`](#exportToCanvas). |
1009
+ | mimeType | string | "image/png" | Indicates the image format, this will be used when exporting as `png`. |
1010
+ | quality | number | 0.92 | A value between 0 and 1 indicating the [image quality](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#parameters). Applies only to `image/jpeg`/`image/webp` MIME types. This will be used when exporting as `png`. |
1011
+ | type | 'png' | 'svg' | 'json' | | This determines the format to which the scene data should be exported. |
1012
+
1013
+ **How to use**
1014
+
1015
+ ```js
1016
+ import { exportToClipboard } from "@excalidraw/excalidraw";
1017
+ ```
1018
+
1019
+ Copies the scene data in the specified format (determined by `type`) to clipboard.
1020
+
1021
+ ##### Additional attributes of appState for `export\*` APIs
1022
+
1023
+ | Name | Type | Default | Description |
1024
+ | --- | --- | --- | --- |
1025
+ | exportBackground | boolean | true | Indicates whether background should be exported |
1026
+ | viewBackgroundColor | string | #fff | The default background color |
1027
+ | exportWithDarkMode | boolean | false | Indicates whether to export with dark mode |
1028
+ | exportEmbedScene | boolean | false | Indicates whether scene data should be embedded in svg/png. This will increase the image size. |
1029
+
1030
+ ### Extra API's
1031
+
1032
+ #### `serializeAsJSON`
1033
+
1034
+ **_Signature_**
1035
+
1036
+ <pre>
1037
+ serializeAsJSON({
1038
+ elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>,
1039
+ appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>,
1040
+ }): string
1041
+ </pre>
1042
+
1043
+ Takes the scene elements and state and returns a JSON string. Deleted `elements`as well as most properties from `AppState` are removed from the resulting JSON. (see [`serializeAsJSON()`](https://github.com/excalidraw/excalidraw/blob/master/src/data/json.ts#L16) source for details).
1044
+
1045
+ If you want to overwrite the source field in the JSON string, you can set `window.EXCALIDRAW_EXPORT_SOURCE` to the desired value.
1046
+
1047
+ #### `serializeLibraryAsJSON`
1048
+
1049
+ **_Signature_**
1050
+
1051
+ <pre>
1052
+ serializeLibraryAsJSON({
1053
+ libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems[]</a>,
1054
+ </pre>
1055
+
1056
+ Takes the library items and returns a JSON string.
1057
+
1058
+ If you want to overwrite the source field in the JSON string, you can set `window.EXCALIDRAW_EXPORT_SOURCE` to the desired value.
1059
+
1060
+ #### `getSceneVersion`
1061
+
1062
+ **How to use**
1063
+
1064
+ <pre>
1065
+ import { getSceneVersion } from "@excalidraw/excalidraw";
1066
+ getSceneVersion(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>)
1067
+ </pre>
1068
+
1069
+ This function returns the current scene version.
1070
+
1071
+ #### `isInvisiblySmallElement`
1072
+
1073
+ **_Signature_**
1074
+
1075
+ <pre>
1076
+ isInvisiblySmallElement(element: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement</a>): boolean
1077
+ </pre>
1078
+
1079
+ **How to use**
1080
+
1081
+ ```js
1082
+ import { isInvisiblySmallElement } from "@excalidraw/excalidraw";
1083
+ ```
1084
+
1085
+ Returns `true` if element is invisibly small (e.g. width & height are zero).
1086
+
1087
+ #### `loadLibraryFromBlob`
1088
+
1089
+ ```js
1090
+ import { loadLibraryFromBlob } from "@excalidraw/excalidraw";
1091
+ ```
1092
+
1093
+ **_Signature_**
1094
+
1095
+ <pre>
1096
+ loadLibraryFromBlob(blob: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>)
1097
+ </pre>
1098
+
1099
+ This function loads the library from the blob.
1100
+
1101
+ #### `loadFromBlob`
1102
+
1103
+ **How to use**
1104
+
1105
+ ```js
1106
+ import { loadFromBlob } from "@excalidraw/excalidraw";
1107
+
1108
+ const scene = await loadFromBlob(file, null, null);
1109
+ excalidrawAPI.updateScene(scene);
1110
+ ```
1111
+
1112
+ **Signature**
1113
+
1114
+ <pre>
1115
+ loadFromBlob(
1116
+ blob: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>,
1117
+ localAppState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a> | null,
1118
+ localElements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a> | null,
1119
+ fileHandle?: FileSystemHandle | null
1120
+ ) => Promise<<a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/restore.ts#L53">RestoredDataState</a>>
1121
+ </pre>
1122
+
1123
+ This function loads the scene data from the blob (or file). If you pass `localAppState`, `localAppState` value will be preferred over the `appState` derived from `blob`. Throws if blob doesn't contain valid scene data.
1124
+
1125
+ #### `loadSceneOrLibraryFromBlob`
1126
+
1127
+ **How to use**
1128
+
1129
+ ```js
1130
+ import { loadSceneOrLibraryFromBlob, MIME_TYPES } from "@excalidraw/excalidraw";
1131
+
1132
+ const contents = await loadSceneOrLibraryFromBlob(file, null, null);
1133
+ if (contents.type === MIME_TYPES.excalidraw) {
1134
+ excalidrawAPI.updateScene(contents.data);
1135
+ } else if (contents.type === MIME_TYPES.excalidrawlib) {
1136
+ excalidrawAPI.updateLibrary(contents.data);
1137
+ }
1138
+ ```
1139
+
1140
+ **Signature**
1141
+
1142
+ <pre>
1143
+ loadSceneOrLibraryFromBlob(
1144
+ blob: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>,
1145
+ localAppState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a> | null,
1146
+ localElements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a> | null,
1147
+ fileHandle?: FileSystemHandle | null
1148
+ ) => Promise<{ type: string, data: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/restore.ts#L53">RestoredDataState</a> | <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L33">ImportedLibraryState</a>}>
1149
+ </pre>
1150
+
1151
+ This function loads either scene or library data from the supplied blob. If the blob contains scene data, and you pass `localAppState`, `localAppState` value will be preferred over the `appState` derived from `blob`. Throws if blob doesn't contain neither valid scene data or library data.
1152
+
1153
+ #### `getFreeDrawSvgPath`
1154
+
1155
+ **How to use**
1156
+
1157
+ ```js
1158
+ import { getFreeDrawSvgPath } from "@excalidraw/excalidraw";
1159
+ ```
1160
+
1161
+ **Signature**
1162
+
1163
+ <pre>
1164
+ getFreeDrawSvgPath(element: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L127">ExcalidrawFreeDrawElement</a>
1165
+ </pre>
1166
+
1167
+ This function returns the free draw svg path for the element.
1168
+
1169
+ #### `isLinearElement`
1170
+
1171
+ **How to use**
1172
+
1173
+ ```js
1174
+ import { isLinearElement } from "@excalidraw/excalidraw";
1175
+ ```
1176
+
1177
+ **Signature**
1178
+
1179
+ <pre>
1180
+ isLinearElement(elementType?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L80">ExcalidrawElement</a>): boolean
1181
+ </pre>
1182
+
1183
+ This function returns true if the element is linear type (`arrow` |`line`) else returns false.
1184
+
1185
+ #### `getNonDeletedElements`
1186
+
1187
+ **How to use**
1188
+
1189
+ ```js
1190
+ import { getNonDeletedElements } from "@excalidraw/excalidraw";
1191
+ ```
1192
+
1193
+ **Signature**
1194
+
1195
+ <pre>
1196
+ getNonDeletedElements(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L80"> readonly ExcalidrawElement[]</a>): as readonly <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L90">NonDeletedExcalidrawElement[]</a>
1197
+ </pre>
1198
+
1199
+ This function returns an array of deleted elements.
1200
+
1201
+ #### `mergeLibraryItems`
1202
+
1203
+ ```js
1204
+ import { mergeLibraryItems } from "@excalidraw/excalidraw";
1205
+ ```
1206
+
1207
+ **_Signature_**
1208
+
1209
+ <pre>
1210
+ mergeLibraryItems(localItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>, otherItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>) => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>
1211
+ </pre>
1212
+
1213
+ This function merges two `LibraryItems` arrays, where unique items from `otherItems` are sorted first in the returned array.
1214
+
1215
+ #### `parseLibraryTokensFromUrl`
1216
+
1217
+ **How to use**
1218
+
1219
+ ```js
1220
+ import { parseLibraryTokensFromUrl } from "@excalidraw/excalidraw";
1221
+ ```
1222
+
1223
+ **Signature**
1224
+
1225
+ <pre>
1226
+ parseLibraryTokensFromUrl(): {
1227
+ libraryUrl: string;
1228
+ idToken: string | null;
1229
+ } | null
1230
+ </pre>
1231
+
1232
+ Parses library parameters from URL if present (expects the `#addLibrary` hash key), and returns an object with the `libraryUrl` and `idToken`. Returns `null` if `#addLibrary` hash key not found.
1233
+
1234
+ #### `useHandleLibrary`
1235
+
1236
+ **How to use**
1237
+
1238
+ ```js
1239
+ import { useHandleLibrary } from "@excalidraw/excalidraw";
1240
+
1241
+ export const App = () => {
1242
+ // ...
1243
+ useHandleLibrary({ excalidrawAPI });
1244
+ };
1245
+ ```
1246
+
1247
+ **Signature**
1248
+
1249
+ <pre>
1250
+ useHandleLibrary(opts: {
1251
+ excalidrawAPI: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L432">ExcalidrawAPI</a>,
1252
+ getInitialLibraryItems?: () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L224">LibraryItemsSource</a>
1253
+ });
1254
+ </pre>
1255
+
1256
+ A hook that automatically imports library from url if `#addLibrary` hash key exists on initial load, or when it changes during the editing session (e.g. when a user installs a new library), and handles initial library load if `getInitialLibraryItems` getter is supplied.
1257
+
1258
+ In the future, we will be adding support for handling library persistence to browser storage (or elsewhere).
1259
+
1260
+ #### `sceneCoordsToViewportCoords`
1261
+
1262
+ ```js
1263
+ import { sceneCoordsToViewportCoords } from "@excalidraw/excalidraw";
1264
+ ```
1265
+
1266
+ **_Signature_**
1267
+
1268
+ <pre>
1269
+ sceneCoordsToViewportCoords({sceneX: number, sceneY: number}, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>): {x: number, y: number}
1270
+ </pre>
1271
+
1272
+ This function returns equivalent viewport coords for the provided scene coords in params.
1273
+
1274
+ #### `viewportCoordsToSceneCoords`
1275
+
1276
+ ```js
1277
+ import { viewportCoordsToSceneCoords } from "@excalidraw/excalidraw";
1278
+ ```
1279
+
1280
+ **_Signature_**
1281
+
1282
+ <pre>
1283
+ viewportCoordsToSceneCoords({clientX: number, clientY: number}, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>): {x: number, y: number}
1284
+ </pre>
1285
+
1286
+ This function returns equivalent scene coords for the provided viewport coords in params.
1287
+
1288
+ ### Exported constants
1289
+
1290
+ #### `FONT_FAMILY`
1291
+
1292
+ **How to use**
1293
+
1294
+ ```js
1295
+ import { FONT_FAMILY } from "@excalidraw/excalidraw";
1296
+ ```
1297
+
1298
+ `FONT_FAMILY` contains all the font families used in `Excalidraw` as explained below
1299
+
1300
+ | Font Family | Description |
1301
+ | ----------- | -------------------- |
1302
+ | Virgil | The handwritten font |
1303
+ | Helvetica | The Normal Font |
1304
+ | Cascadia | The Code Font |
1305
+
1306
+ Defaults to `FONT_FAMILY.Virgil` unless passed in `initialData.appState.currentItemFontFamily`.
1307
+
1308
+ #### `THEME`
1309
+
1310
+ **How to use**
1311
+
1312
+ ```js
1313
+ import { THEME } from "@excalidraw/excalidraw";
1314
+ ```
1315
+
1316
+ `THEME` contains all the themes supported by `Excalidraw` as explained below
1317
+
1318
+ | Theme | Description |
1319
+ | ----- | --------------- |
1320
+ | LIGHT | The light theme |
1321
+ | DARK | The Dark theme |
1322
+
1323
+ Defaults to `THEME.LIGHT` unless passed in `initialData.appState.theme`
1324
+
1325
+ ### `MIME_TYPES`
1326
+
1327
+ **How to use **
1328
+
1329
+ ```js
1330
+ import { MIME_TYPES } from "@excalidraw/excalidraw";
1331
+ ```
1332
+
1333
+ [`MIME_TYPES`](https://github.com/excalidraw/excalidraw/blob/master/src/constants.ts#L92) contains all the mime types supported by `Excalidraw`.
1334
+
1335
+ ## Need help?
1336
+
1337
+ Check out the existing [Q&A](https://github.com/excalidraw/excalidraw/discussions?discussions_q=label%3Apackage%3Aexcalidraw). If you have any queries or need help, ask us [here](https://github.com/excalidraw/excalidraw/discussions?discussions_q=label%3Apackage%3Aexcalidraw).
1338
+
1339
+ ### Development
1340
+
1341
+ #### Install the dependencies
1342
+
1343
+ ```bash
1344
+ yarn
1345
+ ```
1346
+
1347
+ #### Start the server
1348
+
1349
+ ```bash
1350
+ yarn start
1351
+ ```
1352
+
1353
+ [http://localhost:3001](http://localhost:3001) will open in your default browser.
1354
+
1355
+ The example is same as the [codesandbox example](https://ehlz3.csb.app/)
1356
+
1357
+ #### Create a test release
1358
+
1359
+ You can create a test release by posting the below comment in your pull request
1360
+
1361
+ ```
1362
+ @excalibot trigger release
1363
+ ```
1364
+
1365
+ Once the version is released `@excalibot` will post a comment with the release version.
1366
+
1367
+ #### Creating a production release
1368
+
1369
+ To release the next stable version follow the below steps
1370
+
1371
+ ```
1372
+ yarn prerelease version
1373
+ ```
1374
+
1375
+ You need to pass the `version` for which you want to create the release. This will make the changes needed before making the release like updating `package.json`, `changelog` and more.
1376
+
1377
+ The next step is to run the `release` script
1378
+
1379
+ ```
1380
+ yarn release
1381
+ ```
1382
+
1383
+ This will publish the package.
1384
+
1385
+ Right now there are two steps to create a production release but once this works fine these scripts will be combined and more automation will be done.