@excalidraw/excalidraw 0.10.0 → 0.11.0-5346-59101a1

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 (404) hide show
  1. package/CHANGELOG.md +1153 -0
  2. package/README.md +537 -119
  3. package/README_NEXT.md +1345 -0
  4. package/dist/excalidraw-assets/i18n-ar-SA-json-f37c9765d6ba9c94db28.js +1 -0
  5. package/dist/excalidraw-assets/i18n-bg-BG-json-d8c72e41cf02e763b54c.js +1 -0
  6. package/dist/excalidraw-assets/i18n-bn-BD-json-246ddff2b69891d1399d.js +1 -0
  7. package/dist/excalidraw-assets/i18n-ca-ES-json-2583291c4633e96df9d6.js +1 -0
  8. package/dist/excalidraw-assets/i18n-cs-CZ-json-7fb82d30a7139f991154.js +1 -0
  9. package/dist/excalidraw-assets/i18n-da-DK-json-5f58e2d75044deee8410.js +1 -0
  10. package/dist/excalidraw-assets/i18n-de-DE-json-20912cca3094f0524a21.js +1 -0
  11. package/dist/excalidraw-assets/i18n-el-GR-json-96277306136a9ee3d56c.js +1 -0
  12. package/dist/excalidraw-assets/i18n-es-ES-json-2d9209d0d8b45e340212.js +1 -0
  13. package/dist/excalidraw-assets/i18n-eu-ES-json-40142a580d932c8cb50d.js +1 -0
  14. package/dist/excalidraw-assets/i18n-fa-IR-json-5aa04fe7e238f87f3607.js +1 -0
  15. package/dist/excalidraw-assets/i18n-fi-FI-json-2e5665a625fe47e2a60f.js +1 -0
  16. package/dist/excalidraw-assets/i18n-fr-FR-json-ad79d60ccbf7da435101.js +1 -0
  17. package/dist/excalidraw-assets/i18n-he-IL-json-5aa3ca202abb250e82bd.js +1 -0
  18. package/dist/excalidraw-assets/i18n-hi-IN-json-8fe2d63926e008f5725c.js +1 -0
  19. package/dist/excalidraw-assets/i18n-hu-HU-json-78e1c51d6d92ed32aa2f.js +1 -0
  20. package/dist/excalidraw-assets/i18n-id-ID-json-6c529ed7cc3d5353bdc0.js +1 -0
  21. package/dist/excalidraw-assets/i18n-it-IT-json-7c39e59e8682963a7851.js +1 -0
  22. package/dist/excalidraw-assets/i18n-ja-JP-json-2263e6c8e274763d04cc.js +1 -0
  23. package/dist/excalidraw-assets/i18n-kab-KAB-json-9974a930bde67748d79a.js +1 -0
  24. package/dist/excalidraw-assets/i18n-kk-KZ-json-b1da82815e51b638b28e.js +1 -0
  25. package/dist/excalidraw-assets/i18n-ko-KR-json-36dce31f57535a3884fc.js +1 -0
  26. package/dist/excalidraw-assets/i18n-lt-LT-json-7e4b8147241a2807a1f1.js +1 -0
  27. package/dist/excalidraw-assets/i18n-lv-LV-json-0292c4b3153e02ba01cc.js +1 -0
  28. package/dist/excalidraw-assets/i18n-mr-IN-json-85e3bad5588e60eda6ed.js +1 -0
  29. package/dist/excalidraw-assets/i18n-my-MM-json-a50d126ec63009915802.js +1 -0
  30. package/dist/excalidraw-assets/i18n-nb-NO-json-dd7cd6513e3d00551949.js +1 -0
  31. package/dist/excalidraw-assets/i18n-nl-NL-json-a2e36932c7b397dfdf8b.js +1 -0
  32. package/dist/excalidraw-assets/i18n-nn-NO-json-76159e8cfa136255e657.js +1 -0
  33. package/dist/excalidraw-assets/i18n-oc-FR-json-8fcbd2e5e589bc9b3f05.js +1 -0
  34. package/dist/excalidraw-assets/i18n-pa-IN-json-664d068563584bb41ae4.js +1 -0
  35. package/dist/excalidraw-assets/i18n-pl-PL-json-17d817993f240f65dc1f.js +1 -0
  36. package/dist/excalidraw-assets/i18n-pt-BR-json-dfbe3455644130e9851c.js +1 -0
  37. package/dist/excalidraw-assets/i18n-pt-PT-json-bda935fce18a7b179bcb.js +1 -0
  38. package/dist/excalidraw-assets/i18n-ro-RO-json-3473997bac53931c8b1c.js +1 -0
  39. package/dist/excalidraw-assets/i18n-ru-RU-json-2a58c91c91fbb9009a4a.js +1 -0
  40. package/dist/excalidraw-assets/i18n-si-LK-json-0ad49043e4c810f4e8f2.js +1 -0
  41. package/dist/excalidraw-assets/i18n-sk-SK-json-6a88d3cef7420263d448.js +1 -0
  42. package/dist/excalidraw-assets/i18n-sl-SI-json-d883f256ad475721b51e.js +1 -0
  43. package/dist/excalidraw-assets/i18n-sv-SE-json-ab9784b6a181e4b3e52b.js +1 -0
  44. package/dist/excalidraw-assets/i18n-ta-IN-json-49b6bc876b7703f493e7.js +1 -0
  45. package/dist/excalidraw-assets/i18n-tr-TR-json-e6a720f75140ee82da6d.js +1 -0
  46. package/dist/excalidraw-assets/i18n-uk-UA-json-1d95323ec8040114490e.js +1 -0
  47. package/dist/excalidraw-assets/i18n-zh-CN-json-facce09827627d918c14.js +1 -0
  48. package/dist/excalidraw-assets/i18n-zh-HK-json-a6e21fe69a6a6f8c8ea6.js +1 -0
  49. package/dist/excalidraw-assets/i18n-zh-TW-json-37610fbce479c7f8cef2.js +1 -0
  50. package/dist/excalidraw-assets/vendor-52b1f3361986b6c6a4fe.js +2 -0
  51. package/dist/excalidraw-assets/vendor-52b1f3361986b6c6a4fe.js.LICENSE.txt +12 -0
  52. package/dist/excalidraw-assets-dev/i18n-ar-SA-json-505ef559f47ea6b69719.js +22 -0
  53. package/dist/excalidraw-assets-dev/i18n-bg-BG-json-bcb00de8d85335103437.js +22 -0
  54. package/dist/excalidraw-assets-dev/i18n-bn-BD-json-20cb88b768b6656f69a0.js +22 -0
  55. package/dist/excalidraw-assets-dev/i18n-ca-ES-json-c0a2946ac526da48c821.js +22 -0
  56. package/dist/excalidraw-assets-dev/i18n-cs-CZ-json-3b57cc3db37bad8747c9.js +22 -0
  57. package/dist/excalidraw-assets-dev/i18n-da-DK-json-9fd1d27b5e867510c0c4.js +22 -0
  58. package/dist/excalidraw-assets-dev/i18n-de-DE-json-80aa4aed6cc5f0f47bec.js +22 -0
  59. package/dist/excalidraw-assets-dev/i18n-el-GR-json-08221c6f5387a7ef440e.js +22 -0
  60. package/dist/excalidraw-assets-dev/i18n-es-ES-json-bb7d7aa7840ad87ac15d.js +22 -0
  61. package/dist/excalidraw-assets-dev/i18n-eu-ES-json-1aff52bfd1a98cc073a3.js +22 -0
  62. package/dist/excalidraw-assets-dev/i18n-fa-IR-json-1af59f1130dd499b2aee.js +22 -0
  63. package/dist/excalidraw-assets-dev/i18n-fi-FI-json-874b4f80c8cb7c54ba9e.js +22 -0
  64. package/dist/excalidraw-assets-dev/i18n-fr-FR-json-b55b922b008349e24e30.js +22 -0
  65. package/dist/excalidraw-assets-dev/i18n-he-IL-json-e16fce9c2852e89a31f2.js +22 -0
  66. package/dist/excalidraw-assets-dev/i18n-hi-IN-json-96d1324664dcf226249e.js +22 -0
  67. package/dist/excalidraw-assets-dev/i18n-hu-HU-json-5e29c373127695ccfe28.js +22 -0
  68. package/dist/excalidraw-assets-dev/i18n-id-ID-json-c3b8c47e9f2cd5a218a4.js +22 -0
  69. package/dist/excalidraw-assets-dev/i18n-it-IT-json-c4ba0fd51730152b3389.js +22 -0
  70. package/dist/excalidraw-assets-dev/i18n-ja-JP-json-4fb9df48c7c2aca8709b.js +22 -0
  71. package/dist/excalidraw-assets-dev/i18n-kab-KAB-json-56a2f5b742bb44d84587.js +22 -0
  72. package/dist/excalidraw-assets-dev/i18n-kk-KZ-json-69f5849187a51635aa55.js +22 -0
  73. package/dist/excalidraw-assets-dev/i18n-ko-KR-json-be749d83561b4547fca0.js +22 -0
  74. package/dist/excalidraw-assets-dev/i18n-lt-LT-json-f74d8fbb36e64d164cb3.js +22 -0
  75. package/dist/excalidraw-assets-dev/i18n-lv-LV-json-05cafa9d59e825d37a30.js +22 -0
  76. package/dist/excalidraw-assets-dev/i18n-mr-IN-json-4df0aaed6b5bd9c354bf.js +22 -0
  77. package/dist/excalidraw-assets-dev/i18n-my-MM-json-10cd0a77755d74cc2d88.js +22 -0
  78. package/dist/excalidraw-assets-dev/i18n-nb-NO-json-0328d43c8eb21619f1ef.js +22 -0
  79. package/dist/excalidraw-assets-dev/i18n-nl-NL-json-ce7bba8e06a59e62a4d0.js +22 -0
  80. package/dist/excalidraw-assets-dev/i18n-nn-NO-json-64d56d9257aa9516e081.js +22 -0
  81. package/dist/excalidraw-assets-dev/i18n-oc-FR-json-efae2c9bbbc42a6f6c70.js +22 -0
  82. package/dist/excalidraw-assets-dev/i18n-pa-IN-json-6378d9552735e33a9fe3.js +22 -0
  83. package/dist/excalidraw-assets-dev/i18n-pl-PL-json-ed1bf39b6b8f8061299d.js +22 -0
  84. package/dist/excalidraw-assets-dev/i18n-pt-BR-json-2a02a619bfa9700ce852.js +22 -0
  85. package/dist/excalidraw-assets-dev/i18n-pt-PT-json-d28b9a54ff94e15ff9bb.js +22 -0
  86. package/dist/excalidraw-assets-dev/i18n-ro-RO-json-00d5715f05aa3063960a.js +22 -0
  87. package/dist/excalidraw-assets-dev/i18n-ru-RU-json-ac0637166d5b462e339f.js +22 -0
  88. package/dist/excalidraw-assets-dev/i18n-si-LK-json-63d7c3f1c548dd28b002.js +22 -0
  89. package/dist/excalidraw-assets-dev/i18n-sk-SK-json-42cdbcaa7b9a48f2d39f.js +22 -0
  90. package/dist/excalidraw-assets-dev/i18n-sl-SI-json-56b1f2e0db09f030df1d.js +22 -0
  91. package/dist/excalidraw-assets-dev/i18n-sv-SE-json-3eb8200f34c205bc6564.js +22 -0
  92. package/dist/excalidraw-assets-dev/i18n-ta-IN-json-6d1328c5b1be8952f272.js +22 -0
  93. package/dist/excalidraw-assets-dev/i18n-tr-TR-json-f19e7eace448e972fc37.js +22 -0
  94. package/dist/excalidraw-assets-dev/i18n-uk-UA-json-da0e1d496b320531f5dc.js +22 -0
  95. package/dist/excalidraw-assets-dev/i18n-zh-CN-json-84fc26b884a0a83892c9.js +22 -0
  96. package/dist/excalidraw-assets-dev/i18n-zh-HK-json-07799e9c9378a2263273.js +22 -0
  97. package/dist/excalidraw-assets-dev/i18n-zh-TW-json-61c7460fdc361e477121.js +22 -0
  98. package/dist/excalidraw-assets-dev/vendor-c0592035c3911af79359.js +98 -0
  99. package/dist/excalidraw.development.js +975 -286
  100. package/dist/excalidraw.production.min.js +1 -1
  101. package/dist/excalidraw.production.min.js.LICENSE.txt +9 -2
  102. package/package.json +32 -25
  103. package/types/actions/actionAddToLibrary.d.ts +298 -1
  104. package/types/actions/actionAlign.d.ts +91 -6
  105. package/types/actions/actionBoundText.d.ts +123 -0
  106. package/types/actions/actionCanvas.d.ts +861 -8
  107. package/types/actions/actionClipboard.d.ts +563 -4
  108. package/types/actions/actionDeleteSelected.d.ts +323 -1
  109. package/types/actions/actionDistribute.d.ts +33 -2
  110. package/types/actions/actionDuplicateSelection.d.ts +22 -1
  111. package/types/actions/actionExport.d.ts +956 -8
  112. package/types/actions/actionFinalize.d.ts +206 -1
  113. package/types/actions/actionFlip.d.ts +35 -2
  114. package/types/actions/actionGroup.d.ts +45 -2
  115. package/types/actions/actionMenu.d.ts +334 -4
  116. package/types/actions/actionNavigate.d.ts +14 -1
  117. package/types/actions/actionProperties.d.ts +1389 -12
  118. package/types/actions/actionSelectAll.d.ts +15 -1
  119. package/types/actions/actionStyles.d.ts +125 -2
  120. package/types/actions/actionToggleGridMode.d.ts +111 -1
  121. package/types/actions/actionToggleLock.d.ts +17 -0
  122. package/types/actions/actionToggleStats.d.ts +109 -1
  123. package/types/actions/actionToggleViewMode.d.ts +110 -1
  124. package/types/actions/actionToggleZenMode.d.ts +110 -1
  125. package/types/actions/actionZindex.d.ts +67 -4
  126. package/types/actions/index.d.ts +5 -2
  127. package/types/actions/manager.d.ts +6 -14
  128. package/types/actions/register.d.ts +3 -1
  129. package/types/actions/shortcuts.d.ts +2 -1
  130. package/types/actions/types.d.ts +13 -22
  131. package/types/align.d.ts +0 -1
  132. package/types/analytics.d.ts +1 -1
  133. package/types/appState.d.ts +27 -11
  134. package/types/charts.d.ts +8 -0
  135. package/types/clipboard.d.ts +5 -4
  136. package/types/components/Actions.d.ts +9 -5
  137. package/types/components/App.d.ts +67 -16
  138. package/types/components/Avatar.d.ts +3 -2
  139. package/types/components/ButtonIconSelect.d.ts +1 -0
  140. package/types/components/Card.d.ts +1 -1
  141. package/types/components/CheckboxItem.d.ts +2 -1
  142. package/types/components/ClearCanvas.d.ts +5 -0
  143. package/types/components/ColorPicker.d.ts +6 -1
  144. package/types/components/ConfirmDialog.d.ts +11 -0
  145. package/types/components/ContextMenu.d.ts +3 -0
  146. package/types/components/DarkModeToggle.d.ts +3 -3
  147. package/types/components/Dialog.d.ts +4 -2
  148. package/types/components/HintViewer.d.ts +3 -2
  149. package/types/components/ImageExportDialog.d.ts +5 -4
  150. package/types/components/InitializeApp.d.ts +2 -10
  151. package/types/components/JSONExportDialog.d.ts +6 -5
  152. package/types/components/LayerUI.d.ts +12 -5
  153. package/types/components/LibraryButton.d.ts +1 -0
  154. package/types/components/LibraryMenu.d.ts +18 -0
  155. package/types/components/LibraryMenuItems.d.ts +24 -0
  156. package/types/components/LibraryUnit.d.ts +9 -5
  157. package/types/components/LoadingMessage.d.ts +3 -1
  158. package/types/components/LockButton.d.ts +1 -0
  159. package/types/components/MobileMenu.d.ts +8 -2
  160. package/types/components/Modal.d.ts +1 -0
  161. package/types/components/PasteChartDialog.d.ts +1 -1
  162. package/types/components/PenModeButton.d.ts +13 -0
  163. package/types/components/Popover.d.ts +5 -1
  164. package/types/components/PublishLibrary.d.ts +17 -0
  165. package/types/components/SidebarLockButton.d.ts +9 -0
  166. package/types/components/SingleLibraryItem.d.ts +11 -0
  167. package/types/components/Spinner.d.ts +7 -0
  168. package/types/components/Stack.d.ts +1 -1
  169. package/types/components/ToolButton.d.ts +13 -2
  170. package/types/components/Tooltip.d.ts +9 -1
  171. package/types/components/UserList.d.ts +6 -5
  172. package/types/components/icons.d.ts +57 -40
  173. package/types/constants.d.ts +42 -8
  174. package/types/data/blob.d.ts +40 -4
  175. package/types/data/encode.d.ts +29 -1
  176. package/types/data/encryption.d.ts +9 -0
  177. package/types/data/filesystem.d.ts +5 -5
  178. package/types/data/index.d.ts +2 -2
  179. package/types/data/json.d.ts +8 -9
  180. package/types/data/library.d.ts +90 -8
  181. package/types/data/resave.d.ts +3 -3
  182. package/types/data/restore.d.ts +5 -3
  183. package/types/data/types.d.ts +9 -4
  184. package/types/{disitrubte.d.ts → distribute.d.ts} +0 -1
  185. package/types/element/Hyperlink.d.ts +131 -0
  186. package/types/element/bounds.d.ts +12 -1
  187. package/types/element/collision.d.ts +4 -2
  188. package/types/element/dragElements.d.ts +3 -5
  189. package/types/element/image.d.ts +22 -0
  190. package/types/element/index.d.ts +2 -4
  191. package/types/element/linearElementEditor.d.ts +142 -9
  192. package/types/element/mutateElement.d.ts +2 -2
  193. package/types/element/newElement.d.ts +8 -3
  194. package/types/element/resizeElements.d.ts +3 -3
  195. package/types/element/sizeHelpers.d.ts +2 -1
  196. package/types/element/textElement.d.ts +26 -2
  197. package/types/element/textWysiwyg.d.ts +6 -5
  198. package/types/element/typeChecks.d.ts +11 -5
  199. package/types/element/types.d.ts +35 -8
  200. package/types/galines.d.ts +1 -1
  201. package/types/groups.d.ts +1 -0
  202. package/types/i18n.d.ts +1 -1
  203. package/types/jotai.d.ts +120 -0
  204. package/types/keys.d.ts +10 -3
  205. package/types/packages/excalidraw/dist/{excalidraw-assets-dev/vendor-1f85eb76a52b1d218411.d.ts → excalidraw-assets/i18n-ar-SA-json-f37c9765d6ba9c94db28.d.ts} +0 -0
  206. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-ar-SA-json-a98b3a07a69a56aa6ddc.d.ts → i18n-bg-BG-json-d8c72e41cf02e763b54c.d.ts} +0 -0
  207. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-bg-BG-json-63af3f6053ca50d0c1a3.d.ts → i18n-bn-BD-json-246ddff2b69891d1399d.d.ts} +0 -0
  208. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-ca-ES-json-6f613ec62c184eed761c.d.ts → i18n-ca-ES-json-2583291c4633e96df9d6.d.ts} +0 -0
  209. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-cs-CZ-json-c485bdbc1ad44e51f1f1.d.ts → i18n-cs-CZ-json-7fb82d30a7139f991154.d.ts} +0 -0
  210. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-da-DK-json-fdc74fe43abb7f09253d.d.ts → i18n-da-DK-json-5f58e2d75044deee8410.d.ts} +0 -0
  211. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-de-DE-json-2984c3ea70efb6a7673c.d.ts → i18n-de-DE-json-20912cca3094f0524a21.d.ts} +0 -0
  212. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-el-GR-json-ef1babaff2ea7b0ca48c.d.ts → i18n-el-GR-json-96277306136a9ee3d56c.d.ts} +0 -0
  213. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-es-ES-json-770832e8199e76bcea31.d.ts → i18n-es-ES-json-2d9209d0d8b45e340212.d.ts} +0 -0
  214. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-fa-IR-json-5d17bed42e8aa3e26778.d.ts → i18n-eu-ES-json-40142a580d932c8cb50d.d.ts} +0 -0
  215. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-fi-FI-json-1856fe5f0aa5f6733c71.d.ts → i18n-fa-IR-json-5aa04fe7e238f87f3607.d.ts} +0 -0
  216. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-fr-FR-json-7e2c395dc072fbeb4dc8.d.ts → i18n-fi-FI-json-2e5665a625fe47e2a60f.d.ts} +0 -0
  217. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-he-IL-json-c22c852f5d1007b76cfd.d.ts → i18n-fr-FR-json-ad79d60ccbf7da435101.d.ts} +0 -0
  218. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-hi-IN-json-3577c3ff017e2af147ee.d.ts → i18n-he-IL-json-5aa3ca202abb250e82bd.d.ts} +0 -0
  219. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-hu-HU-json-2173dae4a84d3f943a3d.d.ts → i18n-hi-IN-json-8fe2d63926e008f5725c.d.ts} +0 -0
  220. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-id-ID-json-36ef4139fdc39bd473e9.d.ts → i18n-hu-HU-json-78e1c51d6d92ed32aa2f.d.ts} +0 -0
  221. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-it-IT-json-55de4a420bc2799d63ac.d.ts → i18n-id-ID-json-6c529ed7cc3d5353bdc0.d.ts} +0 -0
  222. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-ja-JP-json-10da607a92dd9ee4b6b1.d.ts → i18n-it-IT-json-7c39e59e8682963a7851.d.ts} +0 -0
  223. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-kab-KAB-json-72dfe5e520fb843a911e.d.ts → i18n-ja-JP-json-2263e6c8e274763d04cc.d.ts} +0 -0
  224. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-kk-KZ-json-72a00814a5ea1bc1bd4d.d.ts → i18n-kab-KAB-json-9974a930bde67748d79a.d.ts} +0 -0
  225. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-ko-KR-json-530261d88e915f413822.d.ts → i18n-kk-KZ-json-b1da82815e51b638b28e.d.ts} +0 -0
  226. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-lv-LV-json-efdf3550b88b63639a73.d.ts → i18n-ko-KR-json-36dce31f57535a3884fc.d.ts} +0 -0
  227. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-my-MM-json-9c8f0251105b94363a8f.d.ts → i18n-lt-LT-json-7e4b8147241a2807a1f1.d.ts} +0 -0
  228. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-nb-NO-json-102950eb1c0d17b2be82.d.ts → i18n-lv-LV-json-0292c4b3153e02ba01cc.d.ts} +0 -0
  229. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-nl-NL-json-220f20ddbd7092a3a948.d.ts → i18n-mr-IN-json-85e3bad5588e60eda6ed.d.ts} +0 -0
  230. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-nn-NO-json-5b64fbe09ec2fdc5c686.d.ts → i18n-my-MM-json-a50d126ec63009915802.d.ts} +0 -0
  231. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-oc-FR-json-3fb584025bb45201012f.d.ts → i18n-nb-NO-json-dd7cd6513e3d00551949.d.ts} +0 -0
  232. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-pa-IN-json-b7ad703689a54409b91a.d.ts → i18n-nl-NL-json-a2e36932c7b397dfdf8b.d.ts} +0 -0
  233. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-pl-PL-json-589514e9da02be71829e.d.ts → i18n-nn-NO-json-76159e8cfa136255e657.d.ts} +0 -0
  234. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-pt-BR-json-5eb00d985874b4016992.d.ts → i18n-oc-FR-json-8fcbd2e5e589bc9b3f05.d.ts} +0 -0
  235. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-pt-PT-json-fb8bc9b15f2d232ce452.d.ts → i18n-pa-IN-json-664d068563584bb41ae4.d.ts} +0 -0
  236. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-ro-RO-json-dc651de2037f6a904212.d.ts → i18n-pl-PL-json-17d817993f240f65dc1f.d.ts} +0 -0
  237. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-ru-RU-json-1620932d8cf3b49dbac7.d.ts → i18n-pt-BR-json-dfbe3455644130e9851c.d.ts} +0 -0
  238. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-sk-SK-json-4fc55e97187d84b3e35f.d.ts → i18n-pt-PT-json-bda935fce18a7b179bcb.d.ts} +0 -0
  239. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-sv-SE-json-5fd1ff062cab18b6c3ec.d.ts → i18n-ro-RO-json-3473997bac53931c8b1c.d.ts} +0 -0
  240. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-tr-TR-json-60da00067a54eacae6ea.d.ts → i18n-ru-RU-json-2a58c91c91fbb9009a4a.d.ts} +0 -0
  241. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-uk-UA-json-3398bd8076ace43903a4.d.ts → i18n-si-LK-json-0ad49043e4c810f4e8f2.d.ts} +0 -0
  242. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-zh-CN-json-9b20d01d442a9938174a.d.ts → i18n-sk-SK-json-6a88d3cef7420263d448.d.ts} +0 -0
  243. package/types/packages/excalidraw/dist/excalidraw-assets/{i18n-zh-TW-json-93a8203eb30054101fcc.d.ts → i18n-sl-SI-json-d883f256ad475721b51e.d.ts} +0 -0
  244. package/types/packages/excalidraw/dist/excalidraw-assets/{image-02a1f3ecd6baf42daaa6.d.ts → i18n-sv-SE-json-ab9784b6a181e4b3e52b.d.ts} +0 -0
  245. package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-881ef50682618d9bd3d3.d.ts → i18n-ta-IN-json-49b6bc876b7703f493e7.d.ts} +0 -0
  246. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-tr-TR-json-e6a720f75140ee82da6d.d.ts +0 -0
  247. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-uk-UA-json-1d95323ec8040114490e.d.ts +0 -0
  248. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-CN-json-facce09827627d918c14.d.ts +0 -0
  249. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-HK-json-a6e21fe69a6a6f8c8ea6.d.ts +0 -0
  250. package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-TW-json-37610fbce479c7f8cef2.d.ts +0 -0
  251. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-52b1f3361986b6c6a4fe.d.ts +0 -0
  252. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-ar-SA-json-65bc67ce1607e71d3c60.d.ts → i18n-ar-SA-json-505ef559f47ea6b69719.d.ts} +0 -0
  253. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-bg-BG-json-2e34234671c3f27e834b.d.ts → i18n-bg-BG-json-bcb00de8d85335103437.d.ts} +0 -0
  254. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-ca-ES-json-fc2729f9ec4a48ef830f.d.ts → i18n-bn-BD-json-20cb88b768b6656f69a0.d.ts} +0 -0
  255. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-cs-CZ-json-a5b54f27dd83c625e776.d.ts → i18n-ca-ES-json-c0a2946ac526da48c821.d.ts} +0 -0
  256. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-da-DK-json-2e18fec0eace18cc9d20.d.ts → i18n-cs-CZ-json-3b57cc3db37bad8747c9.d.ts} +0 -0
  257. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-de-DE-json-28622f2358ee065e8411.d.ts → i18n-da-DK-json-9fd1d27b5e867510c0c4.d.ts} +0 -0
  258. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-el-GR-json-3d9a940ed9491b9addc3.d.ts → i18n-de-DE-json-80aa4aed6cc5f0f47bec.d.ts} +0 -0
  259. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-es-ES-json-db6707f20cd2518ad8b3.d.ts → i18n-el-GR-json-08221c6f5387a7ef440e.d.ts} +0 -0
  260. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-fa-IR-json-72cd5824085f3bfcb7a1.d.ts → i18n-es-ES-json-bb7d7aa7840ad87ac15d.d.ts} +0 -0
  261. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-fi-FI-json-1b66bec37676ad9aab1e.d.ts → i18n-eu-ES-json-1aff52bfd1a98cc073a3.d.ts} +0 -0
  262. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-fr-FR-json-843f8bcc26ecf3185344.d.ts → i18n-fa-IR-json-1af59f1130dd499b2aee.d.ts} +0 -0
  263. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-he-IL-json-2679793593de22336d48.d.ts → i18n-fi-FI-json-874b4f80c8cb7c54ba9e.d.ts} +0 -0
  264. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-hi-IN-json-732a1e3f06a5fbb83e8d.d.ts → i18n-fr-FR-json-b55b922b008349e24e30.d.ts} +0 -0
  265. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-hu-HU-json-d6b3d837d675d7375c1e.d.ts → i18n-he-IL-json-e16fce9c2852e89a31f2.d.ts} +0 -0
  266. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-id-ID-json-328fc20f45af18fbbc5b.d.ts → i18n-hi-IN-json-96d1324664dcf226249e.d.ts} +0 -0
  267. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-it-IT-json-6cfbb19fada476d23814.d.ts → i18n-hu-HU-json-5e29c373127695ccfe28.d.ts} +0 -0
  268. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-ja-JP-json-6c84ee63e3effba0eb0a.d.ts → i18n-id-ID-json-c3b8c47e9f2cd5a218a4.d.ts} +0 -0
  269. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-kab-KAB-json-404827528be2a446449d.d.ts → i18n-it-IT-json-c4ba0fd51730152b3389.d.ts} +0 -0
  270. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-kk-KZ-json-03875b16f2b5b4121983.d.ts → i18n-ja-JP-json-4fb9df48c7c2aca8709b.d.ts} +0 -0
  271. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-ko-KR-json-7cd7bfaf5e2b39bd15d8.d.ts → i18n-kab-KAB-json-56a2f5b742bb44d84587.d.ts} +0 -0
  272. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-lv-LV-json-af0cfb3eca967f0fe675.d.ts → i18n-kk-KZ-json-69f5849187a51635aa55.d.ts} +0 -0
  273. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-my-MM-json-b06767407455ca2f4c3f.d.ts → i18n-ko-KR-json-be749d83561b4547fca0.d.ts} +0 -0
  274. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-nb-NO-json-560905b77e939b594348.d.ts → i18n-lt-LT-json-f74d8fbb36e64d164cb3.d.ts} +0 -0
  275. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-nl-NL-json-f132a70ab7b920ac4d8f.d.ts → i18n-lv-LV-json-05cafa9d59e825d37a30.d.ts} +0 -0
  276. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-nn-NO-json-35e531bd3a461f0d1ceb.d.ts → i18n-mr-IN-json-4df0aaed6b5bd9c354bf.d.ts} +0 -0
  277. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-oc-FR-json-68dad2b665d95463621d.d.ts → i18n-my-MM-json-10cd0a77755d74cc2d88.d.ts} +0 -0
  278. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-pa-IN-json-6bec1f7f94b1cf3633f9.d.ts → i18n-nb-NO-json-0328d43c8eb21619f1ef.d.ts} +0 -0
  279. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-pl-PL-json-0b282a1f23c3aa2e8bbb.d.ts → i18n-nl-NL-json-ce7bba8e06a59e62a4d0.d.ts} +0 -0
  280. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-pt-BR-json-cb9dae4e4d99080bbd4c.d.ts → i18n-nn-NO-json-64d56d9257aa9516e081.d.ts} +0 -0
  281. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-pt-PT-json-cabfa4db01426846387f.d.ts → i18n-oc-FR-json-efae2c9bbbc42a6f6c70.d.ts} +0 -0
  282. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-ro-RO-json-0fc304e943c3727d3069.d.ts → i18n-pa-IN-json-6378d9552735e33a9fe3.d.ts} +0 -0
  283. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-ru-RU-json-aae276923a7448546ba9.d.ts → i18n-pl-PL-json-ed1bf39b6b8f8061299d.d.ts} +0 -0
  284. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-sk-SK-json-6672eb5c84a0d06bd3c2.d.ts → i18n-pt-BR-json-2a02a619bfa9700ce852.d.ts} +0 -0
  285. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-sv-SE-json-3738297ef992b7a4e69c.d.ts → i18n-pt-PT-json-d28b9a54ff94e15ff9bb.d.ts} +0 -0
  286. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-tr-TR-json-bc5117a1ab430f3e7fc5.d.ts → i18n-ro-RO-json-00d5715f05aa3063960a.d.ts} +0 -0
  287. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-uk-UA-json-24701ab6a0a1747281aa.d.ts → i18n-ru-RU-json-ac0637166d5b462e339f.d.ts} +0 -0
  288. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-zh-CN-json-77fd3d2d5c8b490cd9c9.d.ts → i18n-si-LK-json-63d7c3f1c548dd28b002.d.ts} +0 -0
  289. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{i18n-zh-TW-json-744589603e44fd0ca7ea.d.ts → i18n-sk-SK-json-42cdbcaa7b9a48f2d39f.d.ts} +0 -0
  290. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-sl-SI-json-56b1f2e0db09f030df1d.d.ts +2 -0
  291. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-sv-SE-json-3eb8200f34c205bc6564.d.ts +2 -0
  292. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ta-IN-json-6d1328c5b1be8952f272.d.ts +2 -0
  293. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-tr-TR-json-f19e7eace448e972fc37.d.ts +2 -0
  294. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-uk-UA-json-da0e1d496b320531f5dc.d.ts +2 -0
  295. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-CN-json-84fc26b884a0a83892c9.d.ts +2 -0
  296. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-HK-json-07799e9c9378a2263273.d.ts +2 -0
  297. package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-TW-json-61c7460fdc361e477121.d.ts +2 -0
  298. package/types/packages/excalidraw/dist/excalidraw-assets-dev/{image-0ad20139bba28f28b031.d.ts → vendor-c0592035c3911af79359.d.ts} +0 -0
  299. package/types/packages/excalidraw/dist/excalidraw.production.min.d.ts +1 -3
  300. package/types/packages/excalidraw/entry.d.ts +0 -2
  301. package/types/packages/excalidraw/env.d.ts +1 -0
  302. package/types/packages/excalidraw/example/App.d.ts +8 -0
  303. package/types/packages/excalidraw/example/index.d.ts +1 -0
  304. package/types/packages/excalidraw/example/initialData.d.ts +172 -0
  305. package/types/packages/excalidraw/example/sidebar/Sidebar.d.ts +5 -0
  306. package/types/packages/excalidraw/index.d.ts +9 -7
  307. package/types/packages/excalidraw/webpack.dev-server.config.d.ts +19 -0
  308. package/types/packages/excalidraw/webpack.dev.config.d.ts +6 -8
  309. package/types/packages/excalidraw/webpack.prod.config.d.ts +7 -8
  310. package/types/packages/utils.d.ts +19 -9
  311. package/types/renderer/renderElement.d.ts +17 -5
  312. package/types/renderer/renderScene.d.ts +5 -9
  313. package/types/scene/Scene.d.ts +2 -3
  314. package/types/scene/comparisons.d.ts +3 -2
  315. package/types/scene/export.d.ts +4 -4
  316. package/types/scene/index.d.ts +2 -2
  317. package/types/scene/selection.d.ts +1 -1
  318. package/types/scene/types.d.ts +16 -8
  319. package/types/scene/zoom.d.ts +12 -5
  320. package/types/shapes.d.ts +7 -3
  321. package/types/types.d.ts +120 -25
  322. package/types/utils.d.ts +48 -8
  323. package/types/zindex.d.ts +2 -2
  324. package/dist/excalidraw-assets/i18n-ar-SA-json-a98b3a07a69a56aa6ddc.js +0 -1
  325. package/dist/excalidraw-assets/i18n-bg-BG-json-63af3f6053ca50d0c1a3.js +0 -1
  326. package/dist/excalidraw-assets/i18n-ca-ES-json-6f613ec62c184eed761c.js +0 -1
  327. package/dist/excalidraw-assets/i18n-cs-CZ-json-c485bdbc1ad44e51f1f1.js +0 -1
  328. package/dist/excalidraw-assets/i18n-da-DK-json-fdc74fe43abb7f09253d.js +0 -1
  329. package/dist/excalidraw-assets/i18n-de-DE-json-2984c3ea70efb6a7673c.js +0 -1
  330. package/dist/excalidraw-assets/i18n-el-GR-json-ef1babaff2ea7b0ca48c.js +0 -1
  331. package/dist/excalidraw-assets/i18n-es-ES-json-770832e8199e76bcea31.js +0 -1
  332. package/dist/excalidraw-assets/i18n-fa-IR-json-5d17bed42e8aa3e26778.js +0 -1
  333. package/dist/excalidraw-assets/i18n-fi-FI-json-1856fe5f0aa5f6733c71.js +0 -1
  334. package/dist/excalidraw-assets/i18n-fr-FR-json-7e2c395dc072fbeb4dc8.js +0 -1
  335. package/dist/excalidraw-assets/i18n-he-IL-json-c22c852f5d1007b76cfd.js +0 -1
  336. package/dist/excalidraw-assets/i18n-hi-IN-json-3577c3ff017e2af147ee.js +0 -1
  337. package/dist/excalidraw-assets/i18n-hu-HU-json-2173dae4a84d3f943a3d.js +0 -1
  338. package/dist/excalidraw-assets/i18n-id-ID-json-36ef4139fdc39bd473e9.js +0 -1
  339. package/dist/excalidraw-assets/i18n-it-IT-json-55de4a420bc2799d63ac.js +0 -1
  340. package/dist/excalidraw-assets/i18n-ja-JP-json-10da607a92dd9ee4b6b1.js +0 -1
  341. package/dist/excalidraw-assets/i18n-kab-KAB-json-72dfe5e520fb843a911e.js +0 -1
  342. package/dist/excalidraw-assets/i18n-kk-KZ-json-72a00814a5ea1bc1bd4d.js +0 -1
  343. package/dist/excalidraw-assets/i18n-ko-KR-json-530261d88e915f413822.js +0 -1
  344. package/dist/excalidraw-assets/i18n-lv-LV-json-efdf3550b88b63639a73.js +0 -1
  345. package/dist/excalidraw-assets/i18n-my-MM-json-9c8f0251105b94363a8f.js +0 -1
  346. package/dist/excalidraw-assets/i18n-nb-NO-json-102950eb1c0d17b2be82.js +0 -1
  347. package/dist/excalidraw-assets/i18n-nl-NL-json-220f20ddbd7092a3a948.js +0 -1
  348. package/dist/excalidraw-assets/i18n-nn-NO-json-5b64fbe09ec2fdc5c686.js +0 -1
  349. package/dist/excalidraw-assets/i18n-oc-FR-json-3fb584025bb45201012f.js +0 -1
  350. package/dist/excalidraw-assets/i18n-pa-IN-json-b7ad703689a54409b91a.js +0 -1
  351. package/dist/excalidraw-assets/i18n-pl-PL-json-589514e9da02be71829e.js +0 -1
  352. package/dist/excalidraw-assets/i18n-pt-BR-json-5eb00d985874b4016992.js +0 -1
  353. package/dist/excalidraw-assets/i18n-pt-PT-json-fb8bc9b15f2d232ce452.js +0 -1
  354. package/dist/excalidraw-assets/i18n-ro-RO-json-dc651de2037f6a904212.js +0 -1
  355. package/dist/excalidraw-assets/i18n-ru-RU-json-1620932d8cf3b49dbac7.js +0 -1
  356. package/dist/excalidraw-assets/i18n-sk-SK-json-4fc55e97187d84b3e35f.js +0 -1
  357. package/dist/excalidraw-assets/i18n-sv-SE-json-5fd1ff062cab18b6c3ec.js +0 -1
  358. package/dist/excalidraw-assets/i18n-tr-TR-json-60da00067a54eacae6ea.js +0 -1
  359. package/dist/excalidraw-assets/i18n-uk-UA-json-3398bd8076ace43903a4.js +0 -1
  360. package/dist/excalidraw-assets/i18n-zh-CN-json-9b20d01d442a9938174a.js +0 -1
  361. package/dist/excalidraw-assets/i18n-zh-TW-json-93a8203eb30054101fcc.js +0 -1
  362. package/dist/excalidraw-assets/image-02a1f3ecd6baf42daaa6.js +0 -1
  363. package/dist/excalidraw-assets/vendor-881ef50682618d9bd3d3.js +0 -2
  364. package/dist/excalidraw-assets/vendor-881ef50682618d9bd3d3.js.LICENSE.txt +0 -1
  365. package/dist/excalidraw-assets-dev/i18n-ar-SA-json-65bc67ce1607e71d3c60.js +0 -22
  366. package/dist/excalidraw-assets-dev/i18n-bg-BG-json-2e34234671c3f27e834b.js +0 -22
  367. package/dist/excalidraw-assets-dev/i18n-ca-ES-json-fc2729f9ec4a48ef830f.js +0 -22
  368. package/dist/excalidraw-assets-dev/i18n-cs-CZ-json-a5b54f27dd83c625e776.js +0 -22
  369. package/dist/excalidraw-assets-dev/i18n-da-DK-json-2e18fec0eace18cc9d20.js +0 -22
  370. package/dist/excalidraw-assets-dev/i18n-de-DE-json-28622f2358ee065e8411.js +0 -22
  371. package/dist/excalidraw-assets-dev/i18n-el-GR-json-3d9a940ed9491b9addc3.js +0 -22
  372. package/dist/excalidraw-assets-dev/i18n-es-ES-json-db6707f20cd2518ad8b3.js +0 -22
  373. package/dist/excalidraw-assets-dev/i18n-fa-IR-json-72cd5824085f3bfcb7a1.js +0 -22
  374. package/dist/excalidraw-assets-dev/i18n-fi-FI-json-1b66bec37676ad9aab1e.js +0 -22
  375. package/dist/excalidraw-assets-dev/i18n-fr-FR-json-843f8bcc26ecf3185344.js +0 -22
  376. package/dist/excalidraw-assets-dev/i18n-he-IL-json-2679793593de22336d48.js +0 -22
  377. package/dist/excalidraw-assets-dev/i18n-hi-IN-json-732a1e3f06a5fbb83e8d.js +0 -22
  378. package/dist/excalidraw-assets-dev/i18n-hu-HU-json-d6b3d837d675d7375c1e.js +0 -22
  379. package/dist/excalidraw-assets-dev/i18n-id-ID-json-328fc20f45af18fbbc5b.js +0 -22
  380. package/dist/excalidraw-assets-dev/i18n-it-IT-json-6cfbb19fada476d23814.js +0 -22
  381. package/dist/excalidraw-assets-dev/i18n-ja-JP-json-6c84ee63e3effba0eb0a.js +0 -22
  382. package/dist/excalidraw-assets-dev/i18n-kab-KAB-json-404827528be2a446449d.js +0 -22
  383. package/dist/excalidraw-assets-dev/i18n-kk-KZ-json-03875b16f2b5b4121983.js +0 -22
  384. package/dist/excalidraw-assets-dev/i18n-ko-KR-json-7cd7bfaf5e2b39bd15d8.js +0 -22
  385. package/dist/excalidraw-assets-dev/i18n-lv-LV-json-af0cfb3eca967f0fe675.js +0 -22
  386. package/dist/excalidraw-assets-dev/i18n-my-MM-json-b06767407455ca2f4c3f.js +0 -22
  387. package/dist/excalidraw-assets-dev/i18n-nb-NO-json-560905b77e939b594348.js +0 -22
  388. package/dist/excalidraw-assets-dev/i18n-nl-NL-json-f132a70ab7b920ac4d8f.js +0 -22
  389. package/dist/excalidraw-assets-dev/i18n-nn-NO-json-35e531bd3a461f0d1ceb.js +0 -22
  390. package/dist/excalidraw-assets-dev/i18n-oc-FR-json-68dad2b665d95463621d.js +0 -22
  391. package/dist/excalidraw-assets-dev/i18n-pa-IN-json-6bec1f7f94b1cf3633f9.js +0 -22
  392. package/dist/excalidraw-assets-dev/i18n-pl-PL-json-0b282a1f23c3aa2e8bbb.js +0 -22
  393. package/dist/excalidraw-assets-dev/i18n-pt-BR-json-cb9dae4e4d99080bbd4c.js +0 -22
  394. package/dist/excalidraw-assets-dev/i18n-pt-PT-json-cabfa4db01426846387f.js +0 -22
  395. package/dist/excalidraw-assets-dev/i18n-ro-RO-json-0fc304e943c3727d3069.js +0 -22
  396. package/dist/excalidraw-assets-dev/i18n-ru-RU-json-aae276923a7448546ba9.js +0 -22
  397. package/dist/excalidraw-assets-dev/i18n-sk-SK-json-6672eb5c84a0d06bd3c2.js +0 -22
  398. package/dist/excalidraw-assets-dev/i18n-sv-SE-json-3738297ef992b7a4e69c.js +0 -22
  399. package/dist/excalidraw-assets-dev/i18n-tr-TR-json-bc5117a1ab430f3e7fc5.js +0 -22
  400. package/dist/excalidraw-assets-dev/i18n-uk-UA-json-24701ab6a0a1747281aa.js +0 -22
  401. package/dist/excalidraw-assets-dev/i18n-zh-CN-json-77fd3d2d5c8b490cd9c9.js +0 -22
  402. package/dist/excalidraw-assets-dev/i18n-zh-TW-json-744589603e44fd0ca7ea.js +0 -22
  403. package/dist/excalidraw-assets-dev/image-0ad20139bba28f28b031.js +0 -32
  404. package/dist/excalidraw-assets-dev/vendor-1f85eb76a52b1d218411.js +0 -323
package/README.md CHANGED
@@ -1,3 +1,13 @@
1
+ <!-- unstable-readme-start-->
2
+
3
+ ## Note
4
+
5
+ **This is an unstable release and not recommended for production. If you don't want to wait for the stable release and try out the unreleased changes you can use this.**
6
+
7
+ For stable release please use [@excalidraw/excalidraw](https://www.npmjs.com/package/@excalidraw/excalidraw).
8
+
9
+ <!-- unstable-readme-end-->
10
+
1
11
  ### Excalidraw
2
12
 
3
13
  Excalidraw exported as a component to directly embed in your projects.
@@ -7,27 +17,23 @@ Excalidraw exported as a component to directly embed in your projects.
7
17
  You can use npm
8
18
 
9
19
  ```
10
- npm install react react-dom @excalidraw/excalidraw
20
+ npm install react react-dom @excalidraw/excalidraw-next
11
21
  ```
12
22
 
13
23
  or via yarn
14
24
 
15
25
  ```
16
- yarn add react react-dom @excalidraw/excalidraw
26
+ yarn add react react-dom @excalidraw/excalidraw-next
17
27
  ```
18
28
 
19
29
  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
30
 
21
31
  Move the folder `excalidraw-assets` and `excalidraw-assets-dev` to the path where your assets are served.
22
32
 
23
- By default it will try to load the files from `https://unpkg.com/@excalidraw/excalidraw/dist/`
33
+ By default it will try to load the files from `https://unpkg.com/@excalidraw/excalidraw-next/dist/`
24
34
 
25
35
  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
36
 
27
- #### Note
28
-
29
- **If you don't want to wait for the next stable release and try out the unreleased changes you can use [@excalidraw/excalidraw-next](https://www.npmjs.com/package/@excalidraw/excalidraw-next).**
30
-
31
37
  ### Demo
32
38
 
33
39
  [Try here](https://codesandbox.io/s/excalidraw-ehlz3).
@@ -42,7 +48,7 @@ If you are using a Web bundler (for instance, Webpack), you can import it as an
42
48
 
43
49
  ```js
44
50
  import React, { useEffect, useState, useRef } from "react";
45
- import Excalidraw from "@excalidraw/excalidraw";
51
+ import { Excalidraw } from "@excalidraw/excalidraw-next";
46
52
  import InitialData from "./initialData";
47
53
 
48
54
  import "./styles.scss";
@@ -160,13 +166,13 @@ import { useState, useEffect } from "react";
160
166
  export default function IndexPage() {
161
167
  const [Comp, setComp] = useState(null);
162
168
  useEffect(() => {
163
- import("@excalidraw/excalidraw").then((comp) => setComp(comp.default));
169
+ import("@excalidraw/excalidraw-next").then((comp) => setComp(comp.default));
164
170
  }, []);
165
171
  return <>{Comp && <Comp />}</>;
166
172
  }
167
173
  ```
168
174
 
169
- The `types` are available at `@excalidraw/excalidraw/types`, you can view [example for typescript](https://codesandbox.io/s/excalidraw-types-9h2dm)
175
+ The `types` are available at `@excalidraw/excalidraw-next/types`, you can view [example for typescript](https://codesandbox.io/s/excalidraw-types-9h2dm)
170
176
 
171
177
  #### In Browser
172
178
 
@@ -177,7 +183,7 @@ For development use :point_down:
177
183
  ```js
178
184
  <script
179
185
  type="text/javascript"
180
- src="https://unpkg.com/@excalidraw/excalidraw/dist/excalidraw.development.js"
186
+ src="https://unpkg.com/@excalidraw/excalidraw-next/dist/excalidraw.development.js"
181
187
  ></script>
182
188
  ```
183
189
 
@@ -186,7 +192,7 @@ For production use :point_down:
186
192
  ```js
187
193
  <script
188
194
  type="text/javascript"
189
- src="https://unpkg.com/@excalidraw/excalidraw/dist/excalidraw.production.min.js"
195
+ src="https://unpkg.com/@excalidraw/excalidraw-next/dist/excalidraw.production.min.js"
190
196
  ></script>
191
197
  ```
192
198
 
@@ -205,7 +211,7 @@ You will need to make sure `react`, `react-dom` is available as shown in the bel
205
211
 
206
212
  <script
207
213
  type="text/javascript"
208
- src="https://unpkg.com/@excalidraw/excalidraw/dist/excalidraw.development.js"
214
+ src="https://unpkg.com/@excalidraw/excalidraw-next/dist/excalidraw.development.js"
209
215
  ></script>
210
216
  </head>
211
217
 
@@ -322,7 +328,7 @@ const App = () => {
322
328
  className: "excalidraw-wrapper",
323
329
  ref: excalidrawWrapperRef,
324
330
  },
325
- React.createElement(Excalidraw.default, {
331
+ React.createElement(ExcalidrawLib.Excalidraw, {
326
332
  initialData: InitialData,
327
333
  onChange: (elements, state) =>
328
334
  console.log("Elements :", elements, "State : ", state),
@@ -347,12 +353,37 @@ To view the full example visit :point_down:
347
353
 
348
354
  </details>
349
355
 
356
+ ### Customizing styles
357
+
358
+ 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.
359
+
360
+ Make sure the selector has higher specificity, e.g. by prefixing it with your app's selector:
361
+
362
+ ```css
363
+ .your-app .excalidraw {
364
+ --color-primary: red;
365
+ }
366
+ .your-app .excalidraw.theme--dark {
367
+ --color-primary: pink;
368
+ }
369
+ ```
370
+
371
+ Most notably, you can customize the primary colors, by overriding these variables:
372
+
373
+ - `--color-primary`
374
+ - `--color-primary-darker`
375
+ - `--color-primary-darkest`
376
+ - `--color-primary-light`
377
+ - `--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.
378
+
379
+ 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.
380
+
350
381
  ### Props
351
382
 
352
383
  | Name | Type | Default | Description |
353
384
  | --- | --- | --- | --- |
354
385
  | [`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. |
355
- | [`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#L42">AppState<a> } </pre> | null | The initial data with which app loads. |
386
+ | [`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. |
356
387
  | [`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 |
357
388
  | [`onCollabButtonClick`](#onCollabButtonClick) | Function | | Callback to be triggered when the collab button is clicked |
358
389
  | [`isCollaborating`](#isCollaborating) | `boolean` | | This implies if the app is in collaboration mode |
@@ -365,14 +396,18 @@ To view the full example visit :point_down:
365
396
  | [`zenModeEnabled`](#zenModeEnabled) | boolean | | This implies if the zen mode is enabled |
366
397
  | [`gridModeEnabled`](#gridModeEnabled) | boolean | | This implies if the grid mode is enabled |
367
398
  | [`libraryReturnUrl`](#libraryReturnUrl) | string | | What URL should [libraries.excalidraw.com](https://libraries.excalidraw.com) be installed to |
368
- | [`theme`](#theme) | `light` or `dark` | | The theme of the Excalidraw component |
399
+ | [`theme`](#theme) | [THEME.LIGHT](#THEME-1) &#124; [THEME.LIGHT](#THEME-1) | [THEME.LIGHT](#THEME-1) | The theme of the Excalidraw component |
369
400
  | [`name`](#name) | string | | Name of the drawing |
370
401
  | [`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) |
371
- | [`onPaste`](#onPaste) | <pre>(data: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/clipboard.ts#L17">ClipboardData</a>, event: ClipboardEvent &#124; null) => boolean</pre> | | Callback to be triggered if passed when the something is pasted in to the scene |
402
+ | [`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 |
372
403
  | [`detectScroll`](#detectScroll) | boolean | true | Indicates whether to update the offsets when nearest ancestor is scrolled. |
373
404
  | [`handleKeyboardGlobally`](#handleKeyboardGlobally) | boolean | false | Indicates whether to bind the keyboard events to document. |
374
405
  | [`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. |
375
406
  | [`autoFocus`](#autoFocus) | boolean | false | Implies whether to focus the Excalidraw component on page load |
407
+ | [`generateIdForFile`](#generateIdForFile) | `(file: File) => string | Promise<string>` | Allows you to override `id` generation for files added on canvas |
408
+ | [`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. |
409
+ | [`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 |
410
+ | [`onScrollChange`](#onScrollChange) | (scrollX: number, scrollY: number) | | This prop if passed gets triggered when scrolling the canvas. |
376
411
 
377
412
  ### Dimensions of Excalidraw
378
413
 
@@ -383,12 +418,14 @@ Excalidraw takes `100%` of `width` and `height` of the containing block so make
383
418
  Every time component updates, this callback if passed will get triggered and has the below signature.
384
419
 
385
420
  ```js
386
- (excalidrawElements, appState) => void;
421
+ (excalidrawElements, appState, files) => void;
387
422
  ```
388
423
 
389
- 1.`excalidrawElements`: Array of [excalidrawElements](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78) in the scene.
424
+ 1.`excalidrawElements`: Array of [excalidrawElements](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106) in the scene.
390
425
 
391
- 2.`appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42) of the scene
426
+ 2.`appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) of the scene.
427
+
428
+ 3. `files`: The [`BinaryFiles`]([BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64) which are added to the scene.
392
429
 
393
430
  Here you can try saving the data to your backend or local storage for example.
394
431
 
@@ -396,12 +433,13 @@ Here you can try saving the data to your backend or local storage for example.
396
433
 
397
434
  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.
398
435
 
399
- | Name | Type | Descrption |
436
+ | Name | Type | Description |
400
437
  | --- | --- | --- |
401
- | `elements` | [ExcalidrawElement[]](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78) | The elements with which Excalidraw should be mounted. |
402
- | `appState` | [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42) | The App state with which Excalidraw should be mounted. |
438
+ | `elements` | [ExcalidrawElement[]](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106) | The elements with which Excalidraw should be mounted. |
439
+ | `appState` | [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) | The App state with which Excalidraw should be mounted. |
403
440
  | `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 |
404
- | `libraryItems` | [LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L151) | This library items with which Excalidraw should be mounted. |
441
+ | `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. |
442
+ | `files` | [BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64) | The files added to the scene. |
405
443
 
406
444
  ```json
407
445
  {
@@ -442,17 +480,23 @@ You can pass a `ref` when you want to access some excalidraw APIs. We expose the
442
480
  | --- | --- | --- |
443
481
  | ready | `boolean` | This is set to true once Excalidraw is rendered |
444
482
  | 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) |
445
- | [updateScene](#updateScene) | <pre>(<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L207">sceneData</a>)) => void </pre> | updates the scene with the sceneData |
483
+ | [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 |
484
+ | [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 |
485
+ | [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 |
446
486
  | resetScene | `({ resetLoadingState: boolean }) => void` | Resets the scene. If `resetLoadingState` is passed as true then it will also force set the loading state to false. |
447
- | 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 |
448
- | 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 |
449
- | getAppState | <pre> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a></pre> | Returns current appState |
487
+ | 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 |
488
+ | 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 |
489
+ | getAppState | <code> () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L66">AppState</a></code> | Returns current appState |
450
490
  | history | `{ clear: () => void }` | This is the history API. `history.clear()` will clear the history |
451
- | scrollToContent | <pre> (target?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a> &#124; <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>[]) => void </pre> | Scroll the nearest element out of the elements supplied to the center. Defaults to the elements on the scene. |
491
+ | 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. |
452
492
  | 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. |
453
493
  | [importLibrary](#importlibrary) | `(url: string, token?: string) => void` | Imports library from given URL |
454
494
  | setToastMessage | `(message: string) => void` | This API can be used to show the toast with custom message. |
455
495
  | [id](#id) | string | Unique ID for the excalidraw component. |
496
+ | [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. |
497
+ | [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 |
498
+ | [setCursor](#setCursor) | <code>(cursor: string) => void </code> | This API can be used to set customise the mouse cursor on the canvas |
499
+ | [resetCursor](#resetCursor) | <code>() => void </code> | This API can be used to reset to default mouse cursor on the canvas |
456
500
 
457
501
  #### `readyPromise`
458
502
 
@@ -465,7 +509,7 @@ Since plain object is passed as a `ref`, the `readyPromise` is resolved as soon
465
509
  ### `updateScene`
466
510
 
467
511
  <pre>
468
- (<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L207">sceneData</a>)) => void
512
+ (scene: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L207">sceneData</a>) => void
469
513
  </pre>
470
514
 
471
515
  You can use this function to update the scene with the sceneData. It accepts the below attributes.
@@ -474,8 +518,37 @@ You can use this function to update the scene with the sceneData. It accepts the
474
518
  | --- | --- | --- |
475
519
  | `elements` | [`ImportedDataState["elements"]`](https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L17) | The `elements` to be updated in the scene |
476
520
  | `appState` | [`ImportedDataState["appState"]`](https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L18) | The `appState` to be updated in the scene. |
477
- | `collaborators` | <pre>Map<string, <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L29">Collaborator></a></pre> | The list of collaborators to be updated in the scene. |
521
+ | `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. |
478
522
  | `commitToHistory` | `boolean` | Implies if the `history (undo/redo)` should be recorded. Defaults to `false`. |
523
+ | `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. |
524
+
525
+ ### `updateLibrary`
526
+
527
+ <pre>
528
+ (opts: {
529
+ libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L224">LibraryItemsSource</a>;
530
+ merge?: boolean;
531
+ prompt?: boolean;
532
+ openLibraryMenu?: boolean;
533
+ defaultStatus?: "unpublished" | "published";
534
+ }) => Promise<<a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>>
535
+ </pre>
536
+
537
+ You can use this function to update the library. It accepts the below attributes.
538
+
539
+ | Name | Type | Default | Description |
540
+ | --- | --- | --- | --- |
541
+ | `libraryItems` | | [LibraryItems](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L224) | The `libraryItems` to be replaced/merged with current library |
542
+ | `merge` | boolean | `false` | Whether to merge with existing library items. |
543
+ | `prompt` | boolean | `false` | Whether to prompt user for confirmation. |
544
+ | `openLibraryMenu` | boolean | `false` | Whether to open the library menu before importing. |
545
+ | `defaultStatus` | <code>"unpublished" &#124; "published"</code> | `"unpublished"` | Default library item's `status` if not present. |
546
+
547
+ ### `addFiles`
548
+
549
+ <pre>(files: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts">BinaryFileData</a>) => void </pre>
550
+
551
+ Adds supplied files data to the `appState.files` cache on top of existing files present in the cache.
479
552
 
480
553
  #### `onCollabButtonClick`
481
554
 
@@ -504,7 +577,7 @@ This callback is triggered when mouse pointer is updated.
504
577
  ```
505
578
 
506
579
  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.
507
- 2. `appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42) of the scene.
580
+ 2. `appState`: [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79) of the scene.
508
581
  3. `canvas`: The `HTMLCanvasElement` of the scene.
509
582
 
510
583
  #### `langCode`
@@ -512,7 +585,7 @@ This callback is triggered when mouse pointer is updated.
512
585
  Determines the language of the UI. It should be one of the [available language codes](https://github.com/excalidraw/excalidraw/blob/master/src/i18n.ts#L14). Defaults to `en` (English). We also export default language and supported languages which you can import as shown below.
513
586
 
514
587
  ```js
515
- import { defaultLang, languages } from "@excalidraw/excalidraw";
588
+ import { defaultLang, languages } from "@excalidraw/excalidraw-next";
516
589
  ```
517
590
 
518
591
  | name | type |
@@ -523,7 +596,7 @@ import { defaultLang, languages } from "@excalidraw/excalidraw";
523
596
  #### `renderTopRightUI`
524
597
 
525
598
  <pre>
526
- (isMobile: boolean, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a>) => JSX
599
+ (isMobile: boolean, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>) => JSX | null
527
600
  </pre>
528
601
 
529
602
  A function returning JSX to render custom UI in the top right corner of the app.
@@ -531,7 +604,7 @@ A function returning JSX to render custom UI in the top right corner of the app.
531
604
  #### `renderFooter`
532
605
 
533
606
  <pre>
534
- (isMobile: boolean, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a>) => JSX
607
+ (isMobile: boolean, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>) => JSX | null
535
608
  </pre>
536
609
 
537
610
  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).
@@ -558,7 +631,7 @@ If supplied, this URL will be used when user tries to install a library from [li
558
631
 
559
632
  #### `theme`
560
633
 
561
- 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.
634
+ 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.
562
635
 
563
636
  #### `name`
564
637
 
@@ -566,7 +639,7 @@ This prop sets the name of the drawing which will be used when exporting the dra
566
639
 
567
640
  #### `UIOptions`
568
641
 
569
- This prop can be used to customise UI of Excalidraw. Currently we support customising only [`canvasActions`](#canvasActions). It accepts the below parameters
642
+ This prop can be used to customise UI of Excalidraw. Currently we support customising [`canvasActions`](#canvasActions) and [`dockedSidebarBreakpoint`](dockedSidebarBreakpoint). It accepts the below parameters
570
643
 
571
644
  <pre>
572
645
  { canvasActions: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L208"> CanvasActions<a/> }
@@ -584,6 +657,12 @@ This prop can be used to customise UI of Excalidraw. Currently we support custom
584
657
  | `theme` | boolean | true | Implies whether to show `Theme toggle` |
585
658
  | `saveAsImage` | boolean | true | Implies whether to show `Save as image button` |
586
659
 
660
+ ##### `dockedSidebarBreakpoint`
661
+
662
+ 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.
663
+
664
+ ![image](https://user-images.githubusercontent.com/11256141/174664866-c698c3fa-197b-43ff-956c-d79852c7b326.png)
665
+
587
666
  #### `exportOpts`
588
667
 
589
668
  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.
@@ -599,18 +678,14 @@ The below attributes can be set in `UIOptions.canvasActions.export` to customize
599
678
  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.
600
679
 
601
680
  <pre>
602
- (data: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/clipboard.ts#L17">ClipboardData</a>, event: ClipboardEvent &#124; null) => boolean
681
+ (data: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/clipboard.ts#L21">ClipboardData</a>, event: ClipboardEvent &#124; null) => boolean
603
682
  </pre>
604
683
 
605
684
  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.
606
685
 
607
686
  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).
608
687
 
609
- ### Does it support collaboration ?
610
-
611
- 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).
612
-
613
- ### importLibrary
688
+ #### `importLibrary`
614
689
 
615
690
  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/)).
616
691
 
@@ -632,19 +707,39 @@ useEffect(() => {
632
707
 
633
708
  Try out the [Demo](#Demo) to see it in action.
634
709
 
635
- ### detectScroll
710
+ #### `setActiveTool`
711
+
712
+ This API has the below signature. It sets the `tool` passed in param as the active tool.
713
+
714
+ <pre>
715
+ (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
716
+ </pre>
717
+
718
+ #### `setCursor`
719
+
720
+ 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.
721
+
722
+ <pre>
723
+ (cursor: string) => void
724
+ </pre>
725
+
726
+ #### `resetCursor`
727
+
728
+ This API can be used to reset to default mouse cursor.
729
+
730
+ #### `detectScroll`
636
731
 
637
732
  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).
638
733
 
639
- ### handleKeyboardGlobally
734
+ #### `handleKeyboardGlobally`
640
735
 
641
736
  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.
642
737
 
643
738
  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).
644
739
 
645
- ### onLibraryChange
740
+ #### `onLibraryChange`
646
741
 
647
- Ths callback if supplied will get triggered when the library is updated and has the below signature.
742
+ This callback if supplied will get triggered when the library is updated and has the below signature.
648
743
 
649
744
  <pre>
650
745
  (items: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems</a>) => void | Promise<any>
@@ -652,58 +747,74 @@ Ths callback if supplied will get triggered when the library is updated and has
652
747
 
653
748
  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.
654
749
 
655
- ### id
750
+ #### `id`
656
751
 
657
752
  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).
658
753
 
659
- ### autoFocus
754
+ #### `autoFocus`
660
755
 
661
756
  This prop implies whether to focus the Excalidraw component on page load. Defaults to false.
662
757
 
663
- ### Extra API's
664
-
665
- #### `getSceneVersion`
758
+ #### `generateIdForFile`
666
759
 
667
- **How to use**
668
-
669
- <pre>
670
- import { getSceneVersion } from "@excalidraw/excalidraw";
671
- getSceneVersion(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>)
672
- </pre>
760
+ Allows you to override `id` generation for files added on canvas (images). By default, an SHA-1 digest of the file is used.
673
761
 
674
- This function returns the current scene version.
675
-
676
- #### `isInvisiblySmallElement`
677
-
678
- **_Signature_**
762
+ ```
763
+ (file: File) => string | Promise<string>
764
+ ```
679
765
 
680
- <pre>
681
- isInvisiblySmallElement(element: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>): boolean
682
- </pre>
766
+ #### `onLinkOpen`
683
767
 
684
- **How to use**
768
+ 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()`.
685
769
 
686
- ```js
687
- import { isInvisiblySmallElement } from "@excalidraw/excalidraw";
770
+ ```
771
+ (element: ExcalidrawElement, event: CustomEvent<{ nativeEvent: MouseEvent }>) => void
688
772
  ```
689
773
 
690
- Returns `true` if element is invisibly small (e.g. width & height are zero).
774
+ Example:
775
+
776
+ ```ts
777
+ const history = useHistory();
778
+
779
+ // open internal links using the app's router, but opens external links in
780
+ // a new tab/window
781
+ const onLinkOpen: ExcalidrawProps["onLinkOpen"] = useCallback(
782
+ (element, event) => {
783
+ const link = element.link;
784
+ const { nativeEvent } = event.detail;
785
+ const isNewTab = nativeEvent.ctrlKey || nativeEvent.metaKey;
786
+ const isNewWindow = nativeEvent.shiftKey;
787
+ const isInternalLink =
788
+ link.startsWith("/") || link.includes(window.location.origin);
789
+ if (isInternalLink && !isNewTab && !isNewWindow) {
790
+ history.push(link.replace(window.location.origin, ""));
791
+ // signal that we're handling the redirect ourselves
792
+ event.preventDefault();
793
+ }
794
+ },
795
+ [history],
796
+ );
797
+ ```
691
798
 
692
- #### `getElementMap`
799
+ #### `onPointerDown`
693
800
 
694
- **_Signature_**
801
+ This prop if passed will be triggered on pointer down events and has the below signature.
695
802
 
696
803
  <pre>
697
- 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>}
804
+ (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
698
805
  </pre>
699
806
 
700
- **How to use**
807
+ #### `onScrollChange`
701
808
 
702
- ```js
703
- import { getElementsMap } from "@excalidraw/excalidraw";
809
+ This prop if passed will be triggered when canvas is scrolled and has the below signature.
810
+
811
+ ```ts
812
+ (scrollX: number, scrollY: number) => void
704
813
  ```
705
814
 
706
- This function returns an object where each element is mapped to its id.
815
+ ### Does it support collaboration ?
816
+
817
+ 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).
707
818
 
708
819
  ### Restore utilities
709
820
 
@@ -712,16 +823,16 @@ This function returns an object where each element is mapped to its id.
712
823
  **_Signature_**
713
824
 
714
825
  <pre>
715
- 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#L42">AppState</a>> | null): <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a>
826
+ 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>
716
827
  </pre>
717
828
 
718
829
  **_How to use_**
719
830
 
720
831
  ```js
721
- import { restoreAppState } from "@excalidraw/excalidraw";
832
+ import { restoreAppState } from "@excalidraw/excalidraw-next";
722
833
  ```
723
834
 
724
- This function will make sure all the keys have appropriate values in [appState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42) and if any key is missing, it will be set to default value.
835
+ 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.
725
836
 
726
837
  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.
727
838
 
@@ -730,13 +841,13 @@ When `localAppState` is supplied, it's used in place of values that are missing
730
841
  **_Signature_**
731
842
 
732
843
  <pre>
733
- 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#L78">ExcalidrawElement[]</a>
844
+ 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>
734
845
  </pre>
735
846
 
736
847
  **_How to use_**
737
848
 
738
849
  ```js
739
- import { restoreElements } from "@excalidraw/excalidraw";
850
+ import { restoreElements } from "@excalidraw/excalidraw-next";
740
851
  ```
741
852
 
742
853
  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.
@@ -748,7 +859,7 @@ When `localElements` are supplied, they are used to ensure that existing restore
748
859
  **_Signature_**
749
860
 
750
861
  <pre>
751
- 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#L42">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>
862
+ 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>
752
863
  </pre>
753
864
 
754
865
  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`.
@@ -756,23 +867,28 @@ See [`restoreAppState()`](https://github.com/excalidraw/excalidraw/blob/master/s
756
867
  **_How to use_**
757
868
 
758
869
  ```js
759
- import { restore } from "@excalidraw/excalidraw";
870
+ import { restore } from "@excalidraw/excalidraw-next";
760
871
  ```
761
872
 
762
873
  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).
763
874
 
764
- #### `serializeAsJSON`
875
+ #### `restoreLibraryItems`
765
876
 
766
877
  **_Signature_**
767
878
 
768
879
  <pre>
769
- serializeAsJSON({
770
- elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>,
771
- appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a>,
772
- }): string
880
+ restoreLibraryItems(libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L22">ImportedDataState["libraryItems"]</a>, defaultStatus: "published" | "unpublished")
773
881
  </pre>
774
882
 
775
- 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).
883
+ **_How to use_**
884
+
885
+ ```js
886
+ import { restoreLibraryItems } from "@excalidraw/excalidraw-next";
887
+
888
+ restoreLibraryItems(libraryItems, "unpublished");
889
+ ```
890
+
891
+ This function normalizes library items elements, adding missing values when needed.
776
892
 
777
893
  ### Export utilities
778
894
 
@@ -785,19 +901,22 @@ Takes the scene elements and state and returns a JSON string. Deleted `elements`
785
901
  elements,
786
902
  appState
787
903
  getDimensions,
788
- }: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L10">ExportOpts</a>
904
+ files
905
+ }: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L12">ExportOpts</a>
789
906
  </pre>
790
907
 
791
908
  | Name | Type | Default | Description |
792
909
  | --- | --- | --- | --- |
793
910
  | elements | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/src/element/types) | | The elements to be exported to canvas |
794
911
  | 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 |
795
- | getDimensions | `(width: number, height: number) => {width: number, height: number, scale: number)` | `(width, height) => ({ width, height, scale: 1 })` | A function which returns the width, height and scale with which canvas is to be exported. |
912
+ | 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. |
913
+ | maxWidthOrHeight | `number` | undefined | The maximum width or height of the exported image. If provided, `getDimensions` is ignored. |
914
+ | files | [BinaryFiles](The [`BinaryFiles`](<[BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64)>) | undefined | The files added to the scene. |
796
915
 
797
916
  **How to use**
798
917
 
799
918
  ```js
800
- import { exportToCanvas } from "@excalidraw/excalidraw";
919
+ import { exportToCanvas } from "@excalidraw/excalidraw-next";
801
920
  ```
802
921
 
803
922
  This function returns the canvas with the exported elements, appState and dimensions.
@@ -808,7 +927,7 @@ This function returns the canvas with the exported elements, appState and dimens
808
927
 
809
928
  <pre>
810
929
  exportToBlob(
811
- opts: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L10">ExportOpts</a> & {
930
+ opts: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L14">ExportOpts</a> & {
812
931
  mimeType?: string,
813
932
  quality?: number;
814
933
  })
@@ -823,7 +942,7 @@ exportToBlob(
823
942
  **How to use**
824
943
 
825
944
  ```js
826
- import { exportToBlob } from "@excalidraw/excalidraw";
945
+ import { exportToBlob } from "@excalidraw/excalidraw-next";
827
946
  ```
828
947
 
829
948
  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).
@@ -834,21 +953,51 @@ Returns a promise which resolves with a [blob](https://developer.mozilla.org/en-
834
953
 
835
954
  <pre>
836
955
  exportToSvg({
837
- elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>,
838
- appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a>,
956
+ elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>,
957
+ appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>,
839
958
  exportPadding?: number,
840
959
  metadata?: string,
960
+ files?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64">BinaryFiles</a>
841
961
  })
842
962
  </pre>
843
963
 
844
964
  | Name | Type | Default | Description |
845
965
  | --- | --- | --- | --- |
846
- | elements | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78) | | The elements to exported as svg |
847
- | appState | [AppState](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42) | [defaultAppState](https://github.com/excalidraw/excalidraw/blob/master/src/appState.ts#L11) | The app state of the scene |
966
+ | elements | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106) | | The elements to exported as svg |
967
+ | 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 |
848
968
  | exportPadding | number | 10 | The padding to be added on canvas |
969
+ | files | [BinaryFiles](The [`BinaryFiles`](<[BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64)>) | undefined | The files added to the scene. |
849
970
 
850
971
  This function returns a promise which resolves to svg of the exported drawing.
851
972
 
973
+ #### `exportToClipboard`
974
+
975
+ **_Signature_**
976
+
977
+ <pre>
978
+ exportToClipboard(
979
+ opts: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L14">ExportOpts</a> & {
980
+ mimeType?: string,
981
+ quality?: number;
982
+ type: 'png' | 'svg' |'json'
983
+ })
984
+ </pre>
985
+
986
+ | Name | Type | Default | Description |
987
+ | --- | --- | --- | --- | --- | --- |
988
+ | opts | | | This param is same as the params passed to `exportToCanvas`. You can refer to [`exportToCanvas`](#exportToCanvas). |
989
+ | mimeType | string | "image/png" | Indicates the image format, this will be used when exporting as `png`. |
990
+ | 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`. |
991
+ | type | 'png' | 'svg' | 'json' | | This determines the format to which the scene data should be exported. |
992
+
993
+ **How to use**
994
+
995
+ ```js
996
+ import { exportToClipboard } from "@excalidraw/excalidraw-next";
997
+ ```
998
+
999
+ Copies the scene data in the specified format (determined by `type`) to clipboard.
1000
+
852
1001
  ##### Additional attributes of appState for `export\*` APIs
853
1002
 
854
1003
  | Name | Type | Default | Description |
@@ -856,30 +1005,69 @@ This function returns a promise which resolves to svg of the exported drawing.
856
1005
  | exportBackground | boolean | true | Indicates whether background should be exported |
857
1006
  | viewBackgroundColor | string | #fff | The default background color |
858
1007
  | exportWithDarkMode | boolean | false | Indicates whether to export with dark mode |
859
- | exportEmbedScene | boolean | false | Indicates whether scene data should be embedded in svg. This will increase the svg size. |
1008
+ | exportEmbedScene | boolean | false | Indicates whether scene data should be embedded in svg/png. This will increase the image size. |
1009
+
1010
+ ### Extra API's
1011
+
1012
+ #### `serializeAsJSON`
1013
+
1014
+ **_Signature_**
860
1015
 
861
- ### FONT_FAMILY
1016
+ <pre>
1017
+ serializeAsJSON({
1018
+ elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>,
1019
+ appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>,
1020
+ }): string
1021
+ </pre>
1022
+
1023
+ 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).
1024
+
1025
+ If you want to overwrite the source field in the JSON string, you can set `window.EXCALIDRAW_EXPORT_SOURCE` to the desired value.
1026
+
1027
+ #### `serializeLibraryAsJSON`
1028
+
1029
+ **_Signature_**
1030
+
1031
+ <pre>
1032
+ serializeLibraryAsJSON({
1033
+ libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L200">LibraryItems[]</a>,
1034
+ </pre>
1035
+
1036
+ Takes the library items and returns a JSON string.
1037
+
1038
+ If you want to overwrite the source field in the JSON string, you can set `window.EXCALIDRAW_EXPORT_SOURCE` to the desired value.
1039
+
1040
+ #### `getSceneVersion`
862
1041
 
863
1042
  **How to use**
864
1043
 
865
- ```js
866
- import { FONT_FAMILY } from "@excalidraw/excalidraw";
867
- ```
1044
+ <pre>
1045
+ import { getSceneVersion } from "@excalidraw/excalidraw-next";
1046
+ getSceneVersion(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a>)
1047
+ </pre>
868
1048
 
869
- `FONT_FAMILY` contains all the font families used in `Excalidraw` as explained below
1049
+ This function returns the current scene version.
870
1050
 
871
- | Font Family | Description |
872
- | ----------- | -------------------- |
873
- | Virgil | The handwritten font |
874
- | Helvetica | The Normal Font |
875
- | Cascadia | The Code Font |
1051
+ #### `isInvisiblySmallElement`
876
1052
 
877
- Defaults to `FONT_FAMILY.Virgil` unless passed in `initialData.appState.currentItemFontFamily`.
1053
+ **_Signature_**
878
1054
 
879
- ### loadLibraryFromBlob
1055
+ <pre>
1056
+ isInvisiblySmallElement(element: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement</a>): boolean
1057
+ </pre>
1058
+
1059
+ **How to use**
880
1060
 
881
1061
  ```js
882
- import { loadLibraryFromBlob } from "@excalidraw/excalidraw";
1062
+ import { isInvisiblySmallElement } from "@excalidraw/excalidraw-next";
1063
+ ```
1064
+
1065
+ Returns `true` if element is invisibly small (e.g. width & height are zero).
1066
+
1067
+ #### `loadLibraryFromBlob`
1068
+
1069
+ ```js
1070
+ import { loadLibraryFromBlob } from "@excalidraw/excalidraw-next";
883
1071
  ```
884
1072
 
885
1073
  **_Signature_**
@@ -890,28 +1078,64 @@ loadLibraryFromBlob(blob: <a href="https://developer.mozilla.org/en-US/docs/Web/
890
1078
 
891
1079
  This function loads the library from the blob.
892
1080
 
893
- ### loadFromBlob
1081
+ #### `loadFromBlob`
894
1082
 
895
1083
  **How to use**
896
1084
 
897
1085
  ```js
898
- import { loadFromBlob } from "@excalidraw/excalidraw";
1086
+ import { loadFromBlob } from "@excalidraw/excalidraw-next";
1087
+
1088
+ const scene = await loadFromBlob(file, null, null);
1089
+ excalidrawAPI.updateScene(scene);
1090
+ ```
1091
+
1092
+ **Signature**
1093
+
1094
+ <pre>
1095
+ loadFromBlob(
1096
+ blob: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>,
1097
+ localAppState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a> | null,
1098
+ localElements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a> | null,
1099
+ fileHandle?: FileSystemHandle | null
1100
+ ) => Promise<<a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/restore.ts#L53">RestoredDataState</a>>
1101
+ </pre>
1102
+
1103
+ 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.
1104
+
1105
+ #### `loadSceneOrLibraryFromBlob`
1106
+
1107
+ **How to use**
1108
+
1109
+ ```js
1110
+ import { loadSceneOrLibraryFromBlob, MIME_TYPES } from "@excalidraw/excalidraw";
1111
+
1112
+ const contents = await loadSceneOrLibraryFromBlob(file, null, null);
1113
+ if (contents.type === MIME_TYPES.excalidraw) {
1114
+ excalidrawAPI.updateScene(contents.data);
1115
+ } else if (contents.type === MIME_TYPES.excalidrawlib) {
1116
+ excalidrawAPI.updateLibrary(contents.data);
1117
+ }
899
1118
  ```
900
1119
 
901
1120
  **Signature**
902
1121
 
903
1122
  <pre>
904
- loadFromBlob(blob: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>, localAppState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a> | null)
1123
+ loadSceneOrLibraryFromBlob(
1124
+ blob: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>,
1125
+ localAppState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a> | null,
1126
+ localElements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L106">ExcalidrawElement[]</a> | null,
1127
+ fileHandle?: FileSystemHandle | null
1128
+ ) => 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>}>
905
1129
  </pre>
906
1130
 
907
- This function loads the scene data from the blob. If you pass `localAppState`, `localAppState` value will be preferred over the `appState` derived from `blob`
1131
+ 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.
908
1132
 
909
- ### getFreeDrawSvgPath
1133
+ #### `getFreeDrawSvgPath`
910
1134
 
911
1135
  **How to use**
912
1136
 
913
1137
  ```js
914
- import { getFreeDrawSvgPath } from "@excalidraw/excalidraw";
1138
+ import { getFreeDrawSvgPath } from "@excalidraw/excalidraw-next";
915
1139
  ```
916
1140
 
917
1141
  **Signature**
@@ -922,6 +1146,200 @@ getFreeDrawSvgPath(element: <a href="https://github.com/excalidraw/excalidraw/bl
922
1146
 
923
1147
  This function returns the free draw svg path for the element.
924
1148
 
1149
+ #### `isLinearElement`
1150
+
1151
+ **How to use**
1152
+
1153
+ ```js
1154
+ import { isLinearElement } from "@excalidraw/excalidraw-next";
1155
+ ```
1156
+
1157
+ **Signature**
1158
+
1159
+ <pre>
1160
+ isLinearElement(elementType?: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L80">ExcalidrawElement</a>): boolean
1161
+ </pre>
1162
+
1163
+ This function returns true if the element is linear type (`arrow` |`line`) else returns false.
1164
+
1165
+ #### `getNonDeletedElements`
1166
+
1167
+ **How to use**
1168
+
1169
+ ```js
1170
+ import { getNonDeletedElements } from "@excalidraw/excalidraw-next";
1171
+ ```
1172
+
1173
+ **Signature**
1174
+
1175
+ <pre>
1176
+ 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>
1177
+ </pre>
1178
+
1179
+ This function returns an array of deleted elements.
1180
+
1181
+ #### `mergeLibraryItems`
1182
+
1183
+ ```js
1184
+ import { mergeLibraryItems } from "@excalidraw/excalidraw-next";
1185
+ ```
1186
+
1187
+ **_Signature_**
1188
+
1189
+ <pre>
1190
+ 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>
1191
+ </pre>
1192
+
1193
+ This function merges two `LibraryItems` arrays, where unique items from `otherItems` are sorted first in the returned array.
1194
+
1195
+ #### `parseLibraryTokensFromUrl`
1196
+
1197
+ **How to use**
1198
+
1199
+ ```js
1200
+ import { parseLibraryTokensFromUrl } from "@excalidraw/excalidraw-next";
1201
+ ```
1202
+
1203
+ **Signature**
1204
+
1205
+ <pre>
1206
+ parseLibraryTokensFromUrl(): {
1207
+ libraryUrl: string;
1208
+ idToken: string | null;
1209
+ } | null
1210
+ </pre>
1211
+
1212
+ 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.
1213
+
1214
+ #### `useHandleLibrary`
1215
+
1216
+ **How to use**
1217
+
1218
+ ```js
1219
+ import { useHandleLibrary } from "@excalidraw/excalidraw-next";
1220
+
1221
+ export const App = () => {
1222
+ // ...
1223
+ useHandleLibrary({ excalidrawAPI });
1224
+ };
1225
+ ```
1226
+
1227
+ **Signature**
1228
+
1229
+ <pre>
1230
+ useHandleLibrary(opts: {
1231
+ excalidrawAPI: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L432">ExcalidrawAPI</a>,
1232
+ getInitialLibraryItems?: () => <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L224">LibraryItemsSource</a>
1233
+ });
1234
+ </pre>
1235
+
1236
+ 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.
1237
+
1238
+ In the future, we will be adding support for handling library persistence to browser storage (or elsewhere).
1239
+
1240
+ #### `sceneCoordsToViewportCoords`
1241
+
1242
+ ```js
1243
+ import { sceneCoordsToViewportCoords } from "@excalidraw/excalidraw-next";
1244
+ ```
1245
+
1246
+ **_Signature_**
1247
+
1248
+ <pre>
1249
+ 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}
1250
+ </pre>
1251
+
1252
+ This function returns equivalent viewport coords for the provided scene coords in params.
1253
+
1254
+ #### `viewportCoordsToSceneCoords`
1255
+
1256
+ ```js
1257
+ import { viewportCoordsToSceneCoords } from "@excalidraw/excalidraw-next";
1258
+ ```
1259
+
1260
+ **_Signature_**
1261
+
1262
+ <pre>
1263
+ 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}
1264
+ </pre>
1265
+
1266
+ This function returns equivalent scene coords for the provided viewport coords in params.
1267
+
1268
+ ### Exported constants
1269
+
1270
+ #### `FONT_FAMILY`
1271
+
1272
+ **How to use**
1273
+
1274
+ ```js
1275
+ import { FONT_FAMILY } from "@excalidraw/excalidraw-next";
1276
+ ```
1277
+
1278
+ `FONT_FAMILY` contains all the font families used in `Excalidraw` as explained below
1279
+
1280
+ | Font Family | Description |
1281
+ | ----------- | -------------------- |
1282
+ | Virgil | The handwritten font |
1283
+ | Helvetica | The Normal Font |
1284
+ | Cascadia | The Code Font |
1285
+
1286
+ Defaults to `FONT_FAMILY.Virgil` unless passed in `initialData.appState.currentItemFontFamily`.
1287
+
1288
+ #### `THEME`
1289
+
1290
+ **How to use**
1291
+
1292
+ ```js
1293
+ import { THEME } from "@excalidraw/excalidraw-next";
1294
+ ```
1295
+
1296
+ `THEME` contains all the themes supported by `Excalidraw` as explained below
1297
+
1298
+ | Theme | Description |
1299
+ | ----- | --------------- |
1300
+ | LIGHT | The light theme |
1301
+ | DARK | The Dark theme |
1302
+
1303
+ Defaults to `THEME.LIGHT` unless passed in `initialData.appState.theme`
1304
+
1305
+ ### `MIME_TYPES`
1306
+
1307
+ **How to use **
1308
+
1309
+ ```js
1310
+ import { MIME_TYPES } from "@excalidraw/excalidraw-next";
1311
+ ```
1312
+
1313
+ [`MIME_TYPES`](https://github.com/excalidraw/excalidraw/blob/master/src/constants.ts#L92) contains all the mime types supported by `Excalidraw`.
1314
+
925
1315
  ## Need help?
926
1316
 
927
1317
  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).
1318
+
1319
+ ### Development
1320
+
1321
+ #### Install the dependencies
1322
+
1323
+ ```bash
1324
+ yarn
1325
+ ```
1326
+
1327
+ #### Start the server
1328
+
1329
+ ```bash
1330
+ yarn start
1331
+ ```
1332
+
1333
+ [http://localhost:3001](http://localhost:3001) will open in your default browser.
1334
+
1335
+ The example is same as the [codesandbox example](https://ehlz3.csb.app/)
1336
+
1337
+ #### Create a test release
1338
+
1339
+ You can create a test release by posting the below comment in your pull request
1340
+
1341
+ ```
1342
+ @excalibot release package
1343
+ ```
1344
+
1345
+ Once the version is released `@excalibot` will post a comment with the release version.