Compare commits

..

423 Commits

Author SHA1 Message Date
Excalidraw Bot 198992f02b Auto commit: Calculate translation coverage 2026-03-11 21:18:02 +00:00
Excalidraw Bot a830820d45 New translations en.json (Karakalpak) 2026-03-11 22:16:57 +01:00
Excalidraw Bot 211c2c5b4c New translations en.json (Kabyle) 2026-03-11 22:16:55 +01:00
Excalidraw Bot ebcd8535ed New translations en.json (Bengali, India) 2026-03-11 22:16:54 +01:00
Excalidraw Bot 34fd9d60d7 New translations en.json (German, Switzerland) 2026-03-11 22:16:53 +01:00
Excalidraw Bot 60e831851b New translations en.json (Occitan) 2026-03-11 22:16:52 +01:00
Excalidraw Bot 40a4146b67 New translations en.json (Norwegian Bokmal) 2026-03-11 22:16:51 +01:00
Excalidraw Bot e466771826 New translations en.json (Uzbek) 2026-03-11 22:16:50 +01:00
Excalidraw Bot 06042fa7ee New translations en.json (Sinhala) 2026-03-11 22:16:48 +01:00
Excalidraw Bot abdf12bcd0 New translations en.json (Chinese Traditional, Hong Kong) 2026-03-11 22:16:47 +01:00
Excalidraw Bot 57a310dfb5 New translations en.json (Burmese) 2026-03-11 22:16:46 +01:00
Excalidraw Bot 06fb8d3d7c New translations en.json (Hindi) 2026-03-11 22:16:45 +01:00
Excalidraw Bot f46dd72595 New translations en.json (Azerbaijani) 2026-03-11 22:16:44 +01:00
Excalidraw Bot da36bc650d New translations en.json (Latvian) 2026-03-11 22:16:43 +01:00
Excalidraw Bot 90d458c089 New translations en.json (Kazakh) 2026-03-11 22:16:41 +01:00
Excalidraw Bot 93cf69a588 New translations en.json (Norwegian Nynorsk) 2026-03-11 22:16:40 +01:00
Excalidraw Bot 7dc916e3dc New translations en.json (Thai) 2026-03-11 22:16:39 +01:00
Excalidraw Bot 460036e324 New translations en.json (Marathi) 2026-03-11 22:16:38 +01:00
Excalidraw Bot c4a527ee17 New translations en.json (Bengali) 2026-03-11 22:16:37 +01:00
Excalidraw Bot 45d11181c9 New translations en.json (Tamil) 2026-03-11 22:16:36 +01:00
Excalidraw Bot bc9fccd61b New translations en.json (Khmer) 2026-03-11 22:16:34 +01:00
Excalidraw Bot a83cfaae6f New translations en.json (Persian) 2026-03-11 22:16:33 +01:00
Excalidraw Bot 795274f9f0 New translations en.json (Indonesian) 2026-03-11 22:16:31 +01:00
Excalidraw Bot f51ac29fbe New translations en.json (Galician) 2026-03-11 22:16:30 +01:00
Excalidraw Bot e1698dd3aa New translations en.json (Vietnamese) 2026-03-11 22:16:29 +01:00
Excalidraw Bot a39587c845 New translations en.json (Chinese Simplified) 2026-03-11 22:16:27 +01:00
Excalidraw Bot 76f004bf99 New translations en.json (Swedish) 2026-03-11 22:16:26 +01:00
Excalidraw Bot 5c0f4fdd42 New translations en.json (Slovenian) 2026-03-11 22:16:25 +01:00
Excalidraw Bot 9d157d7009 New translations en.json (Slovak) 2026-03-11 22:16:24 +01:00
Excalidraw Bot 84e5373a9a New translations en.json (Portuguese) 2026-03-11 22:16:23 +01:00
Excalidraw Bot 107023393c New translations en.json (Polish) 2026-03-11 22:16:22 +01:00
Excalidraw Bot 19f2c741a9 New translations en.json (Punjabi) 2026-03-11 22:16:20 +01:00
Excalidraw Bot a3d000ee71 New translations en.json (Lithuanian) 2026-03-11 22:16:19 +01:00
Excalidraw Bot 6ff96ef739 New translations en.json (Kurdish) 2026-03-11 22:16:18 +01:00
Excalidraw Bot e34139986c New translations en.json (Korean) 2026-03-11 22:16:17 +01:00
Excalidraw Bot 30801b718a New translations en.json (Japanese) 2026-03-11 22:16:16 +01:00
Excalidraw Bot 606b05eb17 New translations en.json (Hungarian) 2026-03-11 22:16:15 +01:00
Excalidraw Bot 625fad6c1b New translations en.json (Hebrew) 2026-03-11 22:16:13 +01:00
Excalidraw Bot 9ebafb63a6 New translations en.json (Finnish) 2026-03-11 22:16:12 +01:00
Excalidraw Bot 4d087cbbd9 New translations en.json (Basque) 2026-03-11 22:16:11 +01:00
Excalidraw Bot 539f6807e3 New translations en.json (Greek) 2026-03-11 22:16:10 +01:00
Excalidraw Bot 20b2604c68 New translations en.json (German) 2026-03-11 22:16:09 +01:00
Excalidraw Bot 0781ac6ad9 New translations en.json (Danish) 2026-03-11 22:16:07 +01:00
Excalidraw Bot 22b8282812 New translations en.json (Czech) 2026-03-11 22:16:06 +01:00
Excalidraw Bot 50500f57f8 New translations en.json (Catalan) 2026-03-11 22:16:05 +01:00
Excalidraw Bot 9a0f8167eb New translations en.json (Bulgarian) 2026-03-11 22:16:04 +01:00
Excalidraw Bot 9564931b69 New translations en.json (Arabic) 2026-03-11 22:16:03 +01:00
Excalidraw Bot 83a3ed78b4 New translations en.json (Spanish) 2026-03-11 22:16:01 +01:00
Excalidraw Bot 8d240c6f66 New translations en.json (Romanian) 2026-03-11 22:16:00 +01:00
Excalidraw Bot 132a8d3cf8 New translations en.json (Turkish) 2026-03-11 22:15:59 +01:00
Excalidraw Bot b2998238f7 New translations en.json (French) 2026-03-11 22:15:58 +01:00
Excalidraw Bot a72f4e1689 New translations en.json (Portuguese, Brazilian) 2026-03-11 22:15:57 +01:00
Excalidraw Bot dc68825d2b New translations en.json (Chinese Traditional) 2026-03-11 22:15:55 +01:00
Excalidraw Bot c49cfc3bde New translations en.json (Ukrainian) 2026-03-11 22:15:54 +01:00
Excalidraw Bot df1566a6ee New translations en.json (Dutch) 2026-03-11 22:15:53 +01:00
Excalidraw Bot e89685b931 New translations en.json (Italian) 2026-03-11 22:15:51 +01:00
Excalidraw Bot b292d2ecbc New translations en.json (Russian) 2026-03-11 22:15:50 +01:00
Excalidraw Bot 4e8d015c6d Auto commit: Calculate translation coverage 2026-03-09 12:30:29 +00:00
Excalidraw Bot f520d6839c New translations en.json (Chinese Traditional) 2026-03-09 13:30:16 +01:00
Excalidraw Bot 1dddcf1633 Auto commit: Calculate translation coverage 2026-03-09 08:53:33 +00:00
Excalidraw Bot db7d73c65e New translations en.json (Romanian) 2026-03-09 09:53:22 +01:00
Excalidraw Bot 5371a13749 Auto commit: Calculate translation coverage 2026-03-08 22:39:08 +00:00
Excalidraw Bot 73ee1552b7 New translations en.json (Karakalpak) 2026-03-08 23:38:00 +01:00
Excalidraw Bot aaa71dad68 New translations en.json (Kabyle) 2026-03-08 23:37:59 +01:00
Excalidraw Bot 365320fdc6 New translations en.json (Bengali, India) 2026-03-08 23:37:57 +01:00
Excalidraw Bot ca05af6aee New translations en.json (German, Switzerland) 2026-03-08 23:37:57 +01:00
Excalidraw Bot 3de073dfa2 New translations en.json (Occitan) 2026-03-08 23:37:55 +01:00
Excalidraw Bot 1f73461abd New translations en.json (Norwegian Bokmal) 2026-03-08 23:37:55 +01:00
Excalidraw Bot b7bc95a216 New translations en.json (Uzbek) 2026-03-08 23:37:54 +01:00
Excalidraw Bot f11580cc71 New translations en.json (Sinhala) 2026-03-08 23:37:52 +01:00
Excalidraw Bot bb5c9439c7 New translations en.json (Chinese Traditional, Hong Kong) 2026-03-08 23:37:51 +01:00
Excalidraw Bot cec234157b New translations en.json (Burmese) 2026-03-08 23:37:51 +01:00
Excalidraw Bot 69cd706970 New translations en.json (Hindi) 2026-03-08 23:37:49 +01:00
Excalidraw Bot fa9ca4598d New translations en.json (Azerbaijani) 2026-03-08 23:37:48 +01:00
Excalidraw Bot 9c88cc2305 New translations en.json (Latvian) 2026-03-08 23:37:47 +01:00
Excalidraw Bot 8817c4ed5e New translations en.json (Kazakh) 2026-03-08 23:37:46 +01:00
Excalidraw Bot f65bdb0a90 New translations en.json (Norwegian Nynorsk) 2026-03-08 23:37:45 +01:00
Excalidraw Bot 99ce84a9b8 New translations en.json (Thai) 2026-03-08 23:37:44 +01:00
Excalidraw Bot 5b15b45bec New translations en.json (Marathi) 2026-03-08 23:37:43 +01:00
Excalidraw Bot 0573bc959b New translations en.json (Bengali) 2026-03-08 23:37:42 +01:00
Excalidraw Bot b950747454 New translations en.json (Tamil) 2026-03-08 23:37:41 +01:00
Excalidraw Bot 60609026c9 New translations en.json (Khmer) 2026-03-08 23:37:40 +01:00
Excalidraw Bot fd5affb040 New translations en.json (Persian) 2026-03-08 23:37:39 +01:00
Excalidraw Bot 5f6dd3dc91 New translations en.json (Indonesian) 2026-03-08 23:37:38 +01:00
Excalidraw Bot 62a178758b New translations en.json (Galician) 2026-03-08 23:37:37 +01:00
Excalidraw Bot c9218fdb10 New translations en.json (Vietnamese) 2026-03-08 23:37:36 +01:00
Excalidraw Bot fd13af7747 New translations en.json (Chinese Simplified) 2026-03-08 23:37:35 +01:00
Excalidraw Bot c310a50fd5 New translations en.json (Swedish) 2026-03-08 23:37:34 +01:00
Excalidraw Bot aba5b98285 New translations en.json (Slovenian) 2026-03-08 23:37:33 +01:00
Excalidraw Bot 53acd4e31b New translations en.json (Slovak) 2026-03-08 23:37:32 +01:00
Excalidraw Bot 38837620e0 New translations en.json (Portuguese) 2026-03-08 23:37:31 +01:00
Excalidraw Bot ec1c4e8ce3 New translations en.json (Polish) 2026-03-08 23:37:30 +01:00
Excalidraw Bot 27a3d5a36d New translations en.json (Punjabi) 2026-03-08 23:37:29 +01:00
Excalidraw Bot 038a44b8ef New translations en.json (Lithuanian) 2026-03-08 23:37:28 +01:00
Excalidraw Bot 56bfebb15c New translations en.json (Kurdish) 2026-03-08 23:37:27 +01:00
Excalidraw Bot 9e14480293 New translations en.json (Korean) 2026-03-08 23:37:25 +01:00
Excalidraw Bot 1b24d6def7 New translations en.json (Japanese) 2026-03-08 23:37:24 +01:00
Excalidraw Bot 5cca65323f New translations en.json (Hungarian) 2026-03-08 23:37:23 +01:00
Excalidraw Bot 32d92bcef5 New translations en.json (Hebrew) 2026-03-08 23:37:22 +01:00
Excalidraw Bot c6c7040cac New translations en.json (Finnish) 2026-03-08 23:37:21 +01:00
Excalidraw Bot c6419e54db New translations en.json (Basque) 2026-03-08 23:37:20 +01:00
Excalidraw Bot 1ce70c7022 New translations en.json (Greek) 2026-03-08 23:37:19 +01:00
Excalidraw Bot af3d94064a New translations en.json (German) 2026-03-08 23:37:18 +01:00
Excalidraw Bot 0750f61536 New translations en.json (Danish) 2026-03-08 23:37:17 +01:00
Excalidraw Bot 979830edf6 New translations en.json (Czech) 2026-03-08 23:37:16 +01:00
Excalidraw Bot 7eea5d5ec4 New translations en.json (Catalan) 2026-03-08 23:37:15 +01:00
Excalidraw Bot eef72ca4fb New translations en.json (Bulgarian) 2026-03-08 23:37:14 +01:00
Excalidraw Bot d0e25ccec2 New translations en.json (Arabic) 2026-03-08 23:37:13 +01:00
Excalidraw Bot cb616e2957 New translations en.json (Spanish) 2026-03-08 23:37:12 +01:00
Excalidraw Bot 80d466cf7a New translations en.json (Romanian) 2026-03-08 23:37:11 +01:00
Excalidraw Bot d0383d0ce3 New translations en.json (Turkish) 2026-03-08 23:37:10 +01:00
Excalidraw Bot d75222110b New translations en.json (French) 2026-03-08 23:37:09 +01:00
Excalidraw Bot e27e4e0e2d New translations en.json (Portuguese, Brazilian) 2026-03-08 23:37:07 +01:00
Excalidraw Bot 6057a40665 New translations en.json (Chinese Traditional) 2026-03-08 23:37:06 +01:00
Excalidraw Bot e29c03554c New translations en.json (Ukrainian) 2026-03-08 23:37:05 +01:00
Excalidraw Bot 3643bf82d0 New translations en.json (Dutch) 2026-03-08 23:37:04 +01:00
Excalidraw Bot 50cfcc26cc New translations en.json (Italian) 2026-03-08 23:37:03 +01:00
Excalidraw Bot d5fb4305a3 New translations en.json (Russian) 2026-03-08 23:37:02 +01:00
Excalidraw Bot 970a1aa720 Auto commit: Calculate translation coverage 2026-03-07 20:55:25 +00:00
Excalidraw Bot e3d305ddc2 New translations en.json (Italian) 2026-03-07 21:55:15 +01:00
Excalidraw Bot 04389e8408 Auto commit: Calculate translation coverage 2026-03-06 08:08:28 +00:00
Excalidraw Bot 29dbc53a56 New translations en.json (Russian) 2026-03-06 09:08:16 +01:00
Excalidraw Bot 8acc174353 Auto commit: Calculate translation coverage 2026-03-06 06:31:04 +00:00
Excalidraw Bot 6985e75394 New translations en.json (French) 2026-03-06 07:30:52 +01:00
Excalidraw Bot 0b65b2cc63 Auto commit: Calculate translation coverage 2026-03-05 20:05:20 +00:00
Excalidraw Bot f6ea4bf135 New translations en.json (Romanian) 2026-03-05 21:05:08 +01:00
Excalidraw Bot a5b37fabea Auto commit: Calculate translation coverage 2026-03-05 18:14:47 +00:00
Excalidraw Bot 43476864ad New translations en.json (Karakalpak) 2026-03-05 19:00:54 +01:00
Excalidraw Bot e29436d8db New translations en.json (Kabyle) 2026-03-05 19:00:53 +01:00
Excalidraw Bot f0b6ace0fc New translations en.json (Bengali, India) 2026-03-05 19:00:51 +01:00
Excalidraw Bot d0a5264b1b New translations en.json (German, Switzerland) 2026-03-05 19:00:50 +01:00
Excalidraw Bot 841ef74430 New translations en.json (Occitan) 2026-03-05 19:00:49 +01:00
Excalidraw Bot 3f7d7f79de New translations en.json (Norwegian Bokmal) 2026-03-05 19:00:47 +01:00
Excalidraw Bot a30d454e5f New translations en.json (Uzbek) 2026-03-05 19:00:46 +01:00
Excalidraw Bot d3471352ed New translations en.json (Sinhala) 2026-03-05 19:00:44 +01:00
Excalidraw Bot de9c8d9fc3 New translations en.json (Chinese Traditional, Hong Kong) 2026-03-05 19:00:42 +01:00
Excalidraw Bot 1ab1db08a8 New translations en.json (Burmese) 2026-03-05 19:00:41 +01:00
Excalidraw Bot 22a72427ec New translations en.json (Hindi) 2026-03-05 19:00:40 +01:00
Excalidraw Bot 74428d8091 New translations en.json (Azerbaijani) 2026-03-05 19:00:38 +01:00
Excalidraw Bot 657929ea6f New translations en.json (Latvian) 2026-03-05 19:00:36 +01:00
Excalidraw Bot 3a0e6aa70c New translations en.json (Kazakh) 2026-03-05 19:00:35 +01:00
Excalidraw Bot 743fd2d38a New translations en.json (Norwegian Nynorsk) 2026-03-05 19:00:33 +01:00
Excalidraw Bot 3b89c89a52 New translations en.json (Thai) 2026-03-05 19:00:32 +01:00
Excalidraw Bot f0a80e9f78 New translations en.json (Marathi) 2026-03-05 19:00:30 +01:00
Excalidraw Bot 5e3dd21a10 New translations en.json (Bengali) 2026-03-05 19:00:29 +01:00
Excalidraw Bot a96134fa81 New translations en.json (Tamil) 2026-03-05 19:00:28 +01:00
Excalidraw Bot 8dd6dd666c New translations en.json (Khmer) 2026-03-05 19:00:26 +01:00
Excalidraw Bot 3a1fc51e44 New translations en.json (Persian) 2026-03-05 19:00:24 +01:00
Excalidraw Bot d83742c5eb New translations en.json (Indonesian) 2026-03-05 19:00:23 +01:00
Excalidraw Bot 83da4bd876 New translations en.json (Galician) 2026-03-05 19:00:21 +01:00
Excalidraw Bot c08a3a4d65 New translations en.json (Vietnamese) 2026-03-05 19:00:20 +01:00
Excalidraw Bot 65e20609d7 New translations en.json (Chinese Simplified) 2026-03-05 19:00:18 +01:00
Excalidraw Bot 5d62d50e4f New translations en.json (Swedish) 2026-03-05 19:00:16 +01:00
Excalidraw Bot 218acae143 New translations en.json (Slovenian) 2026-03-05 19:00:15 +01:00
Excalidraw Bot 35e618cdb6 New translations en.json (Slovak) 2026-03-05 19:00:13 +01:00
Excalidraw Bot e1f14c081c New translations en.json (Portuguese) 2026-03-05 19:00:11 +01:00
Excalidraw Bot cd3165b180 New translations en.json (Polish) 2026-03-05 19:00:10 +01:00
Excalidraw Bot 94da04d9f9 New translations en.json (Punjabi) 2026-03-05 19:00:07 +01:00
Excalidraw Bot a112d5ea41 New translations en.json (Lithuanian) 2026-03-05 19:00:05 +01:00
Excalidraw Bot 77ba23407c New translations en.json (Kurdish) 2026-03-05 19:00:03 +01:00
Excalidraw Bot 4ea2007557 New translations en.json (Korean) 2026-03-05 19:00:02 +01:00
Excalidraw Bot 42d2692b2f New translations en.json (Japanese) 2026-03-05 19:00:00 +01:00
Excalidraw Bot f7c7632ca6 New translations en.json (Hungarian) 2026-03-05 18:59:58 +01:00
Excalidraw Bot 61737f9c1b New translations en.json (Hebrew) 2026-03-05 18:59:57 +01:00
Excalidraw Bot 24d176ba2c New translations en.json (Finnish) 2026-03-05 18:59:56 +01:00
Excalidraw Bot f363fc071b New translations en.json (Basque) 2026-03-05 18:59:55 +01:00
Excalidraw Bot 7221028010 New translations en.json (Greek) 2026-03-05 18:59:53 +01:00
Excalidraw Bot fc1762d0fd New translations en.json (German) 2026-03-05 18:59:52 +01:00
Excalidraw Bot 0581fc1eaf New translations en.json (Danish) 2026-03-05 18:59:51 +01:00
Excalidraw Bot 284ac616e1 New translations en.json (Czech) 2026-03-05 18:59:49 +01:00
Excalidraw Bot 631ff71965 New translations en.json (Catalan) 2026-03-05 18:59:48 +01:00
Excalidraw Bot fb95a77055 New translations en.json (Bulgarian) 2026-03-05 18:59:47 +01:00
Excalidraw Bot 0d57e9f628 New translations en.json (Arabic) 2026-03-05 18:59:45 +01:00
Excalidraw Bot 7a24f13e81 New translations en.json (Spanish) 2026-03-05 18:59:43 +01:00
Excalidraw Bot 8f6e1d942d New translations en.json (Romanian) 2026-03-05 18:59:41 +01:00
Excalidraw Bot b21c6abbe4 New translations en.json (Turkish) 2026-03-05 18:59:40 +01:00
Excalidraw Bot 8757a9ddc4 New translations en.json (French) 2026-03-05 18:59:39 +01:00
Excalidraw Bot f7b3497dee New translations en.json (Portuguese, Brazilian) 2026-03-05 18:59:37 +01:00
Excalidraw Bot 0e17d69535 New translations en.json (Chinese Traditional) 2026-03-05 18:59:36 +01:00
Excalidraw Bot ff6ec195bd New translations en.json (Ukrainian) 2026-03-05 18:59:34 +01:00
Excalidraw Bot dd8637e125 New translations en.json (Dutch) 2026-03-05 18:59:33 +01:00
Excalidraw Bot 6d9257310c New translations en.json (Italian) 2026-03-05 18:59:31 +01:00
Excalidraw Bot 3d3f96880d New translations en.json (Russian) 2026-03-05 18:59:30 +01:00
dwelle 715399b558 Merge branch 'master' into l10n_master 2026-03-05 10:09:15 +01:00
David Luzar 47c254216b fix(editor): disable snap-to-midpoint menu item when arrow-binding disabled (#10885) 2026-03-04 16:48:33 +01:00
Excalidraw Bot b818b61d8b Auto commit: Calculate translation coverage 2026-03-04 14:42:54 +00:00
Excalidraw Bot 99757b1a06 New translations en.json (Romanian) 2026-03-04 15:42:41 +01:00
Excalidraw Bot fe547a6ada New translations en.json (Russian) 2026-03-04 15:42:38 +01:00
Excalidraw Bot b6cb835cd4 Auto commit: Calculate translation coverage 2026-03-03 23:22:02 +00:00
Excalidraw Bot 917079900a New translations en.json (Karakalpak) 2026-03-04 00:20:53 +01:00
Excalidraw Bot a3304507a1 New translations en.json (Kabyle) 2026-03-04 00:20:51 +01:00
Excalidraw Bot 453d934cd9 New translations en.json (Bengali, India) 2026-03-04 00:20:50 +01:00
Excalidraw Bot cf73a91567 New translations en.json (German, Switzerland) 2026-03-04 00:20:49 +01:00
Excalidraw Bot 368ea9dd7f New translations en.json (Occitan) 2026-03-04 00:20:48 +01:00
Excalidraw Bot 0bdca3493b New translations en.json (Norwegian Bokmal) 2026-03-04 00:20:47 +01:00
Excalidraw Bot f69095d2bd New translations en.json (Uzbek) 2026-03-04 00:20:46 +01:00
Excalidraw Bot f5df6b9e4c New translations en.json (Sinhala) 2026-03-04 00:20:45 +01:00
Excalidraw Bot 0d285b3eec New translations en.json (Chinese Traditional, Hong Kong) 2026-03-04 00:20:44 +01:00
Excalidraw Bot be98b5c7cf New translations en.json (Burmese) 2026-03-04 00:20:43 +01:00
Excalidraw Bot 013cc37a47 New translations en.json (Hindi) 2026-03-04 00:20:42 +01:00
Excalidraw Bot 82f3fa6c57 New translations en.json (Azerbaijani) 2026-03-04 00:20:41 +01:00
Excalidraw Bot 669f8a2b59 New translations en.json (Latvian) 2026-03-04 00:20:40 +01:00
Excalidraw Bot 0518fa5beb New translations en.json (Kazakh) 2026-03-04 00:20:38 +01:00
Excalidraw Bot e48b742ee1 New translations en.json (Norwegian Nynorsk) 2026-03-04 00:20:37 +01:00
Excalidraw Bot d4c45dc9be New translations en.json (Thai) 2026-03-04 00:20:36 +01:00
Excalidraw Bot d728887146 New translations en.json (Marathi) 2026-03-04 00:20:35 +01:00
Excalidraw Bot 240e1b0492 New translations en.json (Bengali) 2026-03-04 00:20:34 +01:00
Excalidraw Bot 4cb28e838f New translations en.json (Tamil) 2026-03-04 00:20:33 +01:00
Excalidraw Bot 5823570530 New translations en.json (Khmer) 2026-03-04 00:20:32 +01:00
Excalidraw Bot b832b44413 New translations en.json (Persian) 2026-03-04 00:20:31 +01:00
Excalidraw Bot 5c7123e77b New translations en.json (Indonesian) 2026-03-04 00:20:30 +01:00
Excalidraw Bot 36b220a067 New translations en.json (Galician) 2026-03-04 00:20:29 +01:00
Excalidraw Bot d03c2eb963 New translations en.json (Vietnamese) 2026-03-04 00:20:27 +01:00
Excalidraw Bot e01199e6b8 New translations en.json (Chinese Simplified) 2026-03-04 00:20:26 +01:00
Excalidraw Bot 9c516f1e0a New translations en.json (Swedish) 2026-03-04 00:20:25 +01:00
Excalidraw Bot 6566456832 New translations en.json (Slovenian) 2026-03-04 00:20:24 +01:00
Excalidraw Bot 60936c48ca New translations en.json (Slovak) 2026-03-04 00:20:23 +01:00
Excalidraw Bot 43be14dc93 New translations en.json (Portuguese) 2026-03-04 00:20:22 +01:00
Excalidraw Bot 526d2c52f3 New translations en.json (Polish) 2026-03-04 00:20:21 +01:00
Excalidraw Bot fcb69c36e6 New translations en.json (Punjabi) 2026-03-04 00:20:20 +01:00
Excalidraw Bot 53a4d76e3b New translations en.json (Lithuanian) 2026-03-04 00:20:19 +01:00
Excalidraw Bot 0710d40919 New translations en.json (Kurdish) 2026-03-04 00:20:18 +01:00
Excalidraw Bot a07cd1b0e8 New translations en.json (Korean) 2026-03-04 00:20:16 +01:00
Excalidraw Bot 4a55ab6bab New translations en.json (Japanese) 2026-03-04 00:20:15 +01:00
Excalidraw Bot 6257bdbfb6 New translations en.json (Hungarian) 2026-03-04 00:20:14 +01:00
Excalidraw Bot 3f377c9d69 New translations en.json (Hebrew) 2026-03-04 00:20:13 +01:00
Excalidraw Bot 176e11bac8 New translations en.json (Finnish) 2026-03-04 00:20:12 +01:00
Excalidraw Bot 84c89018d9 New translations en.json (Basque) 2026-03-04 00:20:11 +01:00
Excalidraw Bot 6cac1c8a04 New translations en.json (Greek) 2026-03-04 00:20:10 +01:00
Excalidraw Bot 1e996e4d94 New translations en.json (German) 2026-03-04 00:20:09 +01:00
Excalidraw Bot d028157a5c New translations en.json (Danish) 2026-03-04 00:20:08 +01:00
Excalidraw Bot 2934b8c308 New translations en.json (Czech) 2026-03-04 00:20:07 +01:00
Excalidraw Bot c6f08724eb New translations en.json (Catalan) 2026-03-04 00:20:06 +01:00
Excalidraw Bot 976da91fe7 New translations en.json (Bulgarian) 2026-03-04 00:20:05 +01:00
Excalidraw Bot 0b42b49d9e New translations en.json (Arabic) 2026-03-04 00:20:04 +01:00
Excalidraw Bot 3a472aa6fc New translations en.json (Spanish) 2026-03-04 00:20:02 +01:00
Excalidraw Bot 6a716adea6 New translations en.json (Romanian) 2026-03-04 00:20:01 +01:00
Excalidraw Bot abb33bf686 New translations en.json (Turkish) 2026-03-04 00:20:00 +01:00
Excalidraw Bot 0463c18f02 New translations en.json (French) 2026-03-04 00:19:59 +01:00
Excalidraw Bot fd83e44c6f New translations en.json (Portuguese, Brazilian) 2026-03-04 00:19:58 +01:00
Excalidraw Bot 2d0d6d6c1b New translations en.json (Chinese Traditional) 2026-03-04 00:19:57 +01:00
Excalidraw Bot ab39228fc9 New translations en.json (Ukrainian) 2026-03-04 00:19:56 +01:00
Excalidraw Bot 6e9085eee7 New translations en.json (Dutch) 2026-03-04 00:19:55 +01:00
Excalidraw Bot eac4fa5b57 New translations en.json (Italian) 2026-03-04 00:19:54 +01:00
Excalidraw Bot ef40b72eb0 New translations en.json (Russian) 2026-03-04 00:19:53 +01:00
Hendrik Horstmann d1cff91b75 fix: spacing in the left menu (#10880) 2026-03-03 22:11:30 +00:00
Márk Tolmács 437595fa65 feat: Arrow binding is a preference (#10839)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
2026-03-03 21:55:40 +00:00
Excalidraw Bot e1f5b9f138 Auto commit: Calculate translation coverage 2026-03-02 08:15:54 +00:00
Excalidraw Bot 8bf7fae439 New translations en.json (French) 2026-03-02 09:15:44 +01:00
Excalidraw Bot 503fd4c598 Auto commit: Calculate translation coverage 2026-03-01 14:08:06 +00:00
Excalidraw Bot e99df11729 New translations en.json (Italian) 2026-03-01 15:07:54 +01:00
Excalidraw Bot 39b9224c3c Auto commit: Calculate translation coverage 2026-02-28 08:29:43 +00:00
Excalidraw Bot 38cf2fb51e New translations en.json (Russian) 2026-02-28 09:29:30 +01:00
Excalidraw Bot 333a2ee6fc Auto commit: Calculate translation coverage 2026-02-27 21:22:10 +00:00
Excalidraw Bot 728bb66eb7 New translations en.json (Thai) 2026-02-27 22:21:59 +01:00
Excalidraw Bot 49ea45aa5d Auto commit: Calculate translation coverage 2026-02-27 19:24:41 +00:00
Excalidraw Bot cf5418b128 New translations en.json (Romanian) 2026-02-27 20:24:29 +01:00
Excalidraw Bot 9e0eb0f541 New translations en.json (Chinese Traditional) 2026-02-27 20:24:28 +01:00
Excalidraw Bot d506a822ff Auto commit: Calculate translation coverage 2026-02-27 17:26:28 +00:00
Excalidraw Bot 0fb50e07c0 New translations en.json (Chinese Traditional) 2026-02-27 18:26:16 +01:00
Excalidraw Bot c2edd7c6f4 New translations en.json (Italian) 2026-02-26 22:20:43 +01:00
Excalidraw Bot bf7aafb77d Auto commit: Calculate translation coverage 2026-02-26 15:27:55 +00:00
Excalidraw Bot a3b9763dcd New translations en.json (Karakalpak) 2026-02-26 16:26:58 +01:00
Excalidraw Bot baf93453c3 New translations en.json (Kabyle) 2026-02-26 16:26:57 +01:00
Excalidraw Bot d9b9dc783e New translations en.json (Bengali, India) 2026-02-26 16:26:55 +01:00
Excalidraw Bot dd4343d48c New translations en.json (German, Switzerland) 2026-02-26 16:26:54 +01:00
Excalidraw Bot fdd021574c New translations en.json (Occitan) 2026-02-26 16:26:53 +01:00
Excalidraw Bot 652b0f60f5 New translations en.json (Norwegian Bokmal) 2026-02-26 16:26:51 +01:00
Excalidraw Bot 902c8eaf56 New translations en.json (Uzbek) 2026-02-26 16:26:50 +01:00
Excalidraw Bot 7e9a7cbd26 New translations en.json (Sinhala) 2026-02-26 16:26:48 +01:00
Excalidraw Bot 9d04681dc5 New translations en.json (Chinese Traditional, Hong Kong) 2026-02-26 16:26:47 +01:00
Excalidraw Bot b0bfc7af20 New translations en.json (Burmese) 2026-02-26 16:26:45 +01:00
Excalidraw Bot ba2828914d New translations en.json (Hindi) 2026-02-26 16:26:44 +01:00
Excalidraw Bot 791b63148b New translations en.json (Azerbaijani) 2026-02-26 16:26:42 +01:00
Excalidraw Bot 9ff150bdc2 New translations en.json (Latvian) 2026-02-26 16:26:41 +01:00
Excalidraw Bot 527b2658c1 New translations en.json (Kazakh) 2026-02-26 16:26:39 +01:00
Excalidraw Bot 7b8983c75a New translations en.json (Norwegian Nynorsk) 2026-02-26 16:26:38 +01:00
Excalidraw Bot c4067bfe2f New translations en.json (Thai) 2026-02-26 16:26:36 +01:00
Excalidraw Bot 46abd7bc96 New translations en.json (Marathi) 2026-02-26 16:26:34 +01:00
Excalidraw Bot 3ba91352ed New translations en.json (Bengali) 2026-02-26 16:26:33 +01:00
Excalidraw Bot 0e57d55451 New translations en.json (Tamil) 2026-02-26 16:26:32 +01:00
Excalidraw Bot d4e6e3cae3 New translations en.json (Khmer) 2026-02-26 16:26:30 +01:00
Excalidraw Bot c6395ae166 New translations en.json (Persian) 2026-02-26 16:26:29 +01:00
Excalidraw Bot 2d1aeee971 New translations en.json (Indonesian) 2026-02-26 16:26:28 +01:00
Excalidraw Bot c9455a0de4 New translations en.json (Galician) 2026-02-26 16:26:26 +01:00
Excalidraw Bot 9f944db928 New translations en.json (Vietnamese) 2026-02-26 16:26:25 +01:00
Excalidraw Bot 170bf35513 New translations en.json (Chinese Simplified) 2026-02-26 16:26:24 +01:00
Excalidraw Bot e6e8349a45 New translations en.json (Swedish) 2026-02-26 16:26:22 +01:00
Excalidraw Bot d632694c9b New translations en.json (Slovenian) 2026-02-26 16:26:21 +01:00
Excalidraw Bot cff4ca670d New translations en.json (Slovak) 2026-02-26 16:26:20 +01:00
Excalidraw Bot eaabc26428 New translations en.json (Portuguese) 2026-02-26 16:26:18 +01:00
Excalidraw Bot 0bcc2360a9 New translations en.json (Polish) 2026-02-26 16:26:17 +01:00
Excalidraw Bot f3da2a95ed New translations en.json (Punjabi) 2026-02-26 16:26:15 +01:00
Excalidraw Bot bec4653dcb New translations en.json (Lithuanian) 2026-02-26 16:26:14 +01:00
Excalidraw Bot a2e948d080 New translations en.json (Kurdish) 2026-02-26 16:26:12 +01:00
Excalidraw Bot 6b7da271b5 New translations en.json (Korean) 2026-02-26 16:26:11 +01:00
Excalidraw Bot 65c7c1815f New translations en.json (Japanese) 2026-02-26 16:26:10 +01:00
Excalidraw Bot 8c019fe3fd New translations en.json (Hungarian) 2026-02-26 16:26:08 +01:00
Excalidraw Bot 64466783de New translations en.json (Hebrew) 2026-02-26 16:26:07 +01:00
Excalidraw Bot ce3774e8f2 New translations en.json (Finnish) 2026-02-26 16:26:05 +01:00
Excalidraw Bot 5dd19a04c2 New translations en.json (Basque) 2026-02-26 16:26:04 +01:00
Excalidraw Bot 44769fe876 New translations en.json (Greek) 2026-02-26 16:26:02 +01:00
Excalidraw Bot 4947ec612c New translations en.json (German) 2026-02-26 16:26:01 +01:00
Excalidraw Bot 24b78a1332 New translations en.json (Danish) 2026-02-26 16:25:59 +01:00
Excalidraw Bot ee4f0a43fc New translations en.json (Czech) 2026-02-26 16:25:58 +01:00
Excalidraw Bot cfd9306c57 New translations en.json (Catalan) 2026-02-26 16:25:57 +01:00
Excalidraw Bot 8a3048d4a7 New translations en.json (Bulgarian) 2026-02-26 16:25:55 +01:00
Excalidraw Bot d7138d86ea New translations en.json (Arabic) 2026-02-26 16:25:54 +01:00
Excalidraw Bot b0644a6d3f New translations en.json (Spanish) 2026-02-26 16:25:52 +01:00
Excalidraw Bot 430adfe6f4 New translations en.json (Romanian) 2026-02-26 16:25:51 +01:00
Excalidraw Bot ceb6b47c17 New translations en.json (Turkish) 2026-02-26 16:25:49 +01:00
Excalidraw Bot 54973ba281 New translations en.json (French) 2026-02-26 16:25:48 +01:00
Excalidraw Bot 157b1911e1 New translations en.json (Portuguese, Brazilian) 2026-02-26 16:25:47 +01:00
Excalidraw Bot 482beddd67 New translations en.json (Chinese Traditional) 2026-02-26 16:25:46 +01:00
Excalidraw Bot 904828940d New translations en.json (Ukrainian) 2026-02-26 16:25:44 +01:00
Excalidraw Bot d0990c63db New translations en.json (Dutch) 2026-02-26 16:25:43 +01:00
Excalidraw Bot c86d22be7f New translations en.json (Italian) 2026-02-26 16:25:41 +01:00
Excalidraw Bot 7c03c458a1 New translations en.json (Russian) 2026-02-26 16:25:40 +01:00
David Luzar 60b275880d feat(editor): support radar chart and multiple series for other chart types (#10824) 2026-02-26 16:13:15 +01:00
Excalidraw Bot 8029e68e17 Auto commit: Calculate translation coverage 2026-02-26 11:56:56 +00:00
Excalidraw Bot c3e9430577 New translations en.json (Turkish) 2026-02-26 12:56:44 +01:00
zsviczian cae9d2bcbd fix: "hand" tool active after exiting view mode if laser point was used (#10841) 2026-02-26 12:55:13 +01:00
David Luzar 2874f9e48c fix(editor): simplify and fix midpoint highlighting (#10832) 2026-02-24 21:11:46 +01:00
Márk Tolmács 0b3a5e7cc4 fix: Multi-point arrow bound point update (#10831)
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
2026-02-24 13:32:44 +01:00
Excalidraw Bot 9d34d4fcd4 New translations en.json (French) 2026-02-23 13:32:26 +01:00
Excalidraw Bot fe310acebd Auto commit: Calculate translation coverage 2026-02-22 23:34:27 +00:00
Excalidraw Bot d7c7236ee8 New translations en.json (Dutch) 2026-02-23 00:34:17 +01:00
Excalidraw Bot eefc3b9408 Auto commit: Calculate translation coverage 2026-02-21 05:58:59 +00:00
Excalidraw Bot cc67f9d544 New translations en.json (Chinese Traditional) 2026-02-21 06:58:50 +01:00
Excalidraw Bot e2e13bba0b Auto commit: Calculate translation coverage 2026-02-19 13:58:10 +00:00
Excalidraw Bot 041f012f72 New translations en.json (Chinese Traditional) 2026-02-19 14:57:56 +01:00
Excalidraw Bot dbd8cc8d6f Auto commit: Calculate translation coverage 2026-02-18 13:40:53 +00:00
Excalidraw Bot 9fbac79d11 New translations en.json (Chinese Traditional) 2026-02-18 14:40:42 +01:00
Excalidraw Bot ef915b7427 Auto commit: Calculate translation coverage 2026-02-15 09:04:40 +00:00
Excalidraw Bot c5b913ad9f New translations en.json (Italian) 2026-02-15 10:04:24 +01:00
Excalidraw Bot f66c943720 Auto commit: Calculate translation coverage 2026-02-14 08:25:14 +00:00
Excalidraw Bot 9c0edf1cb9 New translations en.json (Russian) 2026-02-14 09:25:02 +01:00
Excalidraw Bot 9112c61edb New translations en.json (Russian) 2026-02-14 07:54:58 +01:00
Excalidraw Bot f58a84a857 Auto commit: Calculate translation coverage 2026-02-13 19:42:14 +00:00
Excalidraw Bot 626e846d10 New translations en.json (Ukrainian) 2026-02-13 20:41:59 +01:00
Excalidraw Bot feacdcd156 Auto commit: Calculate translation coverage 2026-02-13 18:19:44 +00:00
Excalidraw Bot e1fbf09310 New translations en.json (Ukrainian) 2026-02-13 19:19:30 +01:00
Excalidraw Bot dc521a62c1 Auto commit: Calculate translation coverage 2026-02-13 01:22:27 +00:00
Excalidraw Bot f0bbb7614e New translations en.json (Portuguese, Brazilian) 2026-02-13 02:22:11 +01:00
Excalidraw Bot 62b35ab86c Auto commit: Calculate translation coverage 2026-02-09 06:58:01 +00:00
Excalidraw Bot 2ea8c308e4 New translations en.json (Romanian) 2026-02-09 07:57:50 +01:00
Excalidraw Bot 0a13e3a344 Auto commit: Calculate translation coverage 2026-02-08 23:25:09 +00:00
Excalidraw Bot 540809f2a4 New translations en.json (Karakalpak) 2026-02-09 00:23:37 +01:00
Excalidraw Bot 467d9bd08c New translations en.json (Kabyle) 2026-02-09 00:23:35 +01:00
Excalidraw Bot 13e8374bea New translations en.json (Bengali, India) 2026-02-09 00:23:34 +01:00
Excalidraw Bot b96dd6d332 New translations en.json (German, Switzerland) 2026-02-09 00:23:33 +01:00
Excalidraw Bot 32d77172cc New translations en.json (Occitan) 2026-02-09 00:23:32 +01:00
Excalidraw Bot 9e23421d53 New translations en.json (Norwegian Bokmal) 2026-02-09 00:23:31 +01:00
Excalidraw Bot c3d91aac44 New translations en.json (Uzbek) 2026-02-09 00:23:30 +01:00
Excalidraw Bot 99088550be New translations en.json (Sinhala) 2026-02-09 00:23:28 +01:00
Excalidraw Bot b9a171a2ef New translations en.json (Chinese Traditional, Hong Kong) 2026-02-09 00:23:27 +01:00
Excalidraw Bot 521d727b5b New translations en.json (Burmese) 2026-02-09 00:23:26 +01:00
Excalidraw Bot b7d610fbbe New translations en.json (Hindi) 2026-02-09 00:23:25 +01:00
Excalidraw Bot 1f33be6403 New translations en.json (Azerbaijani) 2026-02-09 00:23:23 +01:00
Excalidraw Bot 7ca28ae504 New translations en.json (Latvian) 2026-02-09 00:23:22 +01:00
Excalidraw Bot d648d1147e New translations en.json (Kazakh) 2026-02-09 00:23:21 +01:00
Excalidraw Bot 869739b170 New translations en.json (Norwegian Nynorsk) 2026-02-09 00:23:20 +01:00
Excalidraw Bot ca09cc2830 New translations en.json (Thai) 2026-02-09 00:23:19 +01:00
Excalidraw Bot 5d1e8448bc New translations en.json (Marathi) 2026-02-09 00:23:18 +01:00
Excalidraw Bot 2076b3643a New translations en.json (Bengali) 2026-02-09 00:23:17 +01:00
Excalidraw Bot cbe5581782 New translations en.json (Tamil) 2026-02-09 00:23:15 +01:00
Excalidraw Bot be9fcec967 New translations en.json (Khmer) 2026-02-09 00:23:14 +01:00
Excalidraw Bot 41f8203889 New translations en.json (Persian) 2026-02-09 00:23:13 +01:00
Excalidraw Bot 60be58033f New translations en.json (Indonesian) 2026-02-09 00:23:12 +01:00
Excalidraw Bot 7010f1af88 New translations en.json (Portuguese, Brazilian) 2026-02-09 00:23:10 +01:00
Excalidraw Bot edd1510183 New translations en.json (Galician) 2026-02-09 00:23:09 +01:00
Excalidraw Bot 5926023ab1 New translations en.json (Chinese Traditional) 2026-02-09 00:23:08 +01:00
Excalidraw Bot 7adc3d163f New translations en.json (Chinese Simplified) 2026-02-09 00:23:07 +01:00
Excalidraw Bot 124ecebca6 New translations en.json (Ukrainian) 2026-02-09 00:23:05 +01:00
Excalidraw Bot 8d8fdc2985 New translations en.json (Turkish) 2026-02-09 00:23:04 +01:00
Excalidraw Bot 0691617028 New translations en.json (Swedish) 2026-02-09 00:23:03 +01:00
Excalidraw Bot 3f181f7fa7 New translations en.json (Slovenian) 2026-02-09 00:23:02 +01:00
Excalidraw Bot 00f2600cbb New translations en.json (Slovak) 2026-02-09 00:23:01 +01:00
Excalidraw Bot 4274935c62 New translations en.json (Portuguese) 2026-02-09 00:23:00 +01:00
Excalidraw Bot 6209445644 New translations en.json (Polish) 2026-02-09 00:22:59 +01:00
Excalidraw Bot d9636c4101 New translations en.json (Punjabi) 2026-02-09 00:22:58 +01:00
Excalidraw Bot fc1c3a3985 New translations en.json (Dutch) 2026-02-09 00:22:56 +01:00
Excalidraw Bot 2c7737ed9b New translations en.json (Lithuanian) 2026-02-09 00:22:55 +01:00
Excalidraw Bot c4dcd3a5d2 New translations en.json (Kurdish) 2026-02-09 00:22:54 +01:00
Excalidraw Bot f0a37029bc New translations en.json (Korean) 2026-02-09 00:22:53 +01:00
Excalidraw Bot 2567526103 New translations en.json (Japanese) 2026-02-09 00:22:52 +01:00
Excalidraw Bot a10f7c10ae New translations en.json (Italian) 2026-02-09 00:22:51 +01:00
Excalidraw Bot 60dc788254 New translations en.json (Hungarian) 2026-02-09 00:22:49 +01:00
Excalidraw Bot 34ab5746b4 New translations en.json (Hebrew) 2026-02-09 00:22:48 +01:00
Excalidraw Bot 6c7b8f4bf4 New translations en.json (Finnish) 2026-02-09 00:22:47 +01:00
Excalidraw Bot 7a79d0306c New translations en.json (Basque) 2026-02-09 00:22:46 +01:00
Excalidraw Bot d70108dcfa New translations en.json (Greek) 2026-02-09 00:22:45 +01:00
Excalidraw Bot c2fc95116a New translations en.json (German) 2026-02-09 00:22:44 +01:00
Excalidraw Bot 947a11bac2 New translations en.json (Danish) 2026-02-09 00:22:42 +01:00
Excalidraw Bot 87336c115e New translations en.json (Czech) 2026-02-09 00:22:41 +01:00
Excalidraw Bot 6041c34aeb New translations en.json (Catalan) 2026-02-09 00:22:40 +01:00
Excalidraw Bot 184d9ca6e8 New translations en.json (Bulgarian) 2026-02-09 00:22:39 +01:00
Excalidraw Bot 3a844186a7 New translations en.json (Arabic) 2026-02-09 00:22:38 +01:00
Excalidraw Bot cc262ce5d5 New translations en.json (Spanish) 2026-02-09 00:22:37 +01:00
Excalidraw Bot 802b01562c New translations en.json (French) 2026-02-09 00:22:36 +01:00
Excalidraw Bot 6f2b43ff0c New translations en.json (Romanian) 2026-02-09 00:22:35 +01:00
Excalidraw Bot 461f327887 New translations en.json (Russian) 2026-02-09 00:22:33 +01:00
Excalidraw Bot a33a643a2f New translations en.json (Vietnamese) 2026-02-09 00:22:32 +01:00
Excalidraw Bot 91f7b38a39 Auto commit: Calculate translation coverage 2026-02-08 21:46:20 +00:00
Excalidraw Bot 998a296ca2 New translations en.json (Persian) 2026-02-08 22:45:54 +01:00
Excalidraw Bot 0afec1bf5c Auto commit: Calculate translation coverage 2026-02-08 16:00:00 +00:00
Excalidraw Bot 2436e8498a New translations en.json (Japanese) 2026-02-08 16:59:48 +01:00
Excalidraw Bot 521362a532 Auto commit: Calculate translation coverage 2026-02-08 15:03:07 +00:00
Excalidraw Bot ae5a2dee54 New translations en.json (Japanese) 2026-02-08 16:02:55 +01:00
Excalidraw Bot bf62bce4cb Auto commit: Calculate translation coverage 2026-02-08 13:52:29 +00:00
Excalidraw Bot 92c5acb960 New translations en.json (Japanese) 2026-02-08 14:52:19 +01:00
Excalidraw Bot d4ce7b067a New translations en.json (Japanese) 2026-02-08 13:56:44 +01:00
Excalidraw Bot 214e68ce03 Auto commit: Calculate translation coverage 2026-02-08 10:53:56 +00:00
Excalidraw Bot 19cb9ab30e New translations en.json (Italian) 2026-02-08 11:53:43 +01:00
Excalidraw Bot 3d097669f8 Auto commit: Calculate translation coverage 2026-02-05 18:24:29 +00:00
Excalidraw Bot ede77bd6ac New translations en.json (Chinese Simplified) 2026-02-05 19:24:17 +01:00
Excalidraw Bot 05dde8f0d1 Auto commit: Calculate translation coverage 2026-02-04 07:52:55 +00:00
Excalidraw Bot d11453ae15 New translations en.json (French) 2026-02-04 08:52:41 +01:00
Excalidraw Bot 2d3577bb43 Auto commit: Calculate translation coverage 2026-02-03 06:40:22 +00:00
Excalidraw Bot 4258aeac53 New translations en.json (Japanese) 2026-02-03 07:40:12 +01:00
Excalidraw Bot 4f772d77a4 New translations en.json (Japanese) 2026-02-03 06:35:52 +01:00
Excalidraw Bot 6f57935419 Auto commit: Calculate translation coverage 2026-02-02 12:15:38 +00:00
Excalidraw Bot 61c69915da New translations en.json (Japanese) 2026-02-02 13:15:26 +01:00
290 changed files with 8835 additions and 6398 deletions
+5
View File
@@ -19,6 +19,11 @@
"command": "yarn fix",
"runAtStart": false
},
"prettier": {
"name": "Prettify",
"command": "yarn prettier",
"runAtStart": false
},
"start": {
"name": "Start Excalidraw",
"command": "yarn start",
+3
View File
@@ -37,6 +37,9 @@ VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX=
# Set this flag to false if you want to open the overlay by default
VITE_APP_COLLAPSE_OVERLAY=true
# Set this flag to false to disable eslint
VITE_APP_ENABLE_ESLINT=true
# Enable PWA in dev server
VITE_APP_ENABLE_PWA=false
+3
View File
@@ -29,3 +29,6 @@ PQIDAQAB'
# Set the below flags explicitly to false in production mode since vite loads and merges .env.local vars when running the build command
VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX=false
VITE_APP_COLLAPSE_OVERLAY=false
# Enable eslint in dev server
VITE_APP_ENABLE_ESLINT=false
+11
View File
@@ -0,0 +1,11 @@
node_modules/
build/
package-lock.json
.vscode/
firebase/
dist/
public/workbox
packages/excalidraw/types
examples/**/public
dev-dist
coverage
+43
View File
@@ -0,0 +1,43 @@
{
"extends": ["@excalidraw/eslint-config", "react-app"],
"rules": {
"import/order": [
"warn",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"],
"pathGroups": [
{
"pattern": "@excalidraw/**",
"group": "external",
"position": "after"
}
],
"newlines-between": "always-and-inside-groups",
"warnOnUnassignedImports": true
}
],
"import/no-anonymous-default-export": "off",
"no-restricted-globals": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"disallowTypeAnnotations": false,
"fixStyle": "separate-type-imports"
}
],
"no-restricted-imports": [
"error",
{
"name": "jotai",
"message": "Do not import from \"jotai\" directly. Use our app-specific modules (\"editor-jotai\" or \"app-jotai\")."
}
],
"react/jsx-no-target-blank": [
"error",
{
"allowReferrer": true
}
]
}
}
+1 -3
View File
@@ -8,9 +8,7 @@
.history
.idea
.vercel
.vscode/*
!.vscode/extensions.json
!.vscode/settings.recommended.json
.vscode
.yarn
*.log
*.tgz
+14
View File
@@ -0,0 +1,14 @@
const { CLIEngine } = require("eslint");
// see https://github.com/okonet/lint-staged#how-can-i-ignore-files-from-eslintignore-
// for explanation
const cli = new CLIEngine({});
module.exports = {
"*.{js,ts,tsx}": files => {
return (
"eslint --max-warnings=0 --fix " + files.filter(file => !cli.isPathIgnored(file)).join(" ")
);
},
"*.{css,scss,json,md,html,yml}": ["prettier --write"],
};
-5
View File
@@ -1,5 +0,0 @@
{
"printWidth": 80,
"proseWrap": "never",
"trailingComma": "all"
}
-149
View File
@@ -1,149 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"plugins": ["typescript", "react", "jsx-a11y", "import"],
"rules": {
"no-unused-vars": [
"warn",
{
"ignoreRestSiblings": true
}
],
"curly": "warn",
"no-console": [
"warn",
{
"allow": ["info", "warn", "error"]
}
],
"no-else-return": "warn",
"no-lonely-if": "warn",
"no-unneeded-ternary": "warn",
"no-unused-expressions": "warn",
"no-useless-return": "warn",
"no-var": "warn",
"one-var": "warn",
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-template": "warn",
"typescript/consistent-type-imports": [
"error",
{
"disallowTypeAnnotations": false
}
],
"typescript/no-restricted-imports": [
"error",
{
"patterns": [
{
"group": [
"../../excalidraw",
"../../../packages/excalidraw",
"@excalidraw/excalidraw"
],
"message": "Do not import from '@excalidraw/excalidraw' package anything but types, as this package must be independent.",
"allowTypeImports": true
}
]
}
],
"eslint/no-restricted-imports": [
"error",
{
"paths": [
{
"name": "jotai",
"message": "Do not import from \"jotai\" directly. Use our app-specific modules (\"editor-jotai\" or \"app-jotai\")."
}
]
}
],
"react/jsx-no-target-blank": [
"error",
{
"allowReferrer": true
}
],
"eslint/no-unreachable": "warn",
// react
"react/jsx-no-comment-textnodes": "error",
"react/iframe-missing-sandbox": "warn",
"react/rules-of-hooks": "error",
"react/no-unescaped-entities": "warn",
// for later
// ----------
// "react/no-array-index-key": "warn",
// "react/jsx-no-useless-fragment": "warn",
// will require major refactor
// ---------------------------
// "react/only-export-components": "warn",
// type-aware rules (requires --type-aware flag)
// -------------------------------------------------------------------------
"typescript/switch-exhaustiveness-check": "warn",
"typescript/unbound-method": [
"warn",
{
"ignoreStatic": true
}
],
// disabled rules
// -------------------------------------------------------------------------
// may be re-enabled later
"typescript/no-redundant-type-constituents": "off",
"typescript/no-unsafe-unary-minus": "off",
"typescript/no-floating-promises": "off",
// not planned
"eslint/no-async-promise-executor": "off",
"jsx-a11y/no-autofocus": "off",
"eslint-plugin-jsx-a11y/click-events-have-key-events": "off",
"eslint-plugin-jsx-a11y/label-has-associated-control": "off"
},
"ignorePatterns": [
"node_modules/",
"build/",
"dist/",
".vscode/",
"firebase/",
"public/workbox",
"packages/excalidraw/types",
"examples/**/public",
"dev-dist",
"coverage"
// "**/tests/**",
// "**/*.test*"
],
"overrides": [
{
"files": [
"packages/common/src/**/*.ts",
"packages/common/src/**/*.tsx",
"packages/element/src/**/*.ts",
"packages/element/src/**/*.tsx"
],
"rules": {
"typescript/no-restricted-imports": [
"error",
{
"patterns": [
{
"group": [
"../../excalidraw",
"../../../packages/excalidraw",
"@excalidraw/excalidraw"
],
"message": "Do not import from '@excalidraw/excalidraw' package anything but types, as this package must be independent.",
"allowTypeImports": true
}
]
}
]
}
}
]
}
View File
-3
View File
@@ -1,3 +0,0 @@
{
"recommendations": ["oxc.oxc-vscode"]
}
-22
View File
@@ -1,22 +0,0 @@
{
"oxc.enable": true,
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[json]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
}
}
@@ -10,11 +10,11 @@ import { FONT_FAMILY } from "@excalidraw/excalidraw";
`FONT_FAMILY` contains all the font families used in `Excalidraw`. The default families are the following:
| Font Family | Description |
| -------------- | --------------------- |
| `Excalifont` | The `Hand-drawn` font |
| `Nunito` | The `Normal` Font |
| `Comic Shanns` | The `Code` Font |
| Font Family | Description |
| ----------- | ---------------------- |
| `Excalifont` | The `Hand-drawn` font |
| `Nunito` | The `Normal` Font |
| `Comic Shanns` | The `Code` Font |
Pre-selected family is `FONT_FAMILY.Excalifont`, unless it's overriden with `initialData.appState.currentItemFontFamily`.
@@ -13,7 +13,7 @@ Once the callback is triggered, you will need to store the api in state to acces
```jsx showLineNumbers
export default function App() {
const [excalidrawAPI, setExcalidrawAPI] = useState(null);
return <Excalidraw excalidrawAPI={(api) => setExcalidrawAPI(api)} />;
return <Excalidraw excalidrawAPI={(api)=> setExcalidrawAPI(api)} />;
}
```
@@ -362,9 +362,10 @@ This API has the below signature. It sets the `tool` passed in param as the acti
```ts
(
tool: ({ type: ToolType } | { type: "custom"; customType: string }) & {
locked?: boolean;
},
tool: (
| { type: ToolType }
| { type: "custom"; customType: string }
) & { locked?: boolean },
) => {};
```
@@ -1,15 +1,7 @@
# initialData
<pre>
&#123; elements?:{" "}
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114">
ExcalidrawElement[]
</a>
, appState?:{" "}
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95">
AppState
</a>{" "}
&#125;
&#123; elements?: <a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114">ExcalidrawElement[]</a>, appState?: <a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95">AppState</a> &#125;
</pre>
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.
@@ -54,7 +46,7 @@ function App() {
},
],
appState: { zenModeEnabled: true, viewBackgroundColor: "#a5d8ff" },
scrollToContent: true,
scrollToContent: true
}}
/>
</div>
@@ -3,7 +3,7 @@
All `props` are _optional_.
| Name | Type | Default | Description |
| --- | --- | --- | --- | --- |
| --- | --- | --- | --- |
| [`initialData`](/docs/@excalidraw/excalidraw/api/props/initialdata) | `object` &#124; `null` &#124; <code>Promise<object &#124; null></code> | `null` | The initial data with which app loads. |
| [`excalidrawAPI`](/docs/@excalidraw/excalidraw/api/props/excalidraw-api) | `function` | \_ | Callback triggered with the excalidraw api once rendered |
| [`isCollaborating`](#iscollaborating) | `boolean` | \_ | This indicates if the app is in `collaboration` mode |
@@ -31,7 +31,7 @@ All `props` are _optional_.
| [`generateIdForFile`](#generateidforfile) | `function` | \_ | Allows you to override `id` generation for files added on canvas |
| [`validateEmbeddable`](#validateembeddable) | `string[]` \| `boolean` \| `RegExp` \| `RegExp[]` \| <code>((link: string) => boolean &#124; undefined)</code> | \_ | use for custom src url validation |
| [`renderEmbeddable`](/docs/@excalidraw/excalidraw/api/props/render-props#renderEmbeddable) | `function` | \_ | Render function that can override the built-in `<iframe>` |
| [`renderScrollbars`] | `boolean` | | `false` | Indicates whether scrollbars will be shown |
| [`renderScrollbars`] | `boolean`| | `false` | Indicates whether scrollbars will be shown
### Storing custom data on Excalidraw elements
@@ -247,7 +247,7 @@ This prop indicates whether to `focus` the Excalidraw component on page load. De
Allows you to override `id` generation for files added on canvas (images). By default, an SHA-1 digest of the file is used.
```tsx
(file: File) => string | Promise<string>;
(file: File) => string | Promise<string>
```
### validateEmbeddable
@@ -65,7 +65,7 @@ If user choses to `dock` the sidebar, it will push the right part of the UI towa
function App() {
return (
<div style={{ height: "500px" }}>
<Excalidraw UIOptions={{ dockedSidebarBreakpoint: 200 }} />
<Excalidraw UIOptions={{dockedSidebarBreakpoint: 200}}/>
</div>
);
}
@@ -73,8 +73,9 @@ function App() {
## tools
This `prop` controls the visibility of the tools in the editor. Currently you can control the visibility of `image` tool via this prop.
This `prop` controls the visibility of the tools in the editor.
Currently you can control the visibility of `image` tool via this prop.
| Prop | Type | Default | Description |
| ----- | ------- | ------- | ----------------------------------------------- |
| image | boolean | true | Decides whether `image` tool should be visible. |
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| image | boolean | true | Decides whether `image` tool should be visible.
@@ -14,44 +14,35 @@ We're working on much improved export utilities. Stay tuned!
**_Signature_**
<pre>
exportToCanvas(&#123;
<br />
&nbsp; elements,
<br />
&nbsp; appState
<br />
&nbsp; getDimensions,
<br />
&nbsp; files,
<br />
&nbsp; exportPadding?: number;
<br />
&#125;:{" "}
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/utils/export.ts#L24">
ExportOpts
</a>
exportToCanvas(&#123;<br/>&nbsp;
elements,<br/>&nbsp;
appState<br/>&nbsp;
getDimensions,<br/>&nbsp;
files,<br/>&nbsp;
exportPadding?: number;<br/>
&#125;: <a href="https://github.com/excalidraw/excalidraw/blob/master/packages/utils/export.ts#L24">ExportOpts</a>
</pre>
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `elements` | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114) | | The elements to be exported to canvas. |
| `appState` | [AppState](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/packages/utils.ts#L23) | [Default App State](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/appState.ts#L17) | The app state of the scene. |
| [`getDimensions`](#getdimensions) | `function` | \_ | A function which returns the `width`, `height`, and optionally `scale` (defaults to `1`), with which canvas is to be exported. |
| `maxWidthOrHeight` | `number` | \_ | The maximum `width` or `height` of the exported image. If provided, `getDimensions` is ignored. |
| `files` | [BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L59) | \_ | The files added to the scene. |
| [`getDimensions`](#getdimensions) | `function` | _ | A function which returns the `width`, `height`, and optionally `scale` (defaults to `1`), with which canvas is to be exported. |
| `maxWidthOrHeight` | `number` | _ | The maximum `width` or `height` of the exported image. If provided, `getDimensions` is ignored. |
| `files` | [BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L59) | _ | The files added to the scene. |
| `exportPadding` | `number` | `10` | The `padding` to be added on canvas. |
#### getDimensions
```tsx
(width: number, height: number) => {
(width: number, height: number) => {
width: number,
height: number,
scale?: number
height: number,
scale?: number
}
```
A function which returns the `width`, `height`, and optionally `scale` (defaults to `1`), with which canvas is to be exported.
A function which returns the `width`, `height`, and optionally `scale` (defaults to `1`), with which canvas is to be exported.
**How to use**
@@ -66,17 +57,17 @@ function App() {
const [canvasUrl, setCanvasUrl] = useState("");
const [excalidrawAPI, setExcalidrawAPI] = useState(null);
return (
return (
<>
<button
className="custom-button"
onClick={async () => {
if (!excalidrawAPI) {
return;
return
}
const elements = excalidrawAPI.getSceneElements();
if (!elements || !elements.length) {
return;
return
}
const canvas = await exportToCanvas({
elements,
@@ -85,9 +76,7 @@ function App() {
exportWithDarkMode: false,
},
files: excalidrawAPI.getFiles(),
getDimensions: () => {
return { width: 350, height: 350 };
},
getDimensions: () => { return {width: 350, height: 350}}
});
const ctx = canvas.getContext("2d");
ctx.font = "30px Virgil";
@@ -101,13 +90,15 @@ function App() {
<img src={canvasUrl} alt="" />
</div>
<div style={{ height: "400px" }}>
<Excalidraw excalidrawAPI={(api) => setExcalidrawAPI(api)} />
<Excalidraw excalidrawAPI={(api) => setExcalidrawAPI(api)}
/>
</div>
</>
);
)
}
```
### exportToBlob
**_Signature_**
@@ -123,7 +114,7 @@ exportToBlob(<br/>&nbsp;
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `opts` | `object` | \_ | This param is passed to `exportToCanvas`. You can refer to [`exportToCanvas`](#exporttocanvas) |
| `opts` | `object` | _ | This param is passed to `exportToCanvas`. You can refer to [`exportToCanvas`](#exporttocanvas) |
| `mimeType` | `string` | `image/png` | Indicates the image format. |
| `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. |
| `exportPadding` | `number` | `10` | The padding to be added on canvas. |
@@ -141,34 +132,26 @@ Returns a promise which resolves with a [blob](https://developer.mozilla.org/en-
**_Signature_**
<pre>
exportToSvg(&#123;
<br />
&nbsp; elements:&nbsp;
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114">
ExcalidrawElement[]
</a>
,<br />
&nbsp; appState:
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95">
{" "}
AppState
</a>
,<br />
&nbsp; exportPadding: number,
<br />
&nbsp; metadata: string,
<br />
&nbsp; files:&nbsp;
exportToSvg(&#123;<br/>&nbsp;
elements:&nbsp;
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114">
ExcalidrawElement[]
</a>,<br/>&nbsp;
appState:
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95"> AppState
</a>,<br/>&nbsp;
exportPadding: number,<br/>&nbsp;
metadata: string,<br/>&nbsp;
files:&nbsp;
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L59">
BinaryFiles
</a>
,<br />
&#125;);
BinaryFiles
</a>,<br/>
&#125;);
</pre>
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| elements | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114) | | The elements to exported as `svg ` |
| elements | [Excalidraw Element []](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114) | | The elements to exported as `svg `|
| appState | [AppState](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95) | [defaultAppState](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/appState.ts#L11) | The `appState` of the scene |
| exportPadding | number | 10 | The `padding` to be added on canvas |
| files | [BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L64) | undefined | The `files` added to the scene. |
@@ -193,7 +176,7 @@ exportToClipboard(<br/>&nbsp;
| `opts` | | | This param is same as the params passed to `exportToCanvas`. You can refer to [`exportToCanvas`](#exporttocanvas). |
| `mimeType` | `string` | `image/png` | Indicates the image format, this will be used when exporting as `png`. |
| `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`. |
| `type` | 'png' &#124; 'svg' &#124; 'json' | \_ | This determines the format to which the scene data should be `exported`. |
| `type` | 'png' &#124; 'svg' &#124; 'json' | _ | This determines the format to which the scene data should be `exported`. |
**How to use**
@@ -20,7 +20,8 @@ import { restoreAppState } from "@excalidraw/excalidraw";
This function will make sure all the `keys` have appropriate `values` in [appState](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95) and if any key is missing, it will be set to its `default` value.
When `localAppState` is supplied, it's used in place of values that are missing (`undefined`) in `appState` instead of the defaults.
Use this as a way to not override user's defaults if you persist them. You can pass `null` / `undefined` if not applicable.
Use this as a way to not override user's defaults if you persist them.
You can pass `null` / `undefined` if not applicable.
### restoreElements
@@ -35,10 +36,10 @@ restoreElements(
</pre>
| Prop | Type | Description |
| --- | --- | --- |
| ---- | ---- | ---- |
| `elements` | <a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114">ImportedDataState["elements"]</a> | The `elements` to be restored |
| [`localElements`](#localelements) | <a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114">ExcalidrawElement[]</a> &#124; null &#124; undefined | When `localElements` are supplied, they are used to ensure that existing restored elements reuse `version` (and increment it), and regenerate `versionNonce`. |
| [`opts`](#opts) | `Object` | The extra optional parameter to configure restored elements |
| [`localElements`](#localelements) | <a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/element/types.ts#L114">ExcalidrawElement[]</a> &#124; null &#124; undefined | When `localElements` are supplied, they are used to ensure that existing restored elements reuse `version` (and increment it), and regenerate `versionNonce`. |
| [`opts`](#opts) | `Object` | The extra optional parameter to configure restored elements
#### localElements
@@ -46,14 +47,13 @@ When `localElements` are supplied, they are used to ensure that existing restore
Use this when you `import` elements which may already be present in the scene to ensure that you do not disregard the newly imported elements if you're using element version to detect the update
#### opts
The extra optional parameter to configure restored elements. It has the following attributes
| Prop | Type | Description |
| --- | --- | --- |
| Prop | Type | Description|
| --- | --- | ------|
| `refreshDimensions` | `boolean` | Indicates whether we should also _recalculate_ text element dimensions. Since this is a potentially costly operation, you may want to disable it if you restore elements in tight loops, such as during collaboration. |
| `repairBindings` | `boolean` | Indicates whether the _bindings_ for the elements should be repaired. This is to make sure there are no containers with non existent bound text element id and no bound text elements with non existent container id. |
| `normalizeIndices` | `boolean` | Indicates whether _fractional indices_ for the elements should be normalized. This is to prevent possible issues caused by using stale (too old, too long) indices. |
| `repairBindings` |`boolean` | Indicates whether the _bindings_ for the elements should be repaired. This is to make sure there are no containers with non existent bound text element id and no bound text elements with non existent container id. |
| `normalizeIndices` |`boolean` | Indicates whether _fractional indices_ for the elements should be normalized. This is to prevent possible issues caused by using stale (too old, too long) indices. |
**_How to use_**
@@ -94,12 +94,8 @@ This function makes sure elements and state is set to appropriate values and set
**_Signature_**
<pre>
restoreLibraryItems(libraryItems:{" "}
<a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/types.ts#L34">
ImportedDataState["libraryItems"]
</a>
,<br />
&nbsp; defaultStatus: "published" | "unpublished")
restoreLibraryItems(libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/types.ts#L34">ImportedDataState["libraryItems"]</a>,<br/>&nbsp;
defaultStatus: "published" | "unpublished")
</pre>
**_How to use_**
@@ -38,7 +38,6 @@ For a complete list of variables, check [theme.scss](https://github.com/excalidr
--color-primary-light: #dcbec9;
}
```
```tsx live
function App() {
return (
@@ -23,7 +23,7 @@ To start the example app using the `@excalidraw/excalidraw` package, follow the
```
[http://localhost:3001](http://localhost:3001) will open in your default browser.
This is the same example as the [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser) example.
## Releasing
+9 -4
View File
@@ -6,17 +6,21 @@ No, Excalidraw package doesn't come with collaboration built in, since the imple
### Turning off Aggressive Anti-Fingerprinting in Brave browser
When _Aggressive Anti-Fingerprinting_ is turned on, the `measureText` API breaks which in turn breaks the Text Elements in your drawings. Here is more [info](https://github.com/excalidraw/excalidraw/pull/6336) on the same.
When *Aggressive Anti-Fingerprinting* is turned on, the `measureText` API breaks which in turn breaks the Text Elements in your drawings. Here is more [info](https://github.com/excalidraw/excalidraw/pull/6336) on the same.
We strongly recommend turning it off. You can follow the steps below on how to do so.
1. Open [excalidraw.com](https://excalidraw.com) in Brave and click on the **Shield** button ![Shield button](../../assets/brave-shield.png)
1. Open [excalidraw.com](https://excalidraw.com) in Brave and click on the **Shield** button
![Shield button](../../assets/brave-shield.png)
<div style={{width:'30rem'}}>
2. Once opened, look for **Aggressively Block Fingerprinting** ![Aggressive block fingerprinting](../../assets/aggressive-block-fingerprint.png)
2. Once opened, look for **Aggressively Block Fingerprinting**
![Aggressive block fingerprinting](../../assets/aggressive-block-fingerprint.png)
3. Switch to **Block Fingerprinting** ![Block filtering](../../assets/block-fingerprint.png)
3. Switch to **Block Fingerprinting**
![Block filtering](../../assets/block-fingerprint.png)
4. Thats all. All text elements should be fixed now 🎉
@@ -24,6 +28,7 @@ We strongly recommend turning it off. You can follow the steps below on how to d
If disabling this setting doesn't fix the display of text elements, please consider opening an [issue](https://github.com/excalidraw/excalidraw/issues/new) on our GitHub, or message us on [Discord](https://discord.gg/UexuTaE).
### ReferenceError: process is not defined
When using `vite` or any build tools, you will have to make sure the `process` is accessible as we are accessing `process.env.IS_PREACT` to decide whether to use `preact` build.
@@ -31,7 +31,9 @@ or, if you serve your assets from the root of your CDN, you would do:
```js
// Vanilla
<head>
<script>window.EXCALIDRAW_ASSET_PATH = "https://my.cdn.com/assets/";</script>
<script>
window.EXCALIDRAW_ASSET_PATH = "https://my.cdn.com/assets/";
</script>
</head>
```
@@ -39,8 +41,8 @@ or, if you prefer the path to be dynamicly set based on the `location.origin`, y
```jsx
// Next.js
<Script id="load-env-variables" strategy="beforeInteractive">
{`window["EXCALIDRAW_ASSET_PATH"] = location.origin;`} // or use just "/"!
<Script id="load-env-variables" strategy="beforeInteractive" >
{ `window["EXCALIDRAW_ASSET_PATH"] = location.origin;` } // or use just "/"!
</Script>
```
@@ -12,7 +12,8 @@ import { Excalidraw } from "@excalidraw/excalidraw";
Throughout the documentation we use live, editable Excalidraw examples like the one shown below.
While we aim for the examples to closely reflect what you'd get if you rendered it yourself, we actually initialize it with some props behind the scenes. For example, we're passing a `theme` prop to it based on the current color theme of the docs you're just reading.
While we aim for the examples to closely reflect what you'd get if you rendered it yourself, we actually initialize it with some props behind the scenes.
For example, we're passing a `theme` prop to it based on the current color theme of the docs you're just reading.
:::
@@ -57,76 +58,80 @@ If you are using `pages router` then importing the wrapper dynamically would wor
<Tabs>
<TabItem value="Excalidraw Wrapper" label="Excalidraw Wrapper" >
```jsx showLineNumbers
"use client";
import { Excalidraw, convertToExcalidrawElements } from "@excalidraw/excalidraw";
```jsx showLineNumbers
"use client";
import { Excalidraw, convertToExcalidrawElements } from "@excalidraw/excalidraw";
import "@excalidraw/excalidraw/index.css";
import "@excalidraw/excalidraw/index.css";
const ExcalidrawWrapper: React.FC = () => {
console.info(convertToExcalidrawElements([{
type: "rectangle",
id: "rect-1",
width: 186.47265625,
height: 141.9765625,
},]));
return (
<div style={{height:"500px", width:"500px"}}>
<Excalidraw />
</div>
);
};
export default ExcalidrawWrapper;
```
const ExcalidrawWrapper: React.FC = () => {
console.info(convertToExcalidrawElements([{
type: "rectangle",
id: "rect-1",
width: 186.47265625,
height: 141.9765625,
},]));
return (
<div style={{height:"500px", width:"500px"}}>
<Excalidraw />
</div>
);
};
export default ExcalidrawWrapper;
```
</TabItem>
<TabItem value="pages" label="Pages router">
```jsx showLineNumbers
import dynamic from "next/dynamic";
```jsx showLineNumbers
import dynamic from "next/dynamic";
// Since client components get prerenderd on server as well hence importing
// the excalidraw stuff dynamically with ssr false
// Since client components get prerenderd on server as well hence importing
// the excalidraw stuff dynamically with ssr false
const ExcalidrawWrapper = dynamic(
async () => (await import("../excalidrawWrapper")).default,
{
ssr: false,
},
);
export default function Page() {
return <ExcalidrawWrapper />;
}
```
const ExcalidrawWrapper = dynamic(
async () => (await import("../excalidrawWrapper")).default,
{
ssr: false,
},
);
export default function Page() {
return (
<ExcalidrawWrapper />
);
}
```
</TabItem>
<TabItem value="app" label="App router">
```jsx showLineNumbers
import dynamic from "next/dynamic";
```jsx showLineNumbers
import dynamic from "next/dynamic";
// Since client components get prerenderd on server as well hence importing
// the excalidraw stuff dynamically with ssr false
// Since client components get prerenderd on server as well hence importing
// the excalidraw stuff dynamically with ssr false
const ExcalidrawWrapper = dynamic(
async () => (await import("../excalidrawWrapper")).default,
{
ssr: false,
},
);
const ExcalidrawWrapper = dynamic(
async () => (await import("../excalidrawWrapper")).default,
{
ssr: false,
},
);
export default function Page() {
return <ExcalidrawWrapper />;
}
```
export default function Page() {
return (
<ExcalidrawWrapper />
);
}
```
</TabItem>
</Tabs>
{/* Link should be updated to point to the latest! */} Here is a [source code](https://github.com/excalidraw/excalidraw/tree/master/examples/with-nextjs) for the example with app and pages router. You you can try it out [here](https://excalidraw-package-example-with-nextjs.vercel.app/).
{/* Link should be updated to point to the latest! */}
Here is a [source code](https://github.com/excalidraw/excalidraw/tree/master/examples/with-nextjs) for the example with app and pages router. You you can try it out [here](https://excalidraw-package-example-with-nextjs.vercel.app/).
The `types` are available at `@excalidraw/excalidraw/types`, check [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser) example for details.
@@ -149,7 +154,6 @@ Since Vite removes env variables by default, you can update the vite config to e
"process.env.IS_PREACT": JSON.stringify("true"),
},
```
:::
## Browser
@@ -176,16 +180,15 @@ import TabItem from "@theme/TabItem";
/>
<link rel="stylesheet" href="./index.css" />
<script>
window.EXCALIDRAW_ASSET_PATH =
"https://esm.sh/@excalidraw/excalidraw@0.18.0/dist/prod/";
</script>
window.EXCALIDRAW_ASSET_PATH = "https://esm.sh/@excalidraw/excalidraw@0.18.0/dist/prod/";
</script>
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/react@19.0.0",
"react/jsx-runtime": "https://esm.sh/react@19.0.0/jsx-runtime",
"react-dom": "https://esm.sh/react-dom@19.0.0"
}
}
}
</script>
</head>
@@ -205,9 +208,9 @@ import TabItem from "@theme/TabItem";
```js showLineNumbers
// See https://www.npmjs.com/package/@excalidraw/excalidraw documentation.
import * as ExcalidrawLib from "https://esm.sh/@excalidraw/excalidraw@0.18.0/dist/dev/index.js?external=react,react-dom";
import * as ExcalidrawLib from 'https://esm.sh/@excalidraw/excalidraw@0.18.0/dist/dev/index.js?external=react,react-dom';
import React from "https://esm.sh/react@19.0.0";
import ReactDOM from "https://esm.sh/react-dom@19.0.0";
import ReactDOM from "https://esm.sh/react-dom@19.0.0"
window.ExcalidrawLib = ExcalidrawLib;
console.log("Excalidraw library", ExcalidrawLib);
@@ -41,24 +41,18 @@ flowchart TD
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[Car]
```
```
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/c8ea84fc-e9fb-4652-9a12-154136d1a798" width="250" height="200"/>
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/c8ea84fc-e9fb-4652-9a12-154136d1a798"
width="250"
height="200"
/>
```
flowchart LR
id1((Hello from Circle))
```
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/6202a8b9-8aa7-451e-9478-4d8d75c0f2fa"
width="250"
height="200"
/>
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/6202a8b9-8aa7-451e-9478-4d8d75c0f2fa" width="250" height="200"/>
#### Subgraphs
@@ -78,11 +72,7 @@ flowchart TB
end
```
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/098bce52-8f93-437c-9a06-c6972e27c70a"
width="350"
height="200"
/>
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/098bce52-8f93-437c-9a06-c6972e27c70a" width="350" height="200"/>
#### Unsupported shapes fallback to Rectangle
@@ -97,14 +87,9 @@ flowchart LR
id5[/Parallelogram fallback to Rectangle /]
id6[/Trapezoid fallback to Rectangle\]
```
The above shapes are not supported in Excalidraw hence they fallback to Rectangle
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/cb269473-16c5-4c35-bd7a-d631d8cc5b47"
width="350"
height="200"
/>
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/cb269473-16c5-4c35-bd7a-d631d8cc5b47" width="350" height="200"/>
#### Markdown fallback to Regular text
@@ -114,12 +99,7 @@ Since we don't support wysiwyg text editor yet, hence [Markdown Strings](https:/
flowchart LR
A("`Hello **World**`") --> B("`Whats **up** ?`")
```
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/107bd428-9ab9-42d4-ba12-b1e29c8db478"
width="250"
height="200"
/>
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/107bd428-9ab9-42d4-ba12-b1e29c8db478" width="250" height="200"/>
#### Basic FontAwesome fallback to text
@@ -132,11 +112,8 @@ flowchart TD
B-->E(A fa:fa-camera-retro perhaps?)
```
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/7a693863-c3f9-42ff-b325-4b3f8303c7af"
width="250"
height="200"
/>
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/7a693863-c3f9-42ff-b325-4b3f8303c7af" width="250" height="200"/>
#### Cross Arrow head fallback to Bar Arrow head
@@ -144,12 +121,8 @@ flowchart TD
flowchart LR
Start x--x Stop
```
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/217dd1ad-7f4e-4c80-8c1c-03647b42d821" width="250" height="200"/>
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/217dd1ad-7f4e-4c80-8c1c-03647b42d821"
width="250"
height="200"
/>
## Unsupported Diagram Types
@@ -162,11 +135,7 @@ erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
```
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/c1d3fdb3-32ef-4bf3-a38a-02ac3d7d2cb9"
width="300"
height="200"
/>
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/c1d3fdb3-32ef-4bf3-a38a-02ac3d7d2cb9" width="300" height="200"/>
```
gitGraph
@@ -183,8 +152,4 @@ gitGraph
```
<img
src="https://github.com/excalidraw/excalidraw/assets/11256141/e5dcec0b-d570-4eb4-b981-412a996aa96c"
width="400"
height="300"
/>
<img src="https://github.com/excalidraw/excalidraw/assets/11256141/e5dcec0b-d570-4eb4-b981-412a996aa96c" width="400" height="300"/>
@@ -2,6 +2,6 @@
The Codebase is divided into 2 Sections
- [How Parser Works under the hood](/docs/@excalidraw/mermaid-to-excalidraw/codebase/parser) - If you are interested in understanding and deep diving into inner workings of the Parser, then make sure to checkout this section.
* [How Parser Works under the hood](/docs/@excalidraw/mermaid-to-excalidraw/codebase/parser) - If you are interested in understanding and deep diving into inner workings of the Parser, then make sure to checkout this section.
- [Adding a new diagram type](/docs/@excalidraw/mermaid-to-excalidraw/codebase/new-diagram-type) - If you want to help us make the mermaid to Excalidraw Parser more powerful, you will find all information in this section to do so.
* [Adding a new diagram type](/docs/@excalidraw/mermaid-to-excalidraw/codebase/new-diagram-type) - If you want to help us make the mermaid to Excalidraw Parser more powerful, you will find all information in this section to do so.
@@ -10,7 +10,7 @@ lets run the playground server in local :point_down:
yarn start
```
This will start the playground server in port `1234` and open it in browser so you start playing with the playground.
This will start the playground server in port `1234` and open it in browser so you start playing with the playground.
## Update Supported Diagram Types
@@ -26,13 +26,13 @@ For this create a file named `{{diagramType}}.ts` in [`src/parser`](https://gith
The main aim of the parser is :point_down:
1. Determine how elements are connected in the diagram and thus finding arrow and text bindings.
1. Determine how elements are connected in the diagram and thus finding arrow and text bindings.
For this you might have to dig in to the parser `diagram.parser.yy` and which attributes to parse for the new diagram.
2. Determine the position and dimensions of each element, for this would be using the `svg`
Once the parser is ready, lets start using it.
Once the parser is ready, lets start using it.
Add the diagram type in switch case in [`parseMermaid`](https://github.com/excalidraw/mermaid-to-excalidraw/blob/master/src/parseMermaid.ts#L97) and call the parser for the same.
@@ -51,3 +51,4 @@ Thats it, you have added the new diagram type 🥳, now lets test it out!
2. Incase the new diagram type added is present in [`unsupported.ts`](https://github.com/excalidraw/mermaid-to-excalidraw/blob/master/playground/testcases/unsupported.ts) then remove it from there.
3. Verify if the test cases are running fine in playground.
@@ -8,10 +8,12 @@ In this section we will be diving into how the [flowchart parser](https://github
We use `diagram.parser.yy` attribute to parse the data. If you want to know more about how the `diagram.parse.yy` attribute looks like, you can check it [here](https://github.com/mermaid-js/mermaid/blob/00d06c7282a701849793680c1e97da1cfdfcce62/packages/mermaid/src/diagrams/flowchart/flowDb.js#L768), however for scope of flowchart we are using **3** APIs from this parser to compute `vertices`, `edges` and `clusters` as we need these data to transform to [ExcalidrawElementSkeleton](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/transform.ts#L133C13-L133C38).
For computing `vertices` and `edge`s lets consider the below svg generated by mermaid
![image](https://github.com/excalidraw/excalidraw/assets/11256141/d7013305-0b90-4fa0-a66e-b4f4604ad0b2)
## Computing the vertices
We use `getVertices` API from `diagram.parse.yy` to get the vertices for a given flowchart.
@@ -40,10 +42,9 @@ Considering the same example this is the response from the API
}
}
```
The dimensions and position is missing in this response and we need that to transform to [ExcalidrawElementSkeleton](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/transform.ts#L133C13-L133C38), for this we have our own parser [`parseVertex`](https://github.com/excalidraw/mermaid-to-excalidraw/blob/master/src/parseMermaid.ts#L178) which takes the above response and uses the `svg` together to compute position, dimensions and cleans up the response.
The final output from `parseVertex` looks like :point_down:
The final output from `parseVertex` looks like :point_down:
```js
{
@@ -72,55 +73,57 @@ The final output from `parseVertex` looks like :point_down:
}
```
## Computing the edges
The lines and arrows are considered as `edges` in mermaid as shown in the above diagram. We use `getEdges` API from `diagram.parse.yy` to get the edges for a given flowchart. Considering the same example this is the response from the API
The lines and arrows are considered as `edges` in mermaid as shown in the above diagram.
We use `getEdges` API from `diagram.parse.yy` to get the edges for a given flowchart.
Considering the same example this is the response from the API
```js
[
{
start: "start",
end: "stop",
type: "arrow_point",
text: "",
labelType: "text",
stroke: "normal",
length: 1,
},
];
{
"start": "start",
"end": "stop",
"type": "arrow_point",
"text": "",
"labelType": "text",
"stroke": "normal",
"length": 1
}
]
```
Similarly here the dimensions and position is missing and we compute that from the svg. The [`parseEdge`](https://github.com/excalidraw/mermaid-to-excalidraw/blob/master/src/parseMermaid.ts#L245) takes the above response along with `svg` and computes the position, dimensions and cleans up the response.
The final output from `parseEdge` looks like :point_down:
The final output from `parseEdge` looks like :point_down:
```js
[
{
start: "start",
end: "stop",
type: "arrow_point",
text: "",
labelType: "text",
stroke: "normal",
startX: 67.797,
startY: 22,
endX: 117.797,
endY: 22,
reflectionPoints: [
{
x: 67.797,
y: 22,
},
{
x: 117.797,
y: 22,
},
],
},
];
{
"start": "start",
"end": "stop",
"type": "arrow_point",
"text": "",
"labelType": "text",
"stroke": "normal",
"startX": 67.797,
"startY": 22,
"endX": 117.797,
"endY": 22,
"reflectionPoints": [
{
"x": 67.797,
"y": 22
},
{
"x": 117.797,
"y": 22
}
]
}
]
```
## Computing the Subgraphs
`Subgraphs` is collection of elements grouped together. The Subgraphs map to `grouping` elements in Excalidraw.
@@ -129,35 +132,46 @@ Lets consider the below example :point_down:
![image](https://github.com/excalidraw/excalidraw/assets/11256141/5243ce4c-beaa-43d2-812a-0577b0a574d7)
We use `getSubgraphs` API to get the subgraph data for a given flowchart. Considering the same example this is the response from the API
We use `getSubgraphs` API to get the subgraph data for a given flowchart.
Considering the same example this is the response from the API
```js
[
{
id: "one",
nodes: ["flowchart-a2-1399", "flowchart-a1-1400"],
title: "one",
classes: [],
labelType: "text",
},
];
{
"id": "one",
"nodes": [
"flowchart-a2-1399",
"flowchart-a1-1400"
],
"title": "one",
"classes": [],
"labelType": "text"
}
]
```
For position and dimensions we use the svg to compute. The [`parseSubgraph`](https://github.com/excalidraw/mermaid-to-excalidraw/blob/master/src/parseMermaid.ts#L139) takes the above response along with `svg` and computes the position, dimensions and cleans up the response.
```js
[
{
id: "one",
nodes: ["flowchart-a2-1399", "flowchart-a1-1400"],
title: "one",
labelType: "text",
nodeIds: ["a2", "a1"],
x: 75.4921875,
y: 0,
width: 121.25,
height: 188,
text: "one",
},
];
```
{
"id": "one",
"nodes": [
"flowchart-a2-1399",
"flowchart-a1-1400"
],
"title": "one",
"labelType": "text",
"nodeIds": [
"a2",
"a1"
],
"x": 75.4921875,
"y": 0,
"width": 121.25,
"height": 188,
"text": "one"
}
]
```
@@ -2,6 +2,7 @@
[This](https://github.com/excalidraw/mermaid-to-excalidraw/blob/master/src/index.ts) is the entry point of the library.
`parseMermaidToExcalidraw` function is the only function exposed which receives mermaid syntax as the input, parses the mermaid syntax and resolves to Excalidraw Skeleton.
Lets look at the high level overview at how the parse works :point_down:
@@ -12,10 +13,10 @@ Lets dive deeper into individual section now to understand better.
## Parsing Mermaid diagram
One of the dependencies of the library is [`mermaid`](https://www.npmjs.com/package/mermaid) library. We need the mermaid diagram in some extractable format so we can parse it to Excalidraw Elements.
One of the dependencies of the library is [`mermaid`](https://www.npmjs.com/package/mermaid) library.
We need the mermaid diagram in some extractable format so we can parse it to Excalidraw Elements.
Parsing is broken into two steps
1. [`Rendering Mermaid to Svg`](/docs/@excalidraw/mermaid-to-excalidraw/codebase/parser#rendering-mermaid-to-svg) - This helps in determining the position and dimensions of each element in the diagram
2. [`Parsing the mermaid syntax`](/docs/@excalidraw/mermaid-to-excalidraw/codebase/parser#parsing-the-mermaid-syntax) - We also need to know how elements are connected which isn't possible with svg alone hence we also parse the mermaid syntax which helps in determining the connections and bindings between elements in the diagram.
@@ -26,8 +27,10 @@ Parsing is broken into two steps
The [`mermaid`](https://www.npmjs.com/package/mermaid) library provides the API `mermaid.render` API which gives the output of the diagram in `svg`.
If the diagram isn't supported, this svg is converted to `dataURL` and can be rendered as an image in Excalidraw.
### Parsing the mermaid syntax
For this we first need to process the options along with mermaid defination for diagram provided by the user.
@@ -54,8 +57,9 @@ If you want to understand how flowchart parser works, you can navigate to [Flowc
Now we have all the data, we just need to transform it to [ExcalidrawElementSkeleton](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/transform.ts#L133C13-L133C38) API so it can be rendered in Excalidraw.
For this we have `converters` which takes the parsed mermaid data and gives back the Excalidraw Skeleton. For Unsupported types, we have already mentioned above that we convert it to `dataURL` and return the ExcalidrawImageSkeleton.
For this we have `converters` which takes the parsed mermaid data and gives back the Excalidraw Skeleton.
For Unsupported types, we have already mentioned above that we convert it to `dataURL` and return the ExcalidrawImageSkeleton.
For supported types, currently only flowchart, we have [flowchartConverter](https://github.com/excalidraw/mermaid-to-excalidraw/blob/master/src/converter/types/flowchart.ts#L24) which parses the data and converts to [ExcalidrawElementSkeleton](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/transform.ts#L133C13-L133C38).
![image](https://github.com/excalidraw/excalidraw/assets/11256141/00226e9d-043d-4a08-989a-3ad9d2a574f1)
![image](https://github.com/excalidraw/excalidraw/assets/11256141/00226e9d-043d-4a08-989a-3ad9d2a574f1)
@@ -10,6 +10,7 @@ To set up the library in local, follow the below steps 👇🏼
Go to [@excalidraw/mermaid-to-excalidraw](https://github.com/excalidraw/mermaid-to-excalidraw) and clone the repository to your local.
```bash
git clone git@github.com:excalidraw/mermaid-to-excalidraw.git
```
@@ -20,7 +20,7 @@ Once the library is installed, its ready to use.
```js
import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
import { convertToExcalidrawElements } from "@excalidraw/excalidraw";
import { convertToExcalidrawElements} from "@excalidraw/excalidraw"
try {
const { elements, files } = await parseMermaid(diagramDefinition, {
@@ -38,4 +38,5 @@ try {
## Playground
Try it out [here](https://mermaid-to-excalidraw.vercel.app)
Try it out [here](https://mermaid-to-excalidraw.vercel.app)
+6 -2
View File
@@ -2,7 +2,8 @@
Pull requests are welcome. For major changes, please [open an issue](https://github.com/excalidraw/excalidraw/issues/new) first to discuss what you would like to change.
We have a [roadmap](https://github.com/orgs/excalidraw/projects/3) which we strongly recommend to go through and check if something interests you. For new contributors we would recommend to start with _Easy_ tasks.
We have a [roadmap](https://github.com/orgs/excalidraw/projects/3) which we strongly recommend to go through and check if something interests you.
For new contributors we would recommend to start with *Easy* tasks.
In case you want to pick up something from the roadmap, comment on that issue and one of the project maintainers will assign it to you, post which you can discuss in the issue and start working on it.
@@ -59,7 +60,10 @@ It's also a good idea to consider if your change should include additional tests
Finally - always manually test your changes using the convenient staging environment deployed for each pull request. As much as local development attempts to replicate production, there can still be subtle differences in behavior. For larger features consider testing your change in multiple browsers as well.
:::note Some checks, such as the `lint` and `test`, require approval from the maintainers to run. They will appear as `Expected — Waiting for status to be reported` in the PR checks when they are waiting for approval. :::
:::note
Some checks, such as the `lint` and `test`, require approval from the maintainers to run.
They will appear as `Expected — Waiting for status to be reported` in the PR checks when they are waiting for approval.
:::
## Translating
+7 -1
View File
@@ -54,7 +54,7 @@ yarn
yarn start
```
### Lint & format
### Reformat all files with Prettier
```bash
yarn fix
@@ -72,6 +72,12 @@ yarn test
yarn test:update
```
### Test for formatting with Prettier
```bash
yarn test:code
```
### Docker Compose
You can use docker-compose to work on Excalidraw locally if you don't want to setup a Node.js env.
+2 -2
View File
@@ -16,8 +16,8 @@ const FeatureList = [
Svg: require("@site/static/img/undraw_blank_canvas.svg").default,
description: (
<>
Want to build your own app powered by Excalidraw but don&apos;t know
where to start?
Want to build your own app powered by Excalidraw but don't know where to
start?
</>
),
},
+3 -1
View File
@@ -1,5 +1,7 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {}
"compilerOptions": {
"baseUrl": "."
}
}
@@ -11,7 +11,7 @@ const ExcalidrawWrapper: React.FC = () => {
<>
<App
appTitle={"Excalidraw with Nextjs Example"}
useCustom={() => {}}
useCustom={(api: any, args?: any[]) => {}}
excalidrawLib={excalidrawLib}
>
<Excalidraw />
+1 -7
View File
@@ -23,12 +23,6 @@
},
"forceConsistentCasingInFileNames": true
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"build/types/**/*.ts"
],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "build/types/**/*.ts"],
"exclude": ["node_modules"]
}
+1 -2
View File
@@ -1,4 +1,3 @@
{
"outputDirectory": "build",
"installCommand": "yarn install && yarn --cwd ../../ install"
"outputDirectory": "build"
}
@@ -238,7 +238,7 @@ export default function ExampleApp({
left: "50%",
transform: "translateX(-50%)",
bottom: "20px",
zIndex: 999999999999999,
zIndex: 9999999999999999,
}}
>
Toggle Custom Sidebar
@@ -250,7 +250,7 @@ export default function ExampleApp({
</TTDDialogTrigger>
)}
<TTDDialog
onTextSubmit={async () => {
onTextSubmit={async (_) => {
console.info("submit");
// sleep for 2s
await new Promise((resolve) => setTimeout(resolve, 2000));
@@ -555,7 +555,7 @@ export default function ExampleApp({
if (!comment) {
return null;
}
const appState = excalidrawAPI?.getAppState();
const appState = excalidrawAPI?.getAppState()!;
const { x, y } = sceneCoordsToViewportCoords(
{ sceneX: comment.x, sceneY: comment.y },
appState,
+1 -1
View File
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
+1 -1
View File
@@ -20,7 +20,7 @@ root.render(
<StrictMode>
<App
appTitle={"Excalidraw Example"}
useCustom={() => {}}
useCustom={(api: any, args?: any[]) => {}}
excalidrawLib={window.ExcalidrawLib}
>
<Excalidraw />
+10 -10
View File
@@ -2,21 +2,21 @@
"name": "with-script-in-browser",
"version": "1.0.0",
"private": true,
"dependencies": {
"react": "19.0.0",
"react-dom": "19.0.0",
"@excalidraw/excalidraw": "*",
"browser-fs-access": "0.29.1"
},
"devDependencies": {
"vite": "5.0.12",
"typescript": "^5"
},
"scripts": {
"start": "vite",
"build": "vite build",
"preview": "vite preview --port 5002",
"build:preview": "yarn build && yarn preview",
"build:packages": "yarn --cwd ../../ build:packages"
},
"dependencies": {
"@excalidraw/excalidraw": "0.18.0",
"browser-fs-access": "0.29.1",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"typescript": "^5",
"vite": "5.0.12"
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"outputDirectory": "dist",
"installCommand": "yarn install && yarn --cwd ../../ install",
"installCommand": "yarn install",
"buildCommand": "yarn build:packages && yarn build"
}
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -192,7 +192,7 @@ if (window.self !== window.top) {
if (parentUrl.origin === currentUrl.origin) {
isSelfEmbedding = true;
}
} catch {
} catch (error) {
// ignore
}
}
@@ -310,7 +310,7 @@ const initializeScene = async (opts: {
) {
return { scene: data, isExternalScene };
}
} catch {
} catch (error: any) {
return {
scene: {
appState: {
@@ -787,7 +787,7 @@ const ExcalidrawWrapper = () => {
height: "100%",
}}
>
<h1>I&apos;m not a pretzel!</h1>
<h1>I'm not a pretzel!</h1>
</div>
);
}
+3 -5
View File
@@ -210,9 +210,7 @@ class Collab extends PureComponent<CollabProps, CollabState> {
window.addEventListener(EVENT.UNLOAD, this.onUnload);
const unsubOnUserFollow = this.excalidrawAPI.onUserFollow((payload) => {
if (this.portal.socket) {
this.portal.broadcastUserFollowed(payload);
}
this.portal.socket && this.portal.broadcastUserFollowed(payload);
});
const throttledRelayUserViewportBounds = throttleRAF(
this.relayVisibleSceneBounds,
@@ -917,9 +915,9 @@ class Collab extends PureComponent<CollabProps, CollabState> {
button: SocketUpdateDataSource["MOUSE_LOCATION"]["payload"]["button"];
pointersMap: Gesture["pointers"];
}) => {
if (payload.pointersMap.size < 2 && this.portal.socket) {
payload.pointersMap.size < 2 &&
this.portal.socket &&
this.portal.broadcastMouseLocation(payload);
}
},
CURSOR_SYNC_TIMEOUT,
);
+1 -1
View File
@@ -1,4 +1,4 @@
@use "../../packages/excalidraw/css/variables.module.scss" as *;
@import "../../packages/excalidraw/css/variables.module.scss";
.excalidraw {
.collab-errors-button {
+1 -1
View File
@@ -46,7 +46,7 @@ class Portal {
trackEvent("share", "room joined");
}
});
this.socket.on("new-user", async () => {
this.socket.on("new-user", async (_socketId: string) => {
this.broadcastScene(
WS_SUBTYPES.INIT,
this.collab.getSceneElementsIncludingDeleted(),
+1 -1
View File
@@ -95,7 +95,7 @@ export const AIComponents = ({
return {
html,
};
} catch {
} catch (error: any) {
throw new Error("Generation failed (invalid response)");
}
}}
+5 -2
View File
@@ -16,8 +16,11 @@
background-position: center;
background-repeat: no-repeat;
background-image:
radial-gradient(circle, transparent 60%, var(--sidebar-bg-color) 100%),
background-image: radial-gradient(
circle,
transparent 60%,
var(--sidebar-bg-color) 100%
),
var(--image-source);
display: flex;
@@ -28,7 +28,7 @@ export class TopErrorBoundary extends React.Component<
for (const [key, value] of Object.entries({ ...localStorage })) {
try {
_localStorage[key] = JSON.parse(value);
} catch {
} catch (error: any) {
_localStorage[key] = value;
}
}
@@ -37,7 +37,7 @@ export class TopErrorBoundary extends React.Component<
scope.setExtras(errorInfo);
const eventId = Sentry.captureException(error);
this.setState(() => ({
this.setState((state) => ({
hasError: true,
sentryEventId: eventId,
localStorage: JSON.stringify(_localStorage),
+2 -2
View File
@@ -44,7 +44,7 @@ import type { Socket } from "socket.io-client";
let FIREBASE_CONFIG: Record<string, any>;
try {
FIREBASE_CONFIG = JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG);
} catch {
} catch (error: any) {
console.warn(
`Error JSON parsing firebase config. Supplied value: ${
import.meta.env.VITE_APP_FIREBASE_CONFIG
@@ -162,7 +162,7 @@ export const saveFilesToFirebase = async ({
cacheControl: `public, max-age=${FILE_CACHE_MAX_AGE_SEC}`,
});
savedFiles.push(id);
} catch {
} catch (error: any) {
erroredFiles.push(id);
}
}),
+1 -1
View File
@@ -181,7 +181,7 @@ const legacy_decodeFromBackend = async ({
const iv = buffer.slice(0, IV_LENGTH_BYTES);
const encrypted = buffer.slice(IV_LENGTH_BYTES, buffer.byteLength);
decrypted = await decryptData(new Uint8Array(iv), encrypted, decryptionKey);
} catch {
} catch (error: any) {
// Fixed IV (old format, backward compatibility)
const fixedIv = new Uint8Array(IV_LENGTH_BYTES);
decrypted = await decryptData(fixedIv, buffer, decryptionKey);
+1 -1
View File
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
+1 -1
View File
@@ -1,4 +1,4 @@
@use "../packages/excalidraw/css/variables.module.scss" as *;
@import "../packages/excalidraw/css/variables.module.scss";
.excalidraw {
--color-primary-contrast-offset: #625ee0; // to offset Chubb illusion
+29 -28
View File
@@ -3,34 +3,6 @@
"version": "1.0.0",
"private": true,
"homepage": ".",
"scripts": {
"build-node": "node ./scripts/build-node.js",
"build:app:docker": "cross-env VITE_APP_DISABLE_SENTRY=true vite build",
"build:app": "cross-env VITE_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA cross-env VITE_APP_ENABLE_TRACKING=true vite build",
"build:version": "node ../scripts/build-version.js",
"build": "yarn build:app && yarn build:version",
"start": "yarn && vite",
"start:production": "yarn build && yarn serve",
"serve": "npx http-server build -a localhost -p 5001 -o",
"build:preview": "yarn build && vite preview --port 5000"
},
"dependencies": {
"@excalidraw/random-username": "1.0.0",
"@sentry/browser": "9.0.1",
"callsites": "4.2.0",
"firebase": "11.3.1",
"i18next-browser-languagedetector": "6.1.4",
"idb-keyval": "6.0.3",
"jotai": "2.11.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"socket.io-client": "4.7.2",
"uqr": "0.1.2",
"vite-plugin-html": "3.2.2"
},
"devDependencies": {
"vite-plugin-sitemap": "0.7.1"
},
"browserslist": {
"production": [
">0.2%",
@@ -52,5 +24,34 @@
},
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@excalidraw/random-username": "1.0.0",
"@sentry/browser": "9.0.1",
"callsites": "4.2.0",
"firebase": "11.3.1",
"i18next-browser-languagedetector": "6.1.4",
"idb-keyval": "6.0.3",
"jotai": "2.11.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"socket.io-client": "4.7.2",
"uqr": "0.1.2",
"vite-plugin-html": "3.2.2"
},
"prettier": "@excalidraw/prettier-config",
"scripts": {
"build-node": "node ./scripts/build-node.js",
"build:app:docker": "cross-env VITE_APP_DISABLE_SENTRY=true vite build",
"build:app": "cross-env VITE_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA cross-env VITE_APP_ENABLE_TRACKING=true vite build",
"build:version": "node ../scripts/build-version.js",
"build": "yarn build:app && yarn build:version",
"start": "yarn && vite",
"start:production": "yarn build && yarn serve",
"serve": "npx http-server build -a localhost -p 5001 -o",
"build:preview": "yarn build && vite preview --port 5000"
},
"devDependencies": {
"vite-plugin-sitemap": "0.7.1"
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
@use "../../packages/excalidraw/css/variables.module.scss" as *;
@import "../../packages/excalidraw/css/variables.module.scss";
.excalidraw {
.ShareDialog {
+2 -2
View File
@@ -73,7 +73,7 @@ const ActiveRoomDialog = ({
const copyRoomLink = async () => {
try {
await copyTextToSystemClipboard(activeRoomLink);
} catch {
} catch (e) {
collabAPI.setCollabError(t("errors.copyToSystemClipboardFailed"));
}
@@ -97,7 +97,7 @@ const ActiveRoomDialog = ({
text: t("roomDialog.shareTitle"),
url: activeRoomLink,
});
} catch {
} catch (error: any) {
// Just ignore.
}
};
+3
View File
@@ -26,6 +26,9 @@ interface ImportMetaEnv {
// Set this flag to false if you want to open the overlay by default
VITE_APP_COLLAPSE_OVERLAY: string;
// Enable eslint in dev server
VITE_APP_ENABLE_ESLINT: string;
// Enable PWA in dev server
VITE_APP_ENABLE_PWA: string;
+4 -6
View File
@@ -5,7 +5,6 @@ import svgrPlugin from "vite-plugin-svgr";
import { ViteEjsPlugin } from "vite-plugin-ejs";
import { VitePWA } from "vite-plugin-pwa";
import checker from "vite-plugin-checker";
import oxlint from "vite-plugin-oxlint";
import { createHtmlPlugin } from "vite-plugin-html";
import Sitemap from "vite-plugin-sitemap";
import { woff2BrowserPlugin } from "../scripts/woff2/woff2-vite-plugins";
@@ -126,16 +125,15 @@ export default defineConfig(({ mode }) => {
react(),
checker({
typescript: true,
eslint:
envVars.VITE_APP_ENABLE_ESLINT === "false"
? undefined
: { lintCommand: 'eslint "./**/*.{js,ts,tsx}"' },
overlay: {
initialIsOpen: envVars.VITE_APP_COLLAPSE_OVERLAY === "false",
badgeStyle: "margin-bottom: 4rem; margin-left: 1rem",
},
}),
oxlint({
configFile: path.resolve(__dirname, "../.oxlintrc.json"),
path: path.resolve(__dirname, ".."),
oxlintPath: path.resolve(__dirname, "../node_modules/.bin/oxlint"),
}),
svgrPlugin(),
ViteEjsPlugin(),
VitePWA({
+53 -47
View File
@@ -1,11 +1,53 @@
{
"name": "excalidraw-monorepo",
"private": true,
"homepage": ".",
"name": "excalidraw-monorepo",
"packageManager": "yarn@1.22.22",
"workspaces": [
"excalidraw-app",
"packages/*"
"packages/*",
"examples/*"
],
"devDependencies": {
"@babel/preset-env": "7.26.9",
"@excalidraw/eslint-config": "1.0.3",
"@excalidraw/prettier-config": "1.0.2",
"@types/chai": "4.3.0",
"@types/jest": "27.4.0",
"@types/lodash.throttle": "4.1.7",
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
"@types/socket.io-client": "3.0.0",
"@vitejs/plugin-react": "3.1.0",
"@vitest/coverage-v8": "3.0.7",
"@vitest/ui": "2.0.5",
"chai": "4.3.6",
"dotenv": "16.0.1",
"eslint-config-prettier": "8.5.0",
"eslint-config-react-app": "7.0.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-prettier": "3.3.1",
"http-server": "14.1.1",
"husky": "7.0.4",
"jsdom": "22.1.0",
"lint-staged": "12.3.7",
"pepjs": "0.5.3",
"prettier": "2.6.2",
"rewire": "6.0.0",
"rimraf": "^5.0.0",
"typescript": "5.9.3",
"vite": "5.0.12",
"vite-plugin-checker": "0.7.2",
"vite-plugin-ejs": "1.7.0",
"vite-plugin-pwa": "0.21.1",
"vite-plugin-svgr": "4.2.0",
"vitest": "3.0.6",
"vitest-canvas-mock": "0.3.3"
},
"engines": {
"node": ">=18.0.0"
},
"homepage": ".",
"prettier": "@excalidraw/prettier-config",
"scripts": {
"build-node": "node ./scripts/build-node.js",
"build:app:docker": "yarn --cwd ./excalidraw-app build:app:docker",
@@ -23,21 +65,21 @@
"start:example": "yarn build:packages && yarn --cwd ./examples/with-script-in-browser start",
"test:all": "yarn test:typecheck && yarn test:code && yarn test:other && yarn test:app --watch=false",
"test:app": "vitest",
"test:code": "oxlint .",
"test:other": "oxfmt --check .",
"test:code": "eslint --max-warnings=0 --ext .js,.ts,.tsx .",
"test:other": "yarn prettier --list-different",
"test:typecheck": "tsc",
"test:update": "yarn test:app --update --watch=false",
"test": "yarn test:app",
"test:coverage": "vitest --coverage",
"test:coverage:watch": "vitest --coverage --watch",
"test:ui": "yarn test --ui --coverage.enabled=true",
"lint": "oxlint",
"lint:type-aware": "oxlint --type-aware",
"lint:fix": "oxlint --fix",
"format:fix": "oxfmt",
"fix": "yarn lint:fix && yarn format:fix",
"fix:code": "yarn test:code --fix",
"fix:other": "yarn prettier --write",
"fix": "yarn fix:other && yarn fix:code",
"locales-coverage": "node scripts/build-locales-coverage.js",
"locales-coverage:description": "node scripts/locales-coverage-description.js",
"prepare": "husky install",
"prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore",
"release": "node scripts/release.js",
"release:test": "node scripts/release.js --tag=test",
"release:next": "node scripts/release.js --tag=next",
@@ -46,43 +88,7 @@
"rm:node_modules": "rimraf --glob node_modules excalidraw-app/node_modules packages/*/node_modules",
"clean-install": "yarn rm:node_modules && yarn install"
},
"devDependencies": {
"@babel/preset-env": "7.26.9",
"@types/chai": "4.3.0",
"@types/jest": "27.4.0",
"@types/lodash.throttle": "4.1.7",
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
"@types/socket.io-client": "3.0.0",
"@vitejs/plugin-react": "3.1.0",
"@vitest/coverage-v8": "3.0.7",
"@vitest/ui": "2.0.5",
"chai": "4.3.6",
"dotenv": "16.0.1",
"http-server": "14.1.1",
"jsdom": "22.1.0",
"lint-staged": "12.3.7",
"oxfmt": "0.26.0",
"oxlint": "1.41.0",
"oxlint-tsgolint": "0.11.1",
"pepjs": "0.5.3",
"rewire": "6.0.0",
"rimraf": "^5.0.0",
"typescript": "5.9.3",
"vite": "5.0.12",
"vite-plugin-checker": "0.7.2",
"vite-plugin-ejs": "1.7.0",
"vite-plugin-oxlint": "github:dwelle/vite-plugin-oxlint",
"vite-plugin-pwa": "0.21.1",
"vite-plugin-svgr": "4.2.0",
"vitest": "3.0.6",
"vitest-canvas-mock": "0.3.3"
},
"resolutions": {
"strip-ansi": "6.0.1"
},
"engines": {
"node": ">=18.0.0"
},
"packageManager": "yarn@1.22.22"
}
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": ["../eslintrc.base.json"]
}
+22 -22
View File
@@ -1,21 +1,10 @@
{
"name": "@excalidraw/common",
"version": "0.18.0",
"description": "Excalidraw common functions, constants, etc.",
"keywords": [
"excalidraw",
"excalidraw-utils"
],
"bugs": "https://github.com/excalidraw/excalidraw/issues",
"license": "MIT",
"repository": "https://github.com/excalidraw/excalidraw",
"files": [
"dist/*"
],
"type": "module",
"types": "./dist/types/common/src/index.d.ts",
"main": "./dist/prod/index.js",
"module": "./dist/prod/index.js",
"types": "./dist/types/common/src/index.d.ts",
"exports": {
".": {
"types": "./dist/types/common/src/index.d.ts",
@@ -30,19 +19,18 @@
"default": "./dist/prod/index.js"
}
},
"files": [
"dist/*"
],
"description": "Excalidraw common functions, constants, etc.",
"publishConfig": {
"access": "public"
},
"scripts": {
"gen:types": "rimraf types && tsc",
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
},
"dependencies": {
"tinycolor2": "1.6.0"
},
"devDependencies": {
"@types/tinycolor2": "1.4.6"
},
"license": "MIT",
"keywords": [
"excalidraw",
"excalidraw-utils"
],
"browserslist": {
"production": [
">0.2%",
@@ -61,5 +49,17 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"bugs": "https://github.com/excalidraw/excalidraw/issues",
"repository": "https://github.com/excalidraw/excalidraw",
"scripts": {
"gen:types": "rimraf types && tsc",
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
},
"dependencies": {
"tinycolor2": "1.6.0"
},
"devDependencies": {
"@types/tinycolor2": "1.4.6"
}
}
+20 -24
View File
@@ -118,15 +118,12 @@ const pick = <R extends Record<string, any>, K extends readonly (keyof R)[]>(
source: R,
keys: K,
) => {
return keys.reduce(
(acc, key: K[number]) => {
if (key in source) {
acc[key] = source[key];
}
return acc;
},
{} as Pick<R, K[number]>,
) as Pick<R, K[number]>;
return keys.reduce((acc, key: K[number]) => {
if (key in source) {
acc[key] = source[key];
}
return acc;
}, {} as Pick<R, K[number]>) as Pick<R, K[number]>;
};
export type ColorTuple = readonly [string, string, string, string, string];
@@ -243,22 +240,21 @@ export const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE = {
// -----------------------------------------------------------------------------
// !!!MUST BE WITHOUT GRAY, TRANSPARENT AND BLACK!!!
export const getAllColorsSpecificShade = (index: 0 | 1 | 2 | 3 | 4) =>
[
// 2nd row
COLOR_PALETTE.cyan[index],
COLOR_PALETTE.blue[index],
COLOR_PALETTE.violet[index],
COLOR_PALETTE.grape[index],
COLOR_PALETTE.pink[index],
export const getAllColorsSpecificShade = (index: 0 | 1 | 2 | 3 | 4) => [
// 2nd row
COLOR_PALETTE.cyan[index],
COLOR_PALETTE.blue[index],
COLOR_PALETTE.violet[index],
COLOR_PALETTE.grape[index],
COLOR_PALETTE.pink[index],
// 3rd row
COLOR_PALETTE.green[index],
COLOR_PALETTE.teal[index],
COLOR_PALETTE.yellow[index],
COLOR_PALETTE.orange[index],
COLOR_PALETTE.red[index],
] as const;
// 3rd row
COLOR_PALETTE.green[index],
COLOR_PALETTE.teal[index],
COLOR_PALETTE.yellow[index],
COLOR_PALETTE.orange[index],
COLOR_PALETTE.red[index],
];
// -----------------------------------------------------------------------------
// other helpers
+2 -2
View File
@@ -193,7 +193,7 @@ export const loadDesktopUIModePreference = () => {
if (stored === "compact" || stored === "full") {
return stored as EditorInterface["desktopUIMode"];
}
} catch {
} catch (error) {
// ignore storage access issues (e.g., Safari private mode)
}
@@ -206,7 +206,7 @@ const persistDesktopUIMode = (mode: EditorInterface["desktopUIMode"]) => {
}
try {
window.localStorage.setItem(DESKTOP_UI_MODE_STORAGE_KEY, mode);
} catch {
} catch (error) {
// ignore storage access issues (e.g., Safari private mode)
}
};
+6 -4
View File
@@ -44,8 +44,9 @@ export type ForwardRef<T, P = any> = Parameters<
CallableType<React.ForwardRefRenderFunction<T, P>>
>[1];
export type ExtractSetType<T extends Set<any>> =
T extends Set<infer U> ? U : never;
export type ExtractSetType<T extends Set<any>> = T extends Set<infer U>
? U
: never;
export type SameType<T, U> = T extends U ? (U extends T ? true : false) : false;
export type Assert<T extends true> = T;
@@ -73,5 +74,6 @@ export type DTO<T> = {
[K in keyof T as T[K] extends Function ? never : K]: T[K];
};
export type MapEntry<M extends Map<any, any>> =
M extends Map<infer K, infer V> ? [K, V] : never;
export type MapEntry<M extends Map<any, any>> = M extends Map<infer K, infer V>
? [K, V]
: never;
+39 -48
View File
@@ -669,13 +669,10 @@ export const arrayToMap = <T extends { id: string } | string>(
if (items instanceof Map) {
return items;
}
return items.reduce(
(acc: Map<string, T>, element) => {
acc.set(typeof element === "string" ? element : element.id, element);
return acc;
},
new Map() as Map<string, T>,
);
return items.reduce((acc: Map<string, T>, element) => {
acc.set(typeof element === "string" ? element : element.id, element);
return acc;
}, new Map() as Map<string, T>);
};
export const arrayToMapWithIndex = <T extends { id: string }>(
@@ -693,13 +690,10 @@ export const arrayToObject = <T>(
array: readonly T[],
groupBy?: (value: T) => string | number,
) =>
array.reduce(
(acc, value, idx) => {
acc[groupBy ? groupBy(value) : idx] = value;
return acc;
},
{} as { [key: string]: T },
);
array.reduce((acc, value, idx) => {
acc[groupBy ? groupBy(value) : idx] = value;
return acc;
}, {} as { [key: string]: T });
/** Doubly linked node */
export type Node<T> = T & {
@@ -807,7 +801,7 @@ export const isPrimitive = (val: any) => {
export const getFrame = () => {
try {
return window.self === window.top ? "top" : "iframe";
} catch {
} catch (error) {
return "iframe";
}
};
@@ -1027,8 +1021,8 @@ export const isMemberOf = <T extends string>(
return collection instanceof Set || collection instanceof Map
? collection.has(value as T)
: "includes" in collection
? collection.includes(value as T)
: collection.hasOwnProperty(value);
? collection.includes(value as T)
: collection.hasOwnProperty(value);
};
export const cloneJSON = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));
@@ -1159,38 +1153,35 @@ export type HasBrand<T> = {
[K in keyof T]: K extends `~brand${infer _}` | "_brand" ? true : never;
}[keyof T];
type RemoveAllBrands<T> =
HasBrand<T> extends true
? {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
[K in keyof T as K extends `~brand~${infer _}` | "_brand"
? never
: K]: T[K];
}
: T;
type RemoveAllBrands<T> = HasBrand<T> extends true
? {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
[K in keyof T as K extends `~brand~${infer _}` | "_brand"
? never
: K]: T[K];
}
: T;
// For accepting values - uses loose matching for branded types
// Preserves readonly modifier: mutable array requires mutable input
type UnbrandForValue<T> =
T extends Map<infer E, infer F>
? Map<UnbrandForValue<E>, UnbrandForValue<F>>
: T extends Set<infer E>
? Set<UnbrandForValue<E>>
: T extends readonly any[]
? T extends any[]
? unknown[] // mutable array - require mutable input
: readonly unknown[] // readonly array - accept readonly input
: RemoveAllBrands<T>;
type UnbrandForValue<T> = T extends Map<infer E, infer F>
? Map<UnbrandForValue<E>, UnbrandForValue<F>>
: T extends Set<infer E>
? Set<UnbrandForValue<E>>
: T extends readonly any[]
? T extends any[]
? unknown[] // mutable array - require mutable input
: readonly unknown[] // readonly array - accept readonly input
: RemoveAllBrands<T>;
// For return types - preserves array element unbranding
export type Unbrand<T> =
T extends Map<infer E, infer F>
? Map<Unbrand<E>, Unbrand<F>>
: T extends Set<infer E>
? Set<Unbrand<E>>
: T extends readonly (infer E)[]
? Array<Unbrand<E>>
: RemoveAllBrands<T>;
export type Unbrand<T> = T extends Map<infer E, infer F>
? Map<Unbrand<E>, Unbrand<F>>
: T extends Set<infer E>
? Set<Unbrand<E>>
: T extends readonly (infer E)[]
? Array<Unbrand<E>>
: RemoveAllBrands<T>;
export type CombineBrands<BrandedType, CurrentType> =
BrandedType extends readonly (infer BE)[]
@@ -1202,8 +1193,8 @@ export type CombineBrands<BrandedType, CurrentType> =
export type CombineBrandsIfNeeded<T, Required> = [T] extends [Required]
? T[]
: HasBrand<T> extends true
? CombineBrands<T, Required>[]
: Required[];
? CombineBrands<T, Required>[]
: Required[];
/**
* Makes type into a branded type, ensuring that value is assignable to
@@ -1270,8 +1261,8 @@ export const sizeOf = (
return isReadonlyArray(value)
? value.length
: value instanceof Map || value instanceof Set
? value.size
: Object.keys(value).length;
? value.size
: Object.keys(value).length;
};
export const reduceToCommonValue = <T, R = T>(
+3
View File
@@ -0,0 +1,3 @@
{
"extends": ["../eslintrc.base.json"]
}
+20 -20
View File
@@ -1,21 +1,10 @@
{
"name": "@excalidraw/element",
"version": "0.18.0",
"description": "Excalidraw elements-related logic",
"keywords": [
"excalidraw",
"excalidraw-utils"
],
"bugs": "https://github.com/excalidraw/excalidraw/issues",
"license": "MIT",
"repository": "https://github.com/excalidraw/excalidraw",
"files": [
"dist/*"
],
"type": "module",
"types": "./dist/types/element/src/index.d.ts",
"main": "./dist/prod/index.js",
"module": "./dist/prod/index.js",
"types": "./dist/types/element/src/index.d.ts",
"exports": {
".": {
"types": "./dist/types/element/src/index.d.ts",
@@ -36,17 +25,18 @@
"default": "./dist/prod/visualdebug.js"
}
},
"files": [
"dist/*"
],
"description": "Excalidraw elements-related logic",
"publishConfig": {
"access": "public"
},
"scripts": {
"gen:types": "rimraf types && tsc",
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
},
"dependencies": {
"@excalidraw/common": "0.18.0",
"@excalidraw/math": "0.18.0"
},
"license": "MIT",
"keywords": [
"excalidraw",
"excalidraw-utils"
],
"browserslist": {
"production": [
">0.2%",
@@ -65,5 +55,15 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"bugs": "https://github.com/excalidraw/excalidraw/issues",
"repository": "https://github.com/excalidraw/excalidraw",
"scripts": {
"gen:types": "rimraf types && tsc",
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
},
"dependencies": {
"@excalidraw/common": "0.18.0",
"@excalidraw/math": "0.18.0"
}
}
+3 -1
View File
@@ -90,7 +90,7 @@ const hashSelectionOpts = (
type _ = Assert<
SameType<
Required<HashableKeys>,
Pick<Required<HashableKeys>, (typeof keys)[number]>
Pick<Required<HashableKeys>, typeof keys[number]>
>
>;
@@ -438,6 +438,8 @@ export class Scene {
options: {
informMutation: boolean;
isDragging: boolean;
isBindingEnabled?: boolean;
isMidpointSnappingEnabled?: boolean;
} = {
informMutation: true,
isDragging: false,
+3 -3
View File
@@ -258,8 +258,8 @@ export const handleFocusPointDrag = (
switchToInsideBinding && arrow[bindingField]?.mode === "orbit"
? "inside"
: !switchToInsideBinding && arrow[bindingField]?.mode === "inside"
? "orbit"
: null;
? "orbit"
: null;
// If no existing binding, create it
if (!arrow[bindingField] || newMode) {
@@ -473,7 +473,7 @@ export const handleFocusPointPointerUp = (
if (boundElement) {
scene.mutateElement(boundElement, {
boundElements: [
...(boundElement.boundElements || []).filter(
...(boundElement.boundElements || [])?.filter(
({ id }) => id !== arrow.id,
),
{
+108 -74
View File
@@ -1,5 +1,4 @@
import {
KEYS,
arrayToMap,
getFeatureFlag,
invariant,
@@ -137,12 +136,6 @@ export const maxBindingDistance_simple = (zoom?: AppState["zoom"]): number => {
);
};
export const shouldEnableBindingForPointerEvent = (
event: React.PointerEvent<HTMLElement>,
) => {
return !event[KEYS.CTRL_OR_CMD];
};
export const isBindingEnabled = (appState: {
isBindingEnabled: AppState["isBindingEnabled"];
}): boolean => {
@@ -177,8 +170,20 @@ export const bindOrUnbindBindingElement = (
},
);
bindOrUnbindBindingElementEdge(arrow, start, "start", scene);
bindOrUnbindBindingElementEdge(arrow, end, "end", scene);
bindOrUnbindBindingElementEdge(
arrow,
start,
"start",
scene,
appState.isBindingEnabled,
);
bindOrUnbindBindingElementEdge(
arrow,
end,
"end",
scene,
appState.isBindingEnabled,
);
if (start.focusPoint || end.focusPoint) {
// If the strategy dictates a focus point override, then
// update the arrow points to point to the focus point.
@@ -221,12 +226,21 @@ const bindOrUnbindBindingElementEdge = (
{ mode, element, focusPoint }: BindingStrategy,
startOrEnd: "start" | "end",
scene: Scene,
shouldSnapToOutline = true,
): void => {
if (mode === null) {
// null means break the binding
unbindBindingElement(arrow, startOrEnd, scene);
} else if (mode !== undefined) {
bindBindingElement(arrow, element, mode, startOrEnd, scene, focusPoint);
bindBindingElement(
arrow,
element,
mode,
startOrEnd,
scene,
focusPoint,
shouldSnapToOutline,
);
}
};
@@ -392,7 +406,7 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
element: otherElement,
focusPoint: shiftKey
? elementCenterPoint(otherElement, elementsMap)
: (origin ?? pointFrom<GlobalPoint>(arrow.x, arrow.y)),
: origin ?? pointFrom<GlobalPoint>(arrow.x, arrow.y),
};
// We are hovering another element with the end point
@@ -523,35 +537,41 @@ const bindingStrategyForSimpleArrowEndpointDragging_complex = (
}
// The opposite binding is inside the same element
// eslint-disable-next-line no-else-return
current = { element: hit, mode: "inside", focusPoint: point };
else {
current = { element: hit, mode: "inside", focusPoint: point };
return { current, other: isMultiPoint ? { mode: undefined } : other };
return { current, other: isMultiPoint ? { mode: undefined } : other };
}
}
// The opposite binding is on a different element (or nested)
// eslint-disable-next-line no-else-return
// Handle the nested element case
if (isOverlapping && oppositeElement && !otherIsTransparent) {
current = {
element: oppositeElement,
mode: "inside",
focusPoint: point,
};
} else {
current = {
element: hit,
mode: "orbit",
focusPoint: isNested ? point : point,
};
}
else {
// Handle the nested element case
if (isOverlapping && oppositeElement && !otherIsTransparent) {
current = {
element: oppositeElement,
mode: "inside",
focusPoint: point,
};
} else {
current = {
element: hit,
mode: "orbit",
focusPoint: isNested ? point : point,
};
}
return { current, other: isMultiPoint ? { mode: undefined } : other };
return { current, other: isMultiPoint ? { mode: undefined } : other };
}
}
// The opposite binding is on a different element or no binding
current = {
element: hit,
mode: "orbit",
focusPoint: point,
};
else {
current = {
element: hit,
mode: "orbit",
focusPoint: point,
};
}
// Must return as only one endpoint is dragged, therefore
// the end binding strategy might accidentally gets overriden
@@ -727,13 +747,13 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = (
focusPoint: startDragged
? globalPoint
: // NOTE: Can only affect the start point because new arrows always drag the end point
opts?.newArrow
? appState.selectedLinearElement!.initialState.origin!
: LinearElementEditor.getPointAtIndexGlobalCoordinates(
arrow,
0,
elementsMap,
), // startFixedPoint,
opts?.newArrow
? appState.selectedLinearElement!.initialState.origin!
: LinearElementEditor.getPointAtIndexGlobalCoordinates(
arrow,
0,
elementsMap,
), // startFixedPoint,
},
end: {
mode: "inside",
@@ -792,6 +812,7 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = (
startDragged ? "start" : "end",
elementsMap,
appState.zoom,
appState.isMidpointSnappingEnabled,
) || globalPoint,
}
: { mode: null };
@@ -825,20 +846,21 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = (
focusPoint: appState.selectedLinearElement.initialState.altFocusPoint,
}
: opts?.angleLocked && otherBindableElement
? {
mode: "orbit",
element: otherBindableElement,
focusPoint:
projectFixedPointOntoDiagonal(
arrow,
otherEndpoint,
otherBindableElement,
startDragged ? "end" : "start",
elementsMap,
appState.zoom,
) || otherEndpoint,
}
: { mode: undefined }
? {
mode: "orbit",
element: otherBindableElement,
focusPoint:
projectFixedPointOntoDiagonal(
arrow,
otherEndpoint,
otherBindableElement,
startDragged ? "end" : "start",
elementsMap,
appState.zoom,
appState.isMidpointSnappingEnabled,
) || otherEndpoint,
}
: { mode: undefined }
: { mode: undefined };
return {
@@ -999,6 +1021,7 @@ export const bindBindingElement = (
startOrEnd: "start" | "end",
scene: Scene,
focusPoint?: GlobalPoint,
shouldSnapToOutline = true,
): void => {
const elementsMap = scene.getNonDeletedElementsMap();
@@ -1013,6 +1036,7 @@ export const bindBindingElement = (
hoveredElement,
startOrEnd,
elementsMap,
shouldSnapToOutline,
),
};
} else {
@@ -1346,6 +1370,7 @@ export const bindPointToSnapToElementOutline = (
startOrEnd: "start" | "end",
elementsMap: ElementsMap,
customIntersector?: LineSegment<GlobalPoint>,
isMidpointSnappingEnabled = true,
): GlobalPoint => {
const elbowed = isElbowArrow(arrowElement);
const point = LinearElementEditor.getPointAtIndexGlobalCoordinates(
@@ -1385,13 +1410,9 @@ export const bindPointToSnapToElementOutline = (
const isHorizontal = headingIsHorizontal(
headingForPointFromElement(bindableElement, aabb, point),
);
const snapPoint = snapToMid(
bindableElement,
elementsMap,
edgePoint,
0.05,
arrowElement,
);
const snapPoint = isMidpointSnappingEnabled
? snapToMid(bindableElement, elementsMap, edgePoint, 0.05, arrowElement)
: undefined;
const resolved = snapPoint || point;
const otherPoint = pointFrom<GlobalPoint>(
isHorizontal ? bindableCenter[0] : resolved[0],
@@ -1770,10 +1791,13 @@ export const updateBoundPoint = (
);
const otherArrowPoint = LinearElementEditor.getPointAtIndexGlobalCoordinates(
arrow,
startOrEnd === "startBinding" ? -1 : 0,
startOrEnd === "startBinding" ? 1 : -2,
elementsMap,
);
const otherFocusPointOrArrowPoint = otherFocusPoint || otherArrowPoint;
const otherFocusPointOrArrowPoint =
arrow.points.length === 2
? otherFocusPoint || otherArrowPoint
: otherArrowPoint;
const intersector =
otherFocusPointOrArrowPoint &&
lineSegment(focusPoint, otherFocusPointOrArrowPoint);
@@ -1849,8 +1873,8 @@ export const updateBoundPoint = (
return LinearElementEditor.createPointAt(
arrow,
elementsMap,
arrowTooShort ? focusPoint[0] : (outlinePoint?.[0] ?? focusPoint[0]),
arrowTooShort ? focusPoint[1] : (outlinePoint?.[1] ?? focusPoint[1]),
arrowTooShort ? focusPoint[0] : outlinePoint?.[0] ?? focusPoint[0],
arrowTooShort ? focusPoint[1] : outlinePoint?.[1] ?? focusPoint[1],
null,
);
}
@@ -1883,6 +1907,8 @@ export const calculateFixedPointForElbowArrowBinding = (
hoveredElement: ExcalidrawBindableElement,
startOrEnd: "start" | "end",
elementsMap: ElementsMap,
shouldSnapToOutline = true,
isMidpointSnappingEnabled = true,
): { fixedPoint: FixedPoint } => {
const bounds = [
hoveredElement.x,
@@ -1890,12 +1916,20 @@ export const calculateFixedPointForElbowArrowBinding = (
hoveredElement.x + hoveredElement.width,
hoveredElement.y + hoveredElement.height,
] as Bounds;
const snappedPoint = bindPointToSnapToElementOutline(
linearElement,
hoveredElement,
startOrEnd,
elementsMap,
);
const snappedPoint = shouldSnapToOutline
? bindPointToSnapToElementOutline(
linearElement,
hoveredElement,
startOrEnd,
elementsMap,
undefined,
isMidpointSnappingEnabled,
)
: LinearElementEditor.getPointAtIndexGlobalCoordinates(
linearElement,
startOrEnd === "start" ? 0 : -1,
elementsMap,
);
const globalMidPoint = pointFrom(
bounds[0] + (bounds[2] - bounds[0]) / 2,
bounds[1] + (bounds[3] - bounds[1]) / 2,
@@ -2055,9 +2089,9 @@ const newBoundElements = (
nextBoundElements.push(
...elementsToAdd.map(
(x) =>
({ id: x.id, type: x.type }) as
({ id: x.id, type: x.type } as
| ExcalidrawArrowElement
| ExcalidrawTextElement,
| ExcalidrawTextElement),
),
);
@@ -2541,7 +2575,7 @@ const SHAPE_CONFIGS: Record<ShapeType, SectorConfig[]> = {
const getSectorBoundaries = (
config: SectorConfig[],
): Array<{ start: number; end: number; side: Side }> => {
return config.map((sector) => {
return config.map((sector, index) => {
const halfWidth = sector.sectorWidth / 2;
let start = sector.centerAngle - halfWidth;
let end = sector.centerAngle + halfWidth;
+10 -10
View File
@@ -467,7 +467,6 @@ export class Delta<T> {
} else {
assertNever(
join,
// oxlint-disable-next-line typescript/restrict-template-expressions
`Unknown distinctKeysIterator's join param "${join}"`,
true,
);
@@ -861,7 +860,6 @@ export class AppStateDelta implements DeltaContainer<AppState> {
default:
assertNever(
key,
// oxlint-disable-next-line typescript/restrict-template-expressions
`Unknown ObservedElementsAppState's key "${key}"`,
true,
);
@@ -976,7 +974,7 @@ export class AppStateDelta implements DeltaContainer<AppState> {
inserted,
"selectedElementIds",
// ts language server has a bit trouble resolving this, so we are giving it a little push
() => true as ValueOf<T["selectedElementIds"]>,
(_) => true as ValueOf<T["selectedElementIds"]>,
);
Delta.diffObjects(
deleted,
@@ -997,8 +995,9 @@ export class AppStateDelta implements DeltaContainer<AppState> {
if (isTestEnv() || isDevEnv()) {
throw e;
}
} finally {
return [deleted, inserted];
}
return [deleted, inserted];
}
private static orderAppStateKeys(partial: Partial<ObservedAppState>) {
@@ -1334,7 +1333,6 @@ export class ElementsDelta implements DeltaContainer<SceneElementsMap> {
for (const key of Object.keys(partial) as Array<keyof typeof partial>) {
// do not update following props:
// - `boundElements`, as it is a reference value which is postprocessed to contain only deleted/inserted keys
// oxlint-disable-next-line typescript/switch-exhaustiveness-check
switch (key) {
case "boundElements":
latestPartial[key] = partial[key];
@@ -1461,8 +1459,9 @@ export class ElementsDelta implements DeltaContainer<SceneElementsMap> {
if (isTestEnv() || isDevEnv()) {
throw e;
}
} finally {
return [nextElements, flags.containsVisibleDifference];
}
return [nextElements, flags.containsVisibleDifference];
}
public squash(delta: ElementsDelta): this {
@@ -1803,7 +1802,7 @@ export class ElementsDelta implements DeltaContainer<SceneElementsMap> {
// updated delta is affecting the binding only in case it contains changed binding or bindable property
for (const [id] of Array.from(Object.entries(this.updated)).filter(
([, delta]) =>
([_, delta]) =>
Object.keys({ ...delta.deleted, ...delta.inserted }).find((prop) =>
bindingProperties.has(prop as BindingProp | BindableProp),
),
@@ -1909,8 +1908,9 @@ export class ElementsDelta implements DeltaContainer<SceneElementsMap> {
if (isTestEnv() || isDevEnv()) {
throw e;
}
} finally {
return nextElements;
}
return nextElements;
}
private static redrawTextBoundingBoxes(
@@ -2051,9 +2051,9 @@ export class ElementsDelta implements DeltaContainer<SceneElementsMap> {
if (isTestEnv() || isDevEnv()) {
throw e;
}
} finally {
return [deleted, inserted];
}
return [deleted, inserted];
}
private static stripIrrelevantProps(
+45 -38
View File
@@ -255,12 +255,11 @@ const handleSegmentRenormalization = (
);
}
if (isDevEnv()) {
isDevEnv() &&
invariant(
validateElbowPoints(nextPoints),
"Invalid elbow points with fixed segments",
);
}
return normalizeArrowElementUpdate(
nextPoints,
@@ -522,8 +521,8 @@ const handleSegmentMove = (
? segmentLength / 2
: BASE_PADDING
: segmentIsTooShort
? -segmentLength / 2
: -BASE_PADDING;
? -segmentLength / 2
: -BASE_PADDING;
fixedSegments[activelyModifiedSegmentIdx].start = pointFrom<LocalPoint>(
fixedSegments[activelyModifiedSegmentIdx].start[0] +
(startIsHorizontal ? padding : 0),
@@ -548,8 +547,8 @@ const handleSegmentMove = (
? segmentLength / 2
: BASE_PADDING
: segmentIsTooShort
? -segmentLength / 2
: -BASE_PADDING;
? -segmentLength / 2
: -BASE_PADDING;
fixedSegments[activelyModifiedSegmentIdx].end = pointFrom<LocalPoint>(
fixedSegments[activelyModifiedSegmentIdx].end[0] +
(endIsHorizontal ? padding : 0),
@@ -572,7 +571,7 @@ const handleSegmentMove = (
}));
// For start, clone old arrow points
const newPoints: GlobalPoint[] = arrow.points.map((p) =>
const newPoints: GlobalPoint[] = arrow.points.map((p, i) =>
pointFrom<GlobalPoint>(arrow.x + p[0], arrow.y + p[1]),
);
@@ -721,11 +720,11 @@ const handleEndpointDrag = (
i === 0
? pointFrom<GlobalPoint>(arrow.x + p[0], arrow.y + p[1])
: i === updatedPoints.length - 1
? pointFrom<GlobalPoint>(arrow.x + p[0], arrow.y + p[1])
: pointFrom<GlobalPoint>(
arrow.x + arrow.points[i][0],
arrow.y + arrow.points[i][1],
),
? pointFrom<GlobalPoint>(arrow.x + p[0], arrow.y + p[1])
: pointFrom<GlobalPoint>(
arrow.x + arrow.points[i][0],
arrow.y + arrow.points[i][1],
),
);
const nextFixedSegments = fixedSegments.map((segment) => ({
...segment,
@@ -916,6 +915,8 @@ export const updateElbowArrowPoints = (
},
options?: {
isDragging?: boolean;
isBindingEnabled?: boolean;
isMidpointSnappingEnabled?: boolean;
},
): ElementUpdate<ExcalidrawElbowArrowElement> => {
if (arrow.points.length < 2) {
@@ -983,8 +984,8 @@ export const updateElbowArrowPoints = (
idx === 0
? updates.points![0]
: idx === arrow.points.length - 1
? updates.points![1]
: p,
? updates.points![1]
: p,
)
: updates.points.slice()
: arrow.points.slice();
@@ -1203,6 +1204,8 @@ const getElbowArrowData = (
options?: {
isDragging?: boolean;
zoom?: AppState["zoom"];
isBindingEnabled?: boolean;
isMidpointSnappingEnabled?: boolean;
},
) => {
const origStartGlobalPoint: GlobalPoint = pointTranslate<
@@ -1216,7 +1219,7 @@ const getElbowArrowData = (
let hoveredStartElement = null;
let hoveredEndElement = null;
if (options?.isDragging) {
if (options?.isDragging && options?.isBindingEnabled !== false) {
const elements = Array.from(elementsMap.values());
hoveredStartElement =
getHoveredElement(
@@ -1256,6 +1259,8 @@ const getElbowArrowData = (
hoveredStartElement,
elementsMap,
options?.isDragging,
options?.isBindingEnabled,
options?.isMidpointSnappingEnabled,
);
const endGlobalPoint = getGlobalPoint(
{
@@ -1271,6 +1276,8 @@ const getElbowArrowData = (
hoveredEndElement,
elementsMap,
options?.isDragging,
options?.isBindingEnabled,
options?.isMidpointSnappingEnabled,
);
const startHeading = getBindPointHeading(
startGlobalPoint,
@@ -1490,12 +1497,8 @@ const routeElbowArrow = (
node.pos[0],
node.pos[1],
]) as GlobalPoint[];
if (startDongle) {
points.unshift(startGlobalPoint);
}
if (endDongle) {
points.push(endGlobalPoint);
}
startDongle && points.unshift(startGlobalPoint);
endDongle && points.push(endGlobalPoint);
return points;
}
@@ -1685,29 +1688,29 @@ const generateDynamicAABBs = (
? Math.min((startEl[0] + endEl[2]) / 2, a[0] - startLeft)
: (startEl[0] + endEl[2]) / 2
: a[0] > b[0]
? a[0] - startLeft
: common[0] - startLeft,
? a[0] - startLeft
: common[0] - startLeft,
a[1] > b[3]
? a[0] > b[2] || a[2] < b[0]
? Math.min((startEl[1] + endEl[3]) / 2, a[1] - startUp)
: (startEl[1] + endEl[3]) / 2
: a[1] > b[1]
? a[1] - startUp
: common[1] - startUp,
? a[1] - startUp
: common[1] - startUp,
a[2] < b[0]
? a[1] > b[3] || a[3] < b[1]
? Math.max((startEl[2] + endEl[0]) / 2, a[2] + startRight)
: (startEl[2] + endEl[0]) / 2
: a[2] < b[2]
? a[2] + startRight
: common[2] + startRight,
? a[2] + startRight
: common[2] + startRight,
a[3] < b[1]
? a[0] > b[2] || a[2] < b[0]
? Math.max((startEl[3] + endEl[1]) / 2, a[3] + startDown)
: (startEl[3] + endEl[1]) / 2
: a[3] < b[3]
? a[3] + startDown
: common[3] + startDown,
? a[3] + startDown
: common[3] + startDown,
] as Bounds;
const second = [
b[0] > a[2]
@@ -1715,29 +1718,29 @@ const generateDynamicAABBs = (
? Math.min((endEl[0] + startEl[2]) / 2, b[0] - endLeft)
: (endEl[0] + startEl[2]) / 2
: b[0] > a[0]
? b[0] - endLeft
: common[0] - endLeft,
? b[0] - endLeft
: common[0] - endLeft,
b[1] > a[3]
? b[0] > a[2] || b[2] < a[0]
? Math.min((endEl[1] + startEl[3]) / 2, b[1] - endUp)
: (endEl[1] + startEl[3]) / 2
: b[1] > a[1]
? b[1] - endUp
: common[1] - endUp,
? b[1] - endUp
: common[1] - endUp,
b[2] < a[0]
? b[1] > a[3] || b[3] < a[1]
? Math.max((endEl[2] + startEl[0]) / 2, b[2] + endRight)
: (endEl[2] + startEl[0]) / 2
: b[2] < a[2]
? b[2] + endRight
: common[2] + endRight,
? b[2] + endRight
: common[2] + endRight,
b[3] < a[1]
? b[0] > a[2] || b[2] < a[0]
? Math.max((endEl[3] + startEl[1]) / 2, b[3] + endDown)
: (endEl[3] + startEl[1]) / 2
: b[3] < a[3]
? b[3] + endDown
: common[3] + endDown,
? b[3] + endDown
: common[3] + endDown,
] as Bounds;
const c = commonAABB([first, second]);
@@ -2218,14 +2221,18 @@ const getGlobalPoint = (
element?: ExcalidrawBindableElement | null,
elementsMap?: ElementsMap,
isDragging?: boolean,
isBindingEnabled = true,
isMidpointSnappingEnabled = true,
): GlobalPoint => {
if (isDragging) {
if (element && elementsMap) {
if (isBindingEnabled && element && elementsMap) {
return bindPointToSnapToElementOutline(
arrow,
element,
startOrEnd,
elementsMap,
undefined,
isMidpointSnappingEnabled,
);
}
+2 -2
View File
@@ -13,7 +13,7 @@ import type { ExcalidrawElement } from "./types";
export const defaultGetElementLinkFromSelection: Exclude<
AppProps["generateLinkForSelection"],
undefined
> = (id) => {
> = (id, type) => {
const url = window.location.href;
try {
@@ -86,7 +86,7 @@ export const isElementLink = (url: string) => {
_url.searchParams.has(ELEMENT_LINK_KEY) &&
_url.host === window.location.host
);
} catch {
} catch (error) {
return false;
}
};
+3 -3
View File
@@ -63,7 +63,7 @@ const parseYouTubeLikeTimestamp = (url: string): number => {
const urlObj = new URL(url.startsWith("http") ? url : `https://${url}`);
timeParam =
urlObj.searchParams.get("t") || urlObj.searchParams.get("start");
} catch {
} catch (error) {
const timeMatch = url.match(/[?&#](?:t|start)=([^&#\s]+)/);
timeParam = timeMatch?.[1];
}
@@ -125,7 +125,7 @@ const parseGoogleDriveVideoLink = (
// normalize to seconds for a stable preview URL.
timestamp: timestamp > 0 ? timestamp : undefined,
};
} catch {
} catch (error) {
return null;
}
};
@@ -465,7 +465,7 @@ const matchHostname = (
if (bareDomain === bareAllowedHostname) {
return bareAllowedHostname;
}
} catch {
} catch (error) {
// ignore
}
return null;
+4 -4
View File
@@ -198,8 +198,8 @@ const getOffsets = (
linkedNodes.length === 0
? 0
: (linkedNodes.length + 1) % 2 === 0
? ((linkedNodes.length + 1) / 2) * _HORIZONTAL_OFFSET
: (linkedNodes.length / 2) * _HORIZONTAL_OFFSET * -1;
? ((linkedNodes.length + 1) / 2) * _HORIZONTAL_OFFSET
: (linkedNodes.length / 2) * _HORIZONTAL_OFFSET * -1;
if (direction === "up") {
return {
@@ -222,8 +222,8 @@ const getOffsets = (
linkedNodes.length === 0
? 0
: (linkedNodes.length + 1) % 2 === 0
? ((linkedNodes.length + 1) / 2) * _VERTICAL_OFFSET
: (linkedNodes.length / 2) * _VERTICAL_OFFSET * -1;
? ((linkedNodes.length + 1) / 2) * _VERTICAL_OFFSET
: (linkedNodes.length / 2) * _VERTICAL_OFFSET * -1;
if (direction === "left") {
return {
+1 -1
View File
@@ -187,7 +187,7 @@ export const syncMovedIndices = (
for (const [element, { index }] of elementsUpdates) {
mutateElement(element, elementsMap, { index });
}
} catch {
} catch (e) {
// fallback to default sync
syncInvalidIndices(elements);
}
+1 -1
View File
@@ -797,7 +797,7 @@ export const isElementInFrame = (
for (const gid of _element.groupIds) {
if (opts?.checkedGroups?.has(gid)) {
return opts.checkedGroups.get(gid)!;
return opts.checkedGroups.get(gid)!!;
}
}
+4 -4
View File
@@ -231,8 +231,8 @@ export const getSelectedGroupIds = (
appState: InteractiveCanvasAppState,
): GroupId[] =>
Object.entries(appState.selectedGroupIds)
.filter(([, isSelected]) => isSelected)
.map(([groupId]) => groupId);
.filter(([groupId, isSelected]) => isSelected)
.map(([groupId, isSelected]) => groupId);
// given a list of elements, return the the actual group ids that should be selected
// or used to update the elements
@@ -325,8 +325,8 @@ export const getMaximumGroups = (
elements: ExcalidrawElement[],
elementsMap: ElementsMap,
): ExcalidrawElement[][] => {
const groups: Map<string, ExcalidrawElement[]> = new Map<
string,
const groups: Map<String, ExcalidrawElement[]> = new Map<
String,
ExcalidrawElement[]
>();
elements.forEach((element: ExcalidrawElement) => {
+10 -10
View File
@@ -268,16 +268,16 @@ export const headingForPointFromElement = <Point extends GlobalPoint>(
)
? HEADING_UP
: triangleIncludesPoint<Point>(
[topRight, bottomRight, midPoint] as Triangle<Point>,
p,
)
? HEADING_RIGHT
: triangleIncludesPoint<Point>(
[bottomRight, bottomLeft, midPoint] as Triangle<Point>,
p,
)
? HEADING_DOWN
: HEADING_LEFT;
[topRight, bottomRight, midPoint] as Triangle<Point>,
p,
)
? HEADING_RIGHT
: triangleIncludesPoint<Point>(
[bottomRight, bottomLeft, midPoint] as Triangle<Point>,
p,
)
? HEADING_DOWN
: HEADING_LEFT;
};
export const flipHeading = (h: Heading): Heading =>
+1 -1
View File
@@ -69,7 +69,7 @@ export const updateImageCache = async ({
const image = await imagePromise;
imageCache.set(fileId, { ...data, image });
} catch {
} catch (error: any) {
erroredFiles.set(fileId, true);
}
})(),
+98 -66
View File
@@ -359,11 +359,20 @@ export class LinearElementEditor {
linearElementEditor,
);
LinearElementEditor.movePoints(element, app.scene, positions, {
startBinding: updates?.startBinding,
endBinding: updates?.endBinding,
moveMidPointsWithElement: updates?.moveMidPointsWithElement,
});
LinearElementEditor.movePoints(
element,
app.scene,
positions,
{
startBinding: updates?.startBinding,
endBinding: updates?.endBinding,
moveMidPointsWithElement: updates?.moveMidPointsWithElement,
},
{
isBindingEnabled: app.state.isBindingEnabled,
isMidpointSnappingEnabled: app.state.isMidpointSnappingEnabled,
},
);
// Set the suggested binding from the updates if available
if (isBindingElement(element, false)) {
if (isBindingEnabled(app.state)) {
@@ -418,6 +427,7 @@ export class LinearElementEditor {
"start",
elementsMap,
app.state.zoom,
app.state.isMidpointSnappingEnabled,
)
: linearElementEditor.initialState.altFocusPoint,
},
@@ -538,11 +548,20 @@ export class LinearElementEditor {
linearElementEditor,
);
LinearElementEditor.movePoints(element, app.scene, positions, {
startBinding: updates?.startBinding,
endBinding: updates?.endBinding,
moveMidPointsWithElement: updates?.moveMidPointsWithElement,
});
LinearElementEditor.movePoints(
element,
app.scene,
positions,
{
startBinding: updates?.startBinding,
endBinding: updates?.endBinding,
moveMidPointsWithElement: updates?.moveMidPointsWithElement,
},
{
isBindingEnabled: app.state.isBindingEnabled,
isMidpointSnappingEnabled: app.state.isMidpointSnappingEnabled,
},
);
// Set the suggested binding from the updates if available
if (isBindingElement(element, false)) {
@@ -614,10 +633,10 @@ export class LinearElementEditor {
updates?.suggestedBinding?.element.id !== startBindingElement.id // The end point is not hovering the start bindable + it's binding gap
? startBindingElement
: startIsSelected && // The "other" end (i.e. "start") is dragged
endBindingElement &&
updates?.suggestedBinding?.element.id !== endBindingElement.id // The start point is not hovering the end bindable + it's binding gap
? endBindingElement
: null;
endBindingElement &&
updates?.suggestedBinding?.element.id !== endBindingElement.id // The start point is not hovering the end bindable + it's binding gap
? endBindingElement
: null;
const newLinearElementEditor: LinearElementEditor = {
...linearElementEditor,
@@ -636,6 +655,7 @@ export class LinearElementEditor {
"start",
elementsMap,
app.state.zoom,
app.state.isMidpointSnappingEnabled,
)
: linearElementEditor.initialState.altFocusPoint,
},
@@ -730,8 +750,8 @@ export class LinearElementEditor {
)
: selectedPointsIndices
: selectedPointsIndices?.includes(pointerDownState.lastClickedPoint)
? [pointerDownState.lastClickedPoint]
: selectedPointsIndices,
? [pointerDownState.lastClickedPoint]
: selectedPointsIndices,
isDragging: false,
customLineAngle: null,
initialState: {
@@ -984,7 +1004,7 @@ export class LinearElementEditor {
const appState = app.state;
const elementsMap = scene.getNonDeletedElementsMap();
const ret: ReturnType<(typeof LinearElementEditor)["handlePointerDown"]> = {
const ret: ReturnType<typeof LinearElementEditor["handlePointerDown"]> = {
didAddPoint: false,
hitElement: null,
linearElementEditor: null,
@@ -1524,6 +1544,10 @@ export class LinearElementEditor {
endBinding?: FixedPointBinding | null;
moveMidPointsWithElement?: boolean | null;
},
options?: {
isBindingEnabled?: boolean;
isMidpointSnappingEnabled?: boolean;
},
) {
const { points } = element;
@@ -1592,6 +1616,8 @@ export class LinearElementEditor {
otherUpdates,
{
isDragging: Array.from(pointUpdates.values()).some((t) => t.isDragging),
isBindingEnabled: options?.isBindingEnabled,
isMidpointSnappingEnabled: options?.isMidpointSnappingEnabled,
},
);
}
@@ -1706,6 +1732,8 @@ export class LinearElementEditor {
isDragging?: boolean;
zoom?: AppState["zoom"];
sceneElementsMap?: NonDeletedSceneElementsMap;
isBindingEnabled?: boolean;
isMidpointSnappingEnabled?: boolean;
},
) {
if (isElbowArrow(element)) {
@@ -1726,6 +1754,8 @@ export class LinearElementEditor {
scene.mutateElement(element, updates, {
informMutation: true,
isDragging: options?.isDragging ?? false,
isBindingEnabled: options?.isBindingEnabled,
isMidpointSnappingEnabled: options?.isMidpointSnappingEnabled,
});
} else {
// TODO do we need to get precise coords here just to calc centers?
@@ -2136,8 +2166,8 @@ const pointDraggingUpdates = (
const suggestedBindingElement = startIsDragged
? start.element
: endIsDragged
? end.element
: null;
? end.element
: null;
return {
positions: naiveDraggingPoints,
@@ -2145,14 +2175,16 @@ const pointDraggingUpdates = (
suggestedBinding: suggestedBindingElement
? {
element: suggestedBindingElement,
midPoint: snapToMid(
suggestedBindingElement,
elementsMap,
pointFrom<GlobalPoint>(
scenePointerX - linearElementEditor.pointerOffset.x,
scenePointerY - linearElementEditor.pointerOffset.y,
),
),
midPoint: app.state.isMidpointSnappingEnabled
? snapToMid(
suggestedBindingElement,
elementsMap,
pointFrom<GlobalPoint>(
scenePointerX - linearElementEditor.pointerOffset.x,
scenePointerY - linearElementEditor.pointerOffset.y,
),
)
: undefined,
}
: null,
},
@@ -2328,14 +2360,14 @@ const pointDraggingUpdates = (
updates.startBinding === undefined
? element.startBinding
: updates.startBinding === null
? null
: updates.startBinding,
? null
: updates.startBinding,
endBinding:
updates.endBinding === undefined
? element.endBinding
: updates.endBinding === null
? null
: updates.endBinding,
? null
: updates.endBinding,
};
// Needed to handle a special case where an existing arrow is dragged over
@@ -2354,28 +2386,28 @@ const pointDraggingUpdates = (
// We need to update the non-dragged point too if bound,
// so we look up the old binding to trigger updateBoundPoint
const endBindable = nextArrow.endBinding
? (end.element ??
? end.element ??
(elementsMap.get(
nextArrow.endBinding.elementId,
)! as ExcalidrawBindableElement))
)! as ExcalidrawBindableElement)
: null;
const endLocalPoint = startIsDraggingOverEndElement
? nextArrow.points[nextArrow.points.length - 1]
: endIsDraggingOverStartElement &&
app.state.bindMode !== "inside" &&
getFeatureFlag("COMPLEX_BINDINGS")
? nextArrow.points[0]
: endBindable
? updateBoundPoint(
element,
"endBinding",
nextArrow.endBinding,
endBindable,
elementsMap,
endIsDragged,
) || nextArrow.points[nextArrow.points.length - 1]
: nextArrow.points[nextArrow.points.length - 1];
app.state.bindMode !== "inside" &&
getFeatureFlag("COMPLEX_BINDINGS")
? nextArrow.points[0]
: endBindable
? updateBoundPoint(
element,
"endBinding",
nextArrow.endBinding,
endBindable,
elementsMap,
endIsDragged,
) || nextArrow.points[nextArrow.points.length - 1]
: nextArrow.points[nextArrow.points.length - 1];
// We need to keep the simulated next arrow up-to-date, because
// updateBoundPoint looks at the opposite point
@@ -2384,29 +2416,29 @@ const pointDraggingUpdates = (
// We need to update the non-dragged point too if bound,
// so we look up the old binding to trigger updateBoundPoint
const startBindable = nextArrow.startBinding
? (start.element ??
? start.element ??
(elementsMap.get(
nextArrow.startBinding.elementId,
)! as ExcalidrawBindableElement))
)! as ExcalidrawBindableElement)
: null;
const startLocalPoint =
endIsDraggingOverStartElement && getFeatureFlag("COMPLEX_BINDINGS")
? nextArrow.points[0]
: startIsDraggingOverEndElement &&
app.state.bindMode !== "inside" &&
getFeatureFlag("COMPLEX_BINDINGS")
? endLocalPoint
: startBindable
? updateBoundPoint(
element,
"startBinding",
nextArrow.startBinding,
startBindable,
elementsMap,
startIsDragged,
) || nextArrow.points[0]
: nextArrow.points[0];
app.state.bindMode !== "inside" &&
getFeatureFlag("COMPLEX_BINDINGS")
? endLocalPoint
: startBindable
? updateBoundPoint(
element,
"startBinding",
nextArrow.startBinding,
startBindable,
elementsMap,
startIsDragged,
) || nextArrow.points[0]
: nextArrow.points[0];
const endChanged =
!startIsDraggingOverEndElement &&
@@ -2440,11 +2472,11 @@ const pointDraggingUpdates = (
isDragging: true,
}
: idx === element.points.length - 1
? {
point: endLocalPoint,
isDragging: true,
}
: naiveDraggingPoints.get(idx)!,
? {
point: endLocalPoint,
isDragging: true,
}
: naiveDraggingPoints.get(idx)!,
];
}),
),
+2
View File
@@ -40,6 +40,8 @@ export const mutateElement = <TElement extends Mutable<ExcalidrawElement>>(
updates: ElementUpdate<TElement>,
options?: {
isDragging?: boolean;
isBindingEnabled?: boolean;
isMidpointSnappingEnabled?: boolean;
},
) => {
let didChange = false;
+2 -2
View File
@@ -230,8 +230,8 @@ const getTextElementPositionOffsets = (
opts.textAlign === "center"
? metrics.width / 2
: opts.textAlign === "right"
? metrics.width
: 0,
? metrics.width
: 0,
y: opts.verticalAlign === "middle" ? metrics.height / 2 : 0,
};
};
+2 -2
View File
@@ -568,8 +568,8 @@ const drawElementOnCanvas = (
element.textAlign === "center"
? element.width / 2
: element.textAlign === "right"
? element.width
: 0;
? element.width
: 0;
const lineHeightPx = getLineHeightInPx(
element.fontSize,
+3 -3
View File
@@ -819,8 +819,8 @@ export const resizeSingleElement = (
nextHeight,
origElement.angle,
handleDirection,
shouldMaintainAspectRatio,
shouldResizeFromCenter,
shouldMaintainAspectRatio!!,
shouldResizeFromCenter!!,
);
if (isLinearElement(origElement) && rescaledPoints.points) {
@@ -1370,7 +1370,7 @@ export const resizeMultipleElements = (
false,
);
const update: (typeof elementsAndUpdates)[0]["update"] = {
const update: typeof elementsAndUpdates[0]["update"] = {
x,
y,
width,
+16 -22
View File
@@ -137,28 +137,22 @@ export const getElementWithTransformHandleType = (
elementsMap: ElementsMap,
editorInterface: EditorInterface,
) => {
return elements.reduce(
(result, element) => {
if (result) {
return result;
}
const transformHandleType = resizeTest(
element,
elementsMap,
appState,
scenePointerX,
scenePointerY,
zoom,
pointerType,
editorInterface,
);
return transformHandleType ? { element, transformHandleType } : null;
},
null as {
element: NonDeletedExcalidrawElement;
transformHandleType: MaybeTransformHandleType;
} | null,
);
return elements.reduce((result, element) => {
if (result) {
return result;
}
const transformHandleType = resizeTest(
element,
elementsMap,
appState,
scenePointerX,
scenePointerY,
zoom,
pointerType,
editorInterface,
);
return transformHandleType ? { element, transformHandleType } : null;
}, null as { element: NonDeletedExcalidrawElement; transformHandleType: MaybeTransformHandleType } | null);
};
export const getTransformHandleTypeFromCoords = <
+4 -4
View File
@@ -223,10 +223,10 @@ export const getTargetElements = (
appState.editingTextElement
? [appState.editingTextElement]
: appState.newElement
? [appState.newElement]
: getSelectedElements(elements, appState, {
includeBoundTextElement: true,
});
? [appState.newElement]
: getSelectedElements(elements, appState, {
includeBoundTextElement: true,
});
/**
* returns prevState's selectedElementids if no change from previous, so as to
+16 -16
View File
@@ -201,8 +201,8 @@ export const generateRoughOptions = (
element.strokeStyle === "dashed"
? getDashArrayDashed(element.strokeWidth)
: element.strokeStyle === "dotted"
? getDashArrayDotted(element.strokeWidth)
: undefined,
? getDashArrayDotted(element.strokeWidth)
: undefined,
// for non-solid strokes, disable multiStroke because it tends to make
// dashes/dots overlay each other
disableMultiStroke: element.strokeStyle !== "solid",
@@ -235,8 +235,8 @@ export const generateRoughOptions = (
options.fill = isTransparent(element.backgroundColor)
? undefined
: isDarkMode
? applyDarkModeFilter(element.backgroundColor)
: element.backgroundColor;
? applyDarkModeFilter(element.backgroundColor)
: element.backgroundColor;
if (element.type === "ellipse") {
options.curveFitting = 1;
}
@@ -250,8 +250,8 @@ export const generateRoughOptions = (
element.backgroundColor === "transparent"
? undefined
: isDarkMode
? applyDarkModeFilter(element.backgroundColor)
: element.backgroundColor;
? applyDarkModeFilter(element.backgroundColor)
: element.backgroundColor;
}
return options;
}
@@ -708,20 +708,20 @@ const _generateElementShape = (
rightX - verticalRadius
} ${rightY - horizontalRadius}
C ${rightX} ${rightY}, ${rightX} ${rightY}, ${
rightX - verticalRadius
} ${rightY + horizontalRadius}
rightX - verticalRadius
} ${rightY + horizontalRadius}
L ${bottomX + verticalRadius} ${bottomY - horizontalRadius}
C ${bottomX} ${bottomY}, ${bottomX} ${bottomY}, ${
bottomX - verticalRadius
} ${bottomY - horizontalRadius}
bottomX - verticalRadius
} ${bottomY - horizontalRadius}
L ${leftX + verticalRadius} ${leftY + horizontalRadius}
C ${leftX} ${leftY}, ${leftX} ${leftY}, ${leftX + verticalRadius} ${
leftY - horizontalRadius
}
leftY - horizontalRadius
}
L ${topX - verticalRadius} ${topY + horizontalRadius}
C ${topX} ${topY}, ${topX} ${topY}, ${topX + verticalRadius} ${
topY + horizontalRadius
}`,
topY + horizontalRadius
}`,
generateRoughOptions(element, true, isDarkMode),
);
} else {
@@ -1057,8 +1057,8 @@ export const getFreedrawOutlinePoints = (
const inputPoints = element.simulatePressure
? element.points
: element.points.length
? element.points.map(([x, y], i) => [x, y, element.pressures[i]])
: [[0, 0, 0.5]];
? element.points.map(([x, y], i) => [x, y, element.pressures[i]])
: [[0, 0, 0.5]];
return getStroke(inputPoints as number[][], {
simulatePressure: element.simulatePressure,
@@ -10,13 +10,13 @@ export const showSelectedShapeActions = (
) =>
Boolean(
!appState.viewModeEnabled &&
appState.openDialog?.name !== "elementLinkSelector" &&
((appState.activeTool.type !== "custom" &&
(appState.editingTextElement ||
(appState.activeTool.type !== "selection" &&
appState.activeTool.type !== "lasso" &&
appState.activeTool.type !== "eraser" &&
appState.activeTool.type !== "hand" &&
appState.activeTool.type !== "laser"))) ||
getSelectedElements(elements, appState).length),
appState.openDialog?.name !== "elementLinkSelector" &&
((appState.activeTool.type !== "custom" &&
(appState.editingTextElement ||
(appState.activeTool.type !== "selection" &&
appState.activeTool.type !== "lasso" &&
appState.activeTool.type !== "eraser" &&
appState.activeTool.type !== "hand" &&
appState.activeTool.type !== "laser"))) ||
getSelectedElements(elements, appState).length),
);
+1 -1
View File
@@ -89,7 +89,7 @@ const CJK = {
* BREAK BEFORE "「"
* BREAK AFTER "」"
*/
// prettier-ignore
// eslint-disable-next-line prettier/prettier
OPENING://u,
CLOSING: //u,
/**
+92 -89
View File
@@ -73,101 +73,104 @@ export type ValidLinearElement = {
textAlign?: TextAlign;
verticalAlign?: VerticalAlign;
} & MarkOptional<ElementConstructorOpts, "x" | "y">;
end?: (
end?:
| (
| {
type: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
id?: ExcalidrawGenericElement["id"];
}
| {
id: ExcalidrawGenericElement["id"];
type?: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
}
)
| ((
| {
type: "text";
text: string;
}
| {
type?: "text";
id: ExcalidrawTextElement["id"];
text: string;
}
| (
| {
type: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
id?: ExcalidrawGenericElement["id"];
}
| {
id: ExcalidrawGenericElement["id"];
type?: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
}
)
| ((
| {
type: "text";
text: string;
}
| {
type?: "text";
id: ExcalidrawTextElement["id"];
text: string;
}
) &
Partial<ExcalidrawTextElement>)
) &
Partial<ExcalidrawTextElement>)
) &
MarkOptional<ElementConstructorOpts, "x" | "y">;
start?: (
MarkOptional<ElementConstructorOpts, "x" | "y">;
start?:
| (
| {
type: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
id?: ExcalidrawGenericElement["id"];
}
| {
id: ExcalidrawGenericElement["id"];
type?: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
}
)
| ((
| {
type: "text";
text: string;
}
| {
type?: "text";
id: ExcalidrawTextElement["id"];
text: string;
}
| (
| {
type: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
id?: ExcalidrawGenericElement["id"];
}
| {
id: ExcalidrawGenericElement["id"];
type?: Exclude<
ExcalidrawBindableElement["type"],
| "image"
| "text"
| "frame"
| "magicframe"
| "embeddable"
| "iframe"
>;
}
)
| ((
| {
type: "text";
text: string;
}
| {
type?: "text";
id: ExcalidrawTextElement["id"];
text: string;
}
) &
Partial<ExcalidrawTextElement>)
) &
Partial<ExcalidrawTextElement>)
) &
MarkOptional<ElementConstructorOpts, "x" | "y">;
MarkOptional<ElementConstructorOpts, "x" | "y">;
} & Partial<ExcalidrawLinearElement>;
export type ValidContainer = {
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
id?: ExcalidrawGenericElement["id"];
label?: {
text: string;
fontSize?: number;
fontFamily?: FontFamilyValues;
textAlign?: TextAlign;
verticalAlign?: VerticalAlign;
} & MarkOptional<ElementConstructorOpts, "x" | "y">;
} & ElementConstructorOpts;
export type ValidContainer =
| {
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
id?: ExcalidrawGenericElement["id"];
label?: {
text: string;
fontSize?: number;
fontFamily?: FontFamilyValues;
textAlign?: TextAlign;
verticalAlign?: VerticalAlign;
} & MarkOptional<ElementConstructorOpts, "x" | "y">;
} & ElementConstructorOpts;
export type ExcalidrawElementSkeleton =
| Extract<
+2 -2
View File
@@ -312,8 +312,8 @@ export const getTransformHandles = (
const margin = isLinearElement(element)
? DEFAULT_TRANSFORM_HANDLE_SPACING + 8
: isImageElement(element)
? 0
: DEFAULT_TRANSFORM_HANDLE_SPACING;
? 0
: DEFAULT_TRANSFORM_HANDLE_SPACING;
return getTransformHandlesFromCoords(
getElementAbsoluteCoords(element, elementsMap, true),
element.angle,
+14 -13
View File
@@ -15,21 +15,21 @@ import type {
ValueOf,
} from "@excalidraw/common/utility-types";
export type ChartType = "bar" | "line";
export type ChartType = "bar" | "line" | "radar";
export type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
export type FontFamilyKeys = keyof typeof FONT_FAMILY;
export type FontFamilyValues = (typeof FONT_FAMILY)[FontFamilyKeys];
export type Theme = (typeof THEME)[keyof typeof THEME];
export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
export type Theme = typeof THEME[keyof typeof THEME];
export type FontString = string & { _brand: "fontString" };
export type GroupId = string;
export type PointerType = "mouse" | "pen" | "touch";
export type StrokeRoundness = "round" | "sharp";
export type RoundnessType = ValueOf<typeof ROUNDNESS>;
export type StrokeStyle = "solid" | "dashed" | "dotted";
export type TextAlign = (typeof TEXT_ALIGN)[keyof typeof TEXT_ALIGN];
export type TextAlign = typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
type VerticalAlignKeys = keyof typeof VERTICAL_ALIGN;
export type VerticalAlign = (typeof VERTICAL_ALIGN)[VerticalAlignKeys];
export type VerticalAlign = typeof VERTICAL_ALIGN[VerticalAlignKeys];
export type FractionalIndex = string & { _brand: "franctionalIndex" };
export type BoundElement = Readonly<{
@@ -124,14 +124,15 @@ export type ExcalidrawIframeLikeElement =
| ExcalidrawIframeElement
| ExcalidrawEmbeddableElement;
export type IframeData = {
intrinsicSize: { w: number; h: number };
error?: Error;
sandbox?: { allowSameOrigin?: boolean };
} & (
| { type: "video" | "generic"; link: string }
| { type: "document"; srcdoc: (theme: Theme) => string }
);
export type IframeData =
| {
intrinsicSize: { w: number; h: number };
error?: Error;
sandbox?: { allowSameOrigin?: boolean };
} & (
| { type: "video" | "generic"; link: string }
| { type: "document"; srcdoc: (theme: Theme) => string }
);
export type ImageCrop = {
x: number;
+13 -9
View File
@@ -343,6 +343,7 @@ export function deconstructRectanguloidElement(
export function getDiamondBaseCorners(
element: ExcalidrawDiamondElement,
offset: number = 0,
): Curve<GlobalPoint>[] {
const [topX, topY, rightX, rightY, bottomX, bottomY, leftX, leftY] =
getDiamondPoints(element);
@@ -430,7 +431,7 @@ export function deconstructDiamondElement(
return cachedShape;
}
const baseCorners = getDiamondBaseCorners(element);
const baseCorners = getDiamondBaseCorners(element, offset);
const corners = baseCorners.map(
(corner) =>
@@ -658,20 +659,23 @@ export const projectFixedPointOntoDiagonal = (
startOrEnd: "start" | "end",
elementsMap: ElementsMap,
zoom: AppState["zoom"],
isMidpointSnappingEnabled: boolean = true,
): GlobalPoint | null => {
invariant(arrow.points.length >= 2, "Arrow must have at least two points");
if (arrow.width < 3 && arrow.height < 3) {
return null;
}
const sideMidPoint = getSnapOutlineMidPoint(
point,
element,
elementsMap,
zoom,
);
if (sideMidPoint) {
return sideMidPoint;
if (isMidpointSnappingEnabled) {
const sideMidPoint = getSnapOutlineMidPoint(
point,
element,
elementsMap,
zoom,
);
if (sideMidPoint) {
return sideMidPoint;
}
}
// Do the projection onto the diagonals (or center lines
+1 -2
View File
@@ -252,7 +252,6 @@ const addToCurrentFrame = (element: DebugElement) => {
if (window.visualDebug?.data && window.visualDebug.data.length === 0) {
window.visualDebug.data[0] = [];
}
if (window.visualDebug?.data) {
window.visualDebug?.data &&
window.visualDebug.data[window.visualDebug.data.length - 1].push(element);
}
};
+1 -1
View File
@@ -334,7 +334,7 @@ const shiftElementsByOne = (
.map((idx) => elements[idx].id),
);
groupedIndices.forEach((indices) => {
groupedIndices.forEach((indices, i) => {
const leadingIndex = indices[0];
const trailingIndex = indices[indices.length - 1];
const boundaryIndex = direction === "left" ? leadingIndex : trailingIndex;
+1 -1
View File
@@ -37,7 +37,7 @@ const _ce = ({
width: w,
height: h,
angle: a,
}) as ExcalidrawElement;
} as ExcalidrawElement);
describe("getElementAbsoluteCoords", () => {
it("test x1 coordinate", () => {
+1 -1
View File
@@ -24,7 +24,7 @@ describe("Test measureText", () => {
...params,
});
expect(getContainerCoords(element)).toEqual({
x: 44.289321881345245,
x: 44.2893218813452455,
y: 39.64466094067262,
});
});

Some files were not shown because too many files have changed in this diff Show More