Compare commits

...
74 Commits
Author SHA1 Message Date
zsviczian 23d1ad0da6 save on window blur 2024-08-30 11:19:43 +00:00
zsviczian 49173dc766 reset autosave timer the first time the drawing changes 2024-08-30 12:49:00 +02:00
zsviczian 03a563856d Merge pull request #1974 from zsviczian/autosave-tweaks
autosave tweaks
2024-08-30 10:33:13 +02:00
zsviczian c3809c409d autosave tweaks 2024-08-30 08:32:27 +00:00
zsviczian dfdca90ca5 2.4.0-rc-2 2024-08-29 23:18:01 +02:00
zsviczian 6a8e1735db update nvmrc to 18 2024-08-29 20:29:54 +02:00
zsviczian c0e9a0553e minor build changes 2024-08-29 20:24:59 +02:00
zsviczian e1501165d9 Merge pull request #1971 from dmscode/master
Update zh-cn.ts to hotekey override, hide spalsh, save active tool, r…
2024-08-29 15:04:15 +02:00
dmscode 3b0f706059 Update zh-cn.ts to hotekey override, hide spalsh, save active tool, remove comments in p… … 2024-08-29 18:27:50 +08:00
zsviczian 7d19662f68 Merge pull request #1970 from zsviczian/hotkey-override
hotekey override, hide spalsh, save active tool, remove comments in p…
2024-08-29 11:58:30 +02:00
zsviczian 5c949dc71c hotekey override, hide spalsh, save active tool, remove comments in prod build 2024-08-29 09:57:53 +00:00
zsviczian 0439d67a0c Merge pull request #1966 from dmscode/master
Update zh-cn.ts to 2.4.0-rc-1
2024-08-29 09:00:59 +02:00
dmscode d3446a20b1 Update zh-cn.ts to 2.4.0-rc-1 2024-08-28 20:45:21 +08:00
zsviczian 5b37dc2e38 save on contentEl mouseleave 2024-08-28 12:34:56 +02:00
zsviczian eee264918e 2.4.0-rc-1 2024-08-27 21:43:21 +02:00
zsviczian 89172a88f1 fix android preview render bug 2024-08-27 08:56:57 +02:00
zsviczian ffdb054291 2.4.0-beta-10 2024-08-26 22:40:45 +02:00
zsviczian 200d39c408 Merge pull request #1960 from dmscode/master
Update zh-cn.ts and add Readme.zh-cn
2024-08-26 22:27:07 +02:00
zsviczian 4306574ace Update Excalidraw Writing Machine 2024-08-26 15:04:58 +02:00
zsviczian 12e3b90458 support wikilinks 2024-08-26 15:04:05 +02:00
dmscode 03364b5d2e Readme.zh-cn 2024-08-26 15:43:28 +08:00
dmscode 4e268991dc Update zh-cn.ts to 2.4.0-beta-9 2024-08-26 14:32:46 +08:00
zsviczian 429c84f940 updated rollup, tsconfig, rollup versions in package.json 2024-08-25 16:53:15 +02:00
zsviczian e890e4489b replace json.stringify with proper processing, fix small issues with Ephemral state, added worker (inactive) 2024-08-25 16:08:12 +02:00
zsviczian 8466c42217 update Excalidraw package -42 is corrupted 2024-08-24 20:30:51 +02:00
zsviczian 353732f597 2.4.0-beta-9 2024-08-24 13:59:49 +02:00
zsviczian 5599d2507f update writing machine data 2024-08-23 12:43:27 +02:00
zsviczian 70cf6ffe70 Support embeddables 2024-08-23 12:41:33 +02:00
zsviczian 61c9277097 writing machine 2024-08-22 21:59:06 +02:00
zsviczian 401052efd3 svg icon take 2 2024-08-22 20:36:00 +02:00
zsviczian a57a0e797d update writing machine svg 2024-08-22 20:33:52 +02:00
zsviczian 8f48853e2c updated writing machine script 2024-08-22 17:58:42 +02:00
zsviczian a62148dc07 publish Excalidraw Writing Machine 2024-08-21 21:53:59 +02:00
zsviczian 3ae890bd86 2.4.0-beta-8 2024-08-19 15:57:23 +02:00
zsviczian 65a4cd4ba5 Merge pull request #1939 from dmscode/master
Update zh-cn.ts 2.4.0-beta-7
2024-08-19 15:38:56 +02:00
dmscode f63b473bc1 Update zh-cn.ts to the commit "fixed getTemplate, migrade gridSize, gridStep" 2024-08-19 09:42:37 +08:00
稻米鼠 859a5ba03a Merge branch 'zsviczian:master' into master 2024-08-19 09:37:07 +08:00
zsviczian 832b97b179 fixed getTemplate, migrade gridSize, gridStep, 2024-08-18 17:15:03 +02:00
dmscode e98d688d36 Update zh-cn.ts 2.4.0-beta-7 2024-08-16 15:53:39 +08:00
zsviczian 39318337fe updated set stroke width script 2024-08-16 08:13:55 +02:00
zsviczian f21215be84 2.4.0-beta-7 2024-08-15 17:45:49 +02:00
zsviczian 0690525af8 Merge pull request #1937 from dmscode/master
Update zh-cn.ts to 2.4.0-beta-6
2024-08-15 17:41:32 +02:00
dmscode b3176425c5 Merge branch 'master' of https://github.com/dmscode/obsidian-excalidraw-plugin 2024-08-15 18:56:30 +08:00
dmscode 9f2c18b6b6 Update zh-cn.ts to 2.4.0-beta-6 2024-08-15 18:56:20 +08:00
zsviczian d529a04f48 2.4.0-beta-6, pdf++ crop support, double tap eraser disable 2024-08-14 20:02:41 +02:00
zsviczian 8786c5aa99 2.4.0-beta-5 2024-08-14 10:07:55 +02:00
zsviczian 013279ab60 2.2.4-beta-4, markdown post processor, PDF frames, selectFrameElements 2024-08-13 22:53:03 +02:00
zsviczian 06193b6d49 2.4.0-beta-3 2024-08-11 09:22:13 +02:00
zsviczian ac6f4af5d6 Merge pull request #1928 from mProjectsCode/patch-1
Fix `authorUrl` in manifest
2024-08-11 08:42:11 +02:00
zsviczian bf148adc68 2.4.0-beta-2 2024-08-09 23:36:20 +02:00
Moritz Jung 0f9dafb01d Fix authorUrl in manifest 2024-08-09 22:16:07 +02:00
zsviczian 9fc0452b70 2.4.0-beta-1 2024-08-08 23:27:57 +02:00
zsviczian 83eda9b3f5 Update README.md 2024-08-04 11:01:12 +02:00
zsviczian 9bfbf47963 2.3.0 2024-08-04 10:37:06 +02:00
zsviczian 252bf411b1 2.3.0-beta-1 2024-08-03 21:26:47 +02:00
zsviczian 5622c019dd rebuild view DEVICE.isDesktop 2024-08-02 17:55:23 +02:00
zsviczian b32fab7865 2.2.13-1 2024-08-01 22:18:16 +02:00
zsviczian cafdad1f7a onWindowMigrated 2024-07-30 18:54:54 +02:00
zsviczian 9da40944ab 2.2.13 2024-07-29 18:13:13 +02:00
zsviczian f678203a64 Merge pull request #1908 from dmscode/master
Update zh-cn.ts to 2.2.11
2024-07-29 17:32:14 +02:00
zsviczian a9572e08e9 Merge branch 'master' into master 2024-07-29 17:31:58 +02:00
dmscode ee9b042cdf Update zh-cn.ts to 2.2.11 2024-07-28 20:42:41 +08:00
zsviczian bc138fa78a fixed storeAction, replaced "none" with "update" #1906 2024-07-28 10:06:31 +02:00
zsviczian 67dbe256f7 2.2.12 2024-07-28 06:55:27 +02:00
zsviczian 8b066d46e2 fix rename and skip inline fonts to cache key 2024-07-28 06:24:30 +02:00
zsviczian 1769a65a82 2.2.11 2024-07-27 21:25:23 +02:00
zsviczian 941eb56769 updated ExcaliAI 2024-07-27 07:09:19 +02:00
zsviczian a317613ef4 Merge pull request #1859 from Saik0s/patch-1
Update ExcaliAI.md to fix incorrect request json for openai api
2024-07-27 07:05:58 +02:00
zsviczian 173571846f 2.2.10-2 2024-07-26 20:11:20 +02:00
zsviczian ab1078d393 Fourth Font 2.2.10-1 2024-07-25 21:59:42 +02:00
zsviczian 681321a595 2.2.10-1 fontpicker beta 2024-07-25 21:52:47 +02:00
zsviczian fcd50d4bc2 Merge pull request #1897 from dmscode/master
Updated zh-cn.ts to 2.2.10
2024-07-23 17:49:00 +02:00
dmscode 7e214e5aaa Updated zh-cn.ts to 2.2.10 2024-07-23 09:54:43 +08:00
Igor Tarasenko d3aeedb9f6 Update ExcaliAI.md to fix incorrect request json for openai api 2024-06-28 21:03:58 +02:00
67 changed files with 3383 additions and 956 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
16
18
-28
View File
@@ -2,31 +2,3 @@ The project runs with `node 18`.
After running `npm -i` you'll need to make two manual changes:
## postprocess
postprocess is used in rollup.config.js.
However, the version available on npmjs does not work, after installing packages you need this update:
`npm install brettz9/rollup-plugin-postprocess#update --save-dev``
More info here: https://github.com/developit/rollup-plugin-postprocess/issues/10
## colormaster
1.2.1 misses 3 plugin references after installing the package you need to update
`node_modules/colormaster/package.json` adding the following to the `exports:` section:
```typescript
,
"./plugins/luv": {
"import": "./plugins/luv.mjs",
"require": "./plugins/luv.js",
"default": "./plugins/luv.mjs"
},
"./plugins/uvw": {
"import": "./plugins/uvw.mjs",
"require": "./plugins/uvw.js",
"default": "./plugins/uvw.mjs"
},
"./plugins/ryb": {
"import": "./plugins/ryb.mjs",
"require": "./plugins/ryb.js",
"default": "./plugins/ryb.mjs"
}
```
+9
View File
@@ -1,5 +1,7 @@
# Excalidraw
[简体中文](./README.zh-cn.md)
The Obsidian-Excalidraw plugin integrates [Excalidraw](https://excalidraw.com/), a feature rich sketching tool, into Obsidian. You can store and edit Excalidraw files in your vault, you can embed drawings into your documents, and you can link to documents and other drawings to/and from Excalidraw. For a showcase of Excalidraw features, please read my blog post [here](https://www.zsolt.blog/2021/03/showcasing-excalidraw.html) and/or watch the videos below.
## Video Walkthrough
@@ -63,6 +65,13 @@ The Obsidian-Excalidraw plugin integrates [Excalidraw](https://excalidraw.com/),
<a href="https://youtu.be/4N6efq1DtH0" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/158008902-12c6a851-237e-4edd-a631-d48e81c904b2.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;Eraser, left-handed mode, improved filename configuration</a><br>
</details>
### Beta testing
The plugin follows a monthly release schedule. If you want to receive more frequent updates with new features (e.g. shiny new stuff available on excalidraw.com, but not yet in Obsidian) and minor bug fixes, then join the beta community.
[![Thumbnail - 20240803 Excalidraw Release Approach (Custom)](https://github.com/user-attachments/assets/ab40648c-f73f-4bda-a416-52839f918f2a)](https://youtu.be/2poSS-Z91lY)
[![Excalidraw Plugin Release Strategy (Phone)](https://github.com/user-attachments/assets/87f1f379-782c-4c32-8b5b-d27fe2d3ac4b)](https://github.com/user-attachments/assets/120a0790-7239-48ae-bfbd-eb249f8b518d)
---
## Features
+285
View File
@@ -0,0 +1,285 @@
# Excalidraw
> 此说明当前更新至 2.4.0-beta-9。
Obsidian-Excalidraw 插件将 [Excalidraw](https://excalidraw.com/) 这一功能丰富的草图工具集成到 Obsidian 中。您可以在您的库中存储和编辑 Excalidraw 文件,可以将图形嵌入到文档中,还可以在 Excalidraw 中链接到文档和其他图形。有关 Excalidraw 功能的展示,请查看我的博客文章 [这里](https://www.zsolt.blog/2021/03/showcasing-excalidraw.html) 或观看以下视频。
## 视频演示
<a href="https://youtu.be/P_Q6avJGoWI" target="_blank"><img src="https://github.com/zsviczian/obsidian-excalidraw-plugin/assets/14358394/da34bb33-7610-45e6-b36f-cb7a02a9141b" width="300"/></a>
<a href="https://youtu.be/o0exK-xFP3k" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/156931370-aa4d88de-c4a8-46cc-aeb2-dc09aa0bea39.jpg" width="300"/></a>
<a href="https://youtu.be/QKnQgSjJVuc" target="_blank"><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/thumbnail-getting-started.jpg" width="300"/></a>
### 这是我完整的视频目录:
<a href="https://excalidraw-obsidian.online/Hobbies/Excalidraw+Blog/Catalogue+of+Videos"><img width="380" alt="image" src="https://github.com/zsviczian/obsidian-excalidraw-plugin/assets/14358394/2577e5ad-7a21-4c62-acd5-4fe80c8a8a95"></a>
<br>
<details><summary>10 部分(稍微过时)视频演示</summary>
<a href="https://youtu.be/sY4FoflGaiM" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160304-7f211180-e17c-11eb-8363-c52723de1ffd.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;1 入门</a><br>
<a href="https://youtu.be/Iy_oVTq12Gw" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160312-8a743d00-e17c-11eb-9fa2-490ef4cbd59e.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;2 基本形状和功能</a><br>
<a href="https://youtu.be/QOL1KF7-kdc" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160323-96f89580-e17c-11eb-9bce-8eb1067a51bb.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;3 元素分组</a><br>
<a href="https://youtu.be/aSgcbfspvfo" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160332-9f50d080-e17c-11eb-98e9-fec60fe147d9.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;4 模板库</a><br>
<a href="https://youtu.be/MaJ5jJwBRWs" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160341-a546b180-e17c-11eb-9de8-d87fdc844c9c.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;5 嵌入</a><br>
<a href="https://youtu.be/MXzeCOEExNo" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160346-aa0b6580-e17c-11eb-930b-4024807040d1.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;6 链接</a><br>
<a href="https://youtu.be/R0IAg0s-wQE" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160354-b2fc3700-e17c-11eb-81af-9e71e461f6dd.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;7 Markdown</a><br>
<a href="https://youtu.be/ibdS7ykwpW4" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160360-b8f21800-e17c-11eb-8bd8-79d4e3f6e92d.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;8 模板</a><br>
<a href="https://youtu.be/VRZVujfVab0" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160367-bdb6cc00-e17c-11eb-92f1-6f59faea85fd.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;9 Excalidraw 自动化</a><br>
<a href="https://youtu.be/D1iBYo1_jjc" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/125160374-c3141680-e17c-11eb-8cc2-dfaffd903d15.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;10 杂项</a><br>
</details>
<details><summary>将内容嵌入 Excalidraw</summary>
<a href="https://www.youtube.com/watch?v=_c_0zpBJ4Xc&" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/138607067-ccb62f92-48a4-4880-ac6e-68c1bf86ac2c.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;图像元素</a><br>
<a href="https://youtu.be/r08wk-58DPk" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/143732412-1c65227e-4381-406d-847a-b001ab3506ca.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;LaTeX 演示</a><br>
<a href="https://youtu.be/tsecSfnTMow" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/143732440-90bfa029-8615-462e-ada3-c903d71a82c9.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;Markdown 嵌入</a><br>
<a href="https://youtu.be/K6qZkTz8GHs" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/143783906-15cee494-c6d5-4495-a2ca-74634e4e7355.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;Markdown 嵌入高级功能</a><br>
<a href="https://youtu.be/Etskjw7a5zo" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/156931461-0979b821-315a-41dd-86f1-31d169b7c127.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;链接到元素、垂直文本对齐、Markdown 样式</a><br>
</details>
<details><summary>脚本引擎商店 - Excalidraw 自动化</summary>
<a href="https://youtu.be/hePJcObHIso" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/145684531-8d9c2992-59ac-4ebc-804a-4cce1777ded2.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;介绍脚本引擎</a><br>
<a href="https://youtu.be/lzYdOQ6z8F0" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/147889174-6c306d0d-2d29-46cc-a53f-3f0013cf14de.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;脚本引擎商店</a><br>
</details>
<details><summary>使用颜色</summary>
<a href="https://youtu.be/6PLGHBH9VZ4" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/194773147-5418a0ab-6be5-4eb0-a8e4-d6af21b1b483.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;颜色 - Excalidraw 基础(自定义)</a><br>
<a href="https://youtu.be/epYNx2FSf2w" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/194773211-9e871be7-0795-4dc7-947e-c6c275e690d0.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;Excalidraw 调色板(自定义)</a><br>
<a href="https://youtu.be/Amhlv6r9WvM" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/194773268-400cfb1b-6bde-45e0-9e4b-91bbaa461cf0.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;“艺术”颜色渐变</a><br>
<a href="https://youtu.be/r9oB1SlK1GU" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/194773527-ef35c8b9-1a6d-4415-9c7e-b667fb17535d.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;美丽草图的简单规则</a><br>
<a href="https://youtu.be/7gJDwNgQ6NU" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/195988535-a133a9b9-d094-45ba-ba64-c994b9a1e0ef.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;ColorMaster 脚本编写</a><br>
</details>
<details><summary>链接和块引用</summary>
<a href="https://youtu.be/qiKuqMcNWgU" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/171635214-30533c45-94fa-436e-83a9-b2ec99f190e2.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;链接视觉思维的 6 种策略 v4</a><br>
<a href="https://youtu.be/yZQoJg2RCKI" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/185791706-3d9983ab-7cb1-4b27-a016-30c039d84e34.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;图像的块引用部分</a><br>
<a href="https://youtu.be/Etskjw7a5zo" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/156931461-0979b821-315a-41dd-86f1-31d169b7c127.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;链接到元素、垂直文本对齐、Markdown 样式</a><br>
<a href="https://youtu.be/2Y8OhkGiTHg" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/152585752-7eb0371f-0bab-40f6-a194-3b48e5811735.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;Excalidraw 原生超链接使用指南</a><br>
</details>
<details><summary>强大工具</summary>
<a href="https://youtu.be/NOuddK6xrr8" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/147283367-e5689385-ea51-4983-81a3-04d810d39f62.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;便签(自动换行)</a><br>
<a href="https://youtu.be/eKFmrSQhFA4" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/149659524-2a4e0a24-40c9-4e66-a6b1-c92f3b88ecd5.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;本地字体</a><br>
<a href="https://youtu.be/vlC1-iBvIfo" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/199207784-8bbe14e0-7d10-47d7-971d-20dce8dbd659.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;SVG 导入</a><br>
<a href="https://youtu.be/7gu4ETx7zro" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/202916770-28f2fa64-1ba2-4b40-a7fe-d721b42634f7.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;OCR</a><br>
<a href="https://youtu.be/U2LkBRBk4LY" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/159369910-6371f08d-b5fa-454d-9c6c-948f7e7a7d26.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;绑定/解绑文本与容器,前置标签自定义导出</a><br>
<a href="https://youtu.be/uZz5MgzWXiM" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/211054371-8872e01a-77d6-4afc-a0c2-86a55410a8d3.png" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;自定义笔支持</a><br>
</details>
<details><summary>生活质量改善</summary>
<a href="https://youtu.be/qbPIAZguJeo" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/151705333-54e9ffd2-0bd7-4d02-b99e-0bd4e4708d4d.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;移动支持</a><br>
<a href="https://youtu.be/2v9TZmQNO8c" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/153676009-6f86b2d7-c248-49a2-b802-be21c6999e4f.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;托盘模式和可自定义调色板</a><br>
<a href="https://youtu.be/xHPGWR3m0c8" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/154821232-a404b6cf-72fb-4ce4-9d53-619132dce491.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;压缩 JSON 和改进的保存/同步支持</a><br>
<a href="https://youtu.be/gMIKXyhS-dM" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/156931428-b2269fd9-87bd-43ab-8558-5572f40dff93.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;Obsidian 工具面板</a><br>
<a href="https://youtu.be/4N6efq1DtH0" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/158008902-12c6a851-237e-4edd-a631-d48e81c904b2.jpg" width="100" style="vertical-align: middle;"/>&nbsp;&nbsp;橡皮擦、左利手模式、改进的文件名配置</a><br>
</details>
### Beta 测试
该插件遵循每月发布的计划。如果您希望获得更频繁的更新,包括新功能(例如,excalidraw.com 上的新内容,但尚未在 Obsidian 中提供)和小的 bug 修复,请加入 beta 社区。
[![缩略图 - 20240803 Excalidraw 发布方法(自定义)](https://github.com/user-attachments/assets/ab40648c-f73f-4bda-a416-52839f918f2a)](https://youtu.be/2poSS-Z91lY)
[![Excalidraw 插件发布策略(手机)](https://github.com/user-attachments/assets/87f1f379-782c-4c32-8b5b-d27fe2d3ac4b)](https://github.com/user-attachments/assets/120a0790-7239-48ae-bfbd-eb249f8b518d)
---
## 功能
- 该插件将 Excalidraw 无缝集成到 Obsidian 中,包括命令面板操作、文件资源管理器功能、选项菜单命令和工具栏按钮。
- 在工具栏按钮或文件资源管理器中 <kbd>CTRL/CMD+鼠标左键</kbd> 以在新面板中创建/打开绘图。
### 设置
设置将允许您根据需要自定义 Excalidraw。该插件提供了大量设置。我尝试为这些设置添加有意义的解释,所以请耐心查找,对于大多数请求,已经存在相关设置。
插件设置分为以下几个部分:
- **基本设置**:例如使用的默认文件夹。
- **保存**:压缩和自动保存间隔。
- **文件名**:配置自动生成的 Excalidraw 文件名。
- **显示**:影响 Excalidraw 处理的设置(例如:左利手模式、主题设置、鼠标滚轮和捏合缩放设置、适应缩放设置)。
- **链接和嵌入**:影响链接和嵌入项在 Excalidraw 画布上行为的设置。
- **Markdown 嵌入设置**:这些设置控制从您的 Vault 嵌入到 Excalidraw 绘图中的 Markdown 文档的行为。
- **嵌入与导出**:控制 Excalidraw 图像在嵌入到 Markdown 文档时的显示方式的设置。
- **自动导出设置**:您可以配置 Excalidraw 在每次保存时创建绘图的 PNG 或 SVG 副本。
- **兼容性功能**:如果您在 Obsidian 之外编辑 Excalidraw 绘图(例如在 LogSeq、Visual Studio、网页等),请检查这些设置。
- **实验性功能**:有一些高级功能作为“巧妙”的 hacks 实现,包括定义本地字体、添加自定义图标以区分 Obsidian 文件资源管理器中的 Excalidraw 文件、OCR 设置等。
- **已安装脚本的设置**:从脚本库安装的一些脚本附带设置。脚本设置在您第一次运行脚本时安装。因此,要访问脚本的设置,请安装脚本,首次运行后在插件设置中查找设置。
#### 模板
- 新绘图的模板。该模板将恢复笔画属性。这意味着您可以在模板中设置笔画颜色、笔画宽度、不透明度、字体系列、字体大小、填充样式、笔画样式等的默认值。这同样适用于 ExcalidrawAutomate。
- 通过模板,您可以自定义 Excalidraw 使用的调色板。
- 切换到 Markdown 视图。
- 滚动到文件底部,找到 `"AppState": {`。
- 在 AppState 部分末尾找到 `"customColorPalette": {`。
- 您可以通过添加以下三个变量中的任何一个或全部来指定 Excalidraw 使用的 3 个调色板:
- `"canvasBackground":[], "elementBackground":[], "elementStroke": []`。
- 在每个变量的数组中添加有效 HTML 颜色的逗号分隔列表(例如,`#FF0000` 表示红色)。
- 有关更多帮助,请查看我上面的录像。
#### 导出
- 如果便携性对您很重要:
- 自动导出 SVG 和/或 PNG 文件,包括同步保持功能,这样您可以将 SVG/PNG 嵌入到文档中,而不是嵌入 Excalidraw 文件。
- 您可以通过添加 `excalidraw-autoexport` 前置字段键来覆盖单个文件的导出设置。该键的有效值为 `none`、`both`、`png` 和 `svg`。
- 指定嵌入绘图的默认宽度。
- 兼容性功能以自动导出和保持同步 Markdown Excalidraw 文件及旧版 `.excalidraw` 文件。
- 实验性功能可在文件资源管理器中添加自定义标签以标记绘图文件。
- 启用/禁用自动保存。
### 将您的绘图嵌入到 Markdown 文档中
- 您可以使用以下格式自定义嵌入图像的大小和位置:
- `![[image.excalidraw|100]]`,
- `![[image.excalidraw|100x100]]`,
- `![[image.excalidraw|100|left]]`,
- `![[image.excalidraw|right-wrap]]`,
- `![[<filename.excalidraw>|<width>x<height>|<alignment>]]`。
- 您可以通过 CSS 添加自定义 [对齐方式](https://www.scaler.com/topics/align-image-in-html/)。
- 出现在 `<alignment>` 中的任何文本将被添加到渲染的 SVG 元素样式和包装 DIV 元素中。
- 有关更多信息,请参见 [styles.css](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/styles.css)。
- Excalidraw 绘图在 Obsidian Publish 中不显示。如果您希望在发布的文档中使用 Excalidraw,可以在插件设置中的 `Embed & Export` 下进行配置,以便在创建新文件时自动将绘图的 PNG 或 SVG 版本插入到文档中。请参见 `type of file to insert into document`。
- 在 `Export settings` 下,您还可以配置自动导出图像的深色和浅色版本,以便您的发布网站支持深色和浅色模式。
### 超链接和拖放支持
![](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/images/excalidraw-modifiers.png)
#### 超链接
- 支持超链接,例如:
- `https://zsolt.blog`,
- `[Obsidian](https://obsidian.md)`,以及
- 内部链接,例如在绘图文本中使用 `[[My file in vault|Alias]]`。
- 如果您启用了 Obsidian 设置中的“文件与链接/自动更新内部链接”,则文件移动或重命名时链接会自动更新。
- 绘图中的链接会出现在文档的反向链接中。
- 支持嵌入:
- `![[myfile#^blockref]]` 将绘图转换为该块的嵌入文本。
- `![[myfile#section]]` 也有效,这将嵌入该部分。
- 您还可以通过在嵌入后加上最大字符数的花括号来指定嵌入文本的换行,例如 `![[myfile#^blockref]]{40}` 将在 40 个字符处换行。
- 为了方便,您还可以使用命令面板将链接插入到绘图中。
- <kbd>CTRL/CMD + 鼠标悬停</kbd> 可以调出链接的 Obsidian 快速预览。(在 Mac 上为 <kbd>CTRL+CMD+鼠标悬停</kbd>)。
- 使用块引用,您还可以在其他文档中引用和嵌入绘图中出现的文本。
#### 拖放支持
- 您可以从 Obsidian 文件资源管理器中拖动文件,它们将成为 Excalidraw 中指向这些文件的链接。有关各种修饰键组合,请参见上面的表格。
- 注意:将图像锚定到其 100% 尺寸是一个非常小众的功能,具有非常特定的行为,我主要是为自己开发的。
- (甚至 Excalidraw Obsidian 中的其他功能更是如此 - 也是主要为自己开发的 😉)。
- 每次打开 Excalidraw 绘图时,这将重置您嵌入的图像为 100% 尺寸,或者如果您在画布上嵌入了使用此功能插入的 Excalidraw 绘图,每次更新嵌入的绘图时,它将缩放回 100% 尺寸。
- 这意味着即使您在绘图中调整了图像的大小,下次打开文件或修改原始嵌入对象时,它也会重置为 100%。此功能在将绘图分解为单独的 Excalidraw 文件时非常有用,但当它们组合到单个画布上时,您希望各个部分保持其实际大小。我使用此功能从原子绘图构建“一页书”摘要。
- 您可以将文本从 Markdown 视图拖放到 Excalidraw 中。
- 您可以从浏览器中拖放网页地址,它们将成为链接。
- 您可以拖放 YouTube 链接和缩略图,它们将在 Excalidraw 中成为带缩略图的 YouTube 链接。
### LaTeX
使用命令面板操作“插入 LaTeX 公式”插入 LaTeX 公式。您可以在 Markdown 视图中编辑公式,或者通过 <kbd>CTRL/CMD + 鼠标左键</kbd> 点击公式进行编辑。
### 图像支持
- 在 iOS 和 Android 上,您可以通过按下 Excalidraw 中的添加图像按钮从相机添加图像。
- 您可以将图像复制/粘贴到绘图中。图像将保存在您的 Vault 中。
- 您可以按照上面的说明拖放图像。
- URL 链接到网络上的图像:您可以从网页将图像拖放到 Excalidraw。如果在将图像拖放到 Excalidraw 时按住 CTRL 键,图像将不会保存到您的 Vault 中。Excalidraw 将从 URL 加载图像。请注意,如果您没有互联网连接,或者这些图像从互联网上被删除,它们也会从您的绘图中消失。
- 如果您将图像 URL 粘贴到 Excalidraw(只需点击 URL 复制,然后在 Excalidraw 画布上点击粘贴),图像将以链接形式插入到网络图像上。同样,图像不会保存到您的 Vault 中,只有链接会被保存。
- 如果您拖放 YouTube 视频链接,它将转换为一个缩略图,并带有指向视频的元素链接。
### 引用图像部分的块
有关更多详细信息,请参见此 [视频](https://youtu.be/yZQoJg2RCKI)。
- 当通过链接引用 Excalidraw 文件中的画布元素时,可以使用:
- 元素 ID 或章节标题(即包含 `# <章节标题>` 的文本元素)
- 例如 `[[file#^elementID]]`,
- 您可以添加 `group=` 前缀,
- 例如 `[[file#^group=elementID]]`,或
- `area=` 前缀,
- 例如 `[[file#area=Section heading]]`。
- 如果找到 `group=` 前缀,Excalidraw 将选择与通过元素 ID(块引用)或章节标题引用的元素在同一组中的元素。
- 如果找到 `area=` 前缀,Excalidraw 将在引用的元素周围插入图像的剪切部分。
- 请注意,当将 Excalidraw 嵌入为 PNG 到您的 Markdown 文档时,不支持 `area=` 选择器。
- 引用文本元素的元素 ID 而不带 `group=` 或 `area=` 前缀将以普通文本嵌入该元素。引用非文本元素(例如矩形、椭圆等)而不带 `group=` 或 `area=` 前缀将导致 Obsidian 错误,因为这些元素 ID 在 Excalidraw Markdown 文件中不能够作为块引用。
### Markdown
- 从 1.2.0 版本开始,绘图文件存储在 Markdown 文件中。
- 您可以为绘图添加标签。
- 您可以在绘图的 YAML 前置字段中添加元数据。
- 您在前置字段和 `# Text Elements` 标题之间添加的任何内容将被 Excalidraw 忽略,即您可以在这里添加任何内容,它将作为文档的一部分被保留。
- Excalidraw 文档现在会在图形视图中显示。
- 以下前置字段键将自定义绘图的显示方式 - 覆盖一般设置:
- `excalidraw-link-prefix: "📍"` 内部链接的预览前缀
- `excalidraw-url-prefix: "🌐"` 外部链接的预览前缀
- `excalidraw-link-brackets: true|false` 是否在预览中显示链接周围的括号
- `excalidraw-default-mode: view|zen` 默认以查看模式或禅模式打开此文档。默认查看模式非常适合演示幻灯片。
- 前置字段标签用于在文件级别自定义图像导出 [519](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/519)。如果这些键存在,它们将覆盖默认的 Excalidraw 嵌入和导出设置。
- `excalidraw-export-transparent: true`: true == 透明 / false == 有背景。
- `excalidraw-export-dark`: true == 深色模式 / false == 浅色模式。
- `excalidraw-export-padding`:指定图像的导出边距。
- `excalidraw-export-pngscale`:这仅影响导出为 PNG。指定图像的导出比例。典型范围在 0.5 到 5 之间,但您也可以尝试其他值。
### 将完整的 Markdown 文件嵌入到您的绘图中
从 Obsidian 文件资源管理器中拖动所需文件,同时按住 <kbd>SHIFT</kbd> 将文件放到画布上。
- 使用命令面板操作:`从 Vault 插入 Markdown 文件`
- 使用自定义的 woff、woff2 或 TTF 字体来显示文档,您可以在 Excalidraw 设置中设置默认字体。
- 您可以为渲染 Markdown 文档的快照图像设置自定义 CSS。仅支持操作系统标准字体作为字体系列([Win10](https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list)、[Mac & iOS](https://developer.apple.com/fonts/system-fonts/)),此外,您可以使用上述设置添加一个额外的自定义字体。
- (要查看演示,请观看此 [视频](https://youtu.be/K6qZkTz8GHs) 并查看此
- [示例 CSS](https://github.com/zsviczian/obsidian-excalidraw-plugin/discussions/281))。
- 为了帮助样式设置,您可以查看 Excalidraw 创建的 Markdown 文档的 SVG 快照。
- 打开 Obsidian 开发者控制台 (<kbd>CTRL+Shift+i</kbd>/<kbd>CMD+OPT+i</kbd>),并
- 执行以下命令:`ExcalidrawAutomate.mostRecentMarkdownSVG`
- 您可以通过将以下前置字段键添加到您的 Markdown 文档,按文件控制嵌入 Markdown 文件的外观:
- `excalidraw-font: Virgil|Cascadia|font_file_name.extension`
- `excalidraw-font-color: css-color-name|#HEXcolor|any-other-html-standard-format`,
- 您可以在 [这里](https://www.w3schools.com/colors/colors_names.asp) 找到 CSS 颜色名称。
- `excalidraw-border-color: css-color-name|#HEXcolor|any-other-html-standard-format`
- `excalidraw-css: "css-filename|css snippet"`
- 切换到 Markdown 视图或使用 <kbd>WIN+CTRL</kbd>/<kbd>CMD+CTRL</kbd> 点击图像以编辑嵌入的属性:
- `[[filename#^blockref|WIDTHxMAXHEIGHT]]`
### 自定义字体、自定义笔、OCR 支持、SVG 导入
- 在插件设置中,您可以添加自定义的本地字体。有关更多详细信息,请参见此 [视频](https://youtu.be/eKFmrSQhFA4)。
- 该插件包括使用 Taskbone OCR 的 OCR 支持。有关更多详细信息,请参见此 [视频](https://youtu.be/7gu4ETx7zro)。
- 您可以将 SVG 文件转换为 Excalidraw 绘图(有一些限制)。有关更多详细信息,请参见此 [视频](https://youtu.be/vlC1-iBvIfo)。
- 您可以定义自定义笔和荧光笔,并将其固定到侧边栏。有关更多详细信息,请参见此 [视频](https://youtu.be/OjNhjaH2KjI)。使用 ExcalidrawAutomate,您可以添加对 [自动切换](<ea-scripts/Auto Draw for Pen.md>) 笔的支持,以及对 [硬件橡皮擦按钮](<ea-scripts/Hardware Eraser Support.md>) 的支持。
### 脚本引擎
- 从 1.5.0 版本开始,您可以轻松执行 ExcalidrawAutomate 宏,并为它们分配命令面板快捷键,使用脚本引擎。您可以在 [这里](ea-scripts/README.md) 找到介绍视频和不断增加的可安装脚本库。
- 您可以通过将脚本和随附的 SVG 图标文件移动到文件夹中,将脚本组织成组,放在 Excalidraw 的 Obsidian 工具面板中。请参见演示 [视频](https://youtu.be/wTtaXmRJ7wg?t=16)。
### 其他
- 左利手模式
- 包含完整的
- [QuickAdd](https://github.com/chhoumann/quickadd),
- [Templater](https://silentvoid13.github.io/Templater/) 和
- [Dataview](https://blacksmithgu.github.io/obsidian-dataview/docs/api/intro/) 支持,通过 ExcalidrawAutomate 实现。
- 查看 [详细帮助 + 示例](https://zsviczian.github.io/obsidian-excalidraw-plugin/)。
- 我还有一个 [YouTube ExcalidrawAutomate 播放列表](https://www.youtube.com/playlist?list=PL6mqgtMZ4NP1IR4nXxSlMA4PA5E-qpyHZ),里面有很多示例。
- 需要 Obsidian Sync 订阅:完整的绘图文件历史记录和设备之间的同步。
- 多语言支持:如果您想通过翻译插件来帮助,请与我联系。
## 反馈、问题、想法、问题
请在 [forum.obsidian.md](https://forum.obsidian.md/t/excalidraw-full-featured-sketching-plugin-in-obsidian) 上参与关于 Excalidraw 插件的讨论。
请前往 [GitHub](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues) 报告错误或请求增强功能。
---
## 感谢支持
如果您喜欢 Excalidraw,请通过在 [https://ko-fi/zsolt](https://ko-fi.com/zsolt) 上请我喝杯咖啡来支持我的工作和热情。
请通过在 Twitter、Reddit 或其他您常用的社交媒体平台上分享 Obsidian Excalidraw 插件来帮助传播消息。
您可以在 Twitter 上找到我 [@zsviczian](https://twitter.com/zsviczian),以及我的博客 [zsolt.blog](https://zsolt.blog)。
[<img style="float:left" src="https://user-images.githubusercontent.com/14358394/115450238-f39e8100-a21b-11eb-89d0-fa4b82cdbce8.png" width="200">](https://ko-fi.com/zsolt)
---
## Excalidraw 的朋友们
如果您喜欢 Excalidraw,可以考虑尝试 [ExcaliBrain](https://github.com/zsviczian/excalibrain)(也可通过 Obsidian 社区插件获得)。
<a href="https://youtu.be/gOkniMkDPyM" target="_blank"><img src="https://user-images.githubusercontent.com/14358394/169708346-9e41289d-9536-43ec-8f70-2d2ad2d369d6.png" width="300"/></a>
+2 -2
View File
@@ -6,7 +6,7 @@ import * as obsidian_module from "obsidian";
import ExcalidrawView, { ExportSettings } from "src/ExcalidrawView";
import { AppState, BinaryFileData, DataURL, ExcalidrawImperativeAPI, Point } from "@zsviczian/excalidraw/types/excalidraw/types";
import { EmbeddedFilesLoader } from "src/EmbeddedFileLoader";
import { ConnectionPoint, DeviceType } from "src/types";
import { ConnectionPoint, DeviceType } from "src/types/types";
import { ColorMaster } from "colormaster";
import { TInput } from "colormaster/types";
import { ClipboardData } from "@zsviczian/excalidraw/types/excalidraw/clipboard";
@@ -123,7 +123,7 @@ export declare class ExcalidrawAutomate {
* @param val //1: Virgil, 2:Helvetica, 3:Cascadia
* @returns
*/
setFontFamily(val: number): "Virgil, Segoe UI Emoji" | "Helvetica, Segoe UI Emoji" | "Cascadia, Segoe UI Emoji" | "LocalFont";
setFontFamily(val: number): "Virgil, Segoe UI Emoji" | "Helvetica, Segoe UI Emoji" | "Cascadia, Segoe UI Emoji" | "Local Font";
/**
* @param val //0:"light", 1:"dark"
* @returns
@@ -19,10 +19,10 @@ if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.0.25")) {
// -------------------------------
const excalidrawTemplates = ea.getListOfTemplateFiles();
if(typeof window.ExcalidrawDeconstructElements === "undefined") {
window.ExcalidrawDeconstructElements = {
openDeconstructedImage: true,
templatePath: excalidrawTemplates?.[0].path??""
};
window.ExcalidrawDeconstructElements = {
openDeconstructedImage: true,
templatePath: excalidrawTemplates?.[0].path??""
};
}
const splitFolderAndFilename = (filepath) => {
@@ -36,13 +36,13 @@ const splitFolderAndFilename = (filepath) => {
let settings = ea.getScriptSettings();
//set default values on first run
if(!settings["Templates"]) {
settings = {
"Templates" : {
value: "",
settings = {
"Templates" : {
value: "",
description: "Comma-separated list of template filepaths"
}
};
await ea.setScriptSettings(settings);
}
};
await ea.setScriptSettings(settings);
}
if(!settings["Default file name"]) {
@@ -80,31 +80,31 @@ ea.getElements().filter(el=>el.type==="image").forEach(el=>{
const img = ea.targetView.excalidrawData.getFile(el.fileId);
const path = (img?.linkParts?.original)??(img?.file?.path);
if(img && path) {
ea.imagesDict[el.fileId] = {
mimeType: img.mimeType,
id: el.fileId,
dataURL: img.img,
created: img.mtime,
file: path,
hasSVGwithBitmap: img.isSVGwithBitmap,
latex: null,
};
return;
}
const equation = ea.targetView.excalidrawData.getEquation(el.fileId);
eqImg = ea.targetView.getScene()?.files[el.fileId]
if(equation && eqImg) {
ea.imagesDict[el.fileId] = {
mimeType: eqImg.mimeType,
id: el.fileId,
dataURL: eqImg.dataURL,
created: eqImg.created,
file: null,
hasSVGwithBitmap: null,
latex: equation.latex,
};
return;
}
mimeType: img.mimeType,
id: el.fileId,
dataURL: img.img,
created: img.mtime,
file: path,
hasSVGwithBitmap: img.isSVGwithBitmap,
latex: null,
};
return;
}
const equation = ea.targetView.excalidrawData.getEquation(el.fileId);
eqImg = ea.targetView.getScene()?.files[el.fileId]
if(equation && eqImg) {
ea.imagesDict[el.fileId] = {
mimeType: eqImg.mimeType,
id: el.fileId,
dataURL: eqImg.dataURL,
created: eqImg.created,
file: null,
hasSVGwithBitmap: null,
latex: equation.latex,
};
return;
}
});
+2 -2
View File
@@ -427,7 +427,7 @@ const run = async (text) => {
const requestObject = isImageEditRequest
? {
...imageDataURL ? {image: imageDataURL} : {},
...imageDataURL ? {image: {url: imageDataURL}} : {},
...(text && text.trim() !== "") ? {text} : {},
imageGenerationProperties: {
size: imageSize,
@@ -437,7 +437,7 @@ const run = async (text) => {
},
}
: {
...imageDataURL ? {image: imageDataURL} : {},
...imageDataURL ? {image: {url: imageDataURL}} : {},
...(text && text.trim() !== "") ? {text} : {},
systemPrompt: systemPrompt.prompt,
instruction: outputType.instruction,
+259
View File
@@ -0,0 +1,259 @@
/*
Generates a hierarchical Markdown document out of a visual layout of an article.
Watch this video to understand how the script is intended to work:
![Excalidraw Writing Machine YouTube Video](https://youtu.be/zvRpCOZAUSs)
You can download the sample Obsidian Templater file from [here](https://gist.github.com/zsviczian/bf49d4b2d401f5749aaf8c2fa8a513d9)
You can download the demo PDF document showcased in the video from [here](https://zsviczian.github.io/DemoArticle-AtomicHabits.pdf)
```js*/
const selectedElements = ea.getViewSelectedElements();
if (selectedElements.length !== 1 || selectedElements[0].type === "arrow") {
new Notice("Select a single element that is not an arrow and not a frame");
return;
}
const visited = new Set(); // Avoiding recursive infinite loops
delete window.ewm;
await ea.targetView.save();
//------------------
// Load Settings
//------------------
let settings = ea.getScriptSettings();
//set default values on first run
let didSettingsChange = false;
if(!settings["Template path"]) {
settings = {
"Template path" : {
value: "",
description: "The template file path that will receive the concatenated text. If the file includes <<<REPLACE ME>>> then it will be replaced with the generated text, if <<<REPLACE ME>>> is not present in the file the hierarchical markdown generated from the diagram will be added to the end of the template."
},
"ZK '# Summary' section": {
value: "Summary",
description: "The section in your visual zettelkasten file that contains the short written summary of the idea. This is the text that will be included in the hierarchical markdown file if visual ZK cards are included in your flow"
},
"ZK '# Source' section": {
value: "Source",
description: "The section in your visual zettelkasten file that contains the reference to your source. If present in the file, this text will be included in the output file as a reference"
},
"Embed image links": {
value: true,
description: "Should the resulting markdown document include the ![[embedded images]]?"
}
};
didSettingsChange = true;
}
if(!settings["Generate ![markdown](links)"]) {
settings["Generate ![markdown](links)"] = {
value: true,
description: "If you turn this off the script will generate ![[wikilinks]] for images"
}
didSettingsChange = true;
}
if(didSettingsChange) {
await ea.setScriptSettings(settings);
}
const ZK_SOURCE = settings["ZK '# Source' section"].value;
const ZK_SECTION = settings["ZK '# Summary' section"].value;
const INCLUDE_IMG_LINK = settings["Embed image links"].value;
const MARKDOWN_LINKS = settings["Generate ![markdown](links)"].value;
let templatePath = settings["Template path"].value;
//------------------
// Select template file
//------------------
const MSG = "Select another file"
let selection = MSG;
if(templatePath && app.vault.getAbstractFileByPath(templatePath)) {
selection = await utils.suggester([templatePath, MSG],[templatePath, MSG], "Use previous template or select another?");
if(!selection) {
new Notice("process aborted");
return;
}
}
if(selection === MSG) {
const files = app.vault.getMarkdownFiles().map(f=>f.path);
selection = await utils.suggester(files,files,"Select the template to use. ESC to not use a tempalte");
}
if(selection && selection !== templatePath) {
settings["Template path"].value = selection;
await ea.setScriptSettings(settings);
}
templatePath = selection;
//------------------
// supporting functions
//------------------
function getNextElementFollowingArrow(el, arrow) {
if (arrow.startBinding?.elementId === el.id) {
return ea.getViewElements().find(x => x.id === arrow.endBinding?.elementId);
}
if (arrow.endBinding?.elementId === el.id) {
return ea.getViewElements().find(x => x.id === arrow.startBinding?.elementId);
}
return null;
}
function getImageLink(f) {
if(MARKDOWN_LINKS) {
return `![${f.basename}](${encodeURI(f.path)})`;
}
return `![[${f.path}|${f.basename}]]`;
}
function getBoundText(el) {
const textId = el.boundElements?.find(x => x.type === "text")?.id;
const text = ea.getViewElements().find(x => x.id === textId)?.originalText;
return text ? text + "\n" : "";
}
async function getSectionText(file, section) {
const content = await app.vault.cachedRead(file);
const metadata = app.metadataCache.getFileCache(file);
if (!metadata || !metadata.headings) {
return null;
}
const targetHeading = metadata.headings.find(h => h.heading === section);
if (!targetHeading) {
return null;
}
const startPos = targetHeading.position.start.offset;
let endPos = content.length;
const nextHeading = metadata.headings.find(h => h.position.start.offset > startPos);
if (nextHeading) {
endPos = nextHeading.position.start.offset;
}
let sectionContent = content.slice(startPos, endPos).trim();
sectionContent = sectionContent.substring(sectionContent.indexOf('\n') + 1).trim();
// Remove Markdown comments enclosed in %%
sectionContent = sectionContent.replace(/%%[\s\S]*?%%/g, '').trim();
return sectionContent;
}
async function getBlockText(file, blockref) {
const content = await app.vault.cachedRead(file);
const blockPattern = new RegExp(`\\^${blockref}\\b`, 'g');
let blockPosition = content.search(blockPattern);
if (blockPosition === -1) {
return "";
}
const startPos = content.lastIndexOf('\n', blockPosition) + 1;
let endPos = content.indexOf('\n', blockPosition);
if (endPos === -1) {
endPos = content.length;
} else {
const nextBlockOrHeading = content.slice(endPos).search(/(^# |^\^|\n)/gm);
if (nextBlockOrHeading !== -1) {
endPos += nextBlockOrHeading;
} else {
endPos = content.length;
}
}
let blockContent = content.slice(startPos, endPos).trim();
blockContent = blockContent.replace(blockPattern, '').trim();
blockContent = blockContent.replace(/%%[\s\S]*?%%/g, '').trim();
return blockContent;
}
async function getElementText(el) {
if (el.type === "text") {
return el.originalText;
}
if (el.type === "image") {
const f = ea.getViewFileForImageElement(el);
if(!ea.isExcalidrawFile(f)) return f.name + (INCLUDE_IMG_LINK ? `\n${getImageLink(f)}\n` : "");
let source = await getSectionText(f, ZK_SOURCE);
source = source ? ` (source:: ${source})` : "";
const summary = await getSectionText(f, ZK_SECTION) ;
if(summary) return (INCLUDE_IMG_LINK ? `${getImageLink(f)}\n${summary + source}` : summary + source) + "\n";
return f.name + (INCLUDE_IMG_LINK ? `\n${getImageLink(f)}\n` : "");
}
if (el.type === "embeddable") {
const linkWithRef = el.link.match(/\[\[([^\]]*)]]/)?.[1];
if(!linkWithRef) return "";
const path = linkWithRef.split("#")[0];
const f = app.metadataCache.getFirstLinkpathDest(path, ea.targetView.file.path);
if(!f) return "";
if(f.extension !== "md") return f.name;
const ref = linkWithRef.split("#")[1];
if(!ref) return await app.vault.read(f);
if(ref.startsWith("^")) {
return await getBlockText(f, ref.substring(1));
} else {
return await getSectionText(f, ref);
}
}
return getBoundText(el);
}
//------------------
// Navigating the hierarchy
//------------------
async function crawl(el, level, isFirst = false) {
visited.add(el.id);
let result = await getElementText(el) + "\n";
// Process all arrows connected to this element
const boundElementsData = el.boundElements.filter(x => x.type === "arrow");
const isFork = boundElementsData.length > (isFirst ? 1 : 2);
if(isFork) level++;
for(const bindingData of boundElementsData) {
const arrow = ea.getViewElements().find(x=> x.id === bindingData.id);
const nextEl = getNextElementFollowingArrow(el, arrow);
if (nextEl && !visited.has(nextEl.id)) {
if(isFork) result += `\n${"#".repeat(level)} `;
const arrowLabel = getBoundText(arrow);
if (arrowLabel) {
// If the arrow has a label, add it as an additional level
result += arrowLabel + "\n";
result += await crawl(nextEl, level);
} else {
// If no label, continue to the next element
result += await crawl(nextEl, level);
}
}
};
return result;
}
window.ewm = "## " + await crawl(selectedElements[0], 2, true);
const outputPath = await ea.getAttachmentFilepath(`EWM - ${ea.targetView.file.name}.md`);
let result = templatePath
? await app.vault.read(app.vault.getAbstractFileByPath(templatePath))
: "";
if(result.match("<<<REPLACE ME>>>")) {
result = result.replaceAll("<<<REPLACE ME>>>",window.ewm);
} else {
result += window.ewm;
}
const outfile = await app.vault.create(outputPath,result);
setTimeout(()=>{
ea.openFileInNewOrAdjacentLeaf(outfile);
}, 250);
+11
View File
@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="CurrentColor" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-keyboard">
<path stroke-width="2" d="M10 8h.01"/>
<path stroke-width="2" d="M12 12h.01"/>
<path stroke-width="2" d="M14 8h.01"/>
<path stroke-width="2" d="M16 12h.01"/>
<path stroke-width="2" d="M18 8h.01"/>
<path stroke-width="2" d="M6 8h.01"/>
<path stroke-width="2" d="M7 16h10"/>
<path stroke-width="2" d="M8 12h.01"/>
<path fill="none" stroke-width="2" d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"/>
</svg>

After

Width:  |  Height:  |  Size: 611 B

+40
View File
@@ -8,6 +8,46 @@ https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.h
```javascript
*/
if(ea.verifyMinimumPluginVersion && ea.verifyMinimumPluginVersion("2.4.0")) {
const api = ea.getExcalidrawAPI();
let appState = api.getAppState();
let gridFrequency = appState.gridStep;;
const customControls = (container) => {
new ea.obsidian.Setting(container)
.setName(`Major grid frequency`)
.addDropdown(dropdown => {
[2,3,4,5,6,7,8,9,10].forEach(grid=>dropdown.addOption(grid,grid));
dropdown
.setValue(gridFrequency)
.onChange(value => {
gridFrequency = value;
})
})
}
const gridSize = parseInt(await utils.inputPrompt(
"Grid size?",
null,
appState.GridSize?.toString()??"20",
null,
1,
false,
customControls
));
if(isNaN(gridSize)) return; //this is to avoid passing an illegal value to Excalidraw
const gridStep = isNaN(parseInt(gridFrequency)) ? appState.gridStep : parseInt(gridFrequency);
api.updateScene({
appState : {gridSize, gridStep, gridModeEnabled:true},
commitToHistory:false
});
}
// ----------------
// old script
// ----------------
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("1.9.19")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
return;
@@ -9,7 +9,11 @@ https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.h
```javascript
*/
let width = (ea.getViewSelectedElement().strokeWidth??1).toString();
width = await utils.inputPrompt("Width?","number",width);
width = parseFloat(await utils.inputPrompt("Width?","number",width));
if(isNaN(width)) {
new Notice("Invalid number");
return;
}
const elements=ea.getViewSelectedElements();
ea.copyViewElementsToEAforEditing(elements);
ea.getElements().forEach((el)=>el.strokeWidth=width);
+1 -1
View File
@@ -1 +1 @@
[{"fname":"Mindmap connector.md","mtime":1658686599427},{"fname":"Mindmap connector.svg","mtime":1658686599427},{"fname":"Add Connector Point.md","mtime":1645305706000},{"fname":"Add Connector Point.svg","mtime":1645944722000},{"fname":"Add Link to Existing File and Open.md","mtime":1647807918345},{"fname":"Add Link to Existing File and Open.svg","mtime":1645964261000},{"fname":"Add Link to New Page and Open.md","mtime":1654168862138},{"fname":"Add Link to New Page and Open.svg","mtime":1645960639000},{"fname":"Add Next Step in Process.md","mtime":1688304760357},{"fname":"Add Next Step in Process.svg","mtime":1645960639000},{"fname":"Box Each Selected Groups.md","mtime":1645305706000},{"fname":"Box Each Selected Groups.svg","mtime":1645967510000},{"fname":"Box Selected Elements.md","mtime":1645305706000},{"fname":"Box Selected Elements.svg","mtime":1645960639000},{"fname":"Change shape of selected elements.md","mtime":1652701169236},{"fname":"Change shape of selected elements.svg","mtime":1645960775000},{"fname":"Connect elements.md","mtime":1645305706000},{"fname":"Connect elements.svg","mtime":1645960639000},{"fname":"Convert freedraw to line.md","mtime":1645305706000},{"fname":"Convert freedraw to line.svg","mtime":1645960639000},{"fname":"Convert selected text elements to sticky notes.md","mtime":1670169501383},{"fname":"Convert selected text elements to sticky notes.svg","mtime":1645960639000},{"fname":"Convert text to link with folder and alias.md","mtime":1641639819000},{"fname":"Convert text to link with folder and alias.svg","mtime":1645960639000},{"fname":"Copy Selected Element Styles to Global.md","mtime":1642232088000},{"fname":"Copy Selected Element Styles to Global.svg","mtime":1645960639000},{"fname":"Create new markdown file and embed into active drawing.md","mtime":1640866935000},{"fname":"Create new markdown file and embed into active drawing.svg","mtime":1645960639000},{"fname":"Darken background color.md","mtime":1663059051059},{"fname":"Darken background color.svg","mtime":1645960639000},{"fname":"Elbow connectors.md","mtime":1671126911490},{"fname":"Elbow connectors.svg","mtime":1645960639000},{"fname":"Expand rectangles horizontally keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles horizontally keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles horizontally.md","mtime":1644950235000},{"fname":"Expand rectangles horizontally.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles vertically keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically.md","mtime":1658686599427},{"fname":"Expand rectangles vertically.svg","mtime":1645967510000},{"fname":"Fixed horizontal distance between centers.md","mtime":1646743234000},{"fname":"Fixed horizontal distance between centers.svg","mtime":1645960639000},{"fname":"Fixed inner distance.md","mtime":1646743234000},{"fname":"Fixed inner distance.svg","mtime":1645960639000},{"fname":"Fixed spacing.md","mtime":1646743234000},{"fname":"Fixed spacing.svg","mtime":1645967510000},{"fname":"Fixed vertical distance between centers.md","mtime":1646743234000},{"fname":"Fixed vertical distance between centers.svg","mtime":1645967510000},{"fname":"Fixed vertical distance.md","mtime":1646743234000},{"fname":"Fixed vertical distance.svg","mtime":1645967510000},{"fname":"Lighten background color.md","mtime":1663059051059},{"fname":"Lighten background color.svg","mtime":1645959546000},{"fname":"Modify background color opacity.md","mtime":1644924415000},{"fname":"Modify background color opacity.svg","mtime":1645944722000},{"fname":"Normalize Selected Arrows.md","mtime":1670403743278},{"fname":"Normalize Selected Arrows.svg","mtime":1645960639000},{"fname":"Organic Line.md","mtime":1672920172531},{"fname":"Organic Line.svg","mtime":1645964261000},{"fname":"Organic Line Legacy.md","mtime":1690607372668},{"fname":"Organic Line Legacy.svg","mtime":1690607372668},{"fname":"README.md","mtime":1645175700000},{"fname":"Repeat Elements.md","mtime":1663059051059},{"fname":"Repeat Elements.svg","mtime":1645960639000},{"fname":"Reverse arrows.md","mtime":1645305706000},{"fname":"Reverse arrows.svg","mtime":1645960639000},{"fname":"Scribble Helper.md","mtime":1682228345043},{"fname":"Scribble Helper.svg","mtime":1645944722000},{"fname":"Select Elements of Type.md","mtime":1643464321000},{"fname":"Select Elements of Type.svg","mtime":1645960639000},{"fname":"Set Dimensions.md","mtime":1645305706000},{"fname":"Set Dimensions.svg","mtime":1645944722000},{"fname":"Set Font Family.md","mtime":1645305706000},{"fname":"Set Font Family.svg","mtime":1645944722000},{"fname":"Set Grid.md","mtime":1693725826368},{"fname":"Set Grid.svg","mtime":1645960639000},{"fname":"Set Link Alias.md","mtime":1645305706000},{"fname":"Set Link Alias.svg","mtime":1645960639000},{"fname":"Set Stroke Width of Selected Elements.md","mtime":1645305706Line truncated
[{"fname":"Mindmap connector.md","mtime":1658686599427},{"fname":"Mindmap connector.svg","mtime":1658686599427},{"fname":"Add Connector Point.md","mtime":1645305706000},{"fname":"Add Connector Point.svg","mtime":1645944722000},{"fname":"Add Link to Existing File and Open.md","mtime":1647807918345},{"fname":"Add Link to Existing File and Open.svg","mtime":1645964261000},{"fname":"Add Link to New Page and Open.md","mtime":1654168862138},{"fname":"Add Link to New Page and Open.svg","mtime":1645960639000},{"fname":"Add Next Step in Process.md","mtime":1688304760357},{"fname":"Add Next Step in Process.svg","mtime":1645960639000},{"fname":"Box Each Selected Groups.md","mtime":1645305706000},{"fname":"Box Each Selected Groups.svg","mtime":1645967510000},{"fname":"Box Selected Elements.md","mtime":1645305706000},{"fname":"Box Selected Elements.svg","mtime":1645960639000},{"fname":"Change shape of selected elements.md","mtime":1652701169236},{"fname":"Change shape of selected elements.svg","mtime":1645960775000},{"fname":"Connect elements.md","mtime":1645305706000},{"fname":"Connect elements.svg","mtime":1645960639000},{"fname":"Convert freedraw to line.md","mtime":1645305706000},{"fname":"Convert freedraw to line.svg","mtime":1645960639000},{"fname":"Convert selected text elements to sticky notes.md","mtime":1670169501383},{"fname":"Convert selected text elements to sticky notes.svg","mtime":1645960639000},{"fname":"Convert text to link with folder and alias.md","mtime":1641639819000},{"fname":"Convert text to link with folder and alias.svg","mtime":1645960639000},{"fname":"Copy Selected Element Styles to Global.md","mtime":1642232088000},{"fname":"Copy Selected Element Styles to Global.svg","mtime":1645960639000},{"fname":"Create new markdown file and embed into active drawing.md","mtime":1640866935000},{"fname":"Create new markdown file and embed into active drawing.svg","mtime":1645960639000},{"fname":"Darken background color.md","mtime":1663059051059},{"fname":"Darken background color.svg","mtime":1645960639000},{"fname":"Elbow connectors.md","mtime":1671126911490},{"fname":"Elbow connectors.svg","mtime":1645960639000},{"fname":"Expand rectangles horizontally keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles horizontally keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles horizontally.md","mtime":1644950235000},{"fname":"Expand rectangles horizontally.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles vertically keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically.md","mtime":1658686599427},{"fname":"Expand rectangles vertically.svg","mtime":1645967510000},{"fname":"Fixed horizontal distance between centers.md","mtime":1646743234000},{"fname":"Fixed horizontal distance between centers.svg","mtime":1645960639000},{"fname":"Fixed inner distance.md","mtime":1646743234000},{"fname":"Fixed inner distance.svg","mtime":1645960639000},{"fname":"Fixed spacing.md","mtime":1646743234000},{"fname":"Fixed spacing.svg","mtime":1645967510000},{"fname":"Fixed vertical distance between centers.md","mtime":1646743234000},{"fname":"Fixed vertical distance between centers.svg","mtime":1645967510000},{"fname":"Fixed vertical distance.md","mtime":1646743234000},{"fname":"Fixed vertical distance.svg","mtime":1645967510000},{"fname":"Lighten background color.md","mtime":1663059051059},{"fname":"Lighten background color.svg","mtime":1645959546000},{"fname":"Modify background color opacity.md","mtime":1644924415000},{"fname":"Modify background color opacity.svg","mtime":1645944722000},{"fname":"Normalize Selected Arrows.md","mtime":1670403743278},{"fname":"Normalize Selected Arrows.svg","mtime":1645960639000},{"fname":"Organic Line.md","mtime":1672920172531},{"fname":"Organic Line.svg","mtime":1645964261000},{"fname":"Organic Line Legacy.md","mtime":1690607372668},{"fname":"Organic Line Legacy.svg","mtime":1690607372668},{"fname":"README.md","mtime":1645175700000},{"fname":"Repeat Elements.md","mtime":1663059051059},{"fname":"Repeat Elements.svg","mtime":1645960639000},{"fname":"Reverse arrows.md","mtime":1645305706000},{"fname":"Reverse arrows.svg","mtime":1645960639000},{"fname":"Scribble Helper.md","mtime":1682228345043},{"fname":"Scribble Helper.svg","mtime":1645944722000},{"fname":"Select Elements of Type.md","mtime":1643464321000},{"fname":"Select Elements of Type.svg","mtime":1645960639000},{"fname":"Set Dimensions.md","mtime":1645305706000},{"fname":"Set Dimensions.svg","mtime":1645944722000},{"fname":"Set Font Family.md","mtime":1645305706000},{"fname":"Set Font Family.svg","mtime":1645944722000},{"fname":"Set Grid.md","mtime":1693725826368},{"fname":"Set Grid.svg","mtime":1645960639000},{"fname":"Set Link Alias.md","mtime":1645305706000},{"fname":"Set Link Alias.svg","mtime":1645960639000},{"fname":"Set Stroke Width of Selected Elements.md","mtime":1723788773Line truncated
+7
View File
@@ -119,6 +119,7 @@ I would love to include your contribution in the script library. If you have a s
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Custom%20Zoom.svg"/></div>|[[#Custom Zoom]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Copy%20Selected%20Element%20Styles%20to%20Global.svg"/></div>|[[#Copy Selected Element Styles to Global]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/ExcaliAI.svg"/></div>|[[#ExcaliAI]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Excalidraw%20Writing%20Machine.svg"/></div>|[[#Excalidraw Writing Machine]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/GPT-Draw-a-UI.svg"/></div>|[[#GPT Draw-a-UI]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Hardware%20Eraser%20Support.svg"/></div>|[[#Hardware Eraser Support]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Palette%20loader.svg"/></div>|[[#Palette Loader]]|
@@ -389,6 +390,12 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/zsviczian'>@zsviczian</a></td></tr><tr valign='top'><td class="label">Source</td><td class="data"><a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/ExcaliAI.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Various AI features based on GPT Vision.<br><iframe width="400" height="225" src="https://www.youtube.com/embed/A1vrSGBbWgo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-draw-a-ui.jpg'></td></tr></table>
## Excalidraw Writing Machine
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Excalidraw%20Writing%20Machine.md
```
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/zsviczian'>@zsviczian</a></td></tr><tr valign='top'><td class="label">Source</td><td class="data"><a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Excalidraw%20Writing%20Machine.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Creates a hierarchical Markdown document out of a visual layout of an article that can be fed to Templater and converted into an article using AI for Templater.<br>Watch this video to understand how the script is intended to work:<br><iframe width="400" height="225" src="https://www.youtube.com/embed/zvRpCOZAUSs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><br>You can download the sample Obsidian Templater file from <a href="https://gist.github.com/zsviczian/bf49d4b2d401f5749aaf8c2fa8a513d9">here</a>. You can download the demo PDF document showcased in the video from <a href="https://zsviczian.github.io/DemoArticle-AtomicHabits.pdf">here</a>.</td></tr></table>
## GPT Draw-a-UI
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/GPT-Draw-a-UI.md
Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 KiB

After

Width:  |  Height:  |  Size: 861 KiB

+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.2.7-5",
"version": "2.4.0-rc-2",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",
+3 -3
View File
@@ -1,12 +1,12 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.2.10",
"version": "2.3.0",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",
"authorUrl": "https://zsolt.blog",
"authorUrl": "https://www.zsolt.blog",
"fundingUrl": "https://ko-fi.com/zsolt",
"helpUrl": "https://github.com/zsviczian/obsidian-excalidraw-plugin#readme",
"isDesktopOnly": false
}
}
+18 -16
View File
@@ -19,42 +19,50 @@
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/excalidraw": "0.17.1-obsidian-32",
"@zsviczian/excalidraw": "0.17.1-obsidian-45",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"colormaster": "^1.2.1",
"@zsviczian/colormaster": "^1.2.2",
"gl-matrix": "^3.4.3",
"js-yaml": "^4.1.0",
"lucide-react": "^0.263.1",
"mathjax-full": "^3.2.2",
"monkey-around": "^2.3.0",
"nanoid": "^4.0.2",
"opentype.js": "^1.3.4",
"polybooljs": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"roughjs": "^4.5.2",
"js-yaml": "^4.1.0"
"woff2sfnt-sfnt2woff": "^1.0.0"
},
"devDependencies": {
"dotenv": "^16.4.5",
"@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
"@codemirror/commands": "^6.3.3",
"@codemirror/language": "^6.10.0",
"@codemirror/search": "^6.5.5",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.23.0",
"@excalidraw/eslint-config": "^1.0.3",
"@excalidraw/prettier-config": "^1.0.2",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-typescript": "^11.1.2",
"@rollup/plugin-typescript": "^11.1.6",
"@types/chroma-js": "^2.4.0",
"@types/js-beautify": "^1.14.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.10.5",
"@types/opentype.js": "^1.3.8",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@types/js-yaml": "^4.0.9",
"@zerollup/ts-transform-paths": "^1.7.18",
"cross-env": "^7.0.3",
"cssnano": "^6.0.2",
"dotenv": "^16.4.5",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"lz-string": "^1.5.0",
@@ -62,18 +70,12 @@
"prettier": "^3.0.1",
"rollup": "^2.70.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-postprocess": "github:brettz9/rollup-plugin-postprocess#update",
"@zsviczian/rollup-plugin-postprocess": "^1.0.3",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.34.1",
"rollup-plugin-web-worker-loader": "^1.6.1",
"tslib": "^2.6.1",
"ttypescript": "^1.5.15",
"typescript": "^5.2.2",
"@codemirror/commands": "^6.3.3",
"@codemirror/language": "^6.10.0",
"@codemirror/search": "^6.5.5",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.23.0"
"typescript": "^5.2.2"
},
"resolutions": {
"@typescript-eslint/typescript-estree": "5.3.0"
+16 -35
View File
@@ -1,21 +1,19 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import replace from "@rollup/plugin-replace";
import { terser } from "rollup-plugin-terser";
import copy from "rollup-plugin-copy";
import typescript2 from "rollup-plugin-typescript2";
import webWorker from "rollup-plugin-web-worker-loader";
import fs from 'fs';
import LZString from 'lz-string';
import postprocess from 'rollup-plugin-postprocess';
import postprocess from '@zsviczian/rollup-plugin-postprocess';
import cssnano from 'cssnano';
// Load environment variables
import dotenv from 'dotenv';
dotenv.config();
const DIST_FOLDER = 'dist';
const DIST_FOLDER = 'dist';
const isProd = (process.env.NODE_ENV === "production");
const isLib = (process.env.NODE_ENV === "lib");
console.log(`Running: ${process.env.NODE_ENV}`);
@@ -83,9 +81,12 @@ const BASE_CONFIG = {
const getRollupPlugins = (tsconfig, ...plugins) => [
typescript2(tsconfig),
nodeResolve({ browser: true }),
replace({
preventAssignment: true,
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
}),
commonjs(),
webWorker({ inline: true, forceInline: true, targetPlatform: "browser" }),
nodeResolve({ browser: true, preferBuiltins: false }),
].concat(plugins);
const BUILD_CONFIG = {
@@ -96,48 +97,28 @@ const BUILD_CONFIG = {
format: 'cjs',
exports: 'default',
},
plugins: [
typescript2({
tsconfig: isProd ? "tsconfig.json" : "tsconfig.dev.json",
}),
replace({
preventAssignment: true,
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
}),
babel({
presets: [['@babel/preset-env', {
targets: {
esmodules: true,
},
}]],
exclude: "node_modules/**",
}),
commonjs(),
nodeResolve({ browser: true, preferBuiltins: false }),
plugins: getRollupPlugins(
{tsconfig: isProd ? "tsconfig.json" : "tsconfig.dev.json"},
...(isProd ? [
terser({
toplevel: false,
compress: { passes: 2 },
format: {
comments: false, // Remove all comments
},
}),
//!postprocess - the version available on npmjs does not work, need this update:
// npm install brettz9/rollup-plugin-postprocess#update --save-dev
// https://github.com/developit/rollup-plugin-postprocess/issues/10
postprocess([
[/React=require\("react"\),state=require\("@codemirror\/state"\),view=require\("@codemirror\/view"\)/,
`state=require("@codemirror/state"),view=require("@codemirror/view")` + packageString],
]),
] : [
postprocess([
[/var React = require\('react'\);/, packageString],
]),
postprocess([ [/var React = require\('react'\);/, packageString] ]),
]),
copy({
targets: [
{ src: 'manifest.json', dest: DIST_FOLDER },
],
verbose: true, // Optional: To display copied files in the console
targets: [ { src: 'manifest.json', dest: DIST_FOLDER } ],
verbose: true,
}),
],
),
};
const LIB_CONFIG = {
+76 -20
View File
@@ -4,11 +4,6 @@
import { ExcalidrawElement, FileId } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { BinaryFileData, DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
import { App, MarkdownRenderer, Notice, TFile } from "obsidian";
import {
ASSISTANT_FONT,
CASCADIA_FONT,
VIRGIL_FONT,
} from "./constants/constFonts";
import {
DEFAULT_MD_EMBED_CSS,
fileid,
@@ -16,6 +11,7 @@ import {
nanoid,
THEME_FILTER,
FRONTMATTER_KEYS,
getCSSFontDefinition,
} from "./constants/constants";
import { createSVG } from "./ExcalidrawAutomate";
import { ExcalidrawData, getTransclusion } from "./ExcalidrawData";
@@ -38,10 +34,10 @@ import {
LinkParts,
svgToBase64,
isMaskFile,
embedFontsInSVG,
getEmbeddedFilenameParts,
cropCanvas,
} from "./utils/Utils";
import { ValueOf } from "./types";
import { ValueOf } from "./types/types";
import { getMermaidImageElements, getMermaidText, shouldRenderMermaid } from "./utils/MermaidUtils";
import { mermaidToExcalidraw } from "src/constants/constants";
import { ImageKey, imageCache } from "./utils/ImageCache";
@@ -363,6 +359,7 @@ export class EmbeddedFilesLoader {
: false,
withTheme: !!forceTheme,
isMask,
skipInliningFonts: false,
};
const hasColorMap = Boolean(inFile instanceof EmbeddedFile ? inFile.colorMap : null);
@@ -370,7 +367,10 @@ export class EmbeddedFilesLoader {
const hasFilenameParts = Boolean((inFile instanceof EmbeddedFile) && inFile.filenameparts);
const filenameParts = hasFilenameParts ? (inFile as EmbeddedFile).filenameparts : null;
const cacheKey:ImageKey = {
...hasFilenameParts? filenameParts : {
...hasFilenameParts? {
...filenameParts,
inlineFonts: !exportSettings.skipInliningFonts,
}: {
filepath: file.path,
hasBlockref: false,
hasGroupref: false,
@@ -379,6 +379,7 @@ export class EmbeddedFilesLoader {
hasFrameref: false,
hasClippedFrameref: false,
hasSectionref: false,
inlineFonts: !exportSettings.skipInliningFonts,
blockref: null,
sectionref: null,
linkpartReference: null,
@@ -445,16 +446,16 @@ export class EmbeddedFilesLoader {
//see svgWithFont below
imageCache.addImageToCache(cacheKey,"", svg);
}
const svgWithFont = embedFontsInSVG(svg, this.plugin);
if(!svgWithFont.hasAttribute("width") && svgWithFont.hasAttribute("viewBox")){
if(!svg.hasAttribute("width") && svg.hasAttribute("viewBox")){
//2024.06.09
//this addresses backward compatibility issues where the cache does not have the width and height attributes
//this should be removed in the future
const vb = svgWithFont.getAttr("viewBox").split(" ");
Boolean(vb[2]) && svgWithFont.setAttribute("width", vb[2]);
Boolean(vb[3]) && svgWithFont.setAttribute("height", vb[3]);
const vb = svg.getAttr("viewBox").split(" ");
Boolean(vb[2]) && svg.setAttribute("width", vb[2]);
Boolean(vb[3]) && svg.setAttribute("height", vb[3]);
}
const dURL = svgToBase64(svgWithFont.outerHTML) as DataURL;
const dURL = svgToBase64(svg.outerHTML) as DataURL;
return {dataURL: dURL as DataURL, hasSVGwithBitmap};
};
@@ -472,6 +473,8 @@ export class EmbeddedFilesLoader {
return null;
}
const app = this.plugin.app;
const isHyperLink = inFile instanceof EmbeddedFile ? inFile.isHyperLink : false;
const isLocalLink = inFile instanceof EmbeddedFile ? inFile.isLocalLink : false;
const hyperlink = inFile instanceof EmbeddedFile ? inFile.hyperlink : "";
@@ -746,6 +749,8 @@ export class EmbeddedFilesLoader {
}
const pageNum = isNaN(linkParts.page) ? 1 : (linkParts.page??1);
const scale = this.plugin.settings.pdfScale;
const cropRect = linkParts.ref.split("rect=")[1]?.split(",").map(x=>parseInt(x));
const validRect = cropRect && cropRect.length === 4 && cropRect.every(x=>!isNaN(x));
// Render the page
const renderPage = async (num:number) => {
@@ -766,6 +771,23 @@ export class EmbeddedFilesLoader {
};
await page.render(renderCtx).promise;
if(validRect) {
const [left, bottom, _, top] = page.view;
const pageHeight = top - bottom;
width = (cropRect[2] - cropRect[0]) * scale;
height = (cropRect[3] - cropRect[1]) * scale;
const crop = validRect ? {
left: (cropRect[0] - left) * scale,
top: (bottom + pageHeight - cropRect[3]) * scale,
width,
height,
} : undefined;
if(crop) {
return cropCanvas(canvas, crop);
}
}
return canvas;
};
@@ -816,13 +838,29 @@ export class EmbeddedFilesLoader {
}
switch (fontName) {
case "Virgil":
fontDef = VIRGIL_FONT;
fontDef = await getCSSFontDefinition(1);
break;
case "Cascadia":
fontDef = CASCADIA_FONT;
fontDef = await getCSSFontDefinition(3);
break;
case "Assistant":
fontDef = ASSISTANT_FONT;
case "Assistant":
case "Helvetica":
fontDef = await getCSSFontDefinition(2);
break;
case "Excalifont":
fontDef = await getCSSFontDefinition(5);
break;
case "Nunito":
fontDef = await getCSSFontDefinition(6);
break;
case "Lilita One":
fontDef = await getCSSFontDefinition(7);
break;
case "Comic Shanns":
fontDef = await getCSSFontDefinition(8);
break;
case "Liberation Sans":
fontDef = await getCSSFontDefinition(9);
break;
case "":
fontDef = "";
@@ -905,12 +943,14 @@ export class EmbeddedFilesLoader {
mdDIV.style.display = "block";
mdDIV.style.color = fontColor && fontColor !== "" ? fontColor : "initial";
await MarkdownRenderer.renderMarkdown(text, mdDIV, file.path, plugin);
//await MarkdownRenderer.renderMarkdown(text, mdDIV, file.path, plugin);
await MarkdownRenderer.render(this.plugin.app,text,mdDIV,file.path,this.plugin);
mdDIV
.querySelectorAll(":scope > *[class^='frontmatter']")
.forEach((el) => mdDIV.removeChild(el));
await replaceBlobWithBase64(mdDIV); //because image cache returns a blob
const internalEmbeds = Array.from(mdDIV.querySelectorAll("span[class='internal-embed']"))
for(let i=0;i<internalEmbeds.length;i++) {
const el = internalEmbeds[i];
@@ -1071,3 +1111,19 @@ export const generateIdFromFile = async (file: ArrayBuffer, key?: string): Promi
}
return id;
};
const replaceBlobWithBase64 = async (divElement: HTMLDivElement): Promise<void> => {
const images = divElement.querySelectorAll<HTMLImageElement>('img[src^="blob:app://obsidian.md"]');
for (let img of images) {
const blobUrl = img.src;
try {
const response = await fetch(blobUrl);
const blob = await response.blob();
const base64 = await blobToBase64(blob);
img.src = `data:${blob.type};base64,${base64}`;
} catch (error) {
console.error(`Failed to fetch or convert blob: ${blobUrl}`, error);
}
}
};
+238 -71
View File
@@ -13,6 +13,7 @@ import {
ExcalidrawFrameElement,
ExcalidrawTextContainer,
} from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { MimeType } from "./EmbeddedFileLoader";
import { Editor, normalizePath, Notice, OpenViewState, RequestUrlResponse, TFile, TFolder, WorkspaceLeaf } from "obsidian";
import * as obsidian_module from "obsidian";
import ExcalidrawView, { ExportSettings, TextMode, getTextMode } from "src/ExcalidrawView";
@@ -27,7 +28,7 @@ import {
GITHUB_RELEASES,
determineFocusDistance,
getCommonBoundingBox,
getDefaultLineHeight,
getLineHeight,
getMaximumGroups,
intersectElementWithLine,
measureText,
@@ -37,11 +38,11 @@ import {
THEME_FILTER,
mermaidToExcalidraw,
refreshTextDimensions,
getFontFamilyString,
} from "src/constants/constants";
import { blobToBase64, checkAndCreateFolder, getDrawingFilename, getExcalidrawEmbeddedFilesFiletree, getListOfTemplateFiles, getNewUniqueFilepath, hasExcalidrawEmbeddedImagesTreeChanged, } from "src/utils/FileUtils";
import {
//debug,
embedFontsInSVG,
errorlog,
getEmbeddedFilenameParts,
getImageSize,
@@ -61,22 +62,22 @@ import { tex2dataURL } from "src/LaTeX";
import { GenericInputPrompt, NewFileActions } from "src/dialogs/Prompt";
import { t } from "src/lang/helpers";
import { ScriptEngine } from "src/Scripts";
import { ConnectionPoint, DeviceType } from "src/types";
import CM, { ColorMaster, extendPlugins } from "colormaster";
import HarmonyPlugin from "colormaster/plugins/harmony";
import MixPlugin from "colormaster/plugins/mix"
import A11yPlugin from "colormaster/plugins/accessibility"
import NamePlugin from "colormaster/plugins/name"
import LCHPlugin from "colormaster/plugins/lch";
import LUVPlugin from "colormaster/plugins/luv";
import LABPlugin from "colormaster/plugins/lab";
import UVWPlugin from "colormaster/plugins/uvw";
import XYZPlugin from "colormaster/plugins/xyz";
import HWBPlugin from "colormaster/plugins/hwb";
import HSVPlugin from "colormaster/plugins/hsv";
import RYBPlugin from "colormaster/plugins/ryb";
import CMYKPlugin from "colormaster/plugins/cmyk";
import { TInput } from "colormaster/types";
import { ConnectionPoint, DeviceType } from "src/types/types";
import CM, { ColorMaster, extendPlugins } from "@zsviczian/colormaster";
import HarmonyPlugin from "@zsviczian/colormaster/plugins/harmony";
import MixPlugin from "@zsviczian/colormaster/plugins/mix"
import A11yPlugin from "@zsviczian/colormaster/plugins/accessibility"
import NamePlugin from "@zsviczian/colormaster/plugins/name"
import LCHPlugin from "@zsviczian/colormaster/plugins/lch";
import LUVPlugin from "@zsviczian/colormaster/plugins/luv";
import LABPlugin from "@zsviczian/colormaster/plugins/lab";
import UVWPlugin from "@zsviczian/colormaster/plugins/uvw";
import XYZPlugin from "@zsviczian/colormaster/plugins/xyz";
import HWBPlugin from "@zsviczian/colormaster/plugins/hwb";
import HSVPlugin from "@zsviczian/colormaster/plugins/hsv";
import RYBPlugin from "@zsviczian/colormaster/plugins/ryb";
import CMYKPlugin from "@zsviczian/colormaster/plugins/cmyk";
import { TInput } from "@zsviczian/colormaster/types";
import {ConversionResult, svgToExcalidraw} from "src/svgToExcalidraw/parser"
import { ROUNDNESS } from "src/constants/constants";
import { ClipboardData } from "@zsviczian/excalidraw/types/excalidraw/clipboard";
@@ -92,6 +93,7 @@ import {
import { EXCALIDRAW_AUTOMATE_INFO, EXCALIDRAW_SCRIPTENGINE_INFO } from "./dialogs/SuggesterInfo";
import { addBackOfTheNoteCard, getFrameBasedOnFrameNameOrId } from "./utils/ExcalidrawViewUtils";
import { log } from "./utils/DebugHelper";
import { ExcalidrawLib } from "./ExcalidrawLib";
extendPlugins([
HarmonyPlugin,
@@ -111,6 +113,7 @@ extendPlugins([
declare const PLUGIN_VERSION:string;
declare var LZString: any;
declare const excalidrawLib: typeof ExcalidrawLib;
const GAP = 4;
@@ -275,11 +278,11 @@ export class ExcalidrawAutomate {
return getNewUniqueFilepath(app.vault, filename, folderAndPath.folder);
}
public compressToBase64(str:string):string {
public compressToBase64(str:string): string {
return LZString.compressToBase64(str);
}
public decompressFromBase64(str:string):string {
public decompressFromBase64(str:string): string {
return LZString.decompressFromBase64(str);
}
@@ -386,7 +389,7 @@ export class ExcalidrawAutomate {
opacity: number;
strokeSharpness?: StrokeRoundness; //defaults to undefined, use strokeRoundess and roundess instead. Only kept for legacy script compatibility type StrokeRoundness = "round" | "sharp"
roundness: null | { type: RoundnessType; value?: number };
fontFamily: number; //1: Virgil, 2:Helvetica, 3:Cascadia, 4:LocalFont
fontFamily: number; //1: Virgil, 2:Helvetica, 3:Cascadia, 4:Local Font
fontSize: number;
textAlign: string; //"left"|"right"|"center"
verticalAlign: string; //"top"|"bottom"|"middle" :for future use, has no effect currently
@@ -714,6 +717,12 @@ export class ExcalidrawAutomate {
this.style.roundness ? "round":"sharp",
gridSize: template?.appState?.gridSize ?? this.canvas.gridSize,
colorPalette: template?.appState?.colorPalette ?? this.colorPalette,
...template?.appState?.frameRendering
? {frameRendering: template.appState.frameRendering}
: {},
...template?.appState?.objectsSnapModeEnabled
? {objectsSnapModeEnabled: template.appState.objectsSnapModeEnabled}
: {},
},
files: template?.files ?? {},
};
@@ -1024,6 +1033,22 @@ export class ExcalidrawAutomate {
return id;
};
/**
* Add elements to frame
* @param frameId
* @param elementIDs to add
* @returns void
*/
addElementsToFrame(frameId: string, elementIDs: string[]):void {
if(!this.getElement(frameId)) return;
elementIDs.forEach(elID => {
const el = this.getElement(elID);
if(el) {
el.frameId = frameId;
}
});
}
/**
*
* @param topX
@@ -1191,7 +1216,7 @@ export class ExcalidrawAutomate {
element.text,
element.fontSize,
element.fontFamily,
getDefaultLineHeight(element.fontFamily)
getLineHeight(element.fontFamily)
);
element.width = w;
element.height = h;
@@ -1236,7 +1261,7 @@ export class ExcalidrawAutomate {
text,
this.style.fontSize,
this.style.fontFamily,
getDefaultLineHeight(this.style.fontFamily)
getLineHeight(this.style.fontFamily)
);
const width = formatting?.width ? formatting.width : w;
const height = formatting?.height ? formatting.height : h;
@@ -1294,7 +1319,7 @@ export class ExcalidrawAutomate {
containerId: isContainerBound ? boxId : null,
originalText: isContainerBound ? originalText : text,
rawText: isContainerBound ? originalText : text,
lineHeight: getDefaultLineHeight(this.style.fontFamily),
lineHeight: getLineHeight(this.style.fontFamily),
autoResize: formatting?.box ? true : (formatting?.autoResize ?? true),
};
if (boxId && formatting?.box === "blob") {
@@ -1569,6 +1594,26 @@ export class ExcalidrawAutomate {
return id;
};
/**
* returns the base64 dataURL of the LaTeX equation rendered as an SVG
* @param tex The LaTeX equation as string
* @param scale of the image, default value is 4
* @returns
*/
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1930
async tex2dataURL(
tex: string,
scale: number = 4 // Default scale value, adjust as needed
): Promise<{
mimeType: MimeType;
fileId: FileId;
dataURL: DataURL;
created: number;
size: { height: number; width: number };
}> {
return await tex2dataURL(tex,scale);
};
/**
*
* @param objectA
@@ -1894,15 +1939,16 @@ export class ExcalidrawAutomate {
/**
*
* @param includeFrameChildren
* @returns
*/
getViewSelectedElements(): any[] {
getViewSelectedElements(includeFrameChildren:boolean = true): any[] {
//@ts-ignore
if (!this.targetView || !this.targetView?._loaded) {
errorMessage("targetView not set", "getViewSelectedElements()");
return [];
}
return this.targetView.getViewSelectedElements();
return this.targetView.getViewSelectedElements(includeFrameChildren);
};
/**
@@ -1995,7 +2041,7 @@ export class ExcalidrawAutomate {
appState: {
viewModeEnabled: !isFullscreen,
},
storeAction: "none",
storeAction: "update",
});
this.targetView.toolsPanelRef?.current?.setExcalidrawViewMode(!isFullscreen);
}
@@ -2014,7 +2060,7 @@ export class ExcalidrawAutomate {
return;
}
const view = this.targetView as ExcalidrawView;
view.updateScene({appState:{viewModeEnabled: enabled}});
view.updateScene({appState:{viewModeEnabled: enabled}, storeAction: "update"});
view.toolsPanelRef?.current?.setExcalidrawViewMode(enabled);
}
@@ -2040,7 +2086,7 @@ export class ExcalidrawAutomate {
return;
}
if (!Boolean(scene.storeAction)) {
scene.storeAction = scene.commitToHistory ? "capture" : "none";
scene.storeAction = scene.commitToHistory ? "capture" : "update";
}
this.targetView.updateScene({
@@ -2394,24 +2440,44 @@ export class ExcalidrawAutomate {
* @param elements - typically all the non-deleted elements in the scene
* @returns
*/
getElementsInTheSameGroupWithElement(element: ExcalidrawElement, elements: ExcalidrawElement[]): ExcalidrawElement[] {
getElementsInTheSameGroupWithElement(
element: ExcalidrawElement,
elements: ExcalidrawElement[],
includeFrameElements: boolean = false,
): ExcalidrawElement[] {
if(!element || !elements) return [];
const container = (element.type === "text" && element.containerId)
? elements.filter(el=>el.id === element.containerId)
: [];
if(element.groupIds.length === 0) {
if(includeFrameElements && element.type === "frame") {
return this.getElementsInFrame(element,elements,true);
}
if(container.length === 1) return [element,container[0]];
return [element];
}
if(container.length === 1) {
return elements.filter(el=>
el.groupIds.some(id=>element.groupIds.includes(id)) ||
el === container[0]
);
const conditionFN = container.length === 1
? (el: ExcalidrawElement) => el.groupIds.some(id=>element.groupIds.includes(id)) || el === container[0]
: (el: ExcalidrawElement) => el.groupIds.some(id=>element.groupIds.includes(id));
if(!includeFrameElements) {
return elements.filter(el=>conditionFN(el));
} else {
//I use the set and the filter at the end to preserve scene layer seqeuence
//adding frames could potentially mess up the sequence otherwise
const elementIDs = new Set<string>();
elements
.filter(el=>conditionFN(el))
.forEach(el=>{
if(el.type === "frame") {
this.getElementsInFrame(el,elements,true).forEach(el=>elementIDs.add(el.id))
} else {
elementIDs.add(el.id);
}
});
return elements.filter(el=>elementIDs.has(el.id));
}
return elements.filter(el=>el.groupIds.some(id=>element.groupIds.includes(id)));
}
/**
@@ -2494,16 +2560,17 @@ export class ExcalidrawAutomate {
text,
this.style.fontSize,
this.style.fontFamily,
getDefaultLineHeight(this.style.fontFamily),
getLineHeight(this.style.fontFamily),
);
return { width: size.w ?? 0, height: size.h ?? 0 };
};
/**
* Returns the size of the image element at 100% (i.e. the original size)
* Returns the size of the image element at 100% (i.e. the original size), or undefined if the data URL is not available
* @param imageElement an image element from the active scene on targetView
* @param shouldWaitForImage if true, the function will wait for the image to load before returning the size
*/
async getOriginalImageSize(imageElement: ExcalidrawImageElement): Promise<{width: number; height: number}> {
async getOriginalImageSize(imageElement: ExcalidrawImageElement, shouldWaitForImage: boolean=false): Promise<{width: number; height: number}> {
//@ts-ignore
if (!this.targetView || !this.targetView?._loaded) {
errorMessage("targetView not set", "getOriginalImageSize()");
@@ -2519,10 +2586,59 @@ export class ExcalidrawAutomate {
return null;
}
const isDark = this.getExcalidrawAPI().getAppState().theme === "dark";
const dataURL = ef.getImage(isDark);
let dataURL = ef.getImage(isDark);
if(!dataURL && !shouldWaitForImage) return;
if(!dataURL) {
let watchdog = 0;
while(!dataURL && watchdog < 50) {
await sleep(100);
dataURL = ef.getImage(isDark);
watchdog++;
}
if(!dataURL) return;
}
return await getImageSize(dataURL);
}
/**
* Resets the image to its original aspect ratio.
* If the image is resized then the function returns true.
* If the image element is not in EA (only in the view), then if image is resized, the element is copied to EA for Editing using copyViewElementsToEAforEditing([imgEl]).
* Note you need to run await ea.addElementsToView(false); to add the modified image to the view.
* @param imageElement - the EA image element to be resized
* returns true if image was changed, false if image was not changed
*/
async resetImageAspectRatio(imgEl: ExcalidrawImageElement): Promise<boolean> {
//@ts-ignore
if (!this.targetView || !this.targetView?._loaded) {
errorMessage("targetView not set", "resetImageAspectRatio()");
return null;
}
const size = await this.getOriginalImageSize(imgEl, true);
if (size) {
const originalArea = imgEl.width * imgEl.height;
const originalAspectRatio = size.width / size.height;
let newWidth = Math.sqrt(originalArea * originalAspectRatio);
let newHeight = Math.sqrt(originalArea / originalAspectRatio);
const centerX = imgEl.x + imgEl.width / 2;
const centerY = imgEl.y + imgEl.height / 2;
if (newWidth !== imgEl.width || newHeight !== imgEl.height) {
if(!this.getElement(imgEl.id)) {
this.copyViewElementsToEAforEditing([imgEl]);
}
const eaEl = this.getElement(imgEl.id);
eaEl.width = newWidth;
eaEl.height = newHeight;
eaEl.x = centerX - newWidth / 2;
eaEl.y = centerY - newHeight / 2;
return true;
}
}
return false;
}
/**
* verifyMinimumPluginVersion returns true if plugin version is >= than required
* recommended use:
@@ -2736,7 +2852,7 @@ export async function initExcalidrawAutomate(
function normalizeLinePoints(
points: [x: number, y: number][],
//box: { x: number; y: number; w: number; h: number },
) {
): number[][] {
const p = [];
const [x, y] = points[0];
for (let i = 0; i < points.length; i++) {
@@ -2745,7 +2861,9 @@ function normalizeLinePoints(
return p;
}
function getLineBox(points: [x: number, y: number][]) {
function getLineBox(
points: [x: number, y: number][]
):{x:number, y:number, w: number, h:number} {
const [x1, y1, x2, y2] = estimateLineBound(points);
return {
x: x1,
@@ -2755,27 +2873,16 @@ function getLineBox(points: [x: number, y: number][]) {
};
}
function getFontFamily(id: number) {
switch (id) {
case 1:
return "Virgil, Segoe UI Emoji";
case 2:
return "Helvetica, Segoe UI Emoji";
case 3:
return "Cascadia, Segoe UI Emoji";
case 4:
return "LocalFont";
}
function getFontFamily(id: number):string {
return getFontFamilyString({fontFamily:id})
}
export async function initFonts(doc: Document = document) {
for (let i = 1; i <= 3; i++) {
await (doc as any).fonts.load(`20px ${getFontFamily(i)}`);
}
await (doc as any).fonts.load("400 20px Assistant");
await (doc as any).fonts.load("500 20px Assistant");
await (doc as any).fonts.load("600 20px Assistant");
await (doc as any).fonts.load("700 20px Assistant");
export async function initFonts():Promise<void> {
await excalidrawLib.registerFontsInCSS();
const fonts = excalidrawLib.getFontFamilies();
for(let i=0;i<fonts.length;i++) {
if(fonts[i] !== "Local Font") await (document as any).fonts.load(`16px ${fonts[i]}`);
};
}
export function _measureText(
@@ -2783,14 +2890,14 @@ export function _measureText(
fontSize: number,
fontFamily: number,
lineHeight: number,
) {
): {w: number, h:number} {
//following odd error with mindmap on iPad while synchornizing with desktop.
if (!fontSize) {
fontSize = 20;
}
if (!fontFamily) {
fontFamily = 1;
lineHeight = getDefaultLineHeight(fontFamily);
lineHeight = getLineHeight(fontFamily);
}
const metrics = measureText(
newText,
@@ -2882,7 +2989,7 @@ async function getTemplate(
? getTextElementsMatchingQuery(scene.elements,["# "+filenameParts.sectionref],true)
: scene.elements.filter((el: ExcalidrawElement)=>el.id===filenameParts.blockref);
if(el.length > 0) {
groupElements = plugin.ea.getElementsInTheSameGroupWithElement(el[0],scene.elements)
groupElements = plugin.ea.getElementsInTheSameGroupWithElement(el[0],scene.elements,true)
}
}
if(filenameParts.hasFrameref || filenameParts.hasClippedFrameref) {
@@ -2902,6 +3009,7 @@ async function getTemplate(
}
excalidrawData.destroy();
const filehead = data.substring(0, trimLocation);
return {
elements: convertMarkdownLinksToObsidianURLs
? updateElementLinksToObsidianLinks({
@@ -2909,7 +3017,7 @@ async function getTemplate(
hostFile: file,
}) : groupElements,
appState: scene.appState,
frontmatter: data.substring(0, trimLocation),
frontmatter: filehead.match(/^---\n.*\n---\n/ms)?.[0] ?? filehead,
files: scene.files,
hasSVGwithBitmap,
};
@@ -2941,7 +3049,7 @@ export async function createPNG(
depth: number,
padding?: number,
imagesDict?: any,
) {
): Promise<Blob> {
if (!loader) {
loader = new EmbeddedFilesLoader(plugin);
}
@@ -3025,7 +3133,7 @@ export const updateElementLinksToObsidianLinks = ({elements, hostFile}:{
})
}
function addFilterToForeignObjects(svg:SVGSVGElement) {
function addFilterToForeignObjects(svg:SVGSVGElement):void {
const foreignObjects = svg.querySelectorAll("foreignObject");
foreignObjects.forEach((foreignObject) => {
foreignObject.setAttribute("filter", THEME_FILTER);
@@ -3050,6 +3158,9 @@ export async function createSVG(
if (!loader) {
loader = new EmbeddedFilesLoader(plugin);
}
if(typeof exportSettings.skipInliningFonts === "undefined") {
exportSettings.skipInliningFonts = !embedFont;
}
const template = templatePath
? await getTemplate(plugin, templatePath, true, loader, depth, convertMarkdownLinksToObsidianURLs)
: null;
@@ -3120,7 +3231,7 @@ export async function createSVG(
if (template?.hasSVGwithBitmap) {
svg.setAttribute("hasbitmap", "true");
}
return embedFont ? embedFontsInSVG(svg, plugin) : svg;
return svg;
}
function estimateLineBound(points: any): [number, number, number, number] {
@@ -3171,7 +3282,7 @@ export function repositionElementsToCursor(
return restore({elements}, null, null).elements;
}
function errorMessage(message: string, source: string) {
function errorMessage(message: string, source: string):void {
switch (message) {
case "targetView not set":
errorlog({
@@ -3224,7 +3335,7 @@ export const search = async (view: ExcalidrawView) => {
const ea = view.plugin.ea;
ea.reset();
ea.setView(view);
const elements = ea.getViewElements().filter((el) => el.type === "text" || el.type === "frame");
const elements = ea.getViewElements().filter((el) => el.type === "text" || el.type === "frame" || el.link || el.type === "image");
if (elements.length === 0) {
return;
}
@@ -3318,6 +3429,62 @@ export const getFrameElementsMatchingQuery = (
}));
}
/**
*
* @param elements
* @param query
* @param exactMatch - when searching for section header exactMatch should be set to true
* @returns the elements matching the query
*/
export const getElementsWithLinkMatchingQuery = (
elements: ExcalidrawElement[],
query: string[],
exactMatch: boolean = false, //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/530
): ExcalidrawElement[] => {
if (!elements || elements.length === 0 || !query || query.length === 0) {
return [];
}
return elements.filter((el: any) =>
el.link &&
query.some((q) => {
const text = el.link.toLowerCase().trim();
return exactMatch
? (text === q.toLowerCase())
: text.match(q.toLowerCase());
}));
}
/**
*
* @param elements
* @param query
* @param exactMatch - when searching for section header exactMatch should be set to true
* @returns the elements matching the query
*/
export const getImagesMatchingQuery = (
elements: ExcalidrawElement[],
query: string[],
excalidrawData: ExcalidrawData,
exactMatch: boolean = false, //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/530
): ExcalidrawElement[] => {
if (!elements || elements.length === 0 || !query || query.length === 0) {
return [];
}
return elements.filter((el: ExcalidrawElement) =>
el.type === "image" &&
query.some((q) => {
const filename = excalidrawData.getFile(el.fileId)?.file?.basename.toLowerCase().trim();
const equation = excalidrawData.getEquation(el.fileId)?.latex?.toLocaleLowerCase().trim();
const text = filename ?? equation;
if(!text) return false;
return exactMatch
? (text === q.toLowerCase())
: text.match(q.toLowerCase());
}));
}
export const cloneElement = (el: ExcalidrawElement):any => {
const newEl = JSON.parse(JSON.stringify(el));
newEl.version = el.version + 1;
+95 -29
View File
@@ -11,7 +11,7 @@ import {
fileid,
DEVICE,
EMBEDDABLE_THEME_FRONTMATTER_VALUES,
getDefaultLineHeight,
getLineHeight,
ERROR_IFRAME_CONVERSION_CANCELED,
JSON_parse,
FRONTMATTER_KEYS,
@@ -35,6 +35,7 @@ import {
updateFrontmatterInString,
wrapTextAtCharLength,
arrayToMap,
compressAsync,
} from "./utils/Utils";
import { cleanBlockRef, cleanSectionHeading, getAttachmentsFolderAndFilePath, isObsidianThemeDark } from "./utils/ObsidianUtils";
import {
@@ -49,6 +50,7 @@ import { ConfirmationPrompt } from "./dialogs/Prompt";
import { getMermaidImageElements, getMermaidText, shouldRenderMermaid } from "./utils/MermaidUtils";
import { DEBUGGING, debug } from "./utils/DebugHelper";
import { Mutable } from "@zsviczian/excalidraw/types/excalidraw/utility-types";
import { updateElementIdsInScene } from "./utils/ExcalidrawSceneUtils";
type SceneDataWithFiles = SceneData & { files: BinaryFiles };
@@ -68,10 +70,34 @@ export enum AutoexportPreference {
inherit
}
export const REGEX_TAGS = {
// #[\p{Letter}\p{Emoji_Presentation}\p{Number}\/_-]+
// 1
EXPR: /(#[\p{Letter}\p{Emoji_Presentation}\p{Number}\/_-]+)/gu,
getResList: (text: string): IteratorResult<RegExpMatchArray, any>[] => {
const res = text.matchAll(REGEX_TAGS.EXPR);
let parts: IteratorResult<RegExpMatchArray, any>;
const resultList = [];
while (!(parts = res.next()).done) {
resultList.push(parts);
}
return resultList;
},
getTag: (parts: IteratorResult<RegExpMatchArray, any>): string => {
return parts.value[1];
},
isTag: (parts: IteratorResult<RegExpMatchArray, any>): boolean => {
return parts.value[1]?.startsWith("#")
},
};
export const REGEX_LINK = {
//![[link|alias]] [alias](link){num}
// 1 2 3 4 5 67 8 9
EXPR: /(!)?(\[\[([^|\]]+)\|?([^\]]+)?]]|\[([^\]]*)]\(([^)]*)\))(\{(\d+)\})?/g, //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/187
//EXPR: /(!)?(\[\[([^|\]]+)\|?([^\]]+)?]]|\[([^\]]*)]\(([^)]*)\))(\{(\d+)\})?/g, //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/187
// 1 2 3 4 5 67 8 9
EXPR: /(!)?(\[\[([^|\]]+)\|?([^\]]+)?]]|\[([^\]]*)]\(((?:[^\(\)]|\([^\(\)]*\))*)\))(\{(\d+)\})?/g, //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1963
getResList: (text: string): IteratorResult<RegExpMatchArray, any>[] => {
const res = text.matchAll(REGEX_LINK.EXPR);
let parts: IteratorResult<RegExpMatchArray, any>;
@@ -197,15 +223,28 @@ export function getJSON(data: string): { scene: string; pos: number } {
return { scene: data, pos: parts.value ? parts.value.index : 0 };
}
export function getMarkdownDrawingSection(
export async function getMarkdownDrawingSectionAsync (
jsonString: string,
compressed: boolean,
) {
return compressed
const result = compressed
? `## Drawing\n\x60\x60\x60compressed-json\n${await compressAsync(
jsonString,
)}\n\x60\x60\x60\n%%`
: `## Drawing\n\x60\x60\x60json\n${jsonString}\n\x60\x60\x60\n%%`;
return result;
}
export function getMarkdownDrawingSection(
jsonString: string,
compressed: boolean,
): string {
const result = compressed
? `## Drawing\n\x60\x60\x60compressed-json\n${compress(
jsonString,
)}\n\x60\x60\x60\n%%`
: `## Drawing\n\x60\x60\x60json\n${jsonString}\n\x60\x60\x60\n%%`;
return result;
}
/**
@@ -549,7 +588,7 @@ export class ExcalidrawData {
}
if (el.type === "text" && !el.hasOwnProperty("lineHeight")) {
el.lineHeight = getDefaultLineHeight(el.fontFamily);
el.lineHeight = getLineHeight(el.fontFamily);
}
if (el.type === "image" && !el.hasOwnProperty("roundness")) {
@@ -720,6 +759,24 @@ export class ExcalidrawData {
this.scene.appState.theme = isObsidianThemeDark() ? "dark" : "light";
}
//girdSize, gridStep, previousGridSize, gridModeEnabled migration
if(this.scene.appState.hasOwnProperty("previousGridSize")) { //if previousGridSize was present this is legacy data
if(this.scene.appState.gridSize === null) {
this.scene.appState.gridSize = this.scene.appState.previousGridSize;
this.scene.appState.gridModeEnabled = false;
} else {
this.scene.appState.gridModeEnabled = true;
}
delete this.scene.appState.previousGridSize;
}
if(this.scene.appState?.gridColor?.hasOwnProperty("MajorGridFrequency")) { //if this is present, this is legacy data
if(this.scene.appState.gridColor.MajorGridFrequency>1) {
this.scene.gridStep = this.scene.appState.gridColor.MajorGridFrequency;
}
delete this.scene.appState.gridColor.MajorGridFrequency;
}
//once off migration of legacy scenes
if(this.scene?.elements?.some((el:any)=>el.type==="iframe" && !el.customData)) {
const prompt = new ConfirmationPrompt(
@@ -810,7 +867,7 @@ export class ExcalidrawData {
? data.substring(indexOfNewElementLinks + lengthOfNewElementLinks)
: data.substring(indexOfOldElementLinks + lengthOfOldElementLinks);
//Load Embedded files
const RE_ELEMENT_LINKS = /^(.{8}):\s*(\[\[[^\]]*]])$/gm;
const RE_ELEMENT_LINKS = /^(.{8}):\s*(.*)$/gm;
const linksRes = elementLinksData.matchAll(RE_ELEMENT_LINKS);
while (!(parts = linksRes.next()).done) {
elementLinkMap.set(parts.value[1], parts.value[2]);
@@ -1043,7 +1100,7 @@ export class ExcalidrawData {
return (
el.type !== "text" &&
el.link &&
el.link.startsWith("[[") &&
//el.link.startsWith("[[") &&
!this.elementLinks.has(el.id)
);
});
@@ -1051,8 +1108,6 @@ export class ExcalidrawData {
return result;
}
let jsonString = JSON.stringify(this.scene);
let id: string; //will be used to hold the new 8 char long ID for textelements that don't yet appear under # Text Elements
for (const el of elements) {
@@ -1063,11 +1118,10 @@ export class ExcalidrawData {
if (el.id.length > 8) {
result = true;
id = nanoid();
jsonString = jsonString.replaceAll(el.id, id); //brute force approach to replace all occurrences (e.g. links, groups,etc.)
updateElementIdsInScene(this.scene, el, id);
}
this.elementLinks.set(id, el.link);
}
this.scene = JSON.parse(jsonString);
return result;
}
@@ -1079,9 +1133,7 @@ export class ExcalidrawData {
//console.log("Excalidraw.Data.findNewTextElementsInScene()");
//get scene text elements
this.selectedElementIds = selectedElementIds;
const texts = this.scene.elements?.filter((el: any) => el.type === "text");
let jsonString = JSON.stringify(this.scene);
const texts = this.scene.elements?.filter((el: any) => el.type === "text") as ExcalidrawTextElement[];
let dirty: boolean = false; //to keep track if the json has changed
let id: string; //will be used to hold the new 8 char long ID for textelements that don't yet appear under # Text Elements
@@ -1097,7 +1149,7 @@ export class ExcalidrawData {
delete this.selectedElementIds[te.id];
this.selectedElementIds[id] = true;
}
jsonString = jsonString.replaceAll(te.id, id); //brute force approach to replace all occurrences (e.g. links, groups,etc.)
updateElementIdsInScene(this.scene, te, id);
if (this.textElements.has(te.id)) {
//element was created with onBeforeTextSubmit
const text = this.textElements.get(te.id);
@@ -1119,11 +1171,6 @@ export class ExcalidrawData {
}
}
if (dirty) {
//reload scene json in case it has changed
this.scene = JSON.parse(jsonString);
}
return dirty;
}
@@ -1134,8 +1181,8 @@ export class ExcalidrawData {
(el: any) =>
el.type !== "text" &&
el.id === key &&
el.link &&
el.link.startsWith("[["),
el.link, //&&
//el.link.startsWith("[["),
);
if (el.length === 0) {
this.elementLinks.delete(key); //if no longer in the scene, delete the text element
@@ -1364,7 +1411,7 @@ export class ExcalidrawData {
* @returns markdown string
*/
disableCompression: boolean = false;
generateMD(deletedElements: ExcalidrawElement[] = []): string {
generateMDBase(deletedElements: ExcalidrawElement[] = []) {
let outString = this.textElementCommentedOut ? "%%\n" : "";
outString += `# Excalidraw Data\n## Text Elements\n`;
if (this.plugin.settings.addDummyTextElement) {
@@ -1376,10 +1423,10 @@ export class ExcalidrawData {
const element = this.scene.elements.filter((el:any)=>el.id===key);
let elementString = this.textElements.get(key).raw;
if(element && element.length===1 && element[0].link && element[0].rawText === element[0].originalText) {
if(element[0].link.match(/^\[\[[^\]]*]]$/g)) { //apply this only to markdown links
//if(element[0].link.match(/^\[\[[^\]]*]]$/g)) { //apply this only to markdown links
textElementLinks.set(key, element[0].link);
//elementString = `%%***>>>text element-link:${element[0].link}<<<***%%` + elementString;
}
//}
}
outString += `${elementString} ^${key}\n\n`;
}
@@ -1431,14 +1478,33 @@ export class ExcalidrawData {
appState: this.scene.appState,
files: this.scene.files
}, null, "\t");
return (
return { outString, sceneJSONstring };
}
async generateMDAsync(deletedElements: ExcalidrawElement[] = []): Promise<string> {
const { outString, sceneJSONstring } = this.generateMDBase(deletedElements);
const result = (
outString +
(this.textElementCommentedOut ? "" : "%%\n") +
getMarkdownDrawingSection(
(await getMarkdownDrawingSectionAsync(
sceneJSONstring,
this.disableCompression ? false : this.plugin.settings.compress,
)
))
);
return result;
}
generateMDSync(deletedElements: ExcalidrawElement[] = []): string {
const { outString, sceneJSONstring } = this.generateMDBase(deletedElements);
const result = (
outString +
(this.textElementCommentedOut ? "" : "%%\n") +
(getMarkdownDrawingSection(
sceneJSONstring,
this.disableCompression ? false : this.plugin.settings.compress,
))
);
return result;
}
public async saveDataURLtoVault(dataURL: DataURL, mimeType: MimeType, key: FileId) {
@@ -1988,7 +2054,7 @@ export class ExcalidrawData {
}
public getEquationEntries() {
return this.equations.entries();
return this.equations?.entries();
}
public deleteEquation(fileId: FileId) {
+29 -6
View File
@@ -1,8 +1,9 @@
import { RestoredDataState } from "@zsviczian/excalidraw/types/excalidraw/data/restore";
import { ImportedDataState } from "@zsviczian/excalidraw/types/excalidraw/data/types";
import { BoundingBox } from "@zsviczian/excalidraw/types/excalidraw/element/bounds";
import { ElementsMap, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawTextContainer, ExcalidrawTextElement, FontFamilyValues, FontString, NonDeleted, NonDeletedExcalidrawElement, Theme } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { AppState, BinaryFiles, Point, Zoom } from "@zsviczian/excalidraw/types/excalidraw/types";
import { ElementsMap, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFrameLikeElement, ExcalidrawTextContainer, ExcalidrawTextElement, FontFamilyValues, FontString, NonDeleted, NonDeletedExcalidrawElement, Theme } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { FontMetadata } from "@zsviczian/excalidraw/types/excalidraw/fonts/metadata";
import { AppState, BinaryFiles, DataURL, GenerateDiagramToCode, Point, Zoom } from "@zsviczian/excalidraw/types/excalidraw/types";
import { Mutable } from "@zsviczian/excalidraw/types/excalidraw/utility-types";
type EmbeddedLink =
@@ -26,6 +27,7 @@ declare namespace ExcalidrawLib {
appState?: Partial<Omit<AppState, "offsetTop" | "offsetLeft">>;
files: BinaryFiles | null;
maxWidthOrHeight?: number;
exportingFrame?: ExcalidrawFrameLikeElement | null;
getDimensions?: (
width: number,
height: number,
@@ -46,6 +48,7 @@ declare namespace ExcalidrawLib {
exportPadding?: number;
exportingFrame: ExcalidrawFrameElement | null | undefined;
renderEmbeddables?: boolean;
skipInliningFonts?: boolean;
}): Promise<SVGSVGElement>;
function sceneCoordsToViewportCoords(
@@ -116,8 +119,7 @@ declare namespace ExcalidrawLib {
lineHeight: number,
): { width: number; height: number; };
function getDefaultLineHeight(fontFamily: FontFamilyValues): number;
function getLineHeight (fontFamily: FontFamilyValues):number;
function wrapText(text: string, font: FontString, maxWidth: number): string;
function getFontString({
@@ -128,6 +130,13 @@ declare namespace ExcalidrawLib {
fontFamily: FontFamilyValues;
}): FontString;
function getFontFamilyString ({
fontFamily,
}: {
fontFamily: number;
}): string;
function getBoundTextMaxWidth(container: ExcalidrawElement): number;
function exportToBlob(
@@ -162,6 +171,20 @@ declare namespace ExcalidrawLib {
var WelcomeScreen: any;
var TTDDialogTrigger: any;
var TTDDialog: any;
var DiagramToCodePlugin: (props: {
generate: GenerateDiagramToCode;
}) => any;
function getDataURL(file: Blob | File): Promise<DataURL>;
function destroyObsidianUtils(): void;
}
function registerLocalFont(fontMetrics: FontMetadata, uri: string): void;
function getFontFamilies(): string[];
function registerFontsInCSS(): Promise<void>;
function getCSSFontDefinition(fontFamily: number): Promise<string>;
function getTextFromElements (
elements: readonly ExcalidrawElement[],
separator?: string,
): string;
function safelyParseJSON (json: string): Record<string, any> | null;
}
+522 -196
View File
File diff suppressed because it is too large. Load diff
+98 -24
View File
@@ -1,4 +1,5 @@
import {
App,
MarkdownPostProcessorContext,
MetadataCache,
PaneType,
@@ -12,7 +13,6 @@ import { ExportSettings } from "./ExcalidrawView";
import ExcalidrawPlugin from "./main";
import {getIMGFilename,} from "./utils/FileUtils";
import {
embedFontsInSVG,
getEmbeddedFilenameParts,
getExportTheme,
getQuickImagePreview,
@@ -26,7 +26,7 @@ import { getParentOfClass, isObsidianThemeDark, getFileCSSClasses } from "./util
import { linkClickModifierType } from "./utils/ModifierkeyHelper";
import { ImageKey, imageCache } from "./utils/ImageCache";
import { FILENAMEPARTS, PreviewImageType } from "./utils/UtilTypes";
import { CustomMutationObserver, DEBUGGING } from "./utils/DebugHelper";
import { CustomMutationObserver, debug, DEBUGGING } from "./utils/DebugHelper";
import { getExcalidrawFileForwardLinks } from "./utils/ExcalidrawViewUtils";
import { linkPrompt } from "./dialogs/Prompt";
@@ -39,8 +39,11 @@ interface imgElementAttributes {
}
let plugin: ExcalidrawPlugin;
let app: App;
let vault: Vault;
let metadataCache: MetadataCache;
const DEBUGGING_MPP = false;
const getDefaultWidth = (plugin: ExcalidrawPlugin): string => {
const width = parseInt(plugin.settings.width);
@@ -61,8 +64,9 @@ const getDefaultHeight = (plugin: ExcalidrawPlugin): string => {
export const initializeMarkdownPostProcessor = (p: ExcalidrawPlugin) => {
plugin = p;
vault = p.app.vault;
metadataCache = p.app.metadataCache;
app = plugin.app;
vault = app.vault;
metadataCache = app.metadataCache;
};
const _getPNG = async ({imgAttributes,filenameParts,theme,cacheReady,img,file,exportSettings,loader}:{
@@ -75,6 +79,7 @@ const _getPNG = async ({imgAttributes,filenameParts,theme,cacheReady,img,file,ex
exportSettings: ExportSettings,
loader: EmbeddedFilesLoader,
}):Promise<HTMLImageElement> => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(_getPNG, `MarkdownPostProcessor.ts > _getPNG`);
const width = parseInt(imgAttributes.fwidth);
const scale = width >= 2400
? 5
@@ -86,7 +91,14 @@ const _getPNG = async ({imgAttributes,filenameParts,theme,cacheReady,img,file,ex
? 2
: 1;
const cacheKey = {...filenameParts, isDark: theme==="dark", previewImageType: PreviewImageType.PNG, scale, isTransparent: !exportSettings.withBackground};
const cacheKey = {
...filenameParts,
isDark: theme==="dark",
previewImageType: PreviewImageType.PNG,
scale,
isTransparent: !exportSettings.withBackground,
inlineFonts: true, //though for PNG this makes no difference, but the key requires it
};
if(cacheReady) {
const src = await imageCache.getImageFromCache(cacheKey);
@@ -134,6 +146,7 @@ const setStyle = ({element,imgAttributes,onCanvas}:{
onCanvas: boolean,
}
) => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(setStyle, `MarkdownPostProcessor.ts > setStyle`);
let style = "";
if(imgAttributes.fwidth) {
style = `max-width:${imgAttributes.fwidth}${imgAttributes.fwidth.match(/\d$/) ? "px":""}; `; //width:100%;`; //removed !important https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/886
@@ -165,7 +178,17 @@ const _getSVGIMG = async ({filenameParts,theme,cacheReady,img,file,exportSetting
exportSettings: ExportSettings,
loader: EmbeddedFilesLoader,
}):Promise<HTMLImageElement> => {
const cacheKey = {...filenameParts, isDark: theme==="dark", previewImageType: PreviewImageType.SVGIMG, scale:1, isTransparent: !exportSettings.withBackground};
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(_getSVGIMG, `MarkdownPostProcessor.ts > _getSVGIMG`);
exportSettings.skipInliningFonts = false;
const cacheKey = {
...filenameParts,
isDark: theme==="dark",
previewImageType: PreviewImageType.SVGIMG,
scale:1,
isTransparent: !exportSettings.withBackground,
inlineFonts: !exportSettings.skipInliningFonts,
};
if(cacheReady) {
const src = await imageCache.getImageFromCache(cacheKey);
if(src && typeof src === "string") {
@@ -184,7 +207,7 @@ const _getSVGIMG = async ({filenameParts,theme,cacheReady,img,file,exportSetting
}
}
let svg = convertSVGStringToElement((
const svg = convertSVGStringToElement((
await createSVG(
filenameParts.hasGroupref || filenameParts.hasBlockref || filenameParts.hasSectionref || filenameParts.hasFrameref || filenameParts.hasClippedFrameref
? filenameParts.filepath + filenameParts.linkpartReference
@@ -208,7 +231,6 @@ const _getSVGIMG = async ({filenameParts,theme,cacheReady,img,file,exportSetting
return null;
}
svg = embedFontsInSVG(svg, plugin, false);
//need to remove width and height attributes to support area= embeds
svg.removeAttribute("width");
svg.removeAttribute("height");
@@ -224,13 +246,22 @@ const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,fi
exportSettings: ExportSettings,
loader: EmbeddedFilesLoader,
}):Promise<HTMLDivElement> => {
const cacheKey = {...filenameParts, isDark: theme==="dark", previewImageType: PreviewImageType.SVG, scale:1, isTransparent: !exportSettings.withBackground};
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(_getSVGNative, `MarkdownPostProcessor.ts > _getSVGNative`);
exportSettings.skipInliningFonts = false;
const cacheKey = {
...filenameParts,
isDark: theme==="dark",
previewImageType: PreviewImageType.SVG,
scale:1,
isTransparent: !exportSettings.withBackground,
inlineFonts: !exportSettings.skipInliningFonts,
};
let maybeSVG;
if(cacheReady) {
maybeSVG = await imageCache.getImageFromCache(cacheKey);
}
let svg = (maybeSVG && (maybeSVG instanceof SVGSVGElement))
const svg = (maybeSVG && (maybeSVG instanceof SVGSVGElement))
? maybeSVG
: convertSVGStringToElement((await createSVG(
filenameParts.hasGroupref || filenameParts.hasBlockref || filenameParts.hasSectionref || filenameParts.hasFrameref || filenameParts.hasClippedFrameref
@@ -260,7 +291,7 @@ const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,fi
if(!Boolean(maybeSVG)) {
cacheReady && imageCache.addImageToCache(cacheKey,"", svg);
}
svg = embedFontsInSVG(svg, plugin, true);
svg.removeAttribute("width");
svg.removeAttribute("height");
containerElement.append(svg);
@@ -278,6 +309,7 @@ const getIMG = async (
imgAttributes: imgElementAttributes,
onCanvas: boolean = false,
): Promise<HTMLImageElement | HTMLDivElement> => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(getIMG, `MarkdownPostProcessor.ts > getIMG`, imgAttributes);
let file = imgAttributes.file;
if (!imgAttributes.file) {
const f = vault.getAbstractFileByPath(imgAttributes.fname?.split("#")[0]);
@@ -325,22 +357,23 @@ const getIMG = async (
case PreviewImageType.PNG: {
const img = createEl("img");
setStyle({element:img,imgAttributes,onCanvas});
return _getPNG({imgAttributes,filenameParts,theme,cacheReady,img,file,exportSettings,loader});
return await _getPNG({imgAttributes,filenameParts,theme,cacheReady,img,file,exportSettings,loader});
}
case PreviewImageType.SVGIMG: {
const img = createEl("img");
setStyle({element:img,imgAttributes,onCanvas});
return _getSVGIMG({filenameParts,theme,cacheReady,img,file,exportSettings,loader});
return await _getSVGIMG({filenameParts,theme,cacheReady,img,file,exportSettings,loader});
}
case PreviewImageType.SVG: {
const img = createEl("div");
setStyle({element:img,imgAttributes,onCanvas});
return _getSVGNative({filenameParts,theme,cacheReady,containerElement: img,file,exportSettings,loader});
return await _getSVGNative({filenameParts,theme,cacheReady,containerElement: img,file,exportSettings,loader});
}
}
};
const addSVGToImgSrc = (img: HTMLImageElement, svg: SVGSVGElement, cacheReady: boolean, cacheKey: ImageKey):HTMLImageElement => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(addSVGToImgSrc, `MarkdownPostProcessor.ts > addSVGToImgSrc`);
const svgString = new XMLSerializer().serializeToString(svg);
const blob = new Blob([svgString], { type: 'image/svg+xml' });
const blobUrl = URL.createObjectURL(blob);
@@ -353,6 +386,7 @@ const createImgElement = async (
attr: imgElementAttributes,
onCanvas: boolean = false,
) :Promise<HTMLElement> => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(createImgElement, `MarkdownPostProcessor.ts > createImgElement`);
const imgOrDiv = await getIMG(attr,onCanvas);
if(!imgOrDiv) {
return null;
@@ -480,6 +514,7 @@ const createImageDiv = async (
attr: imgElementAttributes,
onCanvas: boolean = false
): Promise<HTMLDivElement> => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(createImageDiv, `MarkdownPostProcessor.ts > createImageDiv`);
const img = await createImgElement(attr, onCanvas);
return createDiv(attr.style.join(" "), (el) => el.append(img));
};
@@ -488,6 +523,7 @@ const processReadingMode = async (
embeddedItems: NodeListOf<Element> | [HTMLElement],
ctx: MarkdownPostProcessorContext,
) => {
(process.env.NODE_ENV === 'development') && DEBUGGING_MPP && debug(processReadingMode, `MarkdownPostProcessor.ts > processReadingMode`);
//We are processing a non-excalidraw file in reading mode
//Embedded files will be displayed in an .internal-embed container
@@ -519,6 +555,7 @@ const processReadingMode = async (
};
const processInternalEmbed = async (internalEmbedEl: Element, file: TFile ):Promise<HTMLDivElement> => {
(process.env.NODE_ENV === 'development') && DEBUGGING_MPP && debug(processInternalEmbed, `MarkdownPostProcessor.ts > processInternalEmbed`, internalEmbedEl);
const attr: imgElementAttributes = {
fname: "",
fheight: "",
@@ -555,6 +592,7 @@ const processAltText = (
alt:string,
attr: imgElementAttributes
) => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(processAltText, `MarkdownPostProcessor.ts > processAltText`);
if (alt && !alt.startsWith(fname)) {
//2:width, 3:height, 4:style 12 3 4
const parts = alt.match(/[^\|\d]*\|?((\d*%?)x?(\d*%?))?\|?(.*)/);
@@ -574,6 +612,7 @@ const processAltText = (
}
const isTextOnlyEmbed = (internalEmbedEl: Element):boolean => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(isTextOnlyEmbed, `MarkdownPostProcessor.ts > isTextOnlyEmbed`);
const src = internalEmbedEl.getAttribute("src");
if(!src) return true; //technically this does not mean this is a text only embed, but still should abort further processing
const fnameParts = getEmbeddedFilenameParts(src);
@@ -584,7 +623,11 @@ const isTextOnlyEmbed = (internalEmbedEl: Element):boolean => {
const tmpObsidianWYSIWYG = async (
el: HTMLElement,
ctx: MarkdownPostProcessorContext,
isPrinting: boolean,
isMarkdownReadingMode: boolean,
isHoverPopover: boolean,
) => {
(process.env.NODE_ENV === 'development') && DEBUGGING_MPP && debug(tmpObsidianWYSIWYG, `MarkdownPostProcessor.ts > tmpObsidianWYSIWYG`);
const file = app.vault.getAbstractFileByPath(ctx.sourcePath);
if(!(file instanceof TFile)) return;
if(!plugin.isExcalidrawFile(file)) return;
@@ -602,11 +645,11 @@ const tmpObsidianWYSIWYG = async (
//@ts-ignore
const containerEl = ctx.containerEl;
if(!plugin.settings.renderImageInMarkdownReadingMode && containerEl.parentElement?.parentElement?.hasClass("markdown-reading-view")) {
if(!plugin.settings.renderImageInMarkdownReadingMode && isMarkdownReadingMode) { // containerEl.parentElement?.parentElement?.hasClass("markdown-reading-view")) {
return;
}
if(!plugin.settings.renderImageInMarkdownToPDF && containerEl.parentElement?.hasClass("print")) {
if(!plugin.settings.renderImageInMarkdownToPDF && isPrinting) { //containerEl.parentElement?.hasClass("print")) {
return;
}
@@ -634,14 +677,14 @@ const tmpObsidianWYSIWYG = async (
if(!plugin.settings.renderImageInHoverPreviewForMDNotes) {
const isHoverPopover = internalEmbedDiv.parentElement?.hasClass("hover-popover");
//const isHoverPopover = internalEmbedDiv.parentElement?.hasClass("hover-popover");
const shouldOpenMD = Boolean(ctx.frontmatter?.["excalidraw-open-md"]);
if(isHoverPopover && shouldOpenMD) {
return;
}
}
const isPrinting = Boolean(internalEmbedDiv.hasClass("print"));
//const isPrinting = Boolean(internalEmbedDiv.hasClass("print"));
const attr: imgElementAttributes = {
fname: ctx.sourcePath,
@@ -653,7 +696,7 @@ const tmpObsidianWYSIWYG = async (
attr.file = file;
const markdownEmbed = internalEmbedDiv.hasClass("markdown-embed");
const markdownReadingView = internalEmbedDiv.hasClass("markdown-reading-view") || isPrinting;
const markdownReadingView = isPrinting || isMarkdownReadingMode; //internalEmbedDiv.hasClass("markdown-reading-view")
if (!internalEmbedDiv.hasClass("internal-embed") && (markdownEmbed || markdownReadingView)) {
if(isPrinting) {
internalEmbedDiv = containerEl;
@@ -740,6 +783,7 @@ const tmpObsidianWYSIWYG = async (
});
};
const docIDs = new Set<string>();
/**
*
* @param el
@@ -749,12 +793,43 @@ export const markdownPostProcessor = async (
el: HTMLElement,
ctx: MarkdownPostProcessorContext,
) => {
const isPrinting = Boolean(document.body.querySelectorAll("body > .print").length>0);
//firstElementChild: https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1956
const isFrontmatter = el.hasClass("mod-frontmatter") || el.firstElementChild?.hasClass("frontmatter");
if(isPrinting && isFrontmatter) {
return;
}
//@ts-ignore
const containerEl = ctx.containerEl;
(process.env.NODE_ENV === 'development') && DEBUGGING_MPP && debug(markdownPostProcessor, `MarkdownPostProcessor.ts > markdownPostProcessor`, ctx, el);
//check to see if we are rendering in editing mode or live preview
//if yes, then there should be no .internal-embed containers
//if yes, then there should be no .internal-embed containers
const isMarkdownReadingMode = Boolean(containerEl && getParentOfClass(containerEl, "markdown-reading-view"));
const isHoverPopover = Boolean(containerEl && getParentOfClass(containerEl, "hover-popover"));
const isPreview = (isHoverPopover && Boolean(ctx?.frontmatter?.["excalidraw-open-md"]) && !plugin.settings.renderImageInHoverPreviewForMDNotes);
const embeddedItems = el.querySelectorAll(".internal-embed");
if (embeddedItems.length === 0) {
tmpObsidianWYSIWYG(el, ctx);
if(isPrinting && plugin.settings.renderImageInMarkdownToPDF) {
await tmpObsidianWYSIWYG(el, ctx, isPrinting, isMarkdownReadingMode, isHoverPopover);
return;
}
if (!isPreview && embeddedItems.length === 0) {
if(isFrontmatter) {
docIDs.add(ctx.docId);
} else {
if(docIDs.has(ctx.docId) && !el.hasChildNodes()) {
docIDs.delete(ctx.docId);
}
const isAreaGroupFrameRef = el.querySelectorAll('[data-heading^="Unable to find"]').length === 1;
if(!isAreaGroupFrameRef) {
return;
}
}
await tmpObsidianWYSIWYG(el, ctx, isPrinting, isMarkdownReadingMode, isHoverPopover);
return;
}
@@ -763,8 +838,7 @@ export const markdownPostProcessor = async (
//transcluded text element or some other transcluded content inside the Excalidraw file
//in reading mode these elements should be hidden
const excalidrawFile = Boolean(ctx.frontmatter?.hasOwnProperty("excalidraw-plugin"));
const isPrinting = Boolean(document.body.querySelectorAll("body > .print"));
if (excalidrawFile && !isPrinting) {
if (!(isPreview || isMarkdownReadingMode || isPrinting) && excalidrawFile) {
el.style.display = "none";
return;
}
-10
View File
@@ -1,10 +0,0 @@
//I converted fonts to data URL using getFontDataURL - my hack was to add the font to Obsidian as a Fourth Font, set it as the fourth font and add
//a breakpoint to capture the converted fontDataURL from plugin.fourthFontDef
export const FONTS_STYLE_ID = "excalidraw-fonts";
export const VIRGIL_DATAURL = `data:application/font-woff;charset=utf-8;base64,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 Line truncated
export const VIRGIL_FONT = ` @font-face {font-display: swap;font-family: "Virgil";src: url("${VIRGIL_DATAURL}") format("woff2");}`;
export const CASCADIA_FONT = ` @font-face {font-display: swap;font-family: "Cascadia";src: url("data:application/font-woff;charset=utf-8;base64,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 Line truncated
export const ASSISTANT_FONT = ` @font-face {font-family: "Assistant";src: url("data:application/font-woff;charset=utf-8;base64,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 Line truncated
+3
View File
@@ -0,0 +1,3 @@
export const TAG_PDFEXPORT = "PDFExport";
export const TAG_MDREADINGMODE = "MDReadingMode";
export const TAG_AUTOEXPORT = "Autoexport";
+12 -3
View File
@@ -1,5 +1,5 @@
import { customAlphabet } from "nanoid";
import { DeviceType } from "../types";
import { DeviceType } from "../types/types";
import { ExcalidrawLib } from "../ExcalidrawLib";
import { moment } from "obsidian";
import ExcalidrawPlugin from "src/main";
@@ -9,6 +9,11 @@ export let EXCALIDRAW_PLUGIN: ExcalidrawPlugin = null;
export const setExcalidrawPlugin = (plugin: ExcalidrawPlugin) => {
EXCALIDRAW_PLUGIN = plugin;
};
export const THEME = {
LIGHT: "light",
DARK: "dark",
} as const;
const MD_EXCALIDRAW = "# Excalidraw Data";
const MD_TEXTELEMENTS = "## Text Elements";
const MD_ELEMENTLINKS = "## Element Links";
@@ -85,7 +90,7 @@ export const {
getCommonBoundingBox,
getMaximumGroups,
measureText,
getDefaultLineHeight,
getLineHeight,
wrapText,
getFontString,
getBoundTextMaxWidth,
@@ -94,10 +99,14 @@ export const {
mutateElement,
restore,
mermaidToExcalidraw,
getFontFamilyString,
getContainerElement,
refreshTextDimensions,
getCSSFontDefinition,
} = excalidrawLib;
export const FONTS_STYLE_ID = "excalidraw-custom-fonts";
export function JSON_parse(x: string): any {
return JSON.parse(x.replaceAll("&#91;", "["));
}
@@ -112,7 +121,7 @@ export const DEVICE: DeviceType = {
isMacOS: document.body.hasClass("mod-macos") && ! document.body.hasClass("is-ios"),
isWindows: document.body.hasClass("mod-windows"),
isIOS: document.body.hasClass("is-ios"),
isAndroid: document.body.hasClass("is-android")
isAndroid: document.body.hasClass("is-android"),
};
export const ROOTELEMENTSIZE = (() => {
+11 -3
View File
@@ -223,6 +223,7 @@ function RenderObsidianView(
} else {
const workspaceLeaf:HTMLDivElement = rootSplit.containerEl.querySelector("div.workspace-leaf");
if(workspaceLeaf) workspaceLeaf.style.borderRadius = "var(--embeddable-radius)";
rootSplit.containerEl.addClass("mod-visible");
containerRef.current.appendChild(rootSplit.containerEl);
setColors(containerRef.current, element, mdProps, canvasColor);
}
@@ -415,8 +416,14 @@ function RenderObsidianView(
}
} else if (leafRef.current?.node) {
//Handle canvas node
containerRef.current?.removeClasses(["is-editing", "is-focused"]);
view.canvasNodeFactory.stopEditing(leafRef.current.node);
if(view.plugin.settings.markdownNodeOneClickEditing && !containerRef.current?.hasClass("is-editing")) {
const newTheme = getTheme(view, themeRef.current);
containerRef.current?.addClasses(["is-editing", "is-focused"]);
view.canvasNodeFactory.startEditing(leafRef.current.node, newTheme);
} else {
containerRef.current?.removeClasses(["is-editing", "is-focused"]);
view.canvasNodeFactory.stopEditing(leafRef.current.node);
}
}
}, [
containerRef,
@@ -427,7 +434,8 @@ function RenderObsidianView(
element,
view,
isEditingRef,
view.canvasNodeFactory
view.canvasNodeFactory,
themeRef.current
]);
return null;
+2 -2
View File
@@ -184,7 +184,7 @@ export class EmbeddableSettings extends Modal {
new Notice("File rename failed. A file with this name already exists.\n"+newPath,10000);
} else {
try {
await this.app.vault.rename(this.file,newPath);
await this.app.fileManager.renameFile(this.file,newPath);
el.link = this.element.link.replace(
/(\[\[)([^#\]]*)([^\]]*]])/,`$1${
this.plugin.app.metadataCache.fileToLinktext(
@@ -226,7 +226,7 @@ export class EmbeddableSettings extends Modal {
(async() => {
await this.ea.addElementsToView();
//@ts-ignore
this.ea.viewUpdateScene({appState: {}});
this.ea.viewUpdateScene({appState: {}, storeAction: "update"});
this.close(); //close should only run once update scene is done
})();
} else {
+2 -1
View File
@@ -63,7 +63,8 @@ export const showFrameSettings = (ea: ExcalidrawAutomate) => {
// @ts-ignore
appState: {
frameRendering: settings
}
},
storeAction: "update",
});
frameSettingsModal.close();
})
+162
View File
@@ -0,0 +1,162 @@
import { BaseComponent, Setting, Modifier } from 'obsidian';
import { DEVICE } from 'src/constants/constants';
import { t } from 'src/lang/helpers';
import { ExcalidrawSettings } from 'src/settings';
import { modifierLabel } from 'src/utils/ModifierkeyHelper';
import { fragWithHTML } from 'src/utils/Utils';
export class HotkeyEditor extends BaseComponent {
private settings: ExcalidrawSettings;
private containerEl: HTMLElement;
private capturing: boolean = false;
private activeModifiers: Modifier[] = [];
public isDirty: boolean = false;
private applySettingsUpdate: Function;
// Store bound event handlers
private boundKeydownHandler: (event: KeyboardEvent) => void;
private boundKeyupHandler: (event: KeyboardEvent) => void;
constructor(containerEl: HTMLElement, settings: ExcalidrawSettings, applySettingsUpdate: Function) {
super();
this.containerEl = containerEl.createDiv();
this.settings = settings;
this.applySettingsUpdate = applySettingsUpdate;
// Bind the event handlers once in the constructor
this.boundKeydownHandler = this.onKeydown.bind(this);
this.boundKeyupHandler = this.onKeyup.bind(this);
}
onload(): void {
this.render();
}
private render(): void {
// Clear previous content
this.containerEl.empty();
// Render current overrides
this.settings.modifierKeyOverrides.forEach((override, index) => {
const key = override.key.toUpperCase();
new Setting(this.containerEl)
.setDesc(fragWithHTML(`<b>Code:</b> <kbd>${override.modifiers.join("+")} + ${key}</kbd> | ` +
`<b>Apple:</b> <kbd>${modifierLabel(override.modifiers, "Mac")} + ${key}</kbd> | ` +
`<b>Windows:</b> <kbd>${modifierLabel(override.modifiers, "Other")} + ${key}</kbd>`))
.addButton((button) =>
button
.setButtonText(t("HOTKEY_BUTTON_REMOVE"))
.setCta()
.onClick(() => {
this.settings.modifierKeyOverrides.splice(index, 1);
this.isDirty = true;
this.applySettingsUpdate();
this.render();
})
);
});
// Render Add New Override or Capture Instruction
if (this.capturing) {
new Setting(this.containerEl)
.setName(t("HOTKEY_PRESS_COMBO_NANE"))
.setDesc(t("HOTKEY_PRESS_COMBO_DESC"))
.controlEl.style.cursor = 'pointer';
} else {
new Setting(this.containerEl)
.addButton((button) =>
button
.setButtonText(t("HOTKEY_BUTTON_ADD_OVERRIDE"))
.setCta()
.onClick(() => this.startCapture())
);
}
}
private startCapture(): void {
this.capturing = true;
this.activeModifiers = [];
this.render();
// Use the pre-bound handlers
window.addEventListener('keydown', this.boundKeydownHandler);
window.addEventListener('keyup', this.boundKeyupHandler);
}
private onKeydown(event: KeyboardEvent): void {
event.preventDefault();
event.stopPropagation();
const modifiers = this.getModifiersFromEvent(event);
// If only modifiers are pressed, update activeModifiers and continue listening
if (['Control', 'Shift', 'Alt', 'Meta'].includes(event.key)) {
this.activeModifiers = modifiers;
return;
}
const key = event.key.length === 1 ? event.key.toLowerCase() : event.key;
// Check for duplicate overrides
const exists = this.settings.modifierKeyOverrides.some(
(override) =>
override.key === key &&
override.modifiers.length === modifiers.length &&
override.modifiers.every((mod) => modifiers.includes(mod))
);
if (!exists) {
this.settings.modifierKeyOverrides.push({ modifiers, key });
this.isDirty = true;
this.applySettingsUpdate();
}
this.stopCapture();
}
private onKeyup(event: KeyboardEvent): void {
// If all modifier keys are released, stop capturing
if (!event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) {
this.stopCapture();
}
}
private stopCapture(): void {
this.capturing = false;
// Use the pre-bound handlers for removal
window.removeEventListener('keydown', this.boundKeydownHandler);
window.removeEventListener('keyup', this.boundKeyupHandler);
this.render();
}
public unload(): void {
// Ensure listeners are removed when the component is unloaded
this.stopCapture();
}
private getModifiersFromEvent(event: KeyboardEvent): Modifier[] {
const modifiers: Modifier[] = [];
if (DEVICE.isMacOS && event.metaKey) {
modifiers.push('Mod');
} else if (!DEVICE.isMacOS && event.ctrlKey) {
modifiers.push('Mod');
}
if (DEVICE.isMacOS && event.ctrlKey) {
modifiers.push('Ctrl');
}
if (!DEVICE.isMacOS && event.metaKey) {
modifiers.push('Meta');
}
if (event.shiftKey) {
modifiers.push('Shift');
}
if (event.altKey) {
modifiers.push('Alt');
}
return modifiers;
}
}
-1
View File
@@ -7,7 +7,6 @@ import { getEA } from "src";
import { ExcalidrawAutomate } from "src/ExcalidrawAutomate";
export class ImportSVGDialog extends FuzzySuggestModal<TFile> {
public app: App;
public plugin: ExcalidrawPlugin;
private view: ExcalidrawView;
-1
View File
@@ -3,7 +3,6 @@ import { REG_LINKINDEX_INVALIDCHARS } from "../constants/constants";
import { t } from "../lang/helpers";
export class InsertCommandDialog extends FuzzySuggestModal<TFile> {
public app: App;
private addText: Function;
destroy() {
-1
View File
@@ -7,7 +7,6 @@ import ExcalidrawPlugin from "../main";
import { getEA } from "src";
export class InsertImageDialog extends FuzzySuggestModal<TFile> {
public app: App;
public plugin: ExcalidrawPlugin;
private view: ExcalidrawView;
-1
View File
@@ -5,7 +5,6 @@ import ExcalidrawPlugin from "src/main";
import { getLink } from "src/utils/FileUtils";
export class InsertLinkDialog extends FuzzySuggestModal<TFile> {
public app: App;
private addText: Function;
private drawingPath: string;
-1
View File
@@ -5,7 +5,6 @@ import ExcalidrawPlugin from "../main";
import { getEA } from "src";
export class InsertMDDialog extends FuzzySuggestModal<TFile> {
public app: App;
public plugin: ExcalidrawPlugin;
private view: ExcalidrawView;
+71 -22
View File
@@ -1,4 +1,4 @@
import { ButtonComponent, TFile } from "obsidian";
import { ButtonComponent, TFile, ToggleComponent } from "obsidian";
import ExcalidrawView from "../ExcalidrawView";
import ExcalidrawPlugin from "../main";
import { getPDFDoc } from "src/utils/FileUtils";
@@ -7,9 +7,11 @@ import { FileSuggestionModal } from "./FolderSuggester";
import { getEA } from "src";
import { ExcalidrawAutomate } from "src/ExcalidrawAutomate";
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
import { t } from "src/lang/helpers";
export class InsertPDFModal extends Modal {
private borderBox: boolean = true;
private frame: boolean = false;
private gapSize:number = 20;
private groupPages: boolean = false;
private direction: "down" | "right" = "right";
@@ -48,6 +50,7 @@ export class InsertPDFModal extends Modal {
if(this.dirty) {
this.plugin.settings.pdfImportScale = this.importScale;
this.plugin.settings.pdfBorderBox = this.borderBox;
this.plugin.settings.pdfFrame = this.frame;
this.plugin.settings.pdfGapSize = this.gapSize;
this.plugin.settings.pdfGroupPages = this.groupPages;
this.plugin.settings.pdfNumColumns = this.numColumns;
@@ -120,6 +123,7 @@ export class InsertPDFModal extends Modal {
async createForm() {
await this.plugin.loadSettings();
this.borderBox = this.plugin.settings.pdfBorderBox;
this.frame = this.plugin.settings.pdfFrame;
this.gapSize = this.plugin.settings.pdfGapSize;
this.groupPages = this.plugin.settings.pdfGroupPages;
this.numColumns = this.plugin.settings.pdfNumColumns;
@@ -138,13 +142,13 @@ export class InsertPDFModal extends Modal {
const importButtonMessages = () => {
if(!this.pdfDoc) {
importMessage.innerText = "Please select a PDF file";
importMessage.innerText = t("IPM_SELECT_PDF");
importButton.buttonEl.style.display="none";
return;
}
if(this.pagesToImport.length === 0) {
importButton.buttonEl.style.display="none";
importMessage.innerText = "Please select pages to import";
importMessage.innerText = t("IPM_SELECT_PAGES_TO_IMPORT");
return
}
if(Math.max(...this.pagesToImport) <= this.pdfDoc.numPages) {
@@ -161,7 +165,7 @@ export class InsertPDFModal extends Modal {
const numPagesMessages = () => {
if(numPages === 0) {
numPagesMessage.innerText = "Please select a PDF file";
numPagesMessage.innerText = t("IPM_SELECT_PDF");
return;
}
numPagesMessage.innerHTML = `There are <b>${numPages}</b> pages in the selected document.`;
@@ -211,7 +215,7 @@ export class InsertPDFModal extends Modal {
numPagesMessage = ce.createEl("p", {text: ""});
numPagesMessages();
new Setting(ce)
.setName("Pages to import")
.setName(t("IPM_PAGES_TO_IMPORT_NAME"))
.setDesc("e.g.: 1,3-5,7,9-10")
.addText(text => {
pageRangesTextComponent = text;
@@ -222,18 +226,52 @@ export class InsertPDFModal extends Modal {
})
importPagesMessage = ce.createEl("p", {text: ""});
new Setting(ce)
.setName("Add border box")
.addToggle(toggle => toggle
.setValue(this.borderBox)
.onChange((value) => {
this.borderBox = value;
this.dirty = true;
}))
let bbToggle: ToggleComponent;
let fToggle: ToggleComponent;
let laiToggle: ToggleComponent;
this.frame = this.borderBox ? false : this.frame;
new Setting(ce)
.setName("Group pages")
.setDesc("This will group all pages into a single group. This is recommended if you are locking the pages after import, because the group will be easier to unlock later rather than unlocking one by one.")
.setName(t("IPM_ADD_BORDER_BOX_NAME"))
.addToggle(toggle => {
bbToggle = toggle;
toggle
.setValue(this.borderBox)
.onChange((value) => {
this.borderBox = value;
if(value) {
this.frame = false;
fToggle.setValue(false);
}
this.dirty = true;
})
})
new Setting(ce)
.setName(t("IPM_ADD_FRAME_NAME"))
.setDesc(t("IPM_ADD_FRAME_DESC"))
.addToggle(toggle => {
fToggle = toggle;
toggle
.setValue(this.frame)
.onChange((value) => {
this.frame = value;
if(value) {
this.borderBox = false;
bbToggle.setValue(false);
if(!this.lockAfterImport) {
this.lockAfterImport = true;
laiToggle.setValue(true);
}
}
this.dirty = true;
})
})
new Setting(ce)
.setName(t("IPM_GROUP_PAGES_NAME"))
.setDesc(t("IPM_GROUP_PAGES_DESC"))
.addToggle(toggle => toggle
.setValue(this.groupPages)
.onChange((value) => {
@@ -244,12 +282,15 @@ export class InsertPDFModal extends Modal {
new Setting(ce)
.setName("Lock pages on canvas after import")
.addToggle(toggle => toggle
.setValue(this.lockAfterImport)
.onChange((value) => {
this.lockAfterImport = value
this.dirty = true;
}))
.addToggle(toggle => {
laiToggle = toggle;
toggle
.setValue(this.lockAfterImport)
.onChange((value) => {
this.lockAfterImport = value
this.dirty = true;
})
})
let numColumnsSetting: Setting;
let numRowsSetting: Setting;
@@ -391,6 +432,12 @@ export class InsertPDFModal extends Modal {
if(this.lockAfterImport) imgEl.locked = true;
ea.addToGroup([boxID,imageID]);
if(this.frame) {
const frameID = ea.addFrame(topX, topY,imgWidth,imgHeight,`${page}`);
ea.addElementsToFrame(frameID, [boxID,imageID]);
ea.getElement(frameID).link = this.pdfFile.path + `#page=${page}`;
}
switch(this.direction) {
case "right":
@@ -404,7 +451,9 @@ export class InsertPDFModal extends Modal {
}
}
if(this.groupPages) {
const ids = ea.getElements().map(el => el.id);
const ids = ea.getElements()
.filter(el=>!this.frame || (el.type === "frame"))
.map(el => el.id);
ea.addToGroup(ids);
}
await ea.addElementsToView(true,true,false);
+40
View File
@@ -17,6 +17,46 @@ I develop this plugin as a hobby, spending my free time doing this. If you find
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://cdn.ko-fi.com/cdn/kofi3.png?v=3" height=45></a></div>
`,
"2.3.0": `
I am moving to a new release approach aiming to publish one update per month to the Obsidian script store. If you want to continue to receive more frequent updates with new features and minor bug fixes, then join the beta testing team. [#1912](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1912)
<div class="excalidraw-videoWrapper"><div>
<iframe src="https://www.youtube.com/embed/2poSS-Z91lY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></div>
## New
- Elbow connectors: https://x.com/excalidraw/status/1819084086222393554
## Fixed
- Convert Markdown to Excalidraw did not work correctly when there was ${String.fromCharCode(96)}---${String.fromCharCode(96)} anywhere in the file, but no frontmatter (e.g. a table)
- Fixed Obsidian move tab to new window
- Fixed duplicating bound arrows without its bound elements throwing error [#8315](https://github.com/excalidraw/excalidraw/issues/8315)
`,
"2.2.13": `
## Fixed
- Could not undo element after pasting [#1906](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1906)
- Links broke after renaming an Excalidraw file using the F2 shortcut [#1907](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1907)
- Unable to open or convert very large ${String.fromCharCode(96)}.excalidraw${String.fromCharCode(96)} file, e.g. BoaPs you can download from [here](https://ko-fi.com/zsolt/shop)
`,
"2.2.12": `
## Fixed
- Rename moved files to root folder [#1905](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1905)
- Fonts not displaying correctly in cached image previews
`,
"2.2.11": `
<img alt="badges" src="https://github.com/user-attachments/assets/7591b523-6bc6-46ff-b552-5c3492139e4c" referrerpolicy="no-referrer" style="width: 100%;">
## New
- Font picker with additional fonts (not yet fully configurable, but that will come in due time) [#8012](https://github.com/excalidraw/excalidraw/pull/8012)
- Introducing Visual Thinking Badges. The more you use Excalidraw the higher your rank will be. Levels are: Bronze, Silver, Gold and Platinum.
## Fixed
- Embedded PDF was not visible on phones [#1904](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1904)
- F2 does not rename files in Excalidraw View [#1900](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1900)
- Wireframe to Code now honors the GPT model settings in plugin settings. [#1901](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1901)
- Updated ExcaliAI to support gpt-4o for vision. [#1859](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/1859) 🙏@Saik0s
- Minor fixes from excalidraw.com [#8287](https://github.com/excalidraw/excalidraw/pull/8287), [#8285](https://github.com/excalidraw/excalidraw/pull/8285)
`,
"2.2.10": `
<div class="excalidraw-videoWrapper"><div>
<iframe src="https://www.youtube.com/embed/sjZfdqpxqsg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
-1
View File
@@ -9,7 +9,6 @@ export enum openDialogAction {
}
export class OpenFileDialog extends FuzzySuggestModal<TFile> {
public app: App;
private plugin: ExcalidrawPlugin;
private action: openDialogAction;
private onNewPane: boolean;
+46 -31
View File
@@ -20,7 +20,7 @@ import { t } from "src/lang/helpers";
import { ExcalidrawElement, getEA } from "src";
import { ExcalidrawAutomate } from "src/ExcalidrawAutomate";
import { MAX_IMAGE_SIZE, REG_LINKINDEX_INVALIDCHARS } from "src/constants/constants";
import { REGEX_LINK } from "src/ExcalidrawData";
import { REGEX_LINK, REGEX_TAGS } from "src/ExcalidrawData";
import { ScriptEngine } from "src/Scripts";
import { openExternalLink, openTagSearch, parseObsidianLink } from "src/utils/ExcalidrawViewUtils";
@@ -211,15 +211,15 @@ export class GenericInputPrompt extends Modal {
}, 30);
}
textComponent.inputEl.addEventListener("keydown", this.keyDownCallback);
textComponent.inputEl.addEventListener('keyup', checkcaret); // Every character written
textComponent.inputEl.addEventListener('pointerup', checkcaret); // Click down
textComponent.inputEl.addEventListener('touchend', checkcaret); // Click down
textComponent.inputEl.addEventListener('input', checkcaret); // Other input events
textComponent.inputEl.addEventListener('paste', checkcaret); // Clipboard actions
textComponent.inputEl.addEventListener('cut', checkcaret);
textComponent.inputEl.addEventListener('select', checkcaret); // Some browsers support this event
textComponent.inputEl.addEventListener('selectionchange', checkcaret);// Some browsers support this event
textComponent.inputEl.addEventListener("keydown", this.keyDownCallback.bind(this));
textComponent.inputEl.addEventListener('keyup', checkcaret.bind(this)); // Every character written
textComponent.inputEl.addEventListener('pointerup', checkcaret.bind(this)); // Click down
textComponent.inputEl.addEventListener('touchend', checkcaret.bind(this)); // Click down
textComponent.inputEl.addEventListener('input', checkcaret.bind(this)); // Other input events
textComponent.inputEl.addEventListener('paste', checkcaret.bind(this)); // Clipboard actions
textComponent.inputEl.addEventListener('cut', checkcaret.bind(this));
textComponent.inputEl.addEventListener('select', checkcaret.bind(this)); // Some browsers support this event
textComponent.inputEl.addEventListener('selectionchange', checkcaret.bind(this));// Some browsers support this event
return textComponent;
}
@@ -272,18 +272,18 @@ export class GenericInputPrompt extends Modal {
this.createButton(
actionButtonContainer,
"✅",
this.submitClickCallback,
this.submitClickCallback.bind(this),
).setCta().buttonEl.style.marginRight = "0";
}
this.createButton(actionButtonContainer, "❌", this.cancelClickCallback, t("PROMPT_BUTTON_CANCEL"));
this.createButton(actionButtonContainer, "❌", this.cancelClickCallback.bind(this), t("PROMPT_BUTTON_CANCEL"));
if(this.displayEditorButtons) {
this.createButton(editorButtonContainer, "⏎", ()=>this.insertStringBtnClickCallback("\n"), t("PROMPT_BUTTON_INSERT_LINE"), "0");
this.createButton(editorButtonContainer, "⌫", this.delBtnClickCallback, "Delete");
this.createButton(editorButtonContainer, "⌫", this.delBtnClickCallback.bind(this), "Delete");
this.createButton(editorButtonContainer, "⎵", ()=>this.insertStringBtnClickCallback(" "), t("PROMPT_BUTTON_INSERT_SPACE"));
if(this.view) {
this.createButton(editorButtonContainer, "🔗", this.linkBtnClickCallback, t("PROMPT_BUTTON_INSERT_LINK"));
this.createButton(editorButtonContainer, "🔗", this.linkBtnClickCallback.bind(this), t("PROMPT_BUTTON_INSERT_LINK"));
}
this.createButton(editorButtonContainer, "🔠", this.uppercaseBtnClickCallback, t("PROMPT_BUTTON_UPPERCASE"));
this.createButton(editorButtonContainer, "🔠", this.uppercaseBtnClickCallback.bind(this), t("PROMPT_BUTTON_UPPERCASE"));
}
}
@@ -342,8 +342,13 @@ export class GenericInputPrompt extends Modal {
this.inputComponent.inputEl.setSelectionRange(this.selectionStart, this.selectionEnd);
}
private submitClickCallback = () => this.submit();
private cancelClickCallback = () => this.cancel();
private submitClickCallback () {
this.submit();
}
private cancelClickCallback () {
this.cancel();
}
private keyDownCallback = (evt: KeyboardEvent) => {
if ((evt.key === "Enter" && this.lines === 1) || (isWinCTRLorMacCMD(evt) && evt.key === "Enter")) {
@@ -668,10 +673,10 @@ export class ConfirmationPrompt extends Modal {
buttonContainer.style.display = "flex";
buttonContainer.style.justifyContent = "flex-end";
const cancelButton = this.createButton(buttonContainer, t("PROMPT_BUTTON_CANCEL"), this.cancelClickCallback);
const cancelButton = this.createButton(buttonContainer, t("PROMPT_BUTTON_CANCEL"), this.cancelClickCallback.bind(this));
cancelButton.buttonEl.style.marginRight = "0.5rem";
const confirmButton = this.createButton(buttonContainer, t("PROMPT_BUTTON_OK"), this.confirmClickCallback);
const confirmButton = this.createButton(buttonContainer, t("PROMPT_BUTTON_OK"), this.confirmClickCallback.bind(this));
confirmButton.buttonEl.style.marginRight = "0";
cancelButton.buttonEl.focus();
@@ -683,12 +688,12 @@ export class ConfirmationPrompt extends Modal {
return button;
}
private cancelClickCallback = () => {
private cancelClickCallback() {
this.didConfirm = false;
this.close();
};
private confirmClickCallback = () => {
private confirmClickCallback() {
this.didConfirm = true;
this.close();
};
@@ -714,18 +719,28 @@ export async function linkPrompt (
view?: ExcalidrawView,
message: string = "Select link to open",
):Promise<[file:TFile, linkText:string, subpath: string]> {
const partsArray = REGEX_LINK.getResList(linkText);
const linksArray = REGEX_LINK.getResList(linkText);
const tagsArray = REGEX_TAGS.getResList(linkText);
let subpath: string = null;
let file: TFile = null;
let parts = partsArray[0];
if (partsArray.length > 1) {
let parts = linksArray[0] ?? tagsArray[0];
const itemsDisplay = [
...linksArray.filter(p=> Boolean(p.value)).map(p => {
const alias = REGEX_LINK.getAliasOrLink(p);
return alias === "100%" ? REGEX_LINK.getLink(p) : alias;
}),
...tagsArray.filter(x=> Boolean(x.value)).map(x => REGEX_TAGS.getTag(x)),
];
const items = [
...linksArray.filter(p=>Boolean(p.value)),
...tagsArray.filter(x=> Boolean(x.value)),
];
if (items.length>1) {
parts = await ScriptEngine.suggester(
app,
partsArray.filter(p=>Boolean(p.value)).map(p => {
const alias = REGEX_LINK.getAliasOrLink(p);
return alias === "100%" ? REGEX_LINK.getLink(p) : alias;
}),
partsArray.filter(p=>Boolean(p.value)),
itemsDisplay,
items,
message,
);
if(!parts) return;
@@ -735,8 +750,8 @@ export async function linkPrompt (
return;
}
if (!parts.value) {
openTagSearch(linkText, app);
if (REGEX_TAGS.isTag(parts)) {
openTagSearch(REGEX_TAGS.getTag(parts), app);
return;
}
+44
View File
@@ -0,0 +1,44 @@
import { App, MarkdownRenderer, Modal } from "obsidian";
import ExcalidrawPlugin from "../main";
import { Rank, SwordColors } from "src/menu/ActionIcons";
export class RankMessage extends Modal {
constructor(app: App, private plugin: ExcalidrawPlugin, private filecount: number, private rank: Rank, private color: string, private shield: string, private dark: string) {
super(app);
}
onOpen(): void {
//this.contentEl.classList.add("excalidraw-release");
this.containerEl.classList.add("excalidraw-release");
this.titleEl.setText("Congratulations, glorious knight!");
this.createForm();
}
async onClose() {
this.contentEl.empty();
this.plugin = null;
}
async createForm() {
const { title} = SwordColors[this.rank];
this.contentEl.createDiv({ cls: "excalidraw-rank" }, (el) => {
el.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 512 512" viewBox="0 0 511 512"><path fill="${this.color}" d="m389 495 36 7c6 1 11-4 10-10l-6-36a22 22 0 0 0-9-14l-61-46-29 28 45 62a22 22 0 0 0 14 9zm0 0" data-original="#97a7a7"/><path fill="#ffd3bc" d="m333 361-33 4-27 29 1 5 15 13c11 10 27 12 39 3 7-4 12-11 13-20 1-11-3-23-8-34zm0 0" data-original="#ffd3bc"/><path fill="#a5b0bc" d="m288 450-3-50-88-15-87 15-3 50 27 16 28-16v-8c0-6 4-11 10-11h51c6 0 10 5 10 11v8l28 16 27-16zm28-114a332 332 0 0 0-4-6c-14-17-32-30-55-29l16 93 60-33c-5-9-11-18-17-25zm0 0" data-original="#a5b0bc"/><path fill="${this.shield}" d="M281 371c-9-54-24-70-24-70H138s-15 16-24 70l-4 29h175l-4-29zm0 0" data-original="${this.shield}"/><path fill="${this.color}" d="M383 160a30 30 0 1 1-59 0 30 30 0 0 1 59 0zm-312 0a30 30 0 1 1-59 0 30 30 0 0 1 59 0zm0 0" data-original="#97a7a7"/><path fill="#a5b0bc" d="M44 160a153 153 0 1 1 306 0 153 153 0 0 1-306 0zm0 0" data-original="#a5b0bc"/><path fill="#748A8A" d="M107 450v13s-12 10-17 27c-2 7 4 14 11 14h49c7 1 12-5 12-11v-43zm181 0v13s12 10 17 27c2 7-4 14-11 14h-49c-7 1-12-5-12-11v-43zm0 0" data-original="#748A8A"/><path fill="#ffd3bc" d="M44 160s44 76 153 76c110 0 153-76 153-76l-17-30-136-27-127 24zm0 0" data-original="#ffd3bc"/><path fill="#ffbe9c" d="M197 103 70 127l-26 33s5 9 16 20c6-4 50-29 137-29s131 25 138 29c11-11 15-20 15-20l-17-30zm0 0" data-original="#ffbe9c"/><path fill="${this.color}" d="M271 59c-47-18-100-18-147 0-39 15-80 45-80 101 0 0 48-34 153-34s153 34 153 34c0-56-40-86-79-101zm0 0" data-original="#97a7a7"/><path fill="#ff889e" d="M274 201h-18a7 7 0 1 1 0-15h18a7 7 0 1 1 0 15zm-135 0h-18a7 7 0 1 1 0-15h18a7 7 0 1 1 0 15zm0 0" data-original="#ff889e"/><path fill="#748A8A" d="m185 387-75 13-2 47a39 39 0 0 0 2 0c31-10 57-30 75-60zm0 0" data-original="#748A8A"/><path fill="#00000060" d="M186 386c15-24 22-50 25-67a43 43 0 0 0 0-18h-73s-15 16-24 70l-4 29h67a160 160 0 0 0 9-14zm0 0" data-original="#00000060"/><path fill="#748A8A" d="M174 268c-29-4-46-12-54-17a43 43 0 0 0-45 0h-1a153 153 0 0 0 138 62 43 43 0 0 0-38-45zm0 0" data-original="#748A8A"/><path fill="${this.dark}" d="M171 293c-32-4-53-14-64-21a18 18 0 0 0-19 0c-11 7-32 17-64 21-10 1-18 11-16 21 6 31 25 90 84 109a18 18 0 0 0 11 0c58-19 77-78 83-109 2-10-5-20-15-21zm0 0" data-original="${this.dark}"/><path fill="${this.shield}" d="M97 387c-29-11-43-39-50-62 22-5 38-12 50-18 12 6 29 13 50 18-7 23-21 51-50 62zm0 0" data-original="${this.shield}"/><path fill="${this.dark}" d="m327 444 52-51a6 6 0 0 0 0-9c-9-9-24-9-33 0l-28 27c-9 9-9 24 0 33a6 6 0 0 0 9 0zm0 0" data-original="${this.dark}"/><path d="M100 88a8 8 0 0 0-7 8v18a8 8 0 1 0 15 0V96c0-4-3-8-8-8zm49-20a7 7 0 0 0-8 8v36a8 8 0 1 0 15 0V76a8 8 0 0 0-7-8zm145 20a7 7 0 0 0-7 8v18c0 4 3 8 7 8a8 8 0 0 0 8-8V96a8 8 0 0 0-8-8zm-48-20a8 8 0 0 0-8 8v36a8 8 0 1 0 15 0V76c0-4-3-8-7-8zm-49-6c-4 0-7 3-7 7v36a8 8 0 0 0 15 0V69c0-4-3-7-8-7zm68 120c4 0 8-3 8-8v-13a8 8 0 1 0-15 0v13a8 8 0 0 0 7 8zm-135 0c4 0 7-3 7-8v-13a8 8 0 1 0-15 0v13a8 8 0 0 0 8 8zm85 0a8 8 0 0 0-11 1l-7 2-6-2a7 7 0 0 0-11-1c-3 3-3 7 0 11 4 5 11 7 17 7 7 0 14-2 18-7a8 8 0 0 0 0-11zM95 394a8 8 0 0 0 5 0c32-13 47-44 55-67 1-4-2-9-6-10-18-3-34-9-48-17a7 7 0 0 0-7 0c-14 8-30 14-48 17-4 1-7 6-6 10 7 23 22 54 55 67zm2-78c13 6 26 10 41 14-7 18-19 39-41 49a83 83 0 0 1-40-49c15-4 28-8 40-14zm0 0" data-original="#000000"/><path d="M436 455a29 29 0 0 0-11-19l-45-34 4-4c5-5 5-14 0-19-6-6-13-9-22-9a30 30 0 0 0-16 4l-6-16c-5-9-10-17-18-27a375 375 0 0 0-4-6 86 86 0 0 0-37-27c36-22 63-58 73-101a37 37 0 0 0 0-74 161 161 0 0 0-313 0 37 37 0 0 0 0 74c6 27 19 51 38 71-12 7-30 14-56 17-14 2-25 16-22 30 4 19 12 47 29 71a8 8 0 1 0 12-9c-16-22-23-47-26-64-1-6 3-12 9-13 33-4 54-14 67-22 3-2 8-2 11 0 20 13 43 19 67 22 8 1 10 8 8 15-3 18-12 46-31 69-12 15-28 26-47 32h-6c-12-4-23-10-33-18a8 8 0 1 0-9 11c11 10 24 16 38 21l11 1a694 694 0 0 0-1 19v10c-4 4-13 14-17 28-3 12 6 24 18 24h49c11 0 19-8 19-19v-51c0-2 1-3 3-3h51a3 3 0 0 1 3 3v51c0 11 8 19 19 19h49c12 0 21-12 18-24-4-14-13-24-17-28v-10a699 699 0 0 0-1-25 41 41 0 0 0 10 3c0 8 3 15 9 21a14 14 0 0 0 9 4c4 0 7-1 10-4l4-4 33 46a29 29 0 0 0 19 11s36 7 36 7c10 2 20-8 18-18zm-272-68c16-22 24-45 28-65l1-1 21-1a159 159 0 0 0 40-9c4 6 12 22 18 52l4 29H160l4-5zm142-52 17 23-33 18a473 473 0 0 0-19-66c16 4 27 15 35 25zm32-190c-23-11-48-17-73-21a426 426 0 0 0-136 0 267 267 0 0 0-76 23c5-37 29-64 74-81a195 195 0 0 1 141 0c44 17 69 44 74 81a173 173 0 0 0-4-2zm18-6a22 22 0 0 1 0 43h1a162 162 0 0 0 0-43h-1zM197 15c49 0 91 23 118 60-12-9-26-17-41-23A210 210 0 0 0 80 75c27-37 69-60 117-60zM19 160c0-11 9-20 19-21a163 163 0 0 0 0 43c-10-1-19-10-19-22zm130 121c-14-3-27-8-38-16a25 25 0 0 0-14-3 26 26 0 0 0-4 0c-20-21-33-46-38-73a8 8 0 0 0 0-1l-1-3 21 19a196 196 0 0 0 150 38 7 7 0 1 0-1-15 217 217 0 0 1-27 2c-43 0-81-12-112-36-15-12-25-23-30-30l30-13c36-12 74-16 112-16a320 320 0 0 1 143 29c-10 13-38 45-88 59a8 8 0 0 0-5 9 7 7 0 0 0 9 5c42-12 69-34 85-51a138 Line truncated
});
await MarkdownRenderer.render(
this.app,
`You have ${this.filecount} Excalidraw drawings in your Vault earning you a new rank: **${this.rank}**! You've ascended to **${title}**!\n\nI've spent the past 3+ years building this plugin. If you appreciate my work, consider supporting me on [Ko-Fi](https://ko-fi.com/zsolt) or join the next [Visual Thinking Workshop](https://visual-thinking-workshop.com) cohort.`,
this.contentEl,
"",
this.plugin,
);
this.contentEl.createEl("p", { text: "" }, (el) => {
//files manually follow one of two options:
el.style.textAlign = "right";
const bOk = el.createEl("button", { text: "Close" });
bOk.onclick = () => this.close();
});
}
}
+50 -8
View File
@@ -100,7 +100,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
{
field: "style.fontFamily",
code: "[number]",
desc: "1: Virgil, 2:Helvetica, 3:Cascadia, 4:LocalFont",
desc: "1: Virgil, 2:Helvetica, 3:Cascadia, 4:Local Font, 5: Excalifont, 6: Nunito, 7: Lilita One, 8: Comic Shanns, 9: Liberation Sans",
after: "",
},
{
@@ -233,6 +233,18 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: null,
after: "",
},
{
field: "addElementsToFrame",
code: "addElementsToFrame(frameId: string, elementIDs: string[]):void;",
desc: null,
after: "",
},
{
field: "addFrame",
code: "addFrame(topX: number, topY: number, width: number, height: number, name?: string): string;",
desc: null,
after: "",
},
{
field: "addRect",
code: "addRect(topX: number, topY: number, width: number, height: number, id?:string): string;",
@@ -311,6 +323,12 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: "This is an async function, you need to avait the results. Adds a LaTex element to the drawing. The tex string is the LaTex code. The function returns the id of the created element.",
after: "",
},
{
field: "tex2dataURL",
code: "async tex2dataURL(tex: string, scale: number = 4): Promise<{mimeType: MimeType;fileId: FileId;dataURL: DataURL;created: number;size: { height: number; width: number };}> ",
desc: "returns the base64 dataURL of the LaTeX equation rendered as an SVG. tex is the LaTeX equation string",
after: "",
},
{
field: "connectObjects",
code: "connectObjects(objectA: string, connectionA: ConnectionPoint, objectB: string, connectionB: ConnectionPoint, formatting?: {numberOfPoints?: number; startArrowHead?: string; endArrowHead?: string; padding?: number;},): string;",
@@ -387,8 +405,8 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "getViewSelectedElements",
code: "getViewSelectedElements(): ExcalidrawElement[];",
desc: null,
code: "getViewSelectedElements(includeFrameChildren: boolean = true): ExcalidrawElement[];",
desc: "If a frame is selected this function will return the frame and all its elements unless includeFrameChildren is set to false",
after: "",
},
{
@@ -442,7 +460,19 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
{
field: "getExportSettings",
code: "getExportSettings(withBackground: boolean, withTheme: boolean,): ExportSettings;",
desc: "Utility function to generate ExportSettings object",
desc: "Utility function to generate ExportSettings object\n" +
"export interface ExportSettings {\n" +
" withBackground: boolean;\n" +
" withTheme: boolean;\n" +
" isMask: boolean; //if true elements will be processed as mask, clipping, etc.\n" +
" frameRendering?: { //optional, overrides relevant appState settings for rendering the frame\n" +
" enabled: boolean;\n" +
" name: boolean;\n" +
" outline: boolean;\n" +
" clip: boolean;\n" +
" };\n" +
" skipInliningFonts?: boolean;\n" +
"}",
after: "",
},
{
@@ -477,8 +507,9 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "getElementsInTheSameGroupWithElement",
code: "getElementsInTheSameGroupWithElement(element: ExcalidrawElement, elements: ExcalidrawElement[]): ExcalidrawElement[];",
desc: "Gets all the elements from elements[] that share one or more groupIds with element.",
code: "getElementsInTheSameGroupWithElement(element: ExcalidrawElement, elements: ExcalidrawElement[], includeFrameElements: boolean = false): ExcalidrawElement[];",
desc: "Gets all the elements from elements[] that share one or more groupIds with element.<br>" +
"If includeFrameElements is true, then if the frame is part of the group all the elements that are in the frame will also be included in the result set",
after: ""
},
{
@@ -519,8 +550,19 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "getOriginalImageSize",
code: "async getOriginalImageSize(imageElement: ExcalidrawImageElement): Promise<{width: number; height: number}>",
desc: "Returns the size of the image element at 100% (i.e. the original size). This is an async function, you need to await the result.",
code: "async getOriginalImageSize(imageElement: ExcalidrawImageElement, shouldWaitForImage: boolean=false): Promise<{width: number; height: number}>",
desc: "Returns the size of the image element at 100% (i.e. the original size) or undefined if the data URL is not available.\n"+
"If shouldWaitForImage is true, the function will wait for the view to load the image before returning the size.\n"+
"This is an async function, you need to await the result.",
after: "",
},
{
field: "resetImageAspectRatio",
code: "async resetImageAspectRatio(imgEl: ExcalidrawImageElement): Promise<boolean>",
desc: "Resets the image to its original aspect ratio.\n" +
"If the image is resized then the function returns true.\n" +
"If the image element is not in EA (only in the view), then if the image is resized, the element is copied to EA for Editing using copyViewElementsToEAforEditing([imgEl]).\n" +
"Note you need to run await ea.addElementsToView(false); to add the modified image to the view.",
after: "",
},
{
+66 -27
View File
@@ -2,6 +2,7 @@ import {
DEVICE,
FRONTMATTER_KEYS,
} from "src/constants/constants";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/ModifierkeyHelper";
// English
@@ -36,6 +37,7 @@ export default {
TRANSCLUDE: "Embed a drawing",
TRANSCLUDE_MOST_RECENT: "Embed the most recently edited drawing",
TOGGLE_LEFTHANDED_MODE: "Toggle left-handed mode",
TOGGLE_SPLASHSCREEN: "Show splash screen in new drawings",
FLIP_IMAGE: "Open the back-of-the-note of the selected excalidraw image",
NEW_IN_NEW_PANE: "Create new drawing - IN AN ADJACENT WINDOW",
NEW_IN_NEW_TAB: "Create new drawing - IN A NEW TAB",
@@ -53,7 +55,7 @@ export default {
COPY_ELEMENT_LINK: "Copy [[link]] for selected element(s)",
COPY_DRAWING_LINK: "Copy ![[embed link]] for this drawing",
INSERT_LINK_TO_ELEMENT:
`Copy [[link]] for selected element to clipboard. ${labelCTRL()}+CLICK to copy 'group=' link. ${labelSHIFT()}+CLICK to copy an 'area=' link. ${labelALT()}+CLICK to watch a help video.`,
`Copy [[link]] for selected element to clipboard. ${labelCTRL()}+CLICK to copy 'group=' link. ${labelSHIFT()}+CLICK to copy an 'area=' link.`,
INSERT_LINK_TO_ELEMENT_GROUP:
"Copy 'group=' ![[link]] for selected element to clipboard.",
INSERT_LINK_TO_ELEMENT_AREA:
@@ -79,7 +81,7 @@ export default {
ERROR_TRY_AGAIN: "Please try again.",
PASTE_CODEBLOCK: "Paste code block",
INSERT_LATEX:
`Insert LaTeX formula (e.g. \\binom{n}{k} = \\frac{n!}{k!(n-k)!}). ${labelALT()}+CLICK to watch a help video.`,
`Insert LaTeX formula (e.g. \\binom{n}{k} = \\frac{n!}{k!(n-k)!}).`,
ENTER_LATEX: "Enter a valid LaTeX expression",
READ_RELEASE_NOTES: "Read latest release notes",
RUN_OCR: "OCR full drawing: Grab text from freedraw + images to clipboard and doc.props",
@@ -92,14 +94,20 @@ export default {
ANNOTATE_IMAGE : "Annotate image in Excalidraw",
INSERT_ACTIVE_PDF_PAGE_AS_IMAGE: "Insert active PDF page as image",
RESET_IMG_TO_100: "Set selected image element size to 100% of original",
RESET_IMG_ASPECT_RATIO: "Reset selected image element aspect ratio",
TEMPORARY_DISABLE_AUTOSAVE: "Disable autosave until next time Obsidian starts (only set this if you know what you are doing)",
TEMPORARY_ENABLE_AUTOSAVE: "Enable autosave",
//ExcalidrawView.ts
NO_SEARCH_RESULT: "Didn't find a matching element in the drawing",
FORCE_SAVE_ABORTED: "Force Save aborted because saving is in progress",
LINKLIST_SECOND_ORDER_LINK: "Second Order Link",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT_TITLE: "Customize the link",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT: "Do not add [[square brackets]] around the filename!<br>Follow this format when editing your link:<br><mark>filename#^blockref|WIDTHxMAXHEIGHT</mark>",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT_TITLE: "Customize the Embedded File link",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT: "Do not add [[square brackets]] around the filename!<br>" +
"For markdown-page images follow this format when editing your link: <mark>filename#^blockref|WIDTHxMAXHEIGHT</mark><br>" +
"You can anchor Excalidraw images to 100% of their size by adding <code>|100%</code> to the end of the link.<br>" +
"You can change the PDF page by changing <code>#page=1</code> to <code>#page=2</code> etc.<br>" +
"PDF rect crop values are: <code>left, bottom, right, top</code>. Eg.: <code>#rect=0,0,500,500</code><br>",
FRAME_CLIPPING_ENABLED: "Frame Rendering: Enabled",
FRAME_CLIPPING_DISABLED: "Frame Rendering: Disabled",
ARROW_BINDING_INVERSE_MODE: "Inverted Mode: Default arrow binding is now disabled. Use CTRL/CMD to temporarily enable binding when needed.",
@@ -230,7 +238,7 @@ export default {
"The default OpenAI API URL. This is a freetext field, so you can enter any valid OpenAI API compatible URL. " +
"Excalidraw will use this URL when posting API requests to OpenAI. I am not doing any error handling on this field, so make sure you enter a valid URL and only change this if you know what you are doing. ",
AI_OPENAI_DEFAULT_IMAGE_API_URL_NAME: "OpenAI Image Generation API URL",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "Enter your default AI vision model here. e.g.: gpt-4-vision-preview",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "Enter your default AI vision model here. e.g.: gpt-4o",
SAVING_HEAD: "Saving",
SAVING_DESC: "In the 'Saving' section of Excalidraw Settings, you can configure how your drawings are saved. This includes options for compressing Excalidraw JSON in Markdown, setting autosave intervals for both desktop and mobile, defining filename formats, and choosing whether to use the .excalidraw.md or .md file extension. ",
COMPRESS_NAME: "Compress Excalidraw JSON in Markdown",
@@ -322,24 +330,33 @@ FILENAME_HEAD: "Filename",
DEFAULT_PEN_MODE_NAME: "Pen mode",
DEFAULT_PEN_MODE_DESC:
"Should pen mode be automatically enabled when opening Excalidraw?",
DISABLE_DOUBLE_TAP_ERASER_NAME: "Enable double-tap eraser in pen mode",
SHOW_PEN_MODE_FREEDRAW_CROSSHAIR_NAME: "Show (+) crosshair in pen mode",
SHOW_PEN_MODE_FREEDRAW_CROSSHAIR_DESC:
"Show crosshair in pen mode when using the freedraw tool. <b><u>Toggle ON:</u></b> SHOW <b><u>Toggle OFF:</u></b> HIDE<br>"+
"The effect depends on the device. Crosshair is typically visible on drawing tablets, MS Surface, but not on iOS.",
SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_NAME: "Render image in hover preview for MD files",
SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_NAME: "Render Excalidraw file as an image in hover preview...",
SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_DESC:
"This setting effects files that have the <b>excalidraw-open-md: true</b> frontmatter key.",
SHOW_DRAWING_OR_MD_IN_READING_MODE_NAME: "Render image when in markdown reading mode",
"...even if the file has the <b>excalidraw-open-md: true</b> frontmatter key.<br>" +
"When this setting is off and the file is set to open in md by default, the hover preview will show the " +
"markdown side of the document.",
SHOW_DRAWING_OR_MD_IN_READING_MODE_NAME: "Render as image when in markdown reading mode of an Excalidraw file",
SHOW_DRAWING_OR_MD_IN_READING_MODE_DESC:
"Must close the active excalidraw/markdown file and reopen it for this change to take effect.<br>When you are in markdown reading mode (aka. reading the back side of the drawing), should the Excalidraw drawing be rendered as an image? " +
"This setting will not affect the display of the drawing when you are in Excalidraw mode, when you embed the drawing into a markdown document or when rendering hover preview.<br><ul>" +
"<li>See other related setting for <b>PDF Export</b> under 'Embedding and Exporting' further below.</li>" +
"<li>Be sure to check out the <b>Fade Out setting</b> in the 'Miscellaneous fetures' section.</li></ul>",
SHOW_DRAWING_OR_MD_IN_EXPORTPDF_NAME: "Render image when EXPORT TO PDF in markdown mode",
"When you are in markdown reading mode (aka. reading the back side of the drawing) should the Excalidraw drawing be rendered as an image? " +
"This setting will not affect the display of the drawing when you are in Excalidraw mode or when you embed the drawing into a markdown document or when rendering hover preview.<br><ul>" +
"<li>See other related setting for <a href='#"+TAG_PDFEXPORT+"'>PDF Export</a> under 'Embedding and Exporting' further below.</li></ul><br>" +
"You must close the active excalidraw/markdown file and reopen it for this change to take effect.",
SHOW_DRAWING_OR_MD_IN_EXPORTPDF_NAME: "Render the file as an image when exporting an Excalidraw file to PDF",
SHOW_DRAWING_OR_MD_IN_EXPORTPDF_DESC:
"Must close the active excalidraw/markdown file and reopen for this change to take effect.<br>When you are printing the markdown side of the note to PDF (aka. the back side of the drawing), should the Excalidraw drawing be rendered as an image?<br><ul>" +
"<li>See other related setting for <b>Markdown Reading Mode</b> under 'Appearnace and Behavior' further above.</li>" +
"<li>Be sure to check out the <b>Fade Out setting</b> in the 'Miscellaneous fetures' section.</li></ul>",
"This setting controls the behavior of Excalidraw when exporting an Excalidraw file to PDF in markdown view mode using Obsidian's <b>Export to PDF</b> feature.<br>" +
"<ul><li>When <b>enabled</b> the PDF will show the Excalidraw drawing only;</li>" +
"<li>When <b>disabled</b> the PDF will show the markdown side of the document.</li></ul>" +
"See the other related setting for <a href='#"+TAG_MDREADINGMODE+"'>Markdown Reading Mode</a> under 'Appearnace and Behavior' further above.<br>" +
"⚠️ Note, you must close the active excalidraw/markdown file and reopen for this change to take effect. ⚠️",
HOTKEY_OVERRIDE_HEAD: "Hotkey overrides",
HOTKEY_OVERRIDE_DESC: `Some of the Excalidraw hotkeys such as <code>${labelCTRL()}+Enter</code> to edit text or <code>${labelCTRL()}+K</code> to create an element link ` +
"conflict with Obsidian hotkey settings. The hotkey combinations you add below will override Obsidian's hotkey settings while useing Excalidraw, thus " +
`you can add <code>${labelCTRL()}+G</code> if you want to default to Group Object in Excalidraw instead of opening Graph View.`,
THEME_HEAD: "Theme and styling",
ZOOM_HEAD: "Zoom",
DEFAULT_PINCHZOOM_NAME: "Allow pinch zoom in pen mode",
@@ -465,7 +482,11 @@ FILENAME_HEAD: "Filename",
EMBED_TOEXCALIDRAW_DESC: "In the Embed Files section of Excalidraw Settings, you can configure how various files are embedded into Excalidraw. This includes options for embedding interactive markdown files, PDFs, and markdown files as images.",
MD_HEAD: "Embed markdown into Excalidraw as image",
MD_EMBED_CUSTOMDATA_HEAD_NAME: "Interactive Markdown Files",
MD_EMBED_CUSTOMDATA_HEAD_DESC: `These settings will only effect future embeds. Current embeds remain unchanged. The theme setting of embedded frames is under the "Excalidraw appearance and behavior" section.`,
MD_EMBED_CUSTOMDATA_HEAD_DESC: `The below settings will only effect future embeds. Current embeds remain unchanged. The theme setting of embedded frames is under the "Excalidraw appearance and behavior" section.`,
MD_EMBED_SINGLECLICK_EDIT_NAME: "Single click to edit embedded markdown",
MD_EMBED_SINGLECLICK_EDIT_DESC:
"Single click on an embedded markdown file to edit it. " +
"When turned off, the markdown file will first open in preview mode, then switch to edit mode when you click on it again.",
MD_TRANSCLUDE_WIDTH_NAME: "Default width of a transcluded markdown document",
MD_TRANSCLUDE_WIDTH_DESC:
"The width of the markdown page. This affects the word wrapping when transcluding longer paragraphs, and the width of " +
@@ -526,7 +547,7 @@ FILENAME_HEAD: "Filename",
EMBED_REUSE_EXPORTED_IMAGE_NAME:
"If found, use the already exported image for preview",
EMBED_REUSE_EXPORTED_IMAGE_DESC:
"This setting works in conjunction with the Auto-export SVG/PNG setting. If an exported image that matches the file name of the drawing " +
"This setting works in conjunction with the <a href='#"+TAG_AUTOEXPORT+"'>Auto-export SVG/PNG</a> setting. If an exported image that matches the file name of the drawing " +
"is available, use that image instead of generating a preview image on the fly. This will result in faster previews especially when you have many embedded objects in the drawing, however, " +
"it may happen that your latest changes are not displayed and that the image will not automatically match your Obsidian theme in case you have changed the " +
"Obsidian theme since the export was created. This setting only applies to embedding images into markdown documents. " +
@@ -557,7 +578,7 @@ FILENAME_HEAD: "Filename",
EMBED_TYPE_NAME: "Type of file to insert into the document",
EMBED_TYPE_DESC:
"When you embed an image into a document using the command palette this setting will specify if Excalidraw should embed the original Excalidraw file " +
"or a PNG or an SVG copy. You need to enable auto-export PNG / SVG (see below under Export Settings) for those image types to be available in the dropdown. For drawings that do not have a " +
"or a PNG or an SVG copy. You need to enable <a href='#"+TAG_AUTOEXPORT+"'>auto-export PNG / SVG</a> (see below under Export Settings) for those image types to be available in the dropdown. For drawings that do not have a " +
"a corresponding PNG or SVG readily available the command palette action will insert a broken link. You need to open the original drawing and initiate export manually. " +
"This option will not autogenerate PNG/SVG files, but will simply reference the already existing files.",
EMBED_MARKDOWN_COMMENT_NAME: "Embed link to drawing as comment",
@@ -647,7 +668,7 @@ FILENAME_HEAD: "Filename",
LATEX_DEFAULT_DESC: "Leave empty if you don't want a default formula. You can add default formatting here such as <code>\\color{white}</code>.",
NONSTANDARD_HEAD: "Non-Excalidraw.com supported features",
NONSTANDARD_DESC: `These settings in the "Non-Excalidraw.com Supported Features" section provide customization options beyond the default Excalidraw.com features. These features are not available on excalidraw.com. When exporting the drawing to Excalidraw.com these features will appear different.
You can configure the number of custom pens displayed next to the Obsidian Menu on the canvas, allowing you to choose from a range of options. Additionally, you can enable a fourth font option, which adds a fourth font button to the properties panel for text elements. `,
You can configure the number of custom pens displayed next to the Obsidian Menu on the canvas, allowing you to choose from a range of options. Additionally, you can enable a local font option, which adds a local font to the list of fonts on the element properties panel for text elements. `,
RENDER_TWEAK_HEAD: "Rendering tweaks",
MAX_IMAGE_ZOOM_IN_NAME: "Maximum image zoom in resolution",
MAX_IMAGE_ZOOM_IN_DESC: "To save on memory and because Apple Safari (Obsidian on iOS) has some hard-coded limitations, Excalidraw.com limits the max resolution of images and large objects when zooming in. You can override this limitation using a multiplicator. " +
@@ -697,16 +718,16 @@ FILENAME_HEAD: "Filename",
"Enabling this feature simplifies the use of Excalidraw front matter properties, allowing you to leverage many powerful settings. If you prefer not to load these properties automatically, " +
"you can disable this feature, but you will need to manually remove any unwanted properties from the suggester. " +
"Note that turning on this setting requires restarting the plugin as properties are loaded at startup.",
CUSTOM_FONT_HEAD: "Fourth font",
ENABLE_FOURTH_FONT_NAME: "Enable fourth font option",
CUSTOM_FONT_HEAD: "Local font",
ENABLE_FOURTH_FONT_NAME: "Enable local font option",
ENABLE_FOURTH_FONT_DESC:
"By turning this on, you will see a fourth font button on the properties panel for text elements. " +
"Files that use this fourth font will (partly) lose their platform independence. " +
"By turning this on, you will see a local font in the font list on the properties panel for text elements. " +
"Files that use this local font will (partly) lose their platform independence. " +
"Depending on the custom font set in settings, they will look differently when loaded in another vault, or at a later time. " +
"Also the 4th font will display as system default font on excalidraw.com, or other Excalidraw versions.",
FOURTH_FONT_NAME: "Fourth font file",
FOURTH_FONT_NAME: "Local font file",
FOURTH_FONT_DESC:
"Select a .ttf, .woff or .woff2 font file from your vault to use as the fourth font. " +
"Select a .ttf, .woff or .woff2 font file from your vault to use as the local font. " +
"If no file is selected, Excalidraw will use the Virgil font by default.",
SCRIPT_SETTINGS_HEAD: "Settings for installed Scripts",
SCRIPT_SETTINGS_DESC: "Some of the Excalidraw Automate Scripts include settings. Settings are organized by script. Settings will only become visible in this list after you have executed the newly downloaded script once.",
@@ -723,6 +744,12 @@ FILENAME_HEAD: "Filename",
"the developer of Taskbone (as you can imagine, there is no such thing as 'free', providing this awesome OCR service costs some money to the developer of Taskbone), you can " +
"purchase a paid API key from <a href='https://www.taskbone.com/' target='_blank'>taskbone.com</a>. In case you have purchased a key, simply overwrite this auto generated free-tier API-key with your paid key.",
//HotkeyEditor
HOTKEY_PRESS_COMBO_NANE: "Press your hotkey combination",
HOTKEY_PRESS_COMBO_DESC: "Please press the desired key combination",
HOTKEY_BUTTON_ADD_OVERRIDE: "Add New Override",
HOTKEY_BUTTON_REMOVE: "Remove",
//openDrawings.ts
SELECT_FILE: "Select a file then press enter.",
SELECT_COMMAND: "Select a command then press enter.",
@@ -767,7 +794,7 @@ FILENAME_HEAD: "Filename",
TOGGLE_FRAME_RENDERING: "Toggle frame rendering",
TOGGLE_FRAME_CLIPPING: "Toggle frame clipping",
OPEN_LINK_CLICK: "Open Link",
OPEN_LINK_PROPS: "Open markdown-embed properties or open link in new window",
OPEN_LINK_PROPS: "Open the image-link or LaTeX-formula editor",
//IFrameActionsMenu.tsx
NARROW_TO_HEADING: "Narrow to heading...",
@@ -835,4 +862,16 @@ FILENAME_HEAD: "Filename",
FRAME_SETTIGNS_NAME: "Display Frame Name",
FRAME_SETTINGS_OUTLINE: "Display Frame Outline",
FRAME_SETTINGS_CLIP: "Enable Frame Clipping",
//InsertPDFModal.ts
IPM_PAGES_TO_IMPORT_NAME: "Pages to import",
IPM_SELECT_PAGES_TO_IMPORT: "Please select pages to import",
IPM_ADD_BORDER_BOX_NAME: "Add border box",
IPM_ADD_FRAME_NAME: "Add page to frame",
IPM_ADD_FRAME_DESC: "For easier handling I recommend to lock the page inside the frame. " +
"If, however, you do lock the page inside the frame then the only way to unlock it is to right-click the frame, select remove elements from frame, then unlock the page.",
IPM_GROUP_PAGES_NAME: "Group pages",
IPM_GROUP_PAGES_DESC: "This will group all pages into a single group. This is recommended if you are locking the pages after import, because the group will be easier to unlock later rather than unlocking one by one.",
IPM_SELECT_PDF: "Please select a PDF file",
};
+80 -30
View File
@@ -2,6 +2,7 @@ import {
DEVICE,
FRONTMATTER_KEYS,
} from "src/constants/constants";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/ModifierkeyHelper";
// 简体中文
@@ -36,6 +37,7 @@ export default {
TRANSCLUDE: "嵌入绘图(形如 ![[drawing]])到当前 Markdown 文档中",
TRANSCLUDE_MOST_RECENT: "嵌入最近编辑过的绘图(形如 ![[drawing]])到当前 Markdown 文档中",
TOGGLE_LEFTHANDED_MODE: "切换为左手模式",
TOGGLE_SPLASHSCREEN: "在新绘图中显示启动画面",
FLIP_IMAGE: "打开当前所选 excalidraw 图像的“背景笔记”",
NEW_IN_NEW_PANE: "新建绘图 - 于新面板",
NEW_IN_NEW_TAB: "新建绘图 - 于新页签",
@@ -50,15 +52,18 @@ export default {
NEW_IN_POPOUT_WINDOW_EMBED: "新建绘图 - 于新窗口 - 并将其嵌入(形如 ![[drawing]])到当前 Markdown 文档中",
TOGGLE_LOCK: "文本元素:原文模式(RAW)⟺ 预览模式(PREVIEW)",
DELETE_FILE: "从库中删除所选图像(或以图像形式嵌入绘图中的 Markdown)的源文件",
COPY_ELEMENT_LINK: "复制所选元素的 Markdown 链接",
COPY_ELEMENT_LINK: "复制所选元素的链接(形如 [[file#^id]]])",
COPY_DRAWING_LINK: "复制绘图的嵌入链接(形如 ![[darwing]])",
INSERT_LINK_TO_ELEMENT:
`复制所选元素为内部链接(形如 [[file#^id]] )。\n按住 ${labelCTRL()} 可复制元素所在分组为内部链接(形如 [[file#^group=id]] )。\n按住 ${labelSHIFT()} 可复制所选元素所在区域为内部链接(形如 [[file#^area=id]] )。\n按住 ${labelALT()} 可观看视频演示。`,
`复制所选元素为内部链接(形如 [[file#^id]] )。\n按住 ${labelCTRL()} 可复制元素所在分组为内部链接(形如 [[file#^group=id]] )。\n按住 ${labelSHIFT()} 可复制所选元素所在区域为内部链接(形如 [[file#^area=id]] )。`,
INSERT_LINK_TO_ELEMENT_GROUP:
"复制所选元素所在分组为内部链接(形如 [[file#^group=id]] )",
"复制所选元素所在分组为嵌入链接(形如 ![[file#^group=id]] )",
INSERT_LINK_TO_ELEMENT_AREA:
"复制所选元素所在区域为内部链接(形如 [[file#^area=id]] )",
"复制所选元素所在区域为嵌入链接(形如 ![[file#^area=id]] )",
INSERT_LINK_TO_ELEMENT_FRAME:
"复制所选框架为内部链接(形如 [[file#^frame=id]] )",
"复制所选框架为嵌入链接(形如 ![[file#^frame=id]] )",
INSERT_LINK_TO_ELEMENT_FRAME_CLIPPED:
"复制所选框架(内容)为嵌入链接(形如 ![[file#^clippedframe=id]] )",
INSERT_LINK_TO_ELEMENT_NORMAL:
"复制所选元素为内部链接(形如 [[file#^id]] )",
INSERT_LINK_TO_ELEMENT_ERROR: "未选择画布里的单个元素",
@@ -76,7 +81,7 @@ export default {
ERROR_TRY_AGAIN: "请重试。",
PASTE_CODEBLOCK: "粘贴代码块",
INSERT_LATEX:
`插入 LaTeX 公式到当前绘图`,
`插入 LaTeX 公式(例如:\\binom{n}{k} = \\frac{n!}{k!(n-k)!})。`,
ENTER_LATEX: "输入 LaTeX 表达式",
READ_RELEASE_NOTES: "阅读本插件的更新说明",
RUN_OCR: "OCR 完整画布:识别涂鸦和图片里的文本并复制到剪贴板和文档属性中",
@@ -88,15 +93,21 @@ export default {
CROP_IMAGE: "对图片裁剪并添加蒙版",
ANNOTATE_IMAGE : "在 Excalidraw 中标注图像",
INSERT_ACTIVE_PDF_PAGE_AS_IMAGE: "将当前激活的的 PDF 页面作为图片插入",
RESET_IMG_TO_100: "重设图像元素的尺寸为 100%",
RESET_IMG_TO_100: "重置图像元素的尺寸为 100%",
RESET_IMG_ASPECT_RATIO: "重置所选图像元素的纵横比",
TEMPORARY_DISABLE_AUTOSAVE: "临时禁用自动保存功能,直到本次 Obsidian 退出(小白慎用!)",
TEMPORARY_ENABLE_AUTOSAVE: "启用自动保存功能",
//ExcalidrawView.ts
NO_SEARCH_RESULT: "在绘图中未找到匹配的元素",
FORCE_SAVE_ABORTED: "自动保存被中止,因为文件正在保存中",
LINKLIST_SECOND_ORDER_LINK: "二级链接",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT_TITLE: "自定义链接",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT: "不要在文件名周围添加[[方括号(Wiki 格式链接)]]!<br>编辑链接时请遵循以下格式:<br><mark>文件名#^块引用|宽度x最大高度</mark>",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT_TITLE: "自定义嵌入文件链接",
MARKDOWN_EMBED_CUSTOMIZE_LINK_PROMPT: "请不要在文件名周围添加 [[方括号]]!<br>" +
"对于 markdown 图像,在编辑链接时请遵循以下格式:<mark>文件名#^块引用|宽度x最大高度</mark><br>" +
"您可以通过在链接末尾添加 <code>|100%</code> 来将 Excalidraw 图像锚定为 100% 的大小。<br>" +
"您可以通过将 <code>#page=1</code> 更改为 <code>#page=2</code> 等来更改 PDF 页码。<br>" +
"PDF 矩形裁剪值为:<code>左, 下, 右, 上</code>。例如:<code>#rect=0,0,500,500</code><br>",
FRAME_CLIPPING_ENABLED: "渲染框架:已启用",
FRAME_CLIPPING_DISABLED: "渲染框架:已禁用",
ARROW_BINDING_INVERSE_MODE: "反转模式:默认方向按键已禁用。需要时请使用 Ctrl/CMD 临时启用。",
@@ -136,6 +147,7 @@ export default {
ERROR_SAVING_IMAGE: "获取图像时发生未知错误。可能是由于某种原因,图像不可用或拒绝了 Obsidian 的获取请求。",
WARNING_PASTING_ELEMENT_AS_TEXT: "你不能将 Excalidraw 元素粘贴为文本元素!",
USE_INSERT_FILE_MODAL: "使用“插入任意文件”功能来嵌入 Markdown 文档",
RECURSIVE_INSERT_ERROR: "你不能将图像的一部分嵌入到此图像中,因为这可能导致无限循环。",
CONVERT_TO_MARKDOWN: "转存为 Markdown 文档(并嵌入为 MD-Embeddable)",
SELECT_TEXTELEMENT_ONLY: "只选择文本元素(非容器)",
REMOVE_LINK: "移除文字元素链接",
@@ -226,7 +238,7 @@ export default {
"默认的 OpenAI API URL。请填写有效的 OpenAI API URL。" +
"Excalidraw 会通过该 URL 发送 API 请求给 OpenAI。我没有对此选项做任何错误处理,请谨慎修改。",
AI_OPENAI_DEFAULT_IMAGE_API_URL_NAME: "OpenAI 图像生成 API URL",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "gpt-4-vision-preview",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "输入你的默认 AI 模型名称,例如:gpt-4o",
SAVING_HEAD: "保存",
SAVING_DESC: "包括:压缩,自动保存的时间间隔,文件的命名格式和扩展名等的设置。",
COMPRESS_NAME: "压缩 Excalidraw JSON",
@@ -318,24 +330,33 @@ FILENAME_HEAD: "文件名",
DEFAULT_PEN_MODE_NAME: "触控笔模式(Pen mode)",
DEFAULT_PEN_MODE_DESC:
"打开绘图时,是否自动开启触控笔模式?",
DISABLE_DOUBLE_TAP_ERASER_NAME: "启用手写模式下的双击橡皮擦功能",
SHOW_PEN_MODE_FREEDRAW_CROSSHAIR_NAME: "在触控笔模式下显示十字准星(+)",
SHOW_PEN_MODE_FREEDRAW_CROSSHAIR_DESC:
"在触控笔模式下使用涂鸦功能会显示十字准星 <b><u>打开:</u></b> 显示 <b><u>关闭:</u></b> 隐藏<br>"+
"效果取决于设备。十字准星通常在绘图板、MS Surface 上可见。但在 iOS 上不可见。",
SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_NAME: "在 Markdown 文件的悬停预览中渲染为图片",
SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_NAME: "在鼠标悬停预览时将 Excalidraw 文件渲染文图片",
SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_DESC:
"这个设置影响 frontmatter 中具有 <b>excalidraw-open-md: true</b> 的文件。",
SHOW_DRAWING_OR_MD_IN_READING_MODE_NAME: "在 Markdown 文件阅读模式下渲染为图片",
"...即使文件具有 `<b>excalidraw-open-md: true</b>` frontmatter 属性。<br>" +
"当此设置关闭且文件默认设置为以 md 格式打开时,悬停预览将显示文档的 Markdown 部分(背景笔记)。" +
"",
SHOW_DRAWING_OR_MD_IN_READING_MODE_NAME: "Excalidraw 文件在 Markdown 阅读模式下渲染为图片",
SHOW_DRAWING_OR_MD_IN_READING_MODE_DESC:
"必须关闭活动的 Excalidraw/Markdown 文件,然后重新打开才能使此更改生效。<br>当您处于 Markdown 阅读模式(即阅读 Excalidraw 的背景笔记)时 Excalidraw 绘图是否应该呈现为图像? " +
"此设置不会影响您处于 Excalidraw 模式时的绘图显示,也不会影响将绘图嵌入到 Markdown 文档中或在渲染悬停预览时的显示。<br><ul>" +
"<li>看下面的“嵌入和导出”中的 <b>PDF 导出</b>的其他相关设置。</li>" +
"<li>请务必查看“其他功能”部分中的<b>淡化设置</b>。</li></ul>",
SHOW_DRAWING_OR_MD_IN_EXPORTPDF_NAME: "在 Markdown 模式下导出为 PDF 时渲染为图片",
"当您处于 Markdown 阅读模式(即查看绘图的背景笔记)时,Excalidraw 绘图是否应该渲染为图像?" +
"此设置不会影响您在 Excalidraw 模式下的绘图显示,或者在将绘图嵌入 Markdown 文档时,或在渲染悬停预览时。<br><ul>" +
"<li>请参阅下面‘嵌入和导出’部分的 <a href='#"+TAG_PDFEXPORT+"'>PDF 导出</a> 相关设置。</li></ul><br>" +
"您必须关闭当前的 Excalidraw/Markdown 文件并重新打开,以使此更改生效。",
SHOW_DRAWING_OR_MD_IN_EXPORTPDF_NAME: "在将 Excalidraw 文件导出为 PDF 时将文件渲染为图像",
SHOW_DRAWING_OR_MD_IN_EXPORTPDF_DESC:
"必须关闭活动的 Excalidraw/Markdown 文件,然后重新打开才能使此更改生效。<br>当您处于 Markdown 阅读模式(即阅读 Excalidraw 的背景笔记)时将笔记导出为 PDF,Excalidraw 绘图是否应该呈现为图像? <br><ul>" +
"<li>查看上面“外观和行为”下的 <b>Markdown 阅读模式</b>的其他相关设置。</li>" +
"<li>请务必查看“其他功能”部分中的<b>淡化设置</b>。</li></ul>",
"处于 Markdown 视图模式时,此设置控制 Excalidraw 在使用 Obsidian 的 <b>导出为 PDF</b> 功能时,将 Excalidraw 文件导出为 PDF 的行为。<br>" +
"<ul><li>当 <b>启用</b> 时,PDF 将仅显示 Excalidraw 绘图;</li>" +
"<li>当 <b>禁用</b> 时,PDF 将显示文档的 Markdown 部分(背景笔记)。</li></ul>" +
"请参阅上面‘外观和行为’部分的 <<a href='#"+TAG_MDREADINGMODE+"'>>Markdown 阅读模式</a> 相关设置。" +
"⚠️ 注意,您必须关闭当前的 Excalidraw/Markdown 文件并重新打开,以使此更改生效。⚠️",
HOTKEY_OVERRIDE_HEAD: "热键覆盖",
HOTKEY_OVERRIDE_DESC: `一些 Excalidraw 的热键,例如 ${labelCTRL()}+Enter 用于编辑文本,或 ${labelCTRL()}+K 用于创建元素链接。` +
"与 Obsidian 的热键设置发生冲突。您在下面添加的热键组合将在使用 Excalidraw 时覆盖 Obsidian 的热键设置," +
`因此如果您希望在 Excalidraw 中默认选择“组合对象”,而不是打开“图形视图”,您可以添加 ${labelCTRL()}+G。`,
THEME_HEAD: "主题和样式",
ZOOM_HEAD: "缩放",
DEFAULT_PINCHZOOM_NAME: "允许在触控笔模式下进行双指缩放",
@@ -461,7 +482,11 @@ FILENAME_HEAD: "文件名",
EMBED_TOEXCALIDRAW_DESC: "包括:以图像形式嵌入到绘图中的 PDF 文档、以交互形式嵌入到绘图中的 Markdown 文档(MD-Embeddable)、以图像形式嵌入的 Markdown 文档(MD-Embed)等。",
MD_HEAD: "以图像形式嵌入到绘图中的 Markdown 文档(MD-Embed)",
MD_EMBED_CUSTOMDATA_HEAD_NAME: "以交互形式嵌入到绘图中的 Markdown 文档(MD-Embeddable)",
MD_EMBED_CUSTOMDATA_HEAD_DESC: `这些选项不会影响到已存在的 MD-Embeddable。MD-Embeddable 的主题风格在“显示 & 行为”小节设置。`,
MD_EMBED_CUSTOMDATA_HEAD_DESC: `以下设置只会影响以后的嵌入。已存在的嵌入保持不变。嵌入框的主题设置位于 “Excalidraw 外观和行为” 部分。`,
MD_EMBED_SINGLECLICK_EDIT_NAME: "单击以编辑嵌入的 markdown。",
MD_EMBED_SINGLECLICK_EDIT_DESC:
"单击嵌入的 markdown 文件以进行编辑。 " +
"当此功能关闭时,markdown 文件将首先以预览模式打开,然后在您再次单击时切换到编辑模式。",
MD_TRANSCLUDE_WIDTH_NAME: "MD-Embed 的默认宽度",
MD_TRANSCLUDE_WIDTH_DESC:
"MD-Embed 的宽度。该选项会影响到折行,以及图像元素的宽度。<br>" +
@@ -522,7 +547,7 @@ FILENAME_HEAD: "文件名",
EMBED_REUSE_EXPORTED_IMAGE_NAME:
"将之前已导出的图像作为预览图",
EMBED_REUSE_EXPORTED_IMAGE_DESC:
"该选项与“自动导出 SVG/PNG 副本”选项配合使用。如果嵌入到 Markdown 文档中的绘图文件存在同名的 SVG/PNG 副本,则将其作为预览图,而不再重新生成。<br>" +
"该选项与<a href='#"+TAG_AUTOEXPORT+"'>自动导出 SVG/PNG 副本</a>选项配合使用。如果嵌入到 Markdown 文档中的绘图文件存在同名的 SVG/PNG 副本,则将其作为预览图,而不再重新生成。<br>" +
"该选项能够提高 Markdown 文档的打开速度,尤其是当嵌入到 Markdown 文档中的绘图文件中含有大量图像或 MD-Embed 时。" +
"但是,该选项也可能导致预览图无法立即响应你对绘图文件或者 Obsidian 主题风格的修改。<br>" +
"该选项仅作用于嵌入到 Markdown 文档中的绘图。" +
@@ -553,7 +578,7 @@ FILENAME_HEAD: "文件名",
EMBED_TYPE_NAME: "“嵌入绘图到当前 Markdown 文档中”系列命令的源文件类型",
EMBED_TYPE_DESC:
"在命令面板中执行“嵌入绘图到当前 Markdown 文档中”系列命令时,要嵌入绘图文件本身,还是嵌入其 PNG 或 SVG 副本。<br>" +
"如果您想选择 PNG 或 SVG 副本,需要先开启下方的“自动导出 PNG 副本”或“自动导出 SVG 副本”。<br>" +
"如果您想选择 PNG 或 SVG 副本,需要先开启下方的<a href='#"+TAG_AUTOEXPORT+"'>自动导出 PNG / SVG 副本</a>。<br>" +
"如果您选择了 PNG 或 SVG 副本,当副本不存在时,该命令将会插入一条损坏的链接,您需要打开绘图文件并手动导出副本才能修复 —— " +
"也就是说,该选项不会自动帮您生成 PNG/SVG 副本,而只会引用已有的 PNG/SVG 副本。",
EMBED_MARKDOWN_COMMENT_NAME: "将链接作为注释嵌入",
@@ -571,7 +596,7 @@ FILENAME_HEAD: "文件名",
"如果关闭,将导出透明背景的图像。",
EXPORT_PADDING_NAME: "导出的图像的空白边距",
EXPORT_PADDING_DESC:
"导出的 SVG/PNG 图像四周的空白边距(单位:像素)。<br>" +
"导出的 SVG/PNG 图像四周的空白边距(单位:像素)。对于裁剪框架引用,间距被设置为 0。<br>" +
"增加该值,可以避免在导出图像时,靠近图像边缘的图形被裁掉。<br>" +
"您可为某个绘图单独设置此项,方法是在其 frontmatter 中添加形如 <code>excalidraw-export-padding: 5<code> 的键值对。",
EXPORT_THEME_NAME: "导出的图像匹配主题",
@@ -602,7 +627,7 @@ FILENAME_HEAD: "文件名",
EXPORT_BOTH_DARK_AND_LIGHT_DESC: "若开启,Excalidraw 将导出两个文件:filename.dark.png(或 filename.dark.svg)和 filename.light.png(或 filename.light.svg)。<br>"+
"该选项可作用于“自动导出 SVG 副本”、“自动导出 PNG 副本”,以及其他的手动的导出命令。",
COMPATIBILITY_HEAD: "兼容性设置",
COMPATIBILITY_DESC: "如果没有特殊原因(例如您想同时在 VSCode / Logseq 和 Obsidian 中使用 Excalidraw),建议您使用 markdown 格式的绘图文件,而不是旧的 excalidraw.com 格式,因为本插件的很多功能在旧格式中无法使用。",
COMPATIBILITY_DESC: "如果没有特殊原因(例如您想同时在 VSCode / Logseq 和 Obsidian 中使用 Excalidraw),建议您使用 Markdown 格式的绘图文件,而不是旧的 excalidraw.com 格式,因为本插件的很多功能在旧格式中无法使用。",
DUMMY_TEXT_ELEMENT_LINT_SUPPORT_NAME: "代码格式化(Linting)兼容性",
DUMMY_TEXT_ELEMENT_LINT_SUPPORT_DESC: "Excalidraw 对 <code># Excalidraw Data</code> 下的文件结构非常敏感。文档的自动代码格式化(linting)可能会在 Excalidraw 数据中造成错误。" +
"虽然我已经努力使数据加载对自动代码格式化(linting)变更具有一定的抗性,但这种解决方案并非万无一失。<br>"+
@@ -642,7 +667,7 @@ FILENAME_HEAD: "文件名",
LATEX_DEFAULT_NAME: "插入 LaTeX 时的默认表达式",
LATEX_DEFAULT_DESC: "允许留空。允许使用类似 <code>\\color{white}</code> 的格式化表达式。",
NONSTANDARD_HEAD: "非 Excalidraw.com 官方支持的特性",
NONSTANDARD_DESC: `这些特性不受 Excalidraw.com 官方支持。如果以 Excalidraw.com 格式导出绘图,这些特性将会发生不可预知的变化。
NONSTANDARD_DESC: `这些特性不受 Excalidraw.com 官方支持。如果在 Excalidraw.com 导入绘图,这些特性将会发生不可预知的变化。
包括:自定义画笔工具的数量,自定义字体等。`,
RENDER_TWEAK_HEAD: "渲染优化",
MAX_IMAGE_ZOOM_IN_NAME: "最大图像放大倍数",
@@ -693,7 +718,7 @@ FILENAME_HEAD: "文件名",
"启用此功能简化了 Excalidraw 前置属性的使用,使您能够利用许多强大的设置。如果您不希望自动加载这些属性," +
"您可以禁用此功能,但您将需要手动从自动提示中移除任何不需要的属性。" +
"请注意,启用此设置需要重启插件,因为属性是在启动时加载的。",
CUSTOM_FONT_HEAD: "自定义字体",
CUSTOM_FONT_HEAD: "本地字体",
ENABLE_FOURTH_FONT_NAME: "为文本元素启用本地字体",
ENABLE_FOURTH_FONT_DESC:
"开启此项后,文本元素的属性面板里会多出一个本地字体按钮。<br>" +
@@ -719,6 +744,12 @@ FILENAME_HEAD: "文件名",
"Taskbone 的开发者(您懂的,没有人能用爱发电,Taskbone 开发者也需要投入资金来维持这项 OCR 服务)您可以" +
"到 <a href='https://www.taskbone.com/' target='_blank'>taskbone.com</a> 购买一个商用 API key。购买后请将它填写到旁边这个文本框里,替换掉原本自动生成的免费 API key。",
//HotkeyEditor
HOTKEY_PRESS_COMBO_NANE: "按下您的组合键",
HOTKEY_PRESS_COMBO_DESC: "请按下所需的组合键",
HOTKEY_BUTTON_ADD_OVERRIDE: "添加新的(热键)覆写",
HOTKEY_BUTTON_REMOVE: "移除",
//openDrawings.ts
SELECT_FILE: "选择一个文件后按回车。",
SELECT_COMMAND: "选择一个命令后按回车。",
@@ -763,7 +794,7 @@ FILENAME_HEAD: "文件名",
TOGGLE_FRAME_RENDERING: "开启或关闭框架渲染",
TOGGLE_FRAME_CLIPPING: "开启或关闭框架裁剪",
OPEN_LINK_CLICK: "打开所选的图形或文本元素里的链接",
OPEN_LINK_PROPS: "编辑所选 MD-Embed 的内部链接,或者打开所选的图形或文本元素里的链接",
OPEN_LINK_PROPS: "打开图像链接或 LaTeX 公式编辑器",
//IFrameActionsMenu.tsx
NARROW_TO_HEADING: "缩放至标题",
@@ -824,4 +855,23 @@ FILENAME_HEAD: "文件名",
INTERNAL_DRAG_ACTION: "在 Obsidian 内部拖放时",
PANE_TARGET: "点击链接时",
DEFAULT_ACTION_DESC: "无修饰键时的行为:",
};
//FrameSettings.ts
FRAME_SETTINGS_TITLE: "框架设置",
FRAME_SETTINGS_ENABLE: "启用框架",
FRAME_SETTIGNS_NAME: "显示框架名称",
FRAME_SETTINGS_OUTLINE: "显示框架外边框",
FRAME_SETTINGS_CLIP: "启用框架裁剪",
//InsertPDFModal.ts
IPM_PAGES_TO_IMPORT_NAME: "要导入的页面",
IPM_SELECT_PAGES_TO_IMPORT: "请选择页面以进行导入",
IPM_ADD_BORDER_BOX_NAME: "添加带边框的盒子容器",
IPM_ADD_FRAME_NAME: "添加页面到框架",
IPM_ADD_FRAME_DESC: "为了更方便的操作,我建议将页面锁定在框架内。" +
"如果,你将锁定页面在框架内,则唯一的解锁方法是右键点击框架,选择‘从框架中移除元素’,然后解锁页面。",
IPM_GROUP_PAGES_NAME: "建立页面组",
IPM_GROUP_PAGES_DESC: "这将把所有页面建立为一个单独的组。如果您在导入后锁定页面,建议使用此方法,因为这样可以更方便地解锁整个组,而不是逐个解锁。",
IPM_SELECT_PDF: "请选择一个 PDF 文件",
};
+203 -72
View File
@@ -43,13 +43,9 @@ import {
IMAGE_TYPES,
setExcalidrawPlugin,
DEVICE,
sceneCoordsToViewportCoords
} from "./constants/constants";
import {
VIRGIL_FONT,
VIRGIL_DATAURL,
sceneCoordsToViewportCoords,
FONTS_STYLE_ID,
} from "./constants/constFonts";
} from "./constants/constants";
import ExcalidrawView, { TextMode, getTextMode } from "./ExcalidrawView";
import {
changeThemeOfExcalidrawMD,
@@ -103,8 +99,9 @@ import {
decompress,
getImageSize,
versionUpdateCheckTimer,
getFontMetrics,
} from "./utils/Utils";
import { editorInsertText, extractSVGPNGFileName, foldExcalidrawSection, getActivePDFPageNumberFromPDFView, getAttachmentsFolderAndFilePath, getNewOrAdjacentLeaf, getParentOfClass, isObsidianThemeDark, mergeMarkdownFiles, openLeaf } from "./utils/ObsidianUtils";
import { editorInsertText, extractSVGPNGFileName, foldExcalidrawSection, getActivePDFPageNumberFromPDFView, getAttachmentsFolderAndFilePath, getNewOrAdjacentLeaf, getParentOfClass, isObsidianThemeDark, mergeMarkdownFiles, openLeaf, setExcalidrawView } from "./utils/ObsidianUtils";
import { ExcalidrawElement, ExcalidrawEmbeddableElement, ExcalidrawImageElement, ExcalidrawTextElement, FileId } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { ScriptEngine } from "./Scripts";
import {
@@ -116,7 +113,7 @@ import {
import { FieldSuggester } from "./dialogs/FieldSuggester";
import { ReleaseNotes } from "./dialogs/ReleaseNotes";
import { Packages } from "./types";
import { Packages } from "./types/types";
import { PreviewImageType } from "./utils/UtilTypes";
import { ScriptInstallPrompt } from "./dialogs/ScriptInstallPrompt";
import Taskbone from "./ocr/Taskbone";
@@ -138,14 +135,19 @@ import { ExcalidrawConfig } from "./utils/ExcalidrawConfig";
import { EditorHandler } from "./CodeMirrorExtension/EditorHandler";
import { clearMathJaxVariables } from "./LaTeX";
import { showFrameSettings } from "./dialogs/FrameSettings";
import { ExcalidrawLib } from "./ExcalidrawLib";
import { Rank, SwordColors } from "./menu/ActionIcons";
import { RankMessage } from "./dialogs/RankMessage";
import { initCompressionWorker, terminateCompressionWorker } from "./workers/compression-worker";
declare let EXCALIDRAW_PACKAGES:string;
declare let react:any;
declare let reactDOM:any;
declare let excalidrawLib: any;
declare let excalidrawLib: typeof ExcalidrawLib;
declare let PLUGIN_VERSION:string;
export default class ExcalidrawPlugin extends Plugin {
public fourthFontLoaded: boolean = false;
public excalidrawConfig: ExcalidrawConfig;
public taskbone: Taskbone;
private excalidrawFiles: Set<TFile> = new Set<TFile>();
@@ -178,7 +180,6 @@ export default class ExcalidrawPlugin extends Plugin {
public equationsMaster: Map<FileId, string> = null; //fileId, formula
public mermaidsMaster: Map<FileId, string> = null; //fileId, mermaidText
public scriptEngine: ScriptEngine;
public fourthFontDef: string = VIRGIL_FONT;
private packageMap: Map<Window,Packages> = new Map<Window,Packages>();
public leafChangeTimeout: number = null;
private forceSaveCommand:Command;
@@ -187,8 +188,9 @@ export default class ExcalidrawPlugin extends Plugin {
public editorHandler: EditorHandler;
//if set, the next time this file is opened it will be opened as markdown
public forceToOpenInMarkdownFilepath: string = null;
private slob:string;
//private slob:string;
private ribbonIcon:HTMLElement;
public loadTimestamp:number;
constructor(app: App, manifest: PluginManifest) {
super(app, manifest);
@@ -200,9 +202,9 @@ export default class ExcalidrawPlugin extends Plugin {
this.equationsMaster = new Map<FileId, string>();
this.mermaidsMaster = new Map<FileId, string>();
setExcalidrawPlugin(this);
if((process.env.NODE_ENV === 'development')) {
/*if((process.env.NODE_ENV === 'development')) {
this.slob = new Array(200 * 1024 * 1024 + 1).join('A'); // Create a 200MB blob
}
}*/
}
get locale() {
@@ -310,14 +312,24 @@ export default class ExcalidrawPlugin extends Plugin {
}*/
async onload() {
initCompressionWorker();
this.loadTimestamp = Date.now();
addIcon(ICON_NAME, EXCALIDRAW_ICON);
addIcon(SCRIPTENGINE_ICON_NAME, SCRIPTENGINE_ICON);
addIcon(EXPORT_IMG_ICON_NAME, EXPORT_IMG_ICON);
await this.loadSettings({reEnableAutosave:true});
const updateSettings = !this.settings.onceOffCompressFlagReset || !this.settings.onceOffGPTVersionReset;
if(!this.settings.onceOffCompressFlagReset) {
this.settings.compress = true;
this.settings.onceOffCompressFlagReset = true;
}
if(!this.settings.onceOffGPTVersionReset) {
if(this.settings.openAIDefaultVisionModel === "gpt-4-vision-preview") {
this.settings.openAIDefaultVisionModel = "gpt-4o";
}
}
if(updateSettings) {
await this.saveSettings();
}
this.excalidrawConfig = new ExcalidrawConfig(this);
@@ -392,26 +404,50 @@ export default class ExcalidrawPlugin extends Plugin {
public initializeFonts() {
this.app.workspace.onLayoutReady(async () => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.initializeFonts,`ExcalidrawPlugin.initializeFonts > app.workspace.onLayoutReady`);
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.initializeFonts, `ExcalidrawPlugin.initializeFonts > app.workspace.onLayoutReady`);
const font = await getFontDataURL(
this.app,
this.settings.experimantalFourthFont,
"",
"LocalFont",
"Local Font",
);
const fourthFontDataURL =
font.dataURL === "" ? VIRGIL_DATAURL : font.dataURL;
this.fourthFontDef = font.fontDef;
this.getOpenObsidianDocuments().forEach((ownerDocument) => {
this.addFonts([
`@font-face{font-family:'LocalFont';src:url("${fourthFontDataURL}");font-display: swap;`,
],ownerDocument);
})
if(font.dataURL === "") {
this.fourthFontLoaded = true;
return;
}
const fourthFontDataURL = font.dataURL;
const f = this.app.metadataCache.getFirstLinkpathDest(this.settings.experimantalFourthFont, "");
// Call getFontMetrics with the fourthFontDataURL
let fontMetrics = f.extension.startsWith("woff") ? undefined : await getFontMetrics(fourthFontDataURL, "Local Font");
if (!fontMetrics) {
console.log("Font Metrics not found, using default");
fontMetrics = {
unitsPerEm: 1000,
ascender: 750,
descender: -250,
lineHeight: 1.2,
fontName: "Local Font",
}
}
this.packageMap.forEach(({excalidrawLib}) => {
(excalidrawLib as typeof ExcalidrawLib).registerLocalFont({metrics: fontMetrics as any, icon: null}, fourthFontDataURL);
});
// Add fonts to open Obsidian documents
for(const ownerDocument of this.getOpenObsidianDocuments()) {
await this.addFonts([
`@font-face{font-family:'Local Font';src:url("${fourthFontDataURL}");font-display: swap;font-weight: 400;`,
], ownerDocument);
};
if(!this.fourthFontLoaded) setTimeout(()=>{this.fourthFontLoaded = true},100);
});
}
public addFonts(declarations: string[],ownerDocument:Document = document) {
public async addFonts(declarations: string[],ownerDocument:Document = document) {
// replace the old local font <style> element with the one we just created
const newStylesheet = ownerDocument.createElement("style");
newStylesheet.id = FONTS_STYLE_ID;
@@ -421,7 +457,7 @@ export default class ExcalidrawPlugin extends Plugin {
if (oldStylesheet) {
ownerDocument.head.removeChild(oldStylesheet);
}
ownerDocument.fonts.load('20px LocalFont');
await ownerDocument.fonts.load('20px Local Font');
}
public removeFonts() {
@@ -454,7 +490,7 @@ export default class ExcalidrawPlugin extends Plugin {
if (fileShouldDefaultAsExcalidraw(leaf.view.file?.path, this.app)) {
this.excalidrawFileModes[(leaf as any).id || leaf.view.file.path] =
VIEW_TYPE_EXCALIDRAW;
this.setExcalidrawView(leaf);
setExcalidrawView(leaf);
} else {
foldExcalidrawSection(leaf.view);
}
@@ -1760,12 +1796,80 @@ export default class ExcalidrawPlugin extends Plugin {
const eaEl = ea.getElement(el.id);
//@ts-ignore
eaEl.width = size.width; eaEl.height = size.height;
ea.addElementsToView(false,false,false);
await ea.addElementsToView(false,false,false);
}
ea.destroy();
})()
}
})
this.addCommand({
id: "reset-image-ar",
name: t("RESET_IMG_ASPECT_RATIO"),
checkCallback: (checking: boolean) => {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (!view) return false;
if (!view.excalidrawAPI) return false;
const els = view.getViewSelectedElements().filter(el => el.type === "image");
if (els.length !== 1) {
if (checking) return false;
new Notice("Select a single image element and try again");
return false;
}
if (checking) return true;
(async () => {
const el = els[0] as ExcalidrawImageElement;
let ef = view.excalidrawData.getFile(el.fileId);
if (!ef) {
await view.forceSave();
let ef = view.excalidrawData.getFile(el.fileId);
new Notice("Select a single image element and try again");
return false;
}
const ea = new ExcalidrawAutomate(this, view);
if (await ea.resetImageAspectRatio(el)) {
await ea.addElementsToView(false, false, false);
}
ea.destroy();
})();
}
});
this.addCommand({
id: "open-link-props",
name: t("OPEN_LINK_PROPS"),
checkCallback: (checking: boolean) => {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (!view) return false;
if (!view.excalidrawAPI) return false;
const els = view.getViewSelectedElements().filter(el => el.type === "image");
if (els.length !== 1) {
if (checking) return false;
new Notice("Select a single image element and try again");
return false;
}
if (checking) return true;
const el = els[0] as ExcalidrawImageElement;
let ef = view.excalidrawData.getFile(el.fileId);
let eq = view.excalidrawData.getEquation(el.fileId);
if (!ef && !eq) {
view.forceSave();
new Notice("Please try again.");
return false;
}
if(ef) {
view.openEmbeddedLinkEditor(el.id);
}
if(eq) {
view.openLaTeXEditor(el.id);
}
}
});
this.addCommand({
id: "convert-card-to-file",
name: t("CONVERT_CARD_TO_FILE"),
@@ -2343,7 +2447,7 @@ export default class ExcalidrawPlugin extends Plugin {
const activeLeaf = markdownView.leaf;
this.excalidrawFileModes[(activeLeaf as any).id || activeFile.path] =
VIEW_TYPE_EXCALIDRAW;
this.setExcalidrawView(activeLeaf);
setExcalidrawView(activeLeaf);
})()
return;
}
@@ -2378,7 +2482,7 @@ export default class ExcalidrawPlugin extends Plugin {
activeFile,
mergedTarget,
);
this.setExcalidrawView(activeView.leaf);
setExcalidrawView(activeView.leaf);
})();
},
});
@@ -2416,7 +2520,7 @@ export default class ExcalidrawPlugin extends Plugin {
log(fname);
const result = await this.app.vault.create(
fname,
FRONTMATTER + (await this.exportSceneToMD(data)),
FRONTMATTER + (await this.exportSceneToMD(data, false)),
);
if (this.settings.keepInSync) {
EXPORT_TYPES.forEach((ext: string) => {
@@ -2504,7 +2608,7 @@ export default class ExcalidrawPlugin extends Plugin {
await view.save();
//@ts-ignore
this.excalidrawFileModes[leaf.id || file.path] = VIEW_TYPE_EXCALIDRAW;
this.setExcalidrawView(leaf);
setExcalidrawView(leaf);
}));
},
),
@@ -2529,7 +2633,7 @@ export default class ExcalidrawPlugin extends Plugin {
await view.save();
//@ts-ignore
this.excalidrawFileModes[leaf.id || file.path] = VIEW_TYPE_EXCALIDRAW;
this.setExcalidrawView(leaf);
setExcalidrawView(leaf);
})});
//@ts-ignore
menu.items.unshift(menu.items.pop());
@@ -2722,37 +2826,53 @@ export default class ExcalidrawPlugin extends Plugin {
this.popScope = null;
}
if (newActiveviewEV) {
const scope = this.app.keymap.getRootScope();
const handler_ctrlEnter = scope.register(["Mod"], "Enter", () => true);
scope.keys.unshift(scope.keys.pop()); // Force our handler to the front of the list
const handler_ctrlK = scope.register(["Mod"], "k", () => true);
scope.keys.unshift(scope.keys.pop()); // Force our handler to the front of the list
const handler_ctrlF = scope.register(["Mod"], "f", () => {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (view) {
search(view);
return true;
}
return false;
});
scope.keys.unshift(scope.keys.pop()); // Force our handler to the front of the list
const overridSaveShortcut = (
this.forceSaveCommand &&
this.forceSaveCommand.hotkeys[0].key === "s" &&
this.forceSaveCommand.hotkeys[0].modifiers.includes("Ctrl")
)
const saveHandler = overridSaveShortcut
? scope.register(["Ctrl"], "s", () => this.forceSaveActiveView(false))
: undefined;
if(saveHandler) {
scope.keys.unshift(scope.keys.pop()); // Force our handler to the front of the list
}
this.popScope = () => {
scope.unregister(handler_ctrlEnter);
scope.unregister(handler_ctrlK);
scope.unregister(handler_ctrlF);
Boolean(saveHandler) && scope.unregister(saveHandler);
this.registerHotkeyOverrides();
}
}
public registerHotkeyOverrides() {
//this is repeated here because the same function is called when settings is closed after hotkeys have changed
if (this.popScope) {
this.popScope();
this.popScope = null;
}
if(!this.activeExcalidrawView) {
return;
}
const scope = this.app.keymap.getRootScope();
// Register overrides from settings
const overrideHandlers = this.settings.modifierKeyOverrides.map(override => {
return scope.register(override.modifiers, override.key, () => true);
});
// Force handlers to the front of the list
overrideHandlers.forEach(() => scope.keys.unshift(scope.keys.pop()));
const handler_ctrlF = scope.register(["Mod"], "f", () => {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (view) {
search(view);
return true;
}
return false;
});
scope.keys.unshift(scope.keys.pop()); // Force our handler to the front of the list
const overridSaveShortcut = (
this.forceSaveCommand &&
this.forceSaveCommand.hotkeys[0].key === "s" &&
this.forceSaveCommand.hotkeys[0].modifiers.includes("Ctrl")
)
const saveHandler = overridSaveShortcut
? scope.register(["Ctrl"], "s", () => this.forceSaveActiveView(false))
: undefined;
if(saveHandler) {
scope.keys.unshift(scope.keys.pop()); // Force our handler to the front of the list
}
this.popScope = () => {
overrideHandlers.forEach(handler => scope.unregister(handler));
scope.unregister(handler_ctrlF);
Boolean(saveHandler) && scope.unregister(saveHandler);
}
}
@@ -3214,6 +3334,7 @@ export default class ExcalidrawPlugin extends Plugin {
react = null;
reactDOM = null;
excalidrawLib = null;
terminateCompressionWorker();
}
public async embedDrawing(file: TFile) {
@@ -3452,7 +3573,7 @@ export default class ExcalidrawPlugin extends Plugin {
* @param {string} data - Excalidraw scene JSON string
* @returns {string} - Text starting with the "# Text Elements" header and followed by each "## id-value" and text
*/
public async exportSceneToMD(data: string): Promise<string> {
public async exportSceneToMD(data: string, compressOverride?: boolean): Promise<string> {
if (!data) {
return "";
}
@@ -3477,7 +3598,9 @@ export default class ExcalidrawPlugin extends Plugin {
outString +
getMarkdownDrawingSection(
JSON.stringify(JSON_parse(data), null, "\t"),
this.settings.compress,
typeof compressOverride === "undefined"
? this.settings.compress
: compressOverride,
)
);
}
@@ -3507,6 +3630,21 @@ export default class ExcalidrawPlugin extends Plugin {
errorlog({file, error: "new drawing not recognized as an excalidraw file", fn: this.createDrawing});
}
if(Date.now() - this.loadTimestamp > 1){//2000) {
const filecount = this.app.vault.getFiles().filter(f=>this.isExcalidrawFile(f)).length;
const rank:Rank = filecount < 200 ? "Bronze" : filecount < 750 ? "Silver" : filecount < 2000 ? "Gold" : "Platinum";
const {grip, decoration, blade} = SwordColors[rank];
if(this.settings.rank !== rank) {
//in case the message was already displayed on another device and it was synced in the mean time
await this.loadSettings();
if(this.settings.rank !== rank) {
this.settings.rank = rank;
await this.saveSettings();
new RankMessage(this.app, this, filecount, rank, decoration, blade, grip).open();
}
}
}
return file;
}
@@ -3547,14 +3685,7 @@ export default class ExcalidrawPlugin extends Plugin {
}
public async setExcalidrawView(leaf: WorkspaceLeaf) {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.setExcalidrawView,`ExcalidrawPlugin.setExcalidrawView`, leaf);
await leaf.setViewState({
type: VIEW_TYPE_EXCALIDRAW,
state: leaf.view.getState(),
popstate: true,
} as ViewState);
}
public isExcalidrawFile(f: TFile) {
if(!f) return false;
+117 -81
View File
@@ -59,6 +59,21 @@ export const ICONS = {
<text x="1" y="18" fontSize="22px">#^</text>
</svg>
),
Learn: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z"/>
<path d="M22 10v6"/>
<path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5"/>
</svg>
),
Discord: (
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -350,13 +365,10 @@ export const ICONS = {
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v7"/>
<polyline
points="14 2 14 8 20 8"
fill="var(--icon-fill-color)"
/>
<path d="m10 18 3-3-3-3"/>
<path d="M4 18v-1a2 2 0 0 1 2-2h6"/>
<path d="M10 12.5 8 15l2 2.5"/>
<path d="m14 12.5 2 2.5-2 2.5"/>
<path d="M14 2v4a2 2 0 0 0 2 2h4"/>
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"/>
</svg>
),
//fa-brands fa-markdown
@@ -634,82 +646,106 @@ export const ICONS = {
<line x1="9" x2="15" y1="15" y2="15"/>
</svg>
),
ExcalidrawSword: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 537.9 1150.7"
>
<g fillRule="evenodd" strokeLinecap="round">
<path fill="#FFF6F0" d="m281 988 113-124-77-569H213l-37 574 106 120-4 2"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M279 989c37-42 82-84 116-122M279 990c33-33 59-66 113-123m0-1c-22-191-51-385-78-570m78 570c-31-196-58-391-78-570m-4-1c-30-1-56 1-97-1m102 3c-41 1-81 0-106-3m1 3c-11 185-20 369-30 574m30-574c-7 165-16 330-32 575m2-3c38 47 73 81 97 121m-98-116c39 41 76 86 100 114m0 1s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<path fill="none" stroke="#af7e00" strokeLinecap="round" strokeWidth="4" d="M279 614v264m-3-259c2 43 8 211 8 254"/>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke="#646261" strokeWidth=".5" d="M209 300c2-1 6-5 9-3m-8 3 7-5m-4 7c-1-1 2-6 5-8m-6 9 5-9m-9 16c3-3 6-11 12-18m-11 14c5-2 10-7 12-10m-13 17c5-7 9-15 15-21m-13 18c4-7 8-10 13-15m-15 17c7-2 14-11 18-20m-19 20c7-3 7-8 21-15m-18 17c6-8 11-15 13-15m-12 17c6-7 11-16 14-23m-19 24 28-22m-25 25 25-25m-24 25c7-7 13-14 23-28m-21 30 18-27m-20 29c4-9 17-13 25-30m-28 30c10-4 17-12 31-30m-28 34c11-9 20-20 26-34m-26 34c10-11 15-20 30-32m-32 40c5-12 16-20 31-40m-31 36c9-10 20-20 34-38m-34 38c11-12 23-22 35-37m-33 39c10-12 24-25 33-40m-34 44c10-12 19-25 42-43m-43 46 41-44m-36 42c9-13 31-32 32-44m-35 46c12-11 22-23 38-45m-43 48c13-14 27-20 47-52m-44 52c16-14 33-35 47-50m-43 51c8-12 25-25 38-50m-40 54 43-56m-43 56c9-9 25-28 46-58m-51 61c13-15 30-30 56-57m-51 58c17-20 35-40 46-57m-47 61c14-16 25-32 48-61m-48 63c15-18 27-27 57-63m-62 64c18-20 33-37 59-63m-51 61c13-19 34-37 48-65m-53 70c16-19 31-34 58-68m-61 69c30-25 48-55 63-67m-63 66c20-17 38-40 66-65m-58 67c23-23 42-48 53-67m-55 71c18-27 42-50 59-74m-60 78c12-21 33-35 64-75m-66 74c20-26 46-53 67-77m-63 80c24-27 43-54 66-77m-70 75c30-31 55-63 68-76m-74 80c15-17 32-32 78-85m-75 86c23-25 48-49 74-83m-66 88c18-21 36-50 66-90m-69 88c21-29 43-55 70-87m-77 93c36-34 59-66 80-93m-79 89c27-25 49-54 81-88m-73 89c23-32 48-61 71-89m-76 94 79-96m-77 96c27-32 58-65 84-90m-89 92c34-38 69-78 86-94m-81 98 84-96m-86 97c32-42 66-82 83-100m-82 100c29-39 62-74 87-98m-92 98c27-24 50-52 93-100m-86 105c34-44 72-83 86-106m-87 105c34-36 63-73 88-104m-91 105c26-24 50-47 94-104m-94 106c27-31 57-67 95-107m-96 109c38-39 71-78 99-112m-97 113 96-110M200 414c35-34 57-67 102-115m-98 110c38-42 77-83 102-112m-96 116c17-27 44-59 96-117m-99 116c23-25 45-55 99-117M205 415c35-45 77-87 110-122M203 418c43-43 81-91 108-122M208 420c44-45 84-97 100-128M205 419l108-123M201 421c40-44 83-86 114-127M203 425c33-41 70-82 111-127M205 425c24-29 50-53 107-131M206 428c38-41 72-83 108-132M205 430l109-132M204 429c30-38 65-73 112-125M204 435c31-35 63-72 111-130M205 433c40-46 76-96 112-132M205 441c20-34 43-60 112-135M200 439c33-34 59-66 116-133M202 436c29-30 56-63 114-129M206 440c27-36 57-70 111-133M201 442c26-31 58-61 120-127M202 445c20-30 46-54 117-131M201 450c41-51 79-93 113-138M204 444c34-40 71-82 113-133M203 450c33-42 68-79 115-135M200 451l120-132M204 449c33-26 65-68 113-132M205 451l115-133M200 458l117-138M201 458l119-135M202 459c35-38 69-74 119-139M205 460c31-42 65-82 113-135M199 467c29-29 52-60 119-135M201 462c32-40 70-80 118-135M203 462c47-52 93-98 116-135M205 466c39-47 76-90 113-139M196 472c35-33 62-58 123-137M199 470c31-36 63-68 120-136M205 469c26-33 56-67 114-132M204 473c42-44 80-91 115-137M197 477c45-52 96-107 121-137M199 477c31-42 67-79 122-137M199 481c44-51 78-97 120-145M200 479c39-46 78-94 123-140M196 485c37-47 76-83 124-144M201 483c31-32 59-68 120-138M204 486c41-56 89-104 115-145M204 485l118-142M196 487c35-29 63-70 124-136M201 491c35-48 73-91 123-143M201 494c36-40 66-71 121-147M204 493c26-38 55-69 120-143M196 498c37-47 79-94 125-147M200 495c38-39 76-82 123-139M200 496c48-48 89-100 127-139M200 499c28-32 55-62 125-146M199 500c26-32 62-68 125-137M198 502c42-47 81-95 125-143M204 506c32-42 60-73 122-145M203 504c37-42 75-90 121-142M202 512c37-51 83-95 121-150M197 507c49-52 92-102 127-140M203 515c45-54 89-106 119-153M203 512c37-45 78-93 121-148M196 518c47-61 104-120 127-145M197 514c32-36 67-72 131-145M198 515c38-40 71-78 127-145M198 518c46-52 89-105 127-149M193 521c47-53 96-111 133-149M199 522c42-47 86-94 127-147M203 523c33-45 71-89 124-149M201 524c44-52 88-104 124-149M199 532c38-55 81-97 127-154M199 527c49-60 104-115 127-148M201 533c28-43 61-84 126-150M199 529c50-53 95-113 128-147M199 533c31-34 63-69 132-148M197 533c43-46 86-97 132-145M195 541l135-157M200 536c42-53 86-105 127-148M198 543c33-41 65-79 128-152M196 540c38-46 75-89 131-150M199 542c40-48 85-93 128-148M198 544c28-36 57-69 130-153M194 549c56-57 105-117 137-150M197 546c37-46 79-89 132-148M197 550c39-44 81-94 131-155M201 552c38-51 80-99 130-155M197 554c30-39 62-72 134-153M195 553c37-40 73-79 136-152M199 555c50-61 102-120 131-150M199 558c43-53 84-102 131-155M196 563c34-40 68-82 132-153M193 561c52-54 99-110 139-154M198 564c29-31 56-66 136-157M198 565c39-45 77-86 131-156M192 566c36-40 73-82 143-153M195 568c28-35 57-71 135-154M195 569c53-55 107-115 138-154M198 569l133-157M196 576c32-34 58-75 133-159M193 572c26-33 57-64 141-154M195 579c54-57 103-117 134-158M198 575c36-40 70-82 133-157M190 579c64-65 117-122 141-155M195 582c39-47 82-94 138-158M196 581c28-38 64-72 138-154M198 583l134-159M191 588c52-61 101-114 145-158M194 588c51-64 102-124 141-160M195 586c41-45 85-97 138-154M197 590c41-47 82-95 135-162M195 594c30-42 63-76 139-162M193 594c32-34 59-68 140-161M195 596c42-50 76-93 141-163M197 594c32-37 65-72 136-160M192 603l142-162M192 598c30-31 59-64 144-157M197 604c43-59 95-112 138-164M195 603c54-64 106-127 139-164M194 605l144-163M192 608c39-42 79-87 146-164M199 612c31-46 66-86 139-170M197 608c38-47 79-93 141-163M190 611c62-65 121-129 149-163M193 614c55-69 11Line truncated
<path stroke="#000" d="M283 989c39-52 86-95 106-127M282 989c38-44 73-85 112-126m-2 1c-27-190-56-380-78-570m79 570c-33-223-64-446-78-568m-1 2c-40 1-79 1-101-6m100 5H210m2-4c-15 208-26 416-31 578m31-576c-14 162-22 325-32 575m0 1c25 33 57 69 96 113m-96-114c29 41 62 76 98 117m2 1s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#dbc9f3" d="m325 490-71-1-133 118-5 3-4 4-3 5-3 5-19 127 20 15 19 15 16 16 14 17 12 18 9 18 8 20 6 20 15-4 15-3 13-2 13-2 12-1 11-1 15 1 5 1-4-11-5-20-5-20-3-19-2-20-1-19v-19l2-19 2-18 3-19 4-18 6-18 6-19 6-18 8-18 4-9 9-18 4-8 2-8 3-10 1-10v-12l-5-39"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M325 490s0 0 0 0m0 0s0 0 0 0m0 0-71-1m71 1-71-1m0 0L121 607m133-118L121 607m0 0s0 0 0 0m0 0s0 0 0 0m0 0-5 3m5-3-5 3m0 0-4 4m4-4-4 4m0 0-3 5m3-5-3 5m0 0-3 5m3-5-3 5m0 0L87 751m19-127L87 751m0 0s0 0 0 0m0 0s0 0 0 0m0 0 20 15m-20-15 20 15m0 0 19 15m-19-15 19 15m0 0 16 16m-16-16 16 16m0 0 14 17m-14-17 14 17m0 0 12 18m-12-18 12 18m0 0 9 18m-9-18 9 18m0 0 8 20m-8-20 8 20m0 0 6 20m-6-20 6 20m0 0 15-4m-15 4 15-4m0 0 15-3m-15 3 15-3m0 0 13-2m-13 2 13-2m0 0 13-2m-13 2 13-2m0 0 12-1m-12 1 12-1m0 0 11-1m-11 1 11-1m0 0 15 1m-15-1 15 1m0 0 5 1m-5-1 5 1m0 0-4-11m4 11-4-11m0 0-5-20m5 20-5-20m0 0-5-20m5 20-5-20m0 0-3-19m3 19-3-19m0 0-2-20m2 20-2-20m0 0-1-19m1 19-1-19m0 0v-19m0 19v-19m0 0 2-19m-2 19 2-19m0 0 2-18m-2 18 2-18m0 0 3-19m-3 19 3-19m0 0 4-18m-4 18 4-18m0 0 6-18m-6 18 6-18m0 0 6-19m-6 19 6-19m0 0 6-18m-6 18 6-18m0 0 8-18m-8 18 8-18m0 0 4-9m-4 9 4-9m0 0 9-18m-9 18 9-18m0 0 4-8m-4 8 4-8m0 0 2-8m-2 8 2-8m0 0 3-10m-3 10 3-10m0 0 1-10m-1 10 1-10m0 0v-12m0 12v-12m0 0-5-39m5 39-5-39m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#a887e8" d="m439 634 10 20 4 24 2 26 3 25 5 25 8 25 9 24 12 24 13 24 8 11 9 12 7 10 2 6 2 6v5l-2 5-2 5-5 8-61 99-8-17-8-16-9-14-9-14-9-12-10-11-10-10-11-10-11-8-11-7-12-6-12-5-13-4-13-3-14-2-6-1h-7l-7-20-5-20-4-20-3-19-1-19-1-19 1-28 2-19 3-18 4-18 5-19 6-18 7-18 8-18 9-19 7-14 7-20 2-21-5-41 114 144"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M439 634s0 0 0 0m0 0s0 0 0 0m0 0 10 20m-10-20 10 20m0 0 4 24m-4-24 4 24m0 0 2 26m-2-26 2 26m0 0 3 25m-3-25 3 25m0 0 5 25m-5-25 5 25m0 0 8 25m-8-25 8 25m0 0 9 24m-9-24 9 24m0 0 12 24m-12-24 12 24m0 0 13 24m-13-24 13 24m0 0 8 11m-8-11 8 11m0 0 9 12m-9-12 9 12m0 0 7 10m-7-10 7 10m0 0 2 6m-2-6 2 6m0 0 2 6m-2-6 2 6m0 0v5m0-5v5m0 0-2 5m2-5-2 5m0 0-2 5m2-5-2 5m0 0-5 8m5-8-5 8m0 0-61 99m61-99-61 99m0 0s0 0 0 0m0 0s0 0 0 0m0 0-8-17m8 17-8-17m0 0-8-16m8 16-8-16m0 0-9-14m9 14-9-14m0 0-9-14m9 14-9-14m0 0-9-12m9 12-9-12m0 0-10-11m10 11-10-11m0 0-10-10m10 10-10-10m0 0-11-10m11 10-11-10m0 0-11-8m11 8-11-8m0 0-11-7m11 7-11-7m0 0-12-6m12 6-12-6m0 0-12-5m12 5-12-5m0 0-13-4m13 4-13-4m0 0-13-3m13 3-13-3m0 0-14-2m14 2-14-2m0 0-6-1m6 1-6-1m0 0h-7m7 0h-7m0 0-7-20m7 20-7-20m0 0-5-20m5 20-5-20m0 0-4-20m4 20-4-20m0 0-3-19m3 19-3-19m0 0-1-19m1 19-1-19m0 0-1-19m1 19-1-19m0 0 1-28m-1 28 1-28m0 0 2-19m-2 19 2-19m0 0 3-18m-3 18 3-18m0 0 4-18m-4 18 4-18m0 0 5-19m-5 19 5-19m0 0 6-18m-6 18 6-18m0 0 7-18m-7 18 7-18m0 0 8-18m-8 18 8-18m0 0 9-19m-9 19 9-19m0 0 7-14m-7 14 7-14m0 0 7-20m-7 20 7-20m0 0 2-21m-2 21 2-21m0 0-5-41m5 41-5-41m0 0 114 144M325 490l114 144m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#6342a0" d="m190 890 6 29 2 29-1 27-2 14-6 27-8 26-11 25-13 25-7 12 28 1 27 1 27 3 27 4 27 5 25 6 26 7 25 9 12 4 12 2 11-1 10-3 9-5 8-9 6-8 8-18 25-85-10-22-11-20-11-18-13-16-13-14-15-13-15-11-17-9-17-7-19-5-19-3-21-2h-21l-23 3-24 4-24 6"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M190 890s0 0 0 0m0 0s0 0 0 0m0 0 6 29m-6-29 6 29m0 0 2 29m-2-29 2 29m0 0-1 27m1-27-1 27m0 0-2 14m2-14-2 14m0 0-6 27m6-27-6 27m0 0-8 26m8-26-8 26m0 0-11 25m11-25-11 25m0 0-13 25m13-25-13 25m0 0-7 12m7-12-7 12m0 0 28 1m-28-1 28 1m0 0 27 1m-27-1 27 1m0 0 27 3m-27-3 27 3m0 0 27 4m-27-4 27 4m0 0 27 5m-27-5 27 5m0 0 25 6m-25-6 25 6m0 0 26 7m-26-7 26 7m0 0 25 9m-25-9 25 9m0 0 12 4m-12-4 12 4m0 0 12 2m-12-2 12 2m0 0 11-1m-11 1 11-1m0 0 10-3m-10 3 10-3m0 0 9-5m-9 5 9-5m0 0 8-9m-8 9 8-9m0 0 6-8m-6 8 6-8m0 0 8-18m-8 18 8-18m0 0 25-85m-25 85 25-85m0 0s0 0 0 0m0 0s0 0 0 0m0 0-10-22m10 22-10-22m0 0-11-20m11 20-11-20m0 0-11-18m11 18-11-18m0 0-13-16m13 16-13-16m0 0-13-14m13 14-13-14m0 0-15-13m15 13-15-13m0 0-15-11m15 11-15-11m0 0-17-9m17 9-17-9m0 0-17-7m17 7-17-7m0 0-19-5m19 5-19-5m0 0-19-3m19 3-19-3m0 0-21-2m21 2-21-2m0 0h-21m21 0h-21m0 0-23 3m23-3-23 3m0 0-24 4m24-4-24 4m0 0-24 6m24-6-24 6m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#390f8c" d="m87 751 25 19 22 20 20 22 16 24 12 26 9 28 6 27 2 26v27l-4 26-6 26-10 27-13 27-17 26L21 976l-8-12-7-11-1-9v-11l3-9 10-22 69-151"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M87 751s0 0 0 0m0 0s0 0 0 0m0 0 25 19m-25-19 25 19m0 0 22 20m-22-20 22 20m0 0 20 22m-20-22 20 22m0 0 16 24m-16-24 16 24m0 0 12 26m-12-26 12 26m0 0 9 28m-9-28 9 28m0 0 6 27m-6-27 6 27m0 0 2 26m-2-26 2 26m0 0v27m0-27v27m0 0-4 26m4-26-4 26m0 0-6 26m6-26-6 26m0 0-10 27m10-27-10 27m0 0-13 27m13-27-13 27m0 0-17 26m17-26-17 26m0 0L21 976m128 126L21 976m0 0s0 0 0 0m0 0s0 0 0 0m0 0-8-12m8 12-8-12m0 0-7-11m7 11-7-11m0 0-1-9m1 9-1-9m0 0v-11m0 11v-11m0 0 3-9m-3 9 3-9m0 0 10-22M8 924l10-22m0 0 69-151M18 902l69-151m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<path fill="none" stroke="#CECDCC" strokeLinecap="round" strokeWidth="10" d="M91 753s0 0 0 0m0 0s0 0 0 0m0 0 21 16m-21-16 21 16m0 0 18 17m-18-17 18 17m0 0 16 16m-16-16 16 16m0 0 13 17m-13-17 13 17m0 0 11 17m-11-17 11 17m0 0 8 17m-8-17 8 17m0 0 7 18m-7-18 7 18m0 0 6 18m-6-18 6 18m0 0 15-4m-15 4 15-4m0 0 14-2m-14 2 14-2m0 0 14-2m-14 2 14-2m0 0 13-2m-13 2 13-2m0 0 12-1m-12 1 12-1m0 0 11-1m-11 1 11-1m0 0h10m-10 0h10m0 0h8m-8 0h8m0 0-6-21m6 21-6-21m0 0-6-20m6 20-6-20m0 0-4-20m4 20-4-20m0 0-3-20m3 20-3-20m0 0-1-19m1 19-1-19m0 0-1-19m1 19-1-19m0 0 1-19m-1 19 1-19m0 0 2-18m-2 18 2-18m0 0 2-19m-2 19 2-19m0 0 4-18m-4 18 4-18m0 0 5-18m-5 18 5-18m0 0 6-18m-6 18 6-18m0 0 7-18m-7 18 7-18m0 0 7-18m-7 18 7-18m0 0 9-18m-9 18 9-18m0 0 9-19m-9 19 9-19m0 0 8-22m-8 22 8-22m0 0 2-10m-2 10 2-10"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill="#FFF6F0" d="m154 297-20-26 25-24 207-6 19 26-27 25-205 1-1-3"/>
<path fill="none" stroke="#000" strokeWidth="4" d="m156 295-20-23m20 24c-7-11-16-19-22-27m6 1c1-11 10-13 21-21m-25 18c6-6 10-11 25-23m0 4c64-2 125-5 200-5m-198 3c64-1 133-4 201-2m-4 0c7 5 16 16 24 23m-20-25c5 6 7 12 20 23m-1 2c-2 8-12 14-18 25m18-24c-7 6-13 13-20 24m-4 1c-82-4-161-3-203 3m207-5c-56 1-110 0-206 4m-1-1s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillRule="evenodd" strokeLinecap="round">
<path fill="#FFF6F0" d="m275 618 12-35 6-12 11-14 23-18 21-16-29-185-5-43-3-5-5-1-45 4-1 14 17 311"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M277 617c2-5 4-24 9-34 4-10 10-19 17-26 7-8 18-13 23-17l10-8c3-3 9-4 11-9 1-5 3 10-2-20l-26-163c-5-31-2-20-3-27l-3-11c-1-4 0-10-2-12s-6 0-11 0l-15 2h-14c-4 0-8-2-10 0s0 7 0 14v30l10 205c3 38 3 13 3 26l1 50m1-1c2-5 7-22 12-31 5-10 11-20 17-27 7-7 17-13 22-17l7-9c4-3 12-5 14-10s3 10-2-20l-28-162c-5-31-2-19-3-25l-1-13c-1-4-1-9-3-11s-5-1-9-1l-17 1h-15c-5 0-10-2-12 0-1 2 3 5 3 13l2 32 10 202c2 39 0 16 0 29l2 49"/>
</g>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke="#bcb9b8" strokeWidth=".5" d="m259 300 6-5m-6 5 7-4m-4 7 3-8m-3 8 4-8m-7 10c4-3 6-3 12-9m-12 10 13-11m-11 13c5-4 5-8 10-14m-8 14 8-14m-11 17c6-4 12-9 15-15m-16 16 17-17m-13 20c1-3 7-8 12-19m-13 17c6-5 8-10 15-17m-15 21c5-9 14-16 21-21m-23 22 22-24m-18 24 19-25m-19 26 18-24m-21 27c8-7 18-19 25-27m-27 28 29-28m-24 29c4-5 13-13 24-28m-25 30 25-32m-28 36c10-10 17-19 33-34m-34 34c8-9 15-17 35-35m-30 37 29-38m-30 38 29-37m-32 38c12-10 24-24 37-39m-36 40 38-40m-37 43c13-13 22-27 36-43m-35 43 36-42m-38 45c11-11 24-24 42-46m-42 46 44-46m-41 50c16-18 29-37 40-52m-40 51c14-19 28-35 41-49m-43 51 46-51m-46 51 45-50m-41 53 42-54m-44 55 45-54m-49 58c15-14 24-29 55-57m-54 56c13-14 26-27 51-57m-46 61c17-23 35-45 49-60m-49 58c11-16 24-32 46-59m-51 64 55-60m-54 60 52-59m-51 61c14-19 32-36 50-61m-48 60 49-60m-52 65c10-14 24-25 55-59m-55 59 54-60m-50 59c13-13 25-28 51-59m-52 62 50-62m-54 66c14-16 27-29 53-60m-53 59c18-21 35-40 54-58m-49 61 50-60m-51 59 50-61m-52 65c12-16 23-27 52-61m-53 60c15-15 29-32 54-60m-49 63 51-63m-52 64 51-63m-55 65 55-60m-54 59c15-15 29-31 53-59m-51 61 52-61m-52 62 53-61m-53 65c14-18 30-36 53-62m-55 62 56-60m-51 61 49-63m-50 64c11-15 23-29 51-62m-53 65c15-18 34-38 55-60m-56 61c15-20 34-39 55-60m-52 61c11-10 20-26 52-63m-53 64c12-15 24-31 52-62m-53 67c11-17 26-35 54-64m-55 63 54-61m-50 63c21-26 41-50 52-61m-54 61 52-63m-55 67c20-26 44-50 57-61m-56 61c21-25 44-50 56-62m-52 64 51-63m-52 64 52-65m-56 65c20-17 39-40 55-60m-54 62 56-63m-53 64 53-64m-54 65 54-64m-53 67c10-14 22-29 55-63m-58 64 57-63m-55 66c20-25 42-52 56-66m-54 65c20-24 39-50 54-64m-57 69c19-23 41-44 56-63m-56 61c18-18 33-37 56-61m-51 62 50-62m-51 63 53-64m-56 68c15-16 31-32 56-64m-57 65c19-23 39-43 58-65m-55 68 56-65m-57 64 55-67m-57 69c20-19 37-43 58-65m-59 66c21-20 38-41 60-64m-57 66c22-26 45-52 59-65m-57 65 54-66m-58 70c23-25 43-44 59-67m-58 66c15-15 27-32 57-64m-56 68c16-16 30-36 57-68m-56 67 56-66m-58 69c19-18 35-40 58-63m-59 63c16-16 28-32 60-65m-55 66 55-66m-56 68 57-68m-62 71c18-17 39-39 62-66m-60 66c16-18 32-37 61-67m-60 71 58-69m-56 68c18-19 33-41 57-69m-59 70c21-19 39-40 62-64m-63 65c25-27 48-53 62-66m-60 70c12-14 25-29 57-71m-56 70 58-70m-60 72c19-22 41-40 59-64m-59 66c19-24 40-45 60-67m-58 68 60-69m-59 71 58-71m-59 72c23-23 46-52 62-67m-65 69 63-68m-60 68c18-18 36-39 60-68m-58 71 57-71m-60 72c14-15 32-34 62-69m-63 71c22-26 45-52 63-70m-60 70c19-20 34-38 61-71m-61 72 61-71m-64 73c23-19 41-40 62-68m-62 70 62-70m-60 72 61-72m-59 72 59-71m-60 74c22-26 45-50 60-71m-63 72 64-70m-61 71c14-14 24-29 63-71m-61 72 59-73m-63 75c23-26 46-52 65-70m-65 71 64-71m-62 75c17-17 33-37 62-75m-60 73 61-73m-64 79 62-71m-63 69 64-71m-60 74c19-23 38-43 60-75m-61 74c19-21 37-43 61-73m-62 79c23-26 46-56 65-76m-67 74 66-72m-64 75c25-26 47-55 65-75m-64 75c17-18 31-36 64-76m-64 78c19-22 38-42 62-72m-64 73c15-17 30-35 66-73m-65 74 64-73m-62 75c14-16 26-34 63-75m-68 76c24-22 44-45 67-69m-65 71 67-73m-64 75 64-76m-64 77 62-77m-66 78c15-13 29-31 68-72m-66 72 67-72m-64 77c13-18 28-31 64-79m-64 78 64-76m-66 77c19-20 37-42 66-71m-67 73 67-74m-62 76c19-26 43-52 62-75m-65 74 66-75m-67 81 66-76m-68 75c27-28 55-58 68-75m-62 78c15-21 30-41 64-78m-67 78 65-78m-67 82c20-21 37-40 69-78m-68 76 67-75m-63 78 65-80m-66 81c12-16 26-32 65-78m-68 81c14-19 32-36 69-79m-70 77c26-26 50-55 69-75m-64 81c14-21 29-38 66-79m-68 77c18-20 33-38 66-80m-66 83c18-22 39-44 66-78m-68 78 69-77m-66 81c21-23 39-48 65-81m-66 81c27-31 50-60 67-81m-70 83c29-29 57-63 72-79m-70 79 70-77m-66 79c13-18 25-35 66-79m-68 78 67-79m-68 82c15-13 28-29 68-76m-68 77 69-78m-66 82 65-81m-67 79c18-18 33-39 69-79m-69 83c18-22 40-48 69-76m-72 77c19-19 36-39 71-79m-68 81c25-31 53-59 69-80m-69 81 69-83m-71 84c15-17 32-34 70-78m-69 79 70-79m-68 84 68-86m-69 84c17-19 30-37 70-82m-70 83 70-79m-72 81c16-17 32-34 72-81m-69 82 69-81m-68 82 69-81m-72 85 71-79m-70 78c21-23 43-46 71-81m-70 83c16-16 33-34 71-84m-71 85 71-82m-74 84 21-18m-19 19 20-21m-19 25c6-7 13-17 20-23m-19 22 18-24m11-13c10-13 23-28 42-45m-43 45c12-16 26-29 43-47m-42 48c11-8 18-20 41-48m-40 49 41-49m-72 87c4-6 9-9 10-13m-11 12 14-11m-10 13 8-15m-9 16 10-14m27-38c13-10 26-27 33-33m-30 34 29-32m-25 34 26-35m-29 35 30-34m-75 87c5-3 7-5 9-8m-8 9c2-4 5-6 10-9m-8 11 7-12m-6 11c1-4 4-7 7-10m42-52 24-21m-24 21 22-23m-20 24c5-3 9-13 18-24m-17 25 19-25m-75 90 8-6m-8 5 8-5m-4 7 4-7m-4 8 3-7m-6 9h3m-3 1 4-1m-1 3v-4m0 4 1-3"/>
<path stroke="transparent" d="M276 614c2-6 5-24 10-33 4-10 11-19 17-26 7-7 17-13 22-17l8-6c4-3 12-5 13-11 2-5 2 9-3-21s-22-128-26-159c-5-30-2-17-3-23l-2-15c0-4 1-8-1-9-3-1-7 1-11 1l-17-2c-4 0-9 3-13 4-3 0-8-4-9-2-2 2-1 6 0 13l2 32 10 198 1 28 1 46m0 1c2-5 5-21 10-31 4-10 11-22 18-29 6-7 17-11 22-14 6-4 7-3 10-6s8-7 10-12c1-5 2 10-2-20l-24-160-4-24-2-15c-1-4 0-6-2-7h-28l-14 2c-3 0-6-2-8 0v12l2 29c1 38 7 163 10 201 2 37 2 11 3 24l-1 50"/>
</g>
<path fill="none" stroke="#000" strokeLinecap="round" strokeWidth="4" d="M276 613c1-5 6-23 11-33 5-9 11-17 18-24l19-15 10-9c4-3 11-7 12-12 2-5 4 11-1-19l-27-160c-5-31-1-17-2-24l-2-13c-1-4 0-9-2-10-3-2-7 0-11 0h-16l-14 1c-4 0-10-3-11-1-2 2 3 6 3 13 1 8-2-7-1 32l11 198 2 27 1 48m1 0c2-5 5-21 10-31 5-9 14-17 20-24l18-18 8-6c3-3 10-5 11-11 2-5 3 9-2-22l-25-160c-5-31-2-18-3-24l1-12c-1-4-1-8-3-10h-9l-17-1-15 2c-5 0-10 0-11 2-2 2 0 4 1 11s1-7 3 31l7 198c2 37 2 14 3 27l3 50"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill="#FFF6F0" d="m275 626-20-52-11-9-23-19-13-7-11-3-1-9 15-233v-1h41l6 1v12l4 61 12 260"/>
<path fill="none" stroke="#000" strokeWidth="4" d="m276 625-12-22c-4-9-5-20-10-28s-12-14-20-20c-7-7-19-15-25-18s-9 1-11-2c-2-4 0-5 0-17l4-55 8-154c1-28-3-13 1-16s13 0 21 0c8 1 23-2 27 1 4 4-2-6-1 18l6 128 12 186m-1 1-9-26c-3-9-8-18-13-26l-19-20c-6-6-17-14-23-18-6-3-9 1-11-3-2-3-1-6-1-18l3-53 9-155c2-28-3-10 0-12 4-3 13-2 21-2s22-2 26 1-1-8 0 17l5 128 14 186"/>
</g>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke="#000" strokeWidth=".3" d="M211 291s0 0 0 0m0 0s0 0 0 0m0 3h1m-1 0 1-1m-1 5 3-4m-3 4 2-3m-3 6c3-1 5-5 5-6m-5 7 5-7m-3 11 6-10m-6 9c0-4 4-6 6-9m-8 12c7-3 4-8 8-13m-7 13 12-15m-14 20c5-13 11-15 18-17m-19 13c8-6 15-12 15-17m-16 25c10-8 13-16 21-26m-19 24c3-4 9-11 18-19m-16 19c8-9 15-16 20-24m-23 26c8-6 9-9 23-23m-23 23c8-5 11-9 28-26m-25 31c5-8 10-15 22-27m-23 25c5-2 17-12 29-26m-28 28 24-30m-28 33c7-4 14-17 32-28m-31 32c8-12 20-23 30-36m-25 38c6-14 12-22 25-41m-29 41c10-14 19-25 32-36m-35 42 36-47m-34 44c16-15 31-33 34-42m-37 44c9-11 19-21 42-40m-39 40c15-14 26-29 40-41m-38 47c9-14 22-32 42-49m-45 48c10-11 21-24 40-50m-41 52c19-14 35-33 42-49m-41 49c17-15 29-30 46-51m-47 51c18-11 30-32 53-48m-50 52c10-14 20-23 47-55m-47 56c14-10 20-24 52-54m-53 55c17-15 28-33 50-56m-49 59c13-16 23-28 53-58m-52 57c10-14 25-27 49-59m-54 64c21-18 33-32 56-65m-53 64c16-19 34-38 54-59m-54 64c14-19 32-44 52-64m-53 63c14-16 31-31 54-60m-57 62c17-15 22-27 53-55m-50 55c15-16 28-32 53-57m-55 59c23-18 32-35 53-56m-51 58c12-11 22-26 54-58m-55 60c21-22 41-42 53-59m-53 61c15-14 29-30 55-60m-54 65c8-15 23-30 52-62m-50 59c6-14 20-23 51-62m-52 63c15-11 28-27 50-54m-53 56c21-25 46-46 56-59m-53 64c20-19 38-38 54-62m-54 62c14-16 30-34 51-63m-53 64c22-19 31-39 53-59m-52 60 52-59m-49 65c17-26 37-50 51-63m-56 62c16-17 29-30 57-63m-57 64c16-12 28-31 56-59m-54 62c10-15 21-30 55-65m-60 65c18-17 41-43 62-60m-56 63c18-24 38-48 53-64m-59 64c16-19 36-36 55-64m-49 67c12-17 28-34 54-63m-59 64c21-19 37-38 57-65m-53 65c11-16 25-29 54-62m-54 66c10-11 21-22 51-62m-52 61 56-62m-57 67c13-18 28-35 56-64m-56 63 56-63m-53 69c23-29 39-54 56-64m-60 60c22-24 48-48 59-64m-58 72c25-24 40-57 59-67m-59 64c25-27 46-52 58-67m-61 69c22-22 47-48 55-63m-52 65c22-24 41-50 58-65m-60 68 62-68m-59 66c18-19 35-42 56-65m-58 71 61-64m-61 63 59-65m-57 67 53-64m-55 64c23-21 40-48 59-65m-58 69c22-22 42-43 57-66m-56 68c10-15 20-30 58-66m-61 66c15-14 34-36 56-63m-54 65c14-21 32-40 56-67m-56 66c17-11 31-29 55-65m-56 69c18-21 38-42 57-66m-60 65c19-17 34-33 59-61m-57 63c21-21 39-43 60-66m-59 69c20-20 41-47 59-64m-59 66 58-69m-55 69c11-18 29-35 56-68m-58 72c19-24 39-49 57-68m-56 74c10-22 31-44 54-73m-58 69c24-25 44-49 61-69m-57 76c15-20 30-38 58-70m-63 68 61-70m-57 72c25-25 45-54 58-70m-58 69 60-69m-65 77c12-21 33-33 66-71m-63 68c18-24 38-46 60-72m-58 77c18-20 34-39 60-76m-60 72 58-71m-63 73c21-21 47-45 60-71m-59 74c18-18 36-37 64-71m-61 77c22-27 43-52 59-74m-59 71 59-70m-63 76c16-21 36-42 66-75m-63 71c13-13 25-29 63-71m-66 74c16-15 36-32 67-68m-66 71c23-23 44-46 64-74m-67 77c21-17 39-38 62-74m-60 72 64-72m-65 79c23-31 45-58 64-77m-60 73c16-21 38-41 63-72m-67 80c32-28 54-58 68-75m-64 69c15-20 32-41 61-71m-62 81c15-24 38-45 60-81m-62 79c18-22 35-42 66-74m-63 78c14-23 30-41 60-78m-62 76c15-19 28-35 64-73m-63 72c22-27 44-44 63-70m-65 72 65-75m-66 78c16-15 31-35 68-77m-66 76c23-26 46-54 66-72m-65 77c14-25 37-45 63-74m-64 73c15-17 29-32 64-74m-67 80c22-26 48-59 68-76m-67 75c23-25 46-50 67-76m-62 77c7-10 25-28 59-71m-62 73 65-76m-65 78c16-19 38-41 61-78m-61 79 66-76m-70 79c32-30 56-65 72-80m-67 82c22-29 43-55 66-78m-66 78c22-28 47-62 62-75m-64 76c17-18 32-36 66-77m-65 84c18-29 39-48 63-77m-65 72 68-75m-70 84c21-25 41-54 70-80m-69 76c17-16 33-35 69-76m-68 78c26-27 46-52 69-74m-70 73c24-24 46-49 69-75m-68 84c25-31 50-58 65-78m-66 76 69-81m-69 84c25-24 41-49 73-83m-73 82 70-80m-70 80c21-27 42-49 72-79m-71 83c19-24 41-48 70-80m-69 76c11-9 25-29 71-71m-71 73c23-22 47-49 66-74m-62 75c19-17 33-40 67-74m-67 74c22-23 45-50 63-72m-61 71 62-71m-64 76c14-20 31-39 66-77m-67 74c27-27 46-46 64-71m-61 71c15-17 28-33 62-67m-59 73c22-25 44-55 61-72m-61 71c16-18 30-39 60-71m-62 73c28-28 47-55 65-69m-63 66c23-26 47-50 61-65m-59 69c14-21 30-30 61-64m-59 60c21-23 38-46 54-62m-52 61c10-15 30-32 58-59m-60 61c20-22 39-39 56-61m-52 64c18-22 29-39 50-62m-53 63 56-64m-55 64c19-24 34-42 52-57m-49 55 50-57m-45 59c15-24 37-44 46-55m-49 54c18-19 32-38 51-55m-53 53c17-8 27-18 50-50m-48 54c9-12 22-22 50-55m-49 58c21-25 34-41 51-58m-47 57c7-15 19-25 46-54m-50 57c15-13 24-29 47-57m-43 54c12-11 21-23 46-52m-48 55c22-22 36-39 45-55m-42 55c16-20 29-34 46-53m-44 50c12-13 19-22 46-48m-45 53c10-18 21-28 40-53m-36 49c4-8 14-25 37-43m-42 45 44-46m-39 47c8-16 17-24 39-49m-42 52 39-48m-36 51c13-19 25-29 37-51m-37 48c10-10 16-22 39-47m-40 47c13-6 21-17 40-39m-40 41 40-46m-37 43c15-6 20-20 33-42m-31 47c8-13 15-19 33-43m-33 42c14-12 22-28 32-37m-31 36 35-40m-31 39c7-8 17-17 26-33m-32 35c8-7 17-15 34-36m-31 35c9-8 18-20 35-36m-34 42c8-13 19-23 32-37m-30 35c8-4 13-18 27-34m-27 34c10-13 18-22 30-34m-29 33c11-5 15-16 27-31m-28 33c12-10 24-24 32-32m-27 34c3-9 11-15 24-34m-27 36c13-13 25-27 28-32m-22 28 20-25m-23 30 24-32m-23 34 26-27m-26 25 24-28m-21 31c6-6 11-13 23-30m-25 28c5-8 13-14 22-28m-19 33c3-10 15-20 19-29m-21 28 21-29m-23 31c11-9 15-9 25-30m-21 28c4-6 8-13 23-26m-23 27 23-22m-21 22c5-10 16-16 19-22m-20 27c3-12 13-12 16-28m-14 24c4-3 9-9 17-21m-17 27c2-10 8-11 17-22m-15 19 16-22m-20 20c7 0 12-4 19-13m-14 19c2-8 10-16 14Line truncated
<path stroke="transparent" strokeWidth=".5" d="m277 624-11-21c-4-9-7-22-11-30-5-8-10-13-17-19-8-6-22-15-29-18-6-3-10 1-12-1-2-3 1-5 2-17l4-55 8-153c2-29-2-15 1-17 4-2 13 2 21 2s23-3 27-1c4 3-4-8-3 16 2 24 7 76 10 128 3 53 6 155 7 186m0 5-10-31-11-23c-4-7-7-13-13-19-7-6-19-16-26-20-7-3-12 0-15-3-2-4 1-5 2-17v-53c1-35 4-127 7-156 2-28 2-14 6-16 5-1 13 7 20 7 8 0 19-7 23-4s-1-3 0 21c2 24 7 71 10 122l6 186"/>
</g>
<path fill="none" stroke="#000" strokeLinecap="round" strokeWidth="4" d="m275 627-10-24c-4-9-6-20-11-27-5-8-12-13-19-19l-25-19c-6-4-10-1-12-4-2-4 0-5 0-17l4-55 9-154c2-28-2-12 2-14 3-2 10 0 18 0s23-3 27 1c5 3-2-7-1 18l6 129 12 184m2 0-13-25c-4-9-5-17-10-25a124 124 0 0 0-45-38c-6-3-8 1-10-2s0-5 0-17l3-54 8-155c2-28 0-11 4-13 3-3 10-2 17-2 7-1 22-4 26-1 4 4-2-3 0 21l9 127 9 183"/>
<path fill="none" stroke="#E6E6E5" strokeLinecap="round" strokeWidth="10" d="M460 1010s0 0 0 0m0 0s0 0 0 0m0 0-10-21m10 21-10-21m0 0-11-19m11 19-11-19m0 0-11-17m11 17-11-17m0 0-13-15m13 15-13-15m0 0-13-14m13 14-13-14m0 0-14-11m14 11-14-11m0 0-16-10m16 10-16-10m0 0-16-9m16 9-16-9m0 0-17-6m17 6-17-6m0 0-18-5m18 5-18-5m0 0-19-3m19 3-19-3m0 0-20-2m20 2-20-2m0 0-21 1m21-1-21 1m0 0-22 2m22-2-22 2m0 0-24 4m24-4-24 4m0 0-24 5m24-5-24 5m0 0 6 29m-6-29 6 29m0 0 2 27m-2-27 2 27m0 0v26m0-26v26m0 0-4 26m4-26-4 26m0 0-7 24m7-24-7 24m0 0-9 24m9-24-9 24m0 0-11 24m11-24-11 24m0 0-13 25m13-25-13 25"/>
<path fill="none" stroke="#6d6d6d" strokeLinecap="round" strokeWidth="10" d="M190 890s0 0 0 0m0 0s0 0 0 0m0 0 6 27m-6-27 6 27m0 0 2 26m-2-26 2 26m0 0v26m0-26v26m0 0-3 25m3-25-3 25m0 0-6 25m6-25-6 25m0 0-9 26m9-26-9 26m0 0-12 25m12-25-12 25m0 0-15 26m15-26-15 26"/>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke="#ea0" strokeWidth=".3" d="M137 269s0 0 0 0m0 0s0 0 0 0m0 0c3-5 5-6 12-12m-11 15c2-4 7-9 11-13m-11 10c2 2 6-7 25-17m-25 19c7-5 16-15 20-21m-17 23c9-4 11-13 24-25m-23 25 20-23m-19 23c4-7 18-21 22-26m-25 31c5-9 13-17 27-32m-28 29c13-12 19-16 28-29m-24 30c6-7 11-14 25-26m-23 33c10-12 20-28 28-36m-29 34c8-9 13-20 28-34m-30 37c16-16 23-29 35-35m-34 32 32-31m-29 35c7-14 18-16 34-33m-32 29c11-11 19-24 27-32m-27 32c5-8 19-18 35-32m-37 34c13-12 24-21 34-34m-30 37c12-14 17-24 30-39m-32 40 35-40m-35 42c14-18 23-30 35-38m-33 36 34-38m-29 40c10-17 26-32 32-38m-35 37c13-13 23-27 37-38m-40 37c15-5 22-12 39-37m-37 41c7-9 18-17 39-43m-38 47c18-22 28-35 43-50m-39 49c5-14 15-21 38-46m-43 49c14-12 22-26 43-52m-39 49c11-10 19-20 41-47m-42 50c20-21 33-36 42-52m-40 52 44-50m-41 47c11-12 18-22 45-48m-45 53c10-17 21-27 40-53m-34 48c4-9 14-26 37-45m-43 47 46-47m-39 46c8-16 18-25 42-52m-46 55c13-14 25-28 43-51m-39 54c15-21 28-32 42-57m-41 54c10-12 18-26 43-52m-43 50c14-7 23-20 44-45m-44 47c15-19 32-37 45-52m-41 48c17-9 24-25 40-50m-38 55c10-15 18-23 40-51m-38 48c16-15 27-34 39-46m-39 45c14-14 26-29 43-49m-38 47c10-12 23-24 36-44m-41 46c10-10 21-20 43-47m-40 45c13-13 26-29 46-48m-45 54c11-17 25-30 42-50m-39 47c10-8 18-24 40-49m-40 49c14-18 27-31 43-48m-40 46c14-11 24-26 40-47m-42 48c18-16 34-36 46-47m-40 48c8-13 19-25 39-52m-42 54c20-20 37-40 43-49m-35 44c12-17 26-32 36-45m-40 49 41-51m-38 52 44-47m-44 45 42-49m-38 50c10-10 19-22 42-51m-44 49c11-13 23-25 42-49m-37 53c9-18 29-37 39-53m-41 52 42-53m-42 53c16-14 24-19 46-55m-42 53c9-12 18-25 43-51m-42 50 45-47m-43 47c13-19 32-34 40-47m-40 52c8-19 25-26 40-56m-38 51c9-9 20-21 40-48m-39 52c10-18 23-27 42-50m-39 47 40-50m-42 46c13-8 24-19 44-42m-40 48c11-16 27-34 40-50m-38 46c6-7 18-23 43-47m-42 47 40-48m-38 47c13-9 17-21 45-47m-46 50 43-49m-39 45c13-13 30-30 40-48m-41 51c12-13 21-26 41-47m-35 45 37-44m-40 47c13-17 29-32 43-47m-40 50c13-19 26-31 41-49m-40 45c9-10 20-22 41-49m-39 50c5-8 21-24 38-46m-40 44c14-11 26-27 45-48m-38 53c8-20 25-31 39-49m-41 44 41-47m-37 45c6-7 15-17 36-46m-39 49c17-19 33-36 41-49m-39 52c8-17 22-22 40-48m-40 46c15-16 30-33 44-51m-41 48c6-9 15-17 41-50m-40 52 41-47m-35 46c9-11 22-26 35-44m-39 46c14-15 26-27 41-48m-34 43c8-16 32-32 37-45m-39 48c5-8 16-22 42-47m-41 51c6-13 16-22 38-51m-41 48c17-18 34-34 45-48m-41 45c12-11 16-21 46-45m-45 47c9-8 17-20 42-49m-41 52c13-17 34-32 41-52m-39 49c13-11 23-27 41-47m-39 45c9-13 17-17 44-47m-42 51c12-18 26-30 41-50m-40 48c15-15 25-23 41-45m-43 47c12-13 26-27 45-51m-41 49c12-15 27-25 43-51m-40 53c12-20 29-37 40-51m-39 52c9-12 22-24 45-52m-45 51c15-19 28-35 43-51m-43 49c14-10 23-17 46-47m-44 50c14-16 24-32 44-52m-44 53c11-10 17-20 49-55m-45 52c13-18 31-35 41-48m-38 45c5-8 19-19 45-48m-48 49c19-16 32-34 45-48m-41 54 41-49m-41 47c16-19 32-40 45-50m-40 51c8-14 22-30 36-55m-37 53c17-18 31-37 41-49m-36 47c11-18 27-33 37-50m-38 50 41-48m-41 49c8-13 22-25 46-48m-46 48c12-11 23-23 42-50m-37 47c13-16 22-31 42-46m-46 48c12-8 19-20 46-49m-38 54c9-23 30-38 39-54m-43 50c15-20 35-37 45-49m-42 47 40-47m-38 48 40-48m-37 50c13-17 26-36 44-49m-47 47c10-10 17-20 42-49m-34 50c9-15 24-28 34-47m-36 45c10-13 23-25 41-45m-44 47c18-23 35-42 46-46m-43 45c19-18 34-34 44-49m-40 47 38-43m-38 44c14-14 26-28 41-49m-38 52c9-17 23-26 42-53m-44 51c13-16 29-29 44-46m-39 44c17-19 31-33 42-49m-42 52c16-16 29-36 40-47m-40 48c8-15 17-23 46-50m-46 47c15-15 28-31 44-45m-38 47c9-18 23-32 43-48m-45 47c11-13 27-28 43-49m-40 51c13-17 20-32 43-49m-43 49c17-17 28-35 43-48m-40 46c14-17 31-32 42-48m-44 47c14-14 28-34 42-47m-37 50c12-14 22-26 37-49m-37 47c13-17 25-33 40-47m-35 45c10-12 23-31 42-44m-45 47c13-17 22-27 44-50m-43 51c10-15 22-30 45-47m-45 44c17-16 32-37 43-46m-41 43c11-11 24-18 45-44m-43 48c15-19 33-36 39-46m-38 47c11-17 26-27 43-41m-40 38 36-41m-36 46c14-15 27-30 36-45m-34 40c7-11 19-23 37-41m-36 46c10-16 26-30 37-47m-37 46c10-10 20-20 37-41m-33 39c11-11 17-22 37-42m-37 40c8-7 17-15 35-38m-34 39c11-15 22-23 37-41m-36 41c10-10 19-19 34-38m-29 41c7-12 15-24 33-36m-33 35 30-38m-28 36c10-8 22-25 29-35m-29 37c8-11 19-22 27-36m-22 33c5-9 15-18 27-31m-31 33c10-11 23-26 29-35m-30 34c10-13 26-24 33-31m-29 31c10-7 15-18 26-30m-20 34c0-10 7-13 20-30m-22 27c6-7 12-13 23-30m-24 28c11-6 15-13 27-31m-24 33c8-7 12-15 25-28m-18 27c-1-6 13-18 17-26m-20 28c6-12 14-19 22-27m-21 24c9-7 17-16 19-20m-20 19 23-23m-228 28s0 0 0 0m0 0s0 0 0 0m3 0-7-7m7 7-8-8m11 5c-9-2-15-11-14-15m16 17c-6-4-11-9-19-13m22 17c-14-12-22-18-27-29m27 27-27-24m31 23c-14-6-19-18-30-26m29 26c-15-9-26-20-32-29m32 30c-3-5-15-17-31-33m30 30-30-28m31 27c-9-7-19-21-28-27m30 27-34-26m36 31c-9-13-22-25-30-34m32 33c-5-7-15-16-32-32m39 30c-11-10-23-12-37-31m34 32c-11-12-20-19-35-32m35 30c-8-14-27-28-31-29m35 28c-16-10-29-26-41-30m41 30c-9-11-21-19-35-31m36 31-40-32m44 31c-17-8-30-24-41-32m41 33c-13-7-25-21-42-33m43 37c-7-12-20-24-38-38m42 38c-16-15-32-27-45-40m49 42c-15-11-29-25-43-43m39 39c-10-11-24-22-45-38m52 41c-14-10-26-19-49-39m46 35c-18-12-32-29-44-37m45 35c-15-11-28-29-48-40m52 44-51-40m51 37c-9-Line truncated
<path stroke="transparent" strokeWidth=".5" d="M160 294c-10-1-8-9-26-22m23 24c-6-8-12-13-21-27m1 0c5-5 16-11 21-25m-21 25 25-22m-3-1c86-2 164-7 206-5m-202 7c70-1 138-1 202-4m0 0c3 10 11 15 17 24m-19-24 20 23m2 5c-6-1-10 10-25 24m23-29-20 25m-3 4c-61 0-123-4-204 1m205-5-205 5m0-1s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<path fill="none" stroke="#000" strokeLinecap="round" strokeWidth="4" d="M153 298c0-10-9-23-15-29m19 23c-8-6-14-14-21-25m1 4c4-9 16-15 21-29m-23 27c8-8 14-14 27-22m1 1c50-4 103-3 198-6m-200 5c46-2 90-3 201-3m2-4c9 6 16 22 20 27m-23-25 22 23m-1 1c-7 10-12 15-19 21m21-22c-9 10-17 19-20 25m-1 0c-64 2-119 5-208 4m207-5c-48-1-97 2-207 4m1 1s0 0 0 0m0 0s0 0 0 0"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill="#FFF6F0" d="m305 241-9-42-4-18v-21l6-46 9-35 11-32 8-17-10 1-27-4-20-12-11-8-14 11-16 8-25 7-8-4-4 9 21 70 9 43 1 36-5 57 6 2 78-4"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M303 241c-1-10-11-36-11-61 0-24 7-62 11-85 5-22 12-39 16-50 3-11 7-11 7-14-1-3-2-1-8-2s-21-1-29-4c-9-2-16-7-21-10s-6-7-9-8c-2 0-2 2-6 5-5 3-14 12-22 15-9 3-24 3-30 4-7 0-7-3-8 0-1 2 1 8 2 13l5 15a771 771 0 0 1 22 106c2 16-1 27-1 37l-1 25c-1 6-3 12-1 15s6 2 14 2l34-2 36-1m-1 0c-1-11-8-38-8-63 0-24 5-60 9-82s12-39 16-50c4-12 9-15 8-18 0-2-5 4-11 3a170 170 0 0 1-49-16c-5-3-4-8-6-9-2 0-3 2-8 5s-13 10-21 14c-9 3-22 4-29 5s-11-3-13 0c-1 2 2 9 4 14 2 4 4 4 7 14s9 29 12 47a465 465 0 0 1 10 97l-1 22c-1 7-4 17-3 20 2 3 4 0 13 0h36l35-4"/>
</g>
<g fill="none" fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path stroke="#c24c0e" strokeWidth=".5" d="M191 30s0 0 0 0m0 0s0 0 0 0m-1 5c2 0 3 0 5-6m-4 7 6-5m-4 8 8-9m-7 9c2-3 5-7 7-7m-4 13c2-9 5-10 7-13m-10 11c6-5 7-8 14-13m-8 20c1-5 8-13 13-23m-16 20c7-8 11-14 17-18m-18 25c3-11 8-14 22-22m-20 23c7-11 17-24 23-27m-25 30 27-29m-24 28c8-8 12-16 25-29m-23 34c2-6 9-17 27-39m-29 39c7-7 16-15 33-35m-34 40c14-13 20-18 45-46m-41 47c16-18 30-38 41-47m-40 46c13-16 33-34 56-60m-58 65c18-18 34-37 56-65m-57 71c15-19 33-35 65-72m-59 69c14-16 26-33 54-64m-56 70c17-23 40-41 56-70m-53 69c20-25 45-53 58-65m-62 73c15-17 31-29 61-72m-58 70c21-27 46-51 60-70m-55 76c19-24 40-49 63-73m-66 71c16-19 31-38 63-71m-59 76c18-27 36-47 62-75m-64 74c14-18 33-33 63-73m-61 78c24-31 50-58 70-78m-71 79c23-33 48-59 66-80m-63 87c21-34 43-56 67-82m-71 77c24-24 45-46 71-80m-65 85c21-22 42-43 70-80m-71 83 71-86m-69 91c24-37 54-65 71-86m-73 85c16-24 36-46 75-88m-77 96c31-35 66-75 84-91m-81 85 79-90m-79 100c15-20 34-46 80-94m-79 89c32-35 65-72 82-93m-85 101c28-27 51-53 91-98m-88 97c18-23 38-45 87-99m-90 105c28-27 46-50 93-105m-88 104c28-32 56-62 88-104m-87 110c17-25 37-42 90-108m-93 108c25-27 51-55 95-107m-93 113c19-23 44-47 95-114m-93 114c30-33 59-70 97-114m-98 121c37-43 75-94 102-118M220 150c27-34 52-65 103-119m-99 121c30-36 67-77 99-122M220 155c27-31 49-58 106-122M223 162c40-45 79-92 103-117M221 161c23-27 44-55 103-117M222 166c17-25 44-48 98-113m-97 112c20-27 45-56 94-112m-96 122c35-39 73-81 96-112m-93 108c27-35 51-65 92-107m-96 114c21-27 41-46 89-95m-85 94c17-22 39-47 82-94m-79 98c14-22 39-50 74-93m-77 96c22-31 52-60 80-94m-77 99c13-20 27-34 78-90m-82 87c24-23 42-46 81-90m-81 98c25-31 59-66 76-94m-76 95c23-24 42-47 78-92m-81 94c20-13 31-32 85-87m-84 91c17-22 35-38 81-91m-76 100c22-36 50-65 77-90m-80 85c17-22 36-43 77-87m-82 100 83-90m-80 88c29-34 56-66 79-90m-78 98c16-22 35-45 74-94m-73 90c23-28 44-50 73-87m-71 95c16-25 38-44 71-83m-74 81 74-85m-76 96c30-36 54-64 76-87m-74 82c25-30 49-60 71-84m-73 96c18-23 37-46 74-88m-77 85c30-34 56-63 75-87m-72 93c34-40 60-66 77-84m-72 80c22-26 43-53 69-81m-63 79c17-17 30-33 62-77m-66 78 67-75m-56 73c18-22 47-49 56-67m-60 70 60-68m-56 71c20-32 48-56 57-64m-56 62c19-24 39-47 57-63m-48 59c8-15 27-25 47-51m-49 54c13-17 23-30 49-58m-42 55c15-13 23-31 38-51m-38 53c10-17 25-31 43-50m-42 47c10-6 13-13 38-44m-36 46 36-41m-28 43c10-17 27-27 31-41m-33 42 32-40m-28 36c6-7 14-12 32-28m-31 30c6-9 16-16 27-32m-25 33c15-10 16-18 26-32m-25 30c7-7 14-15 27-25m-16 25c-1-5 8-17 15-19m-18 20c5-4 11-10 20-25m-16 21c6 1 14-11 14-14m-12 18c3-6 7-9 15-18m-12 19c1-2 7-11 13-13m-13 13c3-6 5-8 14-14m-6 12c2-4 3-7 7-8m-7 8 5-7m0 7 2-2m-3 1 2-2m-84 4s0 0 0 0m0 0s0 0 0 0m6 0s-4-4-7-4m8 4-7-5m10 2c0 1-4-6-12-6m13 9-10-9m20 10c-8-5-11-7-16-19m11 16c-3-1-6-5-14-12m22 16c-12-8-14-12-19-20m18 18c-6-4-10-11-21-18m25 17c-1-2-12-8-25-24m26 27c-7-12-18-20-28-27m33 23c-5-6-16-21-29-30m31 31-34-29m42 31c-5-11-13-17-39-35m39 34-42-36m44 39c-8-13-23-26-44-39m48 35c-12-8-19-17-46-40m50 43c-20-18-37-32-47-46m48 42-50-43m59 43c-24-20-48-40-60-52m58 55c-24-19-46-38-59-51m61 49c-13-18-37-35-62-53m65 53-61-55m68 54c-17-21-40-32-66-58m65 60c-17-18-35-30-68-58m74 53c-24-17-53-43-74-56m73 62c-25-25-48-46-72-65m80 62c-23-18-45-39-84-67m83 69c-30-26-57-53-78-69m79 68c-20-22-41-41-80-76m83 72c-30-24-56-48-83-73m83 64-81-67m77 70c-21-14-42-33-80-69m79 66-83-72m86 69c-28-21-51-40-81-71m78 64c-23-21-44-36-76-68m74 69c-27-22-54-48-79-68m81 59c-25-17-45-36-83-65m81 67c-31-27-63-57-79-69m82 59c-31-13-54-33-81-68m75 72c-15-16-31-30-77-69m74 61c-25-20-48-43-76-63m75 60-73-64m77 62c-25-21-54-42-76-68m73 66-77-66m74 58c-11-15-33-28-77-61m81 63c-26-19-48-39-79-66m77 63c-27-31-56-51-78-68m81 68c-32-27-63-55-82-69m81 60c-20-18-47-43-85-66m83 69c-25-25-55-47-82-72m83 64c-28-23-57-48-83-74m83 76-83-74m86 68c-23-17-46-38-89-77m85 79c-18-13-32-29-85-77m88 71c-31-27-66-50-93-80m90 79c-32-27-67-54-87-74m86 73c-20-26-48-52-86-82m90 79c-27-25-54-50-91-80m90 72c-22-17-48-41-92-75m94 76c-23-13-40-30-93-79m94 76c-24-21-50-47-100-84m98 86-94-84m95 77c-22-16-42-38-94-83m95 83c-25-17-47-36-99-85m103 82c-39-30-74-60-102-85m99 85c-42-38-82-71-103-87m101 82c-35-34-79-65-104-92m106 91c-35-27-66-56-102-88m101 87c-39-33-76-68-104-95m106 90c-26-20-54-47-104-91m107 84c-30-19-52-41-107-85m102 88c-40-32-80-70-106-92m110 91c-29-20-50-43-104-91m104 88L197 31m106 82c-34-23-55-44-100-87m96 85c-34-26-67-57-97-84m98 81c-28-27-62-53-92-85m93 83c-28-21-52-47-96-79m99 76c-38-26-72-58-93-74m91 75c-23-20-43-35-90-80m93 72c-24-17-45-36-88-69m86 72c-27-19-48-39-85-73m85 66c-30-25-64-51-83-71m82 73c-27-24-57-53-81-70m84 67c-19-14-35-30-74-63m73 62c-14-13-33-25-75-67m76 66c-24-26-47-41-75-64m73 59c-14-12-33-27-71-64m70 58c-19-25-51-42-69-59m71 62c-20-19-42-37-66-62m66 60-62-59m65 56c-25-21-53-43-66-56m67 50c-28-19-51-40-69-55m71 55c-23-18-46-38-69-53m67 52c-10-9-29-22-65-56m67 55c-26-23-47-42-64-53m63 51-61-56m62 55c-21-22-48-44-62-55m63 49c-18-12-40-29-55-49m56 51c-13-13-29-25-57-53m61 50c-23-14-41-35-49-44m46 42-48-42m0 2-8-10m9 10-10-8m62 41c-12-5-18-11-35-27mLine truncated
<path stroke="transparent" d="M300 239c-2-10-8-38-8-62 1-24 6-60 11-82s13-41 17-52c3-11 7-12 6-15-1-2-5 0-12-1s-21 0-29-2-13-7-18-10c-4-2-5-7-8-7-2-1-2 2-7 5s-14 10-23 12c-8 3-21 3-28 3-6 1-8-2-9 1-1 2 1 12 2 17l3 12c3 10 10 28 14 46l7 62c2 16 2 27 2 37l-2 25c-1 6-1 11 1 14s4 3 12 3l37-4 32 1m5-6c-3-10-14-34-14-57s8-59 11-81l11-54c4-11 10-13 10-15 1-2 0 4-6 3-7-1-23-8-32-11-8-2-15-4-20-7-5-2-7-9-9-9s2 3-2 7c-5 4-14 12-23 16-10 4-26 6-32 7s-5-3-6-1v12l4 10c4 11 12 32 16 51 5 18 9 45 10 61s-5 27-6 37c-2 10-4 18-3 24 1 7 4 14 7 17 2 2 1-3 7-3 7 0 21 3 33 3s31-4 38-5"/>
</g>
<path fill="none" stroke="#000" strokeLinecap="round" strokeOpacity=".8" strokeWidth="4" d="M301 240c-2-10-9-37-9-62 0-24 4-60 9-83 4-22 13-40 18-50 4-11 8-13 7-15 0-3-3 0-9-1l-28-5-22-7c-5-3-7-8-9-9-3-1 0 1-5 4s-15 10-24 13-23 5-29 6-8-3-8 0c-1 2 2 8 3 13l3 14 13 47c4 18 7 44 9 60s1 25 1 35l-1 26c0 7-4 13-2 16s6 1 14 1h33l37-2m1-1c-2-10-12-37-12-61 0-23 7-60 12-83 5-22 13-40 16-51 4-11 7-12 6-15s-5-1-11-1l-25-3c-8-2-18-6-23-9s-4-9-7-10c-2-1-3 2-8 5s-13 11-21 14-22 5-28 5c-6 1-9-3-10-1s1 8 2 13l4 15c3 10 10 31 14 49s9 43 10 59c1 15-2 24-3 34v27c0 7-2 14 0 17 2 2 4-1 12-2l34-1 37-1"/>
<g strokeLinecap="round">
<path fill="#ff0800" d="M257 42c2 0 7 1 9 3 3 2 5 6 5 10v15c-1 4-3 6-5 8l-9 3c-3-1-6-3-8-7-2-3-3-8-3-13 0-4 1-9 4-12 2-3 8-5 10-5h2m-6-1c3-2 5-2 7 0 3 2 7 6 9 10 1 4-1 9-1 13-1 4-1 8-3 10-2 3-6 6-9 6s-8-2-10-5c-3-3-4-9-4-13s1-8 3-11l6-9c2-1 2 2 2 2"/>
<path fill="none" stroke="#000" strokeWidth="4" d="M257 42c2-1 6 1 8 2 2 2 5 6 6 10s2 9 1 13c0 4-3 9-6 11-2 3-6 4-9 4l-7-8-4-12c0-4 0-9 2-12 1-3 7-6 9-7 1-1 1 1 1 1m5 0c3 1 6 5 8 8s3 8 2 12c0 4-4 9-6 12s-4 5-6 5c-3 0-6-3-9-5-3-3-6-6-7-10s1-11 3-14c2-4 4-7 7-8h10"/>
</g></svg>
)
};
export const SwordColors = {
Bronze: { grip: "#cd7f32", decoration: "#96510d", blade: "#7A420B", bladeFillLight: "#E1B384", title: "Apprentice of Sketchnoting" },
Silver: { grip: "#CECDCC", decoration: "#b2b0b0", blade: "#979595", bladeFillLight: "#F5F5F5", title: "Champion of Spatial Thinking" },
Gold: { grip: "#F5D000", decoration: "#D6B600", blade: "#B89C00", bladeFillLight: "#FFEA70", title: "Hero of Visual Notetaking" },
Platinum: { grip: "#646261", decoration: "#323131", blade: "#000", bladeFillLight: "#8B8988", title: "Legend of Visual Thinking" },
}
export type Rank = keyof typeof SwordColors;
export const excalidrawSword = (rank: Rank) => {
const { grip, decoration, blade, bladeFillLight } = SwordColors[rank];
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 528 1140">
<g fillRule="evenodd" strokeLinecap="round">
<path fill={bladeFillLight} d="m272 979 118-121-80-571-104 1-36 580 104 113-1-2"/>
<path fill="none" stroke="black" strokeWidth="4" d="M271 978c31-30 67-60 117-120M273 979c42-46 89-95 115-120m-1-1c-19-163-41-323-79-569m78 570c-20-165-42-329-78-570m-2 0c-23-2-56-2-102 0m106-1c-34 0-63-1-104 1m0 1c-12 192-21 384-34 574m33-576-31 576m3 2c30 40 71 85 98 112M173 863c38 47 75 87 100 117m1 1s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke={blade} strokeWidth=".5" d="M207 287s0 0 0 0m0 0s0 0 0 0m-2 6 7-5m-6 6 6-7m-6 17c0-8 3-14 10-15m-9 12c4-3 5-8 12-14m-11 20c4-7 6-8 11-20m-13 19c4-6 10-10 15-16m-14 27c4-12 7-14 21-28m-23 24c8-6 13-16 23-27m-23 35c14-11 17-26 31-37m-32 37c10-10 16-17 28-35m-29 39c12-6 18-13 31-37m-28 37c5-8 12-14 33-37m-33 47c7-12 20-27 36-44m-36 42c14-17 26-36 38-44m-36 53c8-11 22-26 37-53m-42 48c14-14 29-29 46-49m-45 60c18-29 42-49 52-62m-52 61c18-22 36-40 52-59m-56 63c15-17 34-27 57-65m-54 66 58-63m-62 71c15-18 35-38 64-74m-62 74c25-30 48-57 62-71m-62 78c22-25 42-52 72-75m-71 72c22-26 47-53 70-75m-69 84c25-30 50-67 70-88m-72 87 74-82m-72 85c30-27 58-58 75-89m-75 94c17-23 37-42 79-90m-82 97c24-21 45-47 86-95m-85 94 84-98m-84 105c22-23 40-48 92-105m-93 106c23-30 47-57 90-105m-90 106c29-25 51-56 95-105m-94 108c19-23 38-47 96-109m-93 118c36-44 72-86 93-114m-98 114c30-35 55-69 102-120M197 408c30-26 58-60 110-119M199 412l108-124M198 421c31-37 66-71 111-129M201 418c32-41 71-82 110-130M196 426c38-43 73-77 119-132M198 426l114-130M196 430c41-47 85-87 120-128M198 431c29-29 53-57 113-133M201 436c25-31 51-61 112-127M198 439c28-30 52-61 114-133M194 442c29-33 63-65 123-134M198 442c42-48 85-97 118-132M195 449c28-35 63-63 122-135M198 449c43-49 88-96 117-131M197 459c45-51 86-103 121-139M199 455c47-49 88-100 117-133M196 463c31-40 67-74 121-133M199 463c44-52 90-106 119-137M195 467c41-39 77-90 118-133M196 472c26-34 54-62 121-141M196 478c45-49 89-102 122-138M198 476c26-28 52-58 117-138M195 481c36-41 69-86 124-140M197 481c26-33 55-66 120-141M192 486c45-46 90-93 123-138M196 490c34-34 64-72 123-142M194 494c42-43 83-93 129-138M194 496c30-32 57-65 127-144M195 506c44-55 88-99 125-146M195 504l123-146M197 506c41-41 80-87 127-142M193 511c40-42 77-84 129-148M195 518c26-37 57-72 127-146M193 517c41-52 85-101 128-146M192 523c42-42 77-85 133-147M192 524c49-60 98-116 129-151M193 527c34-34 69-71 128-147M194 528c45-53 88-104 130-149M192 537c48-48 92-98 129-155M192 537c50-56 99-112 132-152M190 540c47-54 97-107 138-152M192 541c39-49 82-97 131-151M191 546c36-38 68-78 136-153M192 549c51-62 105-123 133-154M194 558c27-42 55-72 134-159M190 557c31-35 59-71 135-155M191 564c49-53 91-108 139-162M190 562l137-155M189 567l142-153M190 568c40-43 76-87 137-157M189 572c50-50 98-108 138-155M190 574l139-158M192 579c58-62 109-126 136-156M190 581c44-48 87-98 139-158M191 591c51-58 95-111 140-164M190 588c35-43 70-84 140-162M188 592c32-32 60-65 139-160M188 595l143-162M191 602c31-43 72-87 141-168M189 600c34-32 64-67 142-161M185 610c54-57 102-117 149-165M187 606c53-58 100-114 146-164M191 610c53-54 106-112 141-166M188 615c37-40 74-81 143-167M185 621c46-46 87-94 150-167M187 621c32-35 64-70 148-169M190 625c45-52 94-112 141-169M188 625c56-62 113-124 146-167M189 633l144-172M187 633c34-40 67-76 146-171M186 643c34-44 71-90 148-172M185 639c60-70 119-135 152-172M187 643c39-43 81-86 147-172M187 646c29-37 61-73 148-172M187 651c52-60 102-117 148-174M185 651l152-171M185 661c59-73 121-137 151-175M187 660c31-44 66-83 150-175M183 667c44-51 84-95 153-176M186 667c35-40 68-78 153-179M183 674c40-47 80-99 158-178M184 671c57-69 116-137 155-175M187 678c39-44 79-97 154-180M185 681c55-62 112-126 153-180M187 687c51-62 110-121 152-178M185 684c29-37 62-73 155-179M181 692c50-63 104-125 163-182M185 692l156-183M187 696c39-46 87-96 154-181M185 697c43-51 84-100 156-180M184 704c48-52 103-110 158-184M185 705c54-69 115-138 159-182M184 710c62-70 131-143 157-183M184 712c59-72 119-143 161-186M184 721c60-71 118-142 159-189M184 719c40-50 86-104 162-186M184 722c41-45 81-91 163-186M182 725c63-76 127-148 163-189M179 728c55-59 110-124 167-188M182 731c45-50 92-104 163-190M179 740c43-47 82-97 169-194M182 738l163-191M184 741c50-62 105-129 166-190M182 743c35-45 74-89 166-189M182 753c33-44 67-87 164-193M180 749c42-43 83-88 169-189M181 757c58-70 125-145 166-195M181 757l166-193M179 763c39-39 73-85 172-193M180 764l169-196M176 771c73-77 138-156 171-196M181 770c47-57 98-115 168-196M182 778c68-77 129-153 171-201M178 777c46-54 93-104 171-197M180 780c54-64 113-132 171-197M180 782c50-56 101-118 171-199M180 789c43-52 90-101 170-197M179 789c43-43 83-90 174-198M178 795c63-64 120-138 173-198M178 795c47-52 93-106 175-201M178 803c42-45 82-96 176-206M177 802c55-62 111-128 176-200M176 809c65-65 124-136 180-201M177 810l176-206M175 817c58-71 118-136 182-203M178 816c69-82 141-162 176-205M175 819c39-40 79-86 180-204M176 822c60-66 117-133 180-208M178 827c40-41 76-91 179-203M176 829c36-47 75-90 180-206M174 835c59-62 114-123 180-211M175 835c36-44 75-86 181-209M176 842c38-48 79-98 182-212M177 842c59-66 115-131 182-210M176 849c44-58 96-119 185-212M176 848c36-46 76-92 183-210M177 853c51-56 99-114 181-210M173 856c59-70 122-140 186-215M176 862c35-44 77-87 184-212M175 862c61-69 120-135 187-216M177 862c74-75 142-156 183-208M177 866c53-58 103-119 183-211M180 866c66-70 131-149 182-211M180 869c44-53 89-104 183-211M180 873c61-70 117-142 185-206M182 871c48-55 94-106 181-208M184 873c41-47 82-97 180-204M185 874c64-75 126-147 179-204M190 879c35-42 72-8Line truncated
<path stroke="black" d="M272 980c39-30 68-66 119-121M273 982c49-46 92-93 114-126m1 0c-26-177-53-358-78-568m78 570c-18-155-40-312-78-569m3-1c-31-1-59 0-106-3m101 3c-29-2-59 0-101-1m-1 1c-10 204-24 410-31 575m32-576c-10 116-16 231-32 576m-2-1c27 25 44 44 105 120M175 865l98 117m2-2s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<path fill="none" stroke={blade} strokeLinecap="round" strokeWidth="4" d="M271 610c1 44 6 217 6 261m-10-263 9 258"/>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#dbc9f3" d="m320 484-4-4-5-3-4-3-4-2-5-2-4-1-5-1h-13l-4 1-5 2-4 2-5 3-4 3-5 4-133 117-5 4-2 2-2 2-2 2-2 2-1 3-1 3-19 127 10 7 10 8 10 7 9 8 8 8 8 8 7 8 7 9 6 9 6 9 5 9 4 9 5 10 3 9 4 10 2 10 15-3 8-2 7-1 7-1 6-1 7-1 6-1 6-1h6l6-1h16l4 1h5l-4-10-2-10-3-10-2-10-3-10-1-10-2-10-1-9-1-10v-10l-1-9v-19l1-10 1-9 1-9 1-10 1-9 2-9 2-9 2-9 3-10 3-9 2-9 4-9 3-9 3-9 4-9 4-9 4-9 9-19 2-3 2-4 1-4 1-5 2-4 1-5v-5l1-6v-23l-1-6-1-7-1-7-2-7"/>
<path fill="none" stroke="black" strokeWidth="4" d="M320 484s0 0 0 0m0 0s0 0 0 0m0 0-4-4m4 4-4-4m0 0-5-3m5 3-5-3m0 0-4-3m4 3-4-3m0 0-4-2m4 2-4-2m0 0-5-2m5 2-5-2m0 0-4-1m4 1-4-1m0 0-5-1m5 1-5-1m0 0h-4m4 0h-4m0 0h-5m5 0h-5m0 0h-4m4 0h-4m0 0-4 1m4-1-4 1m0 0-5 2m5-2-5 2m0 0-4 2m4-2-4 2m0 0-5 3m5-3-5 3m0 0-4 3m4-3-4 3m0 0-5 4m5-4-5 4m0 0L116 600m133-117L116 600m0 0s0 0 0 0m0 0s0 0 0 0m0 0-5 4m5-4-5 4m0 0-2 2m2-2-2 2m0 0-2 2m2-2-2 2m0 0-2 2m2-2-2 2m0 0-2 2m2-2-2 2m0 0-1 3m1-3-1 3m0 0-1 3m1-3-1 3m0 0L82 745m19-127L82 745m0 0s0 0 0 0m0 0s0 0 0 0m0 0 10 7m-10-7 10 7m0 0 10 8m-10-8 10 8m0 0 10 7m-10-7 10 7m0 0 9 8m-9-8 9 8m0 0 8 8m-8-8 8 8m0 0 8 8m-8-8 8 8m0 0 7 8m-7-8 7 8m0 0 7 9m-7-9 7 9m0 0 6 9m-6-9 6 9m0 0 6 9m-6-9 6 9m0 0 5 9m-5-9 5 9m0 0 4 9m-4-9 4 9m0 0 5 10m-5-10 5 10m0 0 3 9m-3-9 3 9m0 0 4 10m-4-10 4 10m0 0 2 10m-2-10 2 10m0 0 15-3m-15 3 15-3m0 0 8-2m-8 2 8-2m0 0 7-1m-7 1 7-1m0 0 7-1m-7 1 7-1m0 0 6-1m-6 1 6-1m0 0 7-1m-7 1 7-1m0 0 6-1m-6 1 6-1m0 0 6-1m-6 1 6-1m0 0h6m-6 0h6m0 0 6-1m-6 1 6-1m0 0h5m-5 0h5m0 0h6m-6 0h6m0 0h5m-5 0h5m0 0 4 1m-4-1 4 1m0 0h5m-5 0h5m0 0-4-10m4 10-4-10m0 0-2-10m2 10-2-10m0 0-3-10m3 10-3-10m0 0-2-10m2 10-2-10m0 0-3-10m3 10-3-10m0 0-1-10m1 10-1-10m0 0-2-10m2 10-2-10m0 0-1-9m1 9-1-9m0 0-1-10m1 10-1-10m0 0v-10m0 10v-10m0 0-1-9m1 9-1-9m0 0v-10m0 10v-10m0 0v-9m0 9v-9m0 0 1-10m-1 10 1-10m0 0 1-9m-1 9 1-9m0 0 1-9m-1 9 1-9m0 0 1-10m-1 10 1-10m0 0 1-9m-1 9 1-9m0 0 2-9m-2 9 2-9m0 0 2-9m-2 9 2-9m0 0 2-9m-2 9 2-9m0 0 3-10m-3 10 3-10m0 0 3-9m-3 9 3-9m0 0 2-9m-2 9 2-9m0 0 4-9m-4 9 4-9m0 0 3-9m-3 9 3-9m0 0 3-9m-3 9 3-9m0 0 4-9m-4 9 4-9m0 0 4-9m-4 9 4-9m0 0 4-9m-4 9 4-9m0 0 9-19m-9 19 9-19m0 0 2-3m-2 3 2-3m0 0 2-4m-2 4 2-4m0 0 1-4m-1 4 1-4m0 0 1-5m-1 5 1-5m0 0 2-4m-2 4 2-4m0 0 1-5m-1 5 1-5m0 0v-5m0 5v-5m0 0 1-6m-1 6 1-6m0 0v-5m0 5v-5m0 0v-6m0 6v-6m0 0v-6m0 6v-6m0 0v-6m0 6v-6m0 0-1-6m1 6-1-6m0 0-1-7m1 7-1-7m0 0-1-7m1 7-1-7m0 0-2-7m2 7-2-7m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#a887e8" d="m434 628 3 4 3 5 2 6 2 5 2 6 1 5 1 7v6l1 13 1 13 1 12 2 13 2 12 3 13 4 12 4 12 4 13 5 12 5 12 7 12 6 11 7 12 8 12 9 12 3 3 2 3 2 3 1 3 1 3 1 3 1 3v5l-1 3-1 2-1 3-1 3-1 2-4 5-61 100-4-9-4-8-4-8-4-8-4-7-5-7-4-7-5-7-4-6-5-6-5-6-5-6-5-5-5-5-5-4-6-5-5-4-6-4-6-4-5-3-6-3-6-3-6-3-6-2-7-2-6-2-7-2-6-1-7-2-7-1h-6l-7-1-4-10-3-10-2-10-3-9-2-10-2-10-1-10-2-9-1-10v-9l-1-10v-19l1-9v-9l1-10 1-9 2-9 1-9 2-10 2-9 3-9 2-9 3-9 3-9 4-9 3-9 4-10 4-9 5-9 4-9 5-9 2-5 2-5 2-5 2-5 1-5 1-5 1-6v-22l-1-6-1-5v-6l-3-12 114 144"/>
<path fill="none" stroke="black" strokeWidth="4" d="M434 628s0 0 0 0m0 0s0 0 0 0m0 0 3 4m-3-4 3 4m0 0 3 5m-3-5 3 5m0 0 2 6m-2-6 2 6m0 0 2 5m-2-5 2 5m0 0 2 6m-2-6 2 6m0 0 1 5m-1-5 1 5m0 0 1 7m-1-7 1 7m0 0v6m0-6v6m0 0 1 13m-1-13 1 13m0 0 1 13m-1-13 1 13m0 0 1 12m-1-12 1 12m0 0 2 13m-2-13 2 13m0 0 2 12m-2-12 2 12m0 0 3 13m-3-13 3 13m0 0 4 12m-4-12 4 12m0 0 4 12m-4-12 4 12m0 0 4 13m-4-13 4 13m0 0 5 12m-5-12 5 12m0 0 5 12m-5-12 5 12m0 0 7 12m-7-12 7 12m0 0 6 11m-6-11 6 11m0 0 7 12m-7-12 7 12m0 0 8 12m-8-12 8 12m0 0 9 12m-9-12 9 12m0 0 3 3m-3-3 3 3m0 0 2 3m-2-3 2 3m0 0 2 3m-2-3 2 3m0 0 1 3m-1-3 1 3m0 0 1 3m-1-3 1 3m0 0 1 3m-1-3 1 3m0 0 1 3m-1-3 1 3m0 0v3m0-3v3m0 0v2m0-2v2m0 0-1 3m1-3-1 3m0 0-1 2m1-2-1 2m0 0-1 3m1-3-1 3m0 0-1 3m1-3-1 3m0 0-1 2m1-2-1 2m0 0-4 5m4-5-4 5m0 0-61 100m61-100-61 100m0 0s0 0 0 0m0 0s0 0 0 0m0 0-4-9m4 9-4-9m0 0-4-8m4 8-4-8m0 0-4-8m4 8-4-8m0 0-4-8m4 8-4-8m0 0-4-7m4 7-4-7m0 0-5-7m5 7-5-7m0 0-4-7m4 7-4-7m0 0-5-7m5 7-5-7m0 0-4-6m4 6-4-6m0 0-5-6m5 6-5-6m0 0-5-6m5 6-5-6m0 0-5-6m5 6-5-6m0 0-5-5m5 5-5-5m0 0-5-5m5 5-5-5m0 0-5-4m5 4-5-4m0 0-6-5m6 5-6-5m0 0-5-4m5 4-5-4m0 0-6-4m6 4-6-4m0 0-6-4m6 4-6-4m0 0-5-3m5 3-5-3m0 0-6-3m6 3-6-3m0 0-6-3m6 3-6-3m0 0-6-3m6 3-6-3m0 0-6-2m6 2-6-2m0 0-7-2m7 2-7-2m0 0-6-2m6 2-6-2m0 0-7-2m7 2-7-2m0 0-6-1m6 1-6-1m0 0-7-2m7 2-7-2m0 0-7-1m7 1-7-1m0 0h-6m6 0h-6m0 0-7-1m7 1-7-1m0 0-4-10m4 10-4-10m0 0-3-10m3 10-3-10m0 0-2-10m2 10-2-10m0 0-3-9m3 9-3-9m0 0-2-10m2 10-2-10m0 0-2-10m2 10-2-10m0 0-1-10m1 10-1-10m0 0-2-9m2 9-2-9m0 0-1-10m1 10-1-10m0 0v-9m0 9v-9m0 0-1-10m1 10-1-10m0 0v-9m0 9v-9m0 0v-10m0 10v-10m0 0 1-9m-1 9 1-9m0 0v-9m0 9v-9m0 0 1-10m-1 10 1-10m0 0 1-9m-1 9 1-9m0 0 2-9m-2 9 2-9m0 0 1-9m-1 9 1-9m0 0 2-10m-2 10 2-10m0 0 2-9m-2 9 2-9m0 0 3-9m-3 9 3-9m0 0 2-9m-2 9 2-9m0 0 3-9m-3 9 3-9m0 0 3-9m-3 9 3-9m0 0 4-9m-4 9 4-9m0 0 3-9m-3 9 3-9m0 0 4-10m-4 10 4-10m0 0 4-9m-4 9 4-9m0 0 5-9m-5 9 5-9m0 0 4-9m-4 9 4-9m0 0 5-9m-5 9 5-9m0 0 2-5m-2 5 2-5m0 0 2-5m-2 5 2-5m0 0 2-5m-2 5 2-5m0 0 2-5m-2 5 2-5m0 0 1-5m-1 5 1-5m0 0 1-5m-1 5 1-5m0 0 1-6m-1 6 1-6m0 0v-5m0 5v-5m0 0v-6m0 6v-6m0 0v-5m0 5v-5m0 0v-6m0 6v-6m0 0-1-6m1 6-1-6m0 0-1-5m1 5-1-5m0 0v-6m0 6v-6m0 0-3-12m3 12-3-12m0 0 114 144M320 484l114 144m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#6342a0" d="m184 884 2 7 2 7 1 8 1 7 1 7 1 7v7l1 7v7l-1 7v7l-1 7v7l-1 7-3 13-3 13-4 14-5 12-5 13-6 13-6 12-6 13-8 12h14l14 1h14l14 1 13 1 14 2 13 2 14 1 13 3 13 2 13 3 13 3 13 4 12 4 13 4 12 5 7 2 6 2 6 1 6 1h5l5-1 6-1 4-2 5-3 5-3 4-4 4-4 2-3 1-2 2-3 2-3 2-4 1-3 2-4 1-4 25-85-5-11-4-11-6-10-5-10-6-9-6-9-6-8-6-8-7-8-7-7-7-6-7-6-8-6-8-5-8-5-8-4-9-4-9-3-9-3-9-2-10-2-10-2-10-1h-32l-11 1-12 2-11 1-12 3-12 3-13 3"/>
<path fill="none" stroke="black" strokeWidth="4" d="M184 884s0 0 0 0m0 0s0 0 0 0m0 0 2 7m-2-7 2 7m0 0 2 7m-2-7 2 7m0 0 1 8m-1-8 1 8m0 0 1 7m-1-7 1 7m0 0 1 7m-1-7 1 7m0 0 1 7m-1-7 1 7m0 0v7m0-7v7m0 0 1 7m-1-7 1 7m0 0v7m0-7v7m0 0-1 7m1-7-1 7m0 0v7m0-7v7m0 0-1 7m1-7-1 7m0 0v7m0-7v7m0 0-1 7m1-7-1 7m0 0-3 13m3-13-3 13m0 0-3 13m3-13-3 13m0 0-4 14m4-14-4 14m0 0-5 12m5-12-5 12m0 0-5 13m5-13-5 13m0 0-6 13m6-13-6 13m0 0-6 12m6-12-6 12m0 0-6 13m6-13-6 13m0 0-8 12m8-12-8 12m0 0h14m-14 0h14m0 0 14 1m-14-1 14 1m0 0h14m-14 0h14m0 0 14 1m-14-1 14 1m0 0 13 1m-13-1 13 1m0 0 14 2m-14-2 14 2m0 0 13 2m-13-2 13 2m0 0 14 1m-14-1 14 1m0 0 13 3m-13-3 13 3m0 0 13 2m-13-2 13 2m0 0 13 3m-13-3 13 3m0 0 13 3m-13-3 13 3m0 0 13 4m-13-4 13 4m0 0 12 4m-12-4 12 4m0 0 13 4m-13-4 13 4m0 0 12 5m-12-5 12 5m0 0 7 2m-7-2 7 2m0 0 6 2m-6-2 6 2m0 0 6 1m-6-1 6 1m0 0 6 1m-6-1 6 1m0 0h5m-5 0h5m0 0 5-1m-5 1 5-1m0 0 6-1m-6 1 6-1m0 0 4-2m-4 2 4-2m0 0 5-3m-5 3 5-3m0 0 5-3m-5 3 5-3m0 0 4-4m-4 4 4-4m0 0 4-4m-4 4 4-4m0 0 2-3m-2 3 2-3m0 0 1-2m-1 2 1-2m0 0 2-3m-2 3 2-3m0 0 2-3m-2 3 2-3m0 0 2-4m-2 4 2-4m0 0 1-3m-1 3 1-3m0 0 2-4m-2 4 2-4m0 0 1-4m-1 4 1-4m0 0 25-85m-25 85 25-85m0 0s0 0 0 0m0 0s0 0 0 0m0 0-5-11m5 11-5-11m0 0-4-11m4 11-4-11m0 0-6-10m6 10-6-10m0 0-5-10m5 10-5-10m0 0-6-9m6 9-6-9m0 0-6-9m6 9-6-9m0 0-6-8m6 8-6-8m0 0-6-8m6 8-6-8m0 0-7-8m7 8-7-8m0 0-7-7m7 7-7-7m0 0-7-6m7 6-7-6m0 0-7-6m7 6-7-6m0 0-8-6m8 6-8-6m0 0-8-5m8 5-8-5m0 0-8-5m8 5-8-5m0 0-8-4m8 4-8-4m0 0-9-4m9 4-9-4m0 0-9-3m9 3-9-3m0 0-9-3m9 3-9-3m0 0-9-2m9 2-9-2m0 0-10-2m10 2-10-2m0 0-10-2m10 2-10-2m0 0-10-1m10 1-10-1m0 0h-10m10 0h-10m0 0h-11m11 0h-11m0 0h-11m11 0h-11m0 0-11 1m11-1-11 1m0 0-12 2m12-2-12 2m0 0-11 1m11-1-11 1m0 0-12 3m12-3-12 3m0 0-12 3m12-3-12 3m0 0-13 3m13-3-13 3m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill="#390f8c" d="m82 745 13 9 6 5 6 4 6 5 5 5 6 5 5 5 5 6 5 5 5 6 5 6 4 6 4 6 4 6 4 6 3 6 4 7 3 6 2 7 3 7 2 7 2 7 2 7 1 6 2 7 1 7 2 6 1 7v7l1 6v33l-1 7-1 7-1 6-1 7-1 6-2 7-1 7-2 6-3 7-2 6-3 7-2 7-3 6-4 7-3 7-3 6-4 7-4 7-4 7-5 6L16 970l-3-4-4-3-2-4-3-4-1-4-2-5-1-4v-9l1-5v-5l2-5 2-5 2-6 3-5 3-6 69-151"/>
<path fill="none" stroke="black" strokeWidth="4" d="M82 745s0 0 0 0m0 0s0 0 0 0m0 0 13 9m-13-9 13 9m0 0 6 5m-6-5 6 5m0 0 6 4m-6-4 6 4m0 0 6 5m-6-5 6 5m0 0 5 5m-5-5 5 5m0 0 6 5m-6-5 6 5m0 0 5 5m-5-5 5 5m0 0 5 6m-5-6 5 6m0 0 5 5m-5-5 5 5m0 0 5 6m-5-6 5 6m0 0 5 6m-5-6 5 6m0 0 4 6m-4-6 4 6m0 0 4 6m-4-6 4 6m0 0 4 6m-4-6 4 6m0 0 4 6m-4-6 4 6m0 0 3 6m-3-6 3 6m0 0 4 7m-4-7 4 7m0 0 3 6m-3-6 3 6m0 0 2 7m-2-7 2 7m0 0 3 7m-3-7 3 7m0 0 2 7m-2-7 2 7m0 0 2 7m-2-7 2 7m0 0 2 7m-2-7 2 7m0 0 1 6m-1-6 1 6m0 0 2 7m-2-7 2 7m0 0 1 7m-1-7 1 7m0 0 2 6m-2-6 2 6m0 0 1 7m-1-7 1 7m0 0v7m0-7v7m0 0 1 6m-1-6 1 6m0 0v7m0-7v7m0 0v7m0-7v7m0 0v6m0-6v6m0 0v7m0-7v7m0 0v6m0-6v6m0 0-1 7m1-7-1 7m0 0-1 7m1-7-1 7m0 0-1 6m1-6-1 6m0 0-1 7m1-7-1 7m0 0-1 6m1-6-1 6m0 0-2 7m2-7-2 7m0 0-1 7m1-7-1 7m0 0-2 6m2-6-2 6m0 0-3 7m3-7-3 7m0 0-2 6m2-6-2 6m0 0-3 7m3-7-3 7m0 0-2 7m2-7-2 7m0 0-3 6m3-6-3 6m0 0-4 7m4-7-4 7m0 0-3 7m3-7-3 7m0 0-3 6m3-6-3 6m0 0-4 7m4-7-4 7m0 0-4 7m4-7-4 7m0 0-4 7m4-7-4 7m0 0-5 6m5-6-5 6m0 0L16 970m128 126L16 970m0 0s0 0 0 0m0 0s0 0 0 0m0 0-3-4m3 4-3-4m0 0-4-3m4 3-4-3m0 0-2-4m2 4-2-4m0 0-3-4m3 4-3-4m0 0-1-4m1 4-1-4m0 0-2-5m2 5-2-5m0 0-1-4m1 4-1-4m0 0v-4m0 4v-4m0 0v-5m0 5v-5m0 0 1-5m-1 5 1-5m0 0v-5m0 5v-5m0 0 2-5m-2 5 2-5m0 0 2-5m-2 5 2-5m0 0 2-6m-2 6 2-6m0 0 3-5m-3 5 3-5m0 0 3-6m-3 6 3-6m0 0 69-151M13 896l69-151m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<path fill="none" stroke="#CECDCC" strokeLinecap="round" strokeWidth="10" d="M86 746s0 0 0 0m0 0s0 0 0 0m0 0 11 8m-11-8 11 8m0 0 10 8m-10-8 10 8m0 0 10 9m-10-9 10 9m0 0 8 8m-8-8 8 8m0 0 8 8m-8-8 8 8m0 0 8 8m-8-8 8 8m0 0 6 9m-6-9 6 9m0 0 7 8m-7-8 7 8m0 0 5 8m-5-8 5 8m0 0 6 9m-6-9 6 9m0 0 4 8m-4-8 4 8m0 0 4 9m-4-9 4 9m0 0 4 9m-4-9 4 9m0 0 3 9m-3-9 3 9m0 0 3 9m-3-9 3 9m0 0 3 9m-3-9 3 9m0 0 7-2m-7 2 7-2m0 0 8-1m-8 1 8-1m0 0 7-2m-7 2 7-2m0 0 7-1m-7 1 7-1m0 0 7-1m-7 1 7-1m0 0 7-1m-7 1 7-1m0 0 7-1m-7 1 7-1m0 0 6-1m-6 1 6-1m0 0h6m-6 0h6m0 0 6-1m-6 1 6-1m0 0h6m-6 0h6m0 0 5-1m-5 1 5-1m0 0h5m-5 0h5m0 0h5m-5 0h5m0 0h4m-4 0h4m0 0h4m-4 0h4m0 0-3-11m3 11-3-11m0 0-3-10m3 10-3-10m0 0-3-10m3 10-3-10m0 0-3-10m3 10-3-10m0 0-2-10m2 10-2-10m0 0-2-10m2 10-2-10m0 0-1-10m1 10-1-10m0 0-2-9m2 9-2-9m0 0-1-10m1 10-1-10m0 0v-10m0 10v-10m0 0-1-9m1 9-1-9m0 0v-10m0 10v-10m0 0v-9m0 9v-9m0 0 1-9m-1 9 1-9m0 0 1-10m-1 10 1-10m0 0 1-9m-1 9 1-9m0 0 1-9m-1 9 1-9m0 0 1-10m-1 10 1-10m0 0 2-9m-2 9 2-9m0 0 2-9m-2 9 2-9m0 0 3-9m-3 9 3-9m0 0 2-9m-2 9 2-9m0 0 3-9m-3 9 3-9m0 0 3-9m-3 9 3-9m0 0 3-9m-3 9 3-9m0 0 4-9m-4 9 4-9m0 0 3-9m-3 9 3-9m0 0c2-2 3-5 4-9m-4 9 4-9m0 0 5-9m-5 9 5-9m0 0 4-8m-4 8 4-8m0 0 5-9m-5 9 5-9m0 0 4-11m-4 11 4-11m0 0 4-11m-4 11 4-11m0 0 4-10m-4 10 4-10m0 0 2-11m-2 11 2-11"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill="#FFF6F0" d="m153 288-19-25 21-20 199-5 23 21-24 28-201 3-4-4"/>
<path fill="none" stroke="black" strokeWidth="4" d="M153 290c-4-9-13-13-20-29m19 25c-8-8-15-18-22-23m4-5c2-6 16-15 20-20m-23 22c10-7 18-16 27-22m-5 2 205-1m-203-2c57-1 114-4 201-2m2 3 24 23m-24-24c3 7 11 10 20 21m0 0c-8 6-9 21-24 24m25-20c-3 2-10 8-22 21m-1 4c-70-1-146 1-207 1m208-5c-64 2-131 3-205 3m-1 1s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<path fill="none" stroke="#E6E6E5" strokeLinecap="round" strokeWidth="10" d="M455 1003s0 0 0 0m0 0s0 0 0 0m0 0-5-10m5 10-5-10m0 0-5-10m5 10-5-10m0 0-5-10m5 10-5-10m0 0-6-9m6 9-6-9m0 0-5-9m5 9-5-9m0 0-6-8m6 8-6-8m0 0-7-8m7 8-7-8m0 0-6-8m6 8-6-8m0 0-6-7m6 7-6-7m0 0-7-6m7 6-7-6m0 0-7-6m7 6-7-6m0 0-7-6m7 6-7-6m0 0-8-5m8 5-8-5m0 0-8-5m8 5-8-5m0 0-8-5m8 5-8-5m0 0-8-4m8 4-8-4m0 0-8-3m8 3-8-3m0 0-9-3m9 3-9-3m0 0-9-3m9 3-9-3m0 0-9-2m9 2-9-2m0 0-9-2m9 2-9-2m0 0-10-1m10 1-10-1m0 0-10-1m10 1-10-1m0 0h-10m10 0h-10m0 0h-10m10 0h-10m0 0h-11m11 0h-11m0 0-11 1m11-1-11 1m0 0-11 1m11-1-11 1m0 0-12 2m12-2-12 2m0 0-12 2m12-2-12 2m0 0-12 2m12-2-12 2m0 0-12 3m12-3-12 3m0 0 2 8m-2-8 2 8m0 0 1 7m-1-7 1 7m0 0 2 7m-2-7 2 7m0 0 1 7m-1-7 1 7m0 0 1 7m-1-7 1 7m0 0 1 7m-1-7 1 7m0 0v7m0-7v7m0 0v6m0-6v6m0 0v7m0-7v7m0 0v7m0-7v7m0 0v6m0-6v6m0 0v7m0-7v7m0 0-2 12m2-12-2 12m0 0-2 13m2-13-2 13m0 0-3 12m3-12-3 12m0 0-4 12m4-12-4 12m0 0-4 12m4-12-4 12m0 0-5 12m5-12-5 12m0 0-5 12m5-12-5 12m0 0-6 13m6-13-6 13m0 0-6 12m6-12-6 12m0 0-7 12m7-12-7 12"/>
<path fill="none" stroke="#6d6d6d" strokeLinecap="round" strokeWidth="10" d="M185 883s0 0 0 0m0 0s0 0 0 0m0 0 3 14m-3-14 3 14m0 0 3 13m-3-13 3 13m0 0 1 13m-1-13 1 13m0 0 1 13m-1-13 1 13m0 0 1 13m-1-13 1 13m0 0-1 13m1-13-1 13m0 0-1 13m1-13-1 13m0 0-2 12m2-12-2 12m0 0-3 13m3-13-3 13m0 0-3 13m3-13-3 13m0 0-4 12m4-12-4 12m0 0-5 13m5-13-5 13m0 0-6 13m6-13-6 13m0 0-6 12m6-12-6 12m0 0-7 13m7-13-7 13m0 0-8 13m8-13-8 13"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill={decoration} d="m148 291-18-30 23-17 206-3 17 19-22 22-204 9v-5"/>
<path fill="none" stroke="transparent" strokeWidth=".5" d="M153 289c-5-11-10-12-24-27m21 29c-3-9-9-16-20-30m-1 1c13-6 16-13 26-21m-22 20c5-6 14-14 25-20m-1 2c67-5 137-8 198-6m-199 2c67 3 132 3 203-1m2 1c3 6 15 17 19 19m-23-22c9 12 17 19 21 24m-2 0c-3 9-8 12-15 29m18-29-20 27m-4-1-206 4m209-5c-64 0-131 3-207 2m0 2s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"/>
</g>
<path fill="none" stroke="black" strokeLinecap="round" strokeWidth="4" d="M153 284c-6-2-17-14-22-25m21 29-21-27m4-1c2-7 8-10 21-24m-26 24c8-7 17-12 27-22m-1 1c75-6 140-6 202-3m-201 1c41 4 81 3 202-2m-3-1c10 7 11 8 25 27m-23-23c5 3 8 9 19 24m-1 0c-8 6-10 19-21 23m25-27c-5 6-9 13-24 25m1 2c-64 1-132 2-206-1m207 0c-56 0-112-2-208 2m1 1s0 0 0 0m0 0s0 0 0 0"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill={bladeFillLight} d="M298 233c-2-10-12-36-12-60 1-24 8-62 13-84s13-37 17-48 7-13 7-16c-1-3-2-2-9-2-7-1-23 1-31-1-9-2-14-9-18-12l-11-6c-3 0 0 0-5 3s-17 12-26 15-19 2-25 2c-7 0-10-4-12-1-1 3 4 13 5 18 2 5 2 2 5 12l11 47 8 62c2 16 4 23 4 32 0 10-4 18-5 25 0 7 0 13 2 17s4 4 12 4l36-3 35-4"/>
<path fill="none" stroke="black" strokeWidth="4" d="M297 236c-1-10-8-38-8-62s5-61 9-83 12-40 16-51c3-11 7-12 7-14-1-3-2-1-8-1-6-1-19-1-27-4-9-2-18-8-23-11s-6-7-8-8c-3 0-2 1-7 4s-14 12-23 15c-9 4-22 4-29 5-6 0-8-3-9-1s2 10 4 14l3 15c3 10 11 29 15 46l7 60c2 15 1 25 1 35l-1 26c0 7-3 14-1 17 2 2 6 0 14 0h34l35-2m1 0c-2-11-10-37-10-61-1-24 4-61 8-83 5-22 13-39 17-51 4-11 9-15 8-18 0-3-5 2-11 1l-24-3c-8-2-17-5-22-8-5-4-6-11-8-12-3-1-3 1-8 4-6 3-15 11-24 14-9 4-24 5-30 6s-7-4-8-1c-1 2 2 10 3 15l4 14 12 48c4 18 11 43 12 59 2 16-2 25-2 35l-1 26c0 8-1 16 1 18 2 3 4-2 12-2l36-1h34"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill={bladeFillLight} d="M293 232c-1-10-6-38-5-61 1-24 7-58 11-80 4-21 12-38 15-50 4-12 9-17 8-19-1-3-9 6-16 5-6 0-13-6-21-8s-20-2-25-4c-5-3-3-12-6-13s-6 5-11 8c-5 2-10 5-18 7s-26 3-32 5c-7 2-5 4-6 7l3 9c0 4-1 2 1 14 2 11 6 35 11 53 4 17 14 37 16 52 2 14-4 26-5 36 0 10 3 16 3 24s-5 21-3 24 9-4 17-5c9-2 20-2 31-2l35-1"/>
<path fill="none" stroke="black" d="M298 234c-1-11-11-36-12-60 0-24 5-62 9-84s11-36 15-47 11-14 11-17c1-3-2 1-9 0l-31-8c-9-3-15-3-20-6-4-3-6-12-9-12s-1 6-6 9-14 8-23 11l-29 4c-6 1-7-1-8 1-1 3-1 10 1 14 1 5 5 3 8 13s5 30 9 48c3 17 9 41 11 57 2 17 2 30 2 40l-2 23c-1 7-3 15-1 18 3 2 7-1 14-1 8 0 21 3 32 2 12 0 29-6 35-6m1 6c-1-10-12-37-12-62a493 493 0 0 1 26-139c4-10 9-8 9-10-1-2-5-2-11-3s-19-1-27-3l-22-11c-4-3-1-6-3-7-2 0-3 3-8 5-6 3-16 11-25 13-8 2-18 0-24 0-6 1-11-1-12 1-1 3 4 11 6 16 2 4 2 0 4 11l8 52 7 56c2 16 2 30 2 41l-2 21c0 6 2 11 4 13 3 3 3 0 11 1l34 3 33 1"/>
</g>
<g fillOpacity=".8" fillRule="evenodd" strokeLinecap="round" strokeOpacity=".8">
<path fill={grip} d="M298 233c-1-10-10-35-10-59 0-23 6-60 10-83 5-23 13-41 16-52l4-13c0-3 0-3-6-3-5-1-21 1-29-1-9-2-15-8-20-11l-11-8c-3-1 1-1-4 2l-25 13-27 9c-6 1-8-4-9-3-1 2 0 9 1 14s0 7 4 18c3 10 12 25 16 43 4 17 6 43 7 59 2 16 2 25 2 36l-2 28c-1 7-1 12 1 14s4-1 12-1l33 1 37-3"/>
<path fill="none" stroke="black" strokeWidth="4" d="M297 235c-2-10-10-37-10-61-1-24 5-60 9-82 5-22 14-40 18-51s8-13 7-16c0-3-4-2-11-3-6 0-18 0-26-2s-17-7-22-10-6-7-8-7c-3-1-2 1-7 3-5 3-15 10-23 13-9 4-22 5-28 6-7 1-9-2-10 0s3 9 4 13l3 15c3 10 10 28 14 46s8 45 10 61v35l-2 25c0 7-3 14-1 17s6 1 13 1l33-2 37-1m-1-1c-3-10-11-35-11-59 1-24 9-62 14-85 4-23 12-40 15-51l6-17c-1-2-3 3-9 2a123 123 0 0 1-50-15c-5-3-3-7-5-7-3-1-3 1-8 4s-15 11-24 14-23 4-30 5c-6 1-8-3-8-1-1 2 3 9 4 14l3 14c3 10 11 30 15 48l8 61c1 16 0 25-1 35l-1 24c0 7-1 16 1 19s4-1 11-2l34 1 37-3"/>
</g>
<g strokeLinecap="round">
<path fill={decoration} d="M256 36c3 0 6 2 8 5s4 9 4 13l-3 12c-2 4-5 7-8 8s-6 1-8-1c-3-2-6-6-7-10s-2-9-1-13 4-8 6-10c2-3 7-4 8-4 2-1 1 1 1 1m1-1c3 0 6 4 8 7l3 12c0 5-2 10-4 13-1 3-4 6-7 7-3 0-8-1-10-4-3-2-5-6-5-10V48c1-4 4-8 6-10 3-2 7-2 9-2v1"/>
<path fill="none" stroke="black" strokeWidth="4" d="M252 37c2-1 7-1 9 1l5 10c1 4 2 9 1 13s-4 8-6 11c-3 2-6 3-8 2-3 0-7-3-9-6s-3-8-3-12c-1-4 1-10 3-13s7-5 8-6v-1m0 0c2-1 6 0 9 2 2 2 5 6 6 10v14c-1 4-4 7-6 9-3 2-6 4-9 3-3 0-6-3-8-7-2-3-4-8-4-12s2-9 4-12l8-7v1"/>
</g>
<g fillRule="evenodd" strokeLinecap="round">
<path fill="hsla(30, 2%, 62%, 1)" d="m275 624-12-21c-4-9-7-22-12-30s-12-12-19-18l-23-19c-6-4-10-2-12-5-2-4 0-5 0-16l4-53 8-154c2-28-1-14 2-16s8 3 16 3c7 0 25-6 30-3s-3-3-2 22l7 125 9 187"/>
<path fill="none" stroke="black" strokeWidth="4" d="m273 626-9-24c-4-9-6-18-11-26l-21-23-23-14c-5-4-9-4-11-7-2-4-2-2-2-14l3-57 9-154c1-28-1-11 2-13 3-3 11 0 18 0 8-1 25-5 29-2s-3-5-2 19l7 127 12 187m0 0-11-25c-4-9-6-18-11-26-5-7-13-14-21-20-7-6-18-11-23-15-6-3-7-1-9-5s-2-5-2-17c-1-12-1-21 1-56l11-152c3-28-1-14 2-16s10 2 17 2c8-1 24-6 28-4 4 3-2-5-1 19l6 127 14 188"/>
</g>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke={blade} strokeWidth=".3" d="M208 292s0 0 0 0m0 0s0 0 0 0m0 3 1-1m-1 1 1-1m-1 5 2-4m-3 4 3-4m-3 5c2 0 2-3 7-6m-6 7c0-2 3-3 5-6m-8 12c4-5 5-8 13-14m-11 12c3-5 6-8 9-10m-11 11c3 3 8-2 12-11m-10 13 11-15m-14 16c5-9 13-9 16-17m-11 19c1-5 6-8 13-15m-13 17c3-2 8-15 16-22m-19 22 18-17m-17 20 20-19m-18 22c4-10 12-18 19-26m-18 30c0-12 13-21 17-33m-19 29c6-6 9-13 20-24m-18 29c7-7 10-19 19-31m-23 30c8-8 18-19 25-29m-25 34c13-16 18-21 32-31m-31 31c6-12 16-20 27-35m-28 41c11-11 11-20 33-40m-34 36 35-36m-36 37c18-13 30-31 39-40m-37 42c9-9 21-21 33-40m-36 41c20-9 29-31 42-44m-40 48c11-11 21-21 38-43m-41 45c13-11 21-22 48-44m-44 43 41-45m-42 52c12-20 34-34 46-52m-47 49c13-13 27-25 46-49m-46 54c9-18 21-31 51-52m-48 51 46-55m-46 60c15-16 25-38 44-62m-48 59c14-15 30-30 50-56m-47 63c12-15 23-27 46-63m-47 61 50-59m-48 64c19-26 40-50 50-61m-53 58 54-62m-52 69c15-21 37-46 48-61m-49 58 54-63m-54 68c15-20 30-40 51-61m-50 59c16-23 35-44 50-59m-51 64c11-14 24-27 48-59m-48 57 51-62m-55 65c16-13 24-25 57-57m-55 57c12-11 22-27 53-60m-50 61c21-18 40-42 54-60m-56 61 54-59m-55 60c20-11 35-28 51-60m-49 63c16-18 30-39 50-62m-52 63c13-16 30-27 51-62m-51 65c14-19 29-33 53-61m-55 60c18-13 30-25 59-56m-57 60c12-13 28-30 53-62m-56 63c27-18 46-44 60-62m-59 64c17-14 33-31 58-61m-52 66c20-27 41-51 54-68m-56 65c8-14 24-26 52-60m-54 62c19-16 34-31 58-60m-59 62 56-63m-55 70c15-26 32-41 51-67m-52 63c21-22 42-47 57-60m-53 65c12-15 21-26 48-67m-50 65c11-15 22-28 54-60m-54 64c12-20 33-39 51-60m-53 61c17-20 36-44 57-65m-59 66c15-11 23-23 56-65m-52 68c11-18 25-32 54-65m-54 69c20-25 39-41 51-64m-51 63c17-20 35-41 55-67m-58 68c23-21 43-45 59-66m-58 66c15-19 30-37 57-65m-55 72c18-21 37-44 54-69m-56 68 55-65m-57 68c20-24 41-45 59-63m-57 60c19-21 36-39 56-65m-55 68c14-17 28-26 58-65m-61 66 57-65m-54 69c17-16 26-33 57-68m-59 66c18-22 40-43 58-64m-55 72c12-15 19-34 57-72m-61 71 60-68m-61 67c23-20 43-41 61-61m-60 62c18-19 34-37 58-67m-59 70c14-18 35-35 64-66m-64 68c24-27 43-48 58-67m-55 67c20-23 46-52 54-63m-54 67c19-26 37-45 58-68m-57 73c11-20 33-44 56-72m-58 68c14-17 31-32 59-67m-61 71c20-16 41-36 60-69m-57 71c21-27 41-50 59-68m-57 73c18-22 30-41 59-72m-61 69 60-70m-59 73c11-20 28-36 57-71m-61 73c21-23 40-44 62-72m-58 74c12-18 32-40 56-67m-58 66c15-19 32-37 57-70m-56 72 56-67m-59 70 61-70m-63 76c26-29 50-63 60-77m-56 74 61-72m-64 77c15-20 36-36 64-77m-62 73c22-26 49-52 62-71m-62 77c15-15 27-38 59-75m-60 73 62-71m-60 75c17-20 30-33 57-74m-60 73c15-15 33-33 64-71m-65 78c14-21 30-42 67-75m-64 71c16-15 29-33 60-70m-62 78c21-28 33-46 60-79m-61 74c23-23 42-49 63-71m-65 78c24-33 47-53 70-75m-66 71c26-27 53-57 61-73m-63 76c24-21 39-47 61-69m-60 69 64-72m-65 74c13-15 30-35 64-68m-63 70c19-19 35-37 65-71m-64 73c24-21 41-48 60-71m-63 71c25-29 50-56 65-71m-62 73c19-18 35-39 60-74m-62 76c15-19 33-39 64-71m-66 78c18-27 41-43 71-73m-69 71c26-29 53-58 64-74m-62 80c17-28 37-51 66-78m-68 76c15-17 25-32 66-78m-68 80c22-17 34-37 64-75m-63 73 67-71m-69 75c23-26 49-48 66-73m-64 74c12-15 26-32 66-77m-68 79c20-16 30-33 68-75m-64 76 65-77m-70 84c19-15 29-35 73-79m-71 77c26-32 51-57 70-79m-71 82c24-20 36-44 73-77m-71 76c21-28 47-54 69-77m-68 82c17-26 38-50 66-76m-67 75c16-23 35-40 67-78m-64 79c19-22 43-49 69-76m-73 76 69-76m-70 83c27-31 53-60 69-81m-67 80c19-22 34-43 67-78m-65 83c16-24 36-46 69-83m-72 79c20-24 41-51 70-76m-68 81c25-35 55-64 64-79m-65 75c27-29 54-56 67-75m-64 79c21-31 41-51 63-81m-65 80c17-17 33-31 69-74m-70 79c19-21 29-36 66-80m-64 79 65-76m-60 79c12-22 35-42 63-79m-64 74 65-73m-61 77c19-27 35-47 59-72m-63 73c23-28 43-52 65-76m-61 75c11-22 34-43 58-72m-62 71c20-18 36-39 64-68m-63 68 62-65m-60 68c11-16 26-33 59-70m-59 69c16-14 28-29 57-67m-53 70 57-68m-53 72c11-25 23-35 51-71m-56 67c15-19 33-37 56-66m-50 70c20-30 39-55 52-64m-55 62 55-65m-50 66c12-17 25-27 46-65m-50 64c20-24 36-46 54-60m-52 59c20-16 37-33 56-60m-58 60c18-18 32-35 52-57m-49 60 52-58m-50 57c14-15 26-32 47-57m-44 61c9-19 25-29 43-56m-46 52c19-19 34-35 49-55m-47 57c10-7 16-24 44-51m-44 51c16-15 29-34 46-52m-47 54c12-17 27-30 49-55m-46 54c10-13 23-26 45-51m-47 56c19-25 39-40 44-52m-40 50c18-22 34-40 43-53m-41 52c5-11 19-22 43-44m-45 44c11-10 20-22 42-47m-41 49c14-10 21-18 44-51m-42 50 43-48m-39 50 37-47m-38 48c8-14 18-22 40-46m-39 50c4-9 15-25 35-48m-35 43c10-13 23-26 38-41m-33 45c12-23 30-32 31-47m-35 44c14-14 28-31 36-41m-36 43c9-13 24-22 39-42m-37 41c11-14 26-25 33-39m-30 46c8-13 18-24 34-40m-36 37 33-39m-33 43c18-22 24-32 35-44m-35 40c9-8 19-16 35-36m-29 35c3-3 12-19 29-30m-34 31c13-9 22-20 36-33m-33 40c11-12 24-31 31-40m-31 39c8-12 18-20 29-38m-24 40c3-10 13-19 26-39m-28 35c3-5 13-14 29-31m-27 37c11-13 18-26 27-36m-30 33 28-33m-24 30c9-8 20-15 21-28m-23 33c7-8 14-14 28-31m-25 33c7-10 8-18 24-29m-26 27 25-30m-23 30c11-9 15-19 20-30m-18 32c4-8 11-13 22-28m-24 27c13-8 21-19 24-25m-24 26c10-6 18-17 25-26m-26 25c10-7 18-8 23-18m-20 23c9-9 17-20 23-27m-20 28c10-12 14-19 20-24m-21 23c6-4 8-10 21-24m-20 23c7 0 12-9 16-17m-17 19c8-6 16-16 20-20m-14 20c3 1 2-8 12-17m-14 20c5-7 8-12 18-21m-21 26c1Line truncated
<path stroke="transparent" strokeWidth=".5" d="m275 627-11-23c-4-9-10-23-15-31s-10-11-17-17l-24-19c-6-3-8 2-10-1-2-4-3-7-3-19l3-56 10-153c2-27-4-11 0-14 3-2 15-1 22-1 8 0 19-3 23-1 5 3 1-6 2 18l8 131 11 184m-2 1-9-26c-3-8-3-18-8-25-6-7-16-10-23-16s-14-18-19-22c-6-4-10 1-12-2-3-4-3-9-4-21-1-13-4-20-2-54 1-35 7-127 9-155s0-10 4-12c5-2 16 2 24 2 8-1 22-8 25-4 4 3-2 0-1 25 0 25 2 74 6 125 3 52 12 152 13 183"/>
</g>
<path fill="none" stroke="black" strokeLinecap="round" strokeWidth="4" d="m275 627-13-26c-4-9-5-17-10-25s-12-15-19-21l-23-15c-6-3-9-3-11-7-3-4-3-4-3-16l4-55 8-154c1-28-1-12 3-14 3-3 10 0 18 0 7 0 23-5 28-2 4 4-1-3 0 21l6 127 12 186m-1 0-10-24c-3-9-8-20-13-28s-11-13-18-19l-25-18c-5-3-6-2-8-5s-3-1-3-13c-1-12 0-22 2-57l10-155c2-28-4-12-1-14 4-2 13 1 20 2 8 0 22-3 27 0s1-7 2 18l5 126c3 52 12 155 13 186"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill={bladeFillLight} d="M273 611c1-4 5-21 9-31 5-10 12-22 18-29 6-8 11-12 18-18 7-5 20-9 24-15 3-5 0 13-5-17l-24-161c-4-31-4-17-5-23-1-7 1-12 1-17-1-4-2-9-4-10s-4 4-8 4l-17-2-15 1c-5 0-11 1-12 3s5 2 6 9c0 6-4-7-2 31 1 38 10 160 12 198l1 31 3 45"/>
<path fill="none" stroke="black" strokeWidth="4" d="M270 610c2-5 6-21 11-30 5-10 11-21 17-29l22-18c7-6 18-8 21-14 2-6 2 9-3-21l-25-158-4-25v-14c-1-3-2-7-4-9s-5-1-9-1l-16 2-13 1c-5 0-9-2-11 0-1 2 2 5 2 12 0 8-2-6 0 32l9 197 2 28 2 47m1 2c1-6 4-24 8-34s10-18 17-26 17-16 24-22c6-5 15-6 18-11s5 12 0-18l-25-163c-5-31-1-18-2-23l-5-12c-1-4 0-10-2-12-1-2-5 0-9 1l-17 1h-12c-4 0-10-2-11 1-2 2 2 4 3 11 0 8-2-7 0 31l10 199c2 38-1 16-1 28l1 47"/>
</g>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke={blade} strokeWidth=".5" d="m254 299 7-5m-7 5 7-5m-4 8 4-8m-4 8 4-8m-7 11c4-4 6-4 12-11m-12 11 12-11m-9 13c4-2 4-6 9-13m-9 13 9-13m-11 17c2-5 8-9 17-17m-17 17 17-17m-14 19 14-19m-14 19 14-19m-17 22 23-23m-23 23 23-23m-20 26 20-26m-20 26 20-26m-23 30c10-13 21-22 28-29m-28 29c8-11 17-19 28-29m-25 31c7-9 18-20 25-31m-25 31 25-31m-28 34 33-35m-33 35 33-35m-30 38c9-11 18-20 30-38m-30 38 30-38m-32 41 38-41m-38 41 38-41m-35 43c13-14 27-30 35-43m-35 43 35-43m-38 46c9-10 21-25 44-47m-44 47 44-47m-41 50c11-16 24-32 41-50m-41 50 41-50m-43 53c16-16 32-33 46-51m-46 51c12-16 28-30 46-51m-43 54 43-54m-43 54c9-13 19-24 43-54m-46 57c21-21 37-42 51-56m-51 56 51-56m-48 58c11-12 23-26 48-58m-48 58 48-58m-51 62 53-58m-53 58c14-14 25-29 53-58m-50 61c17-23 38-42 50-61m-50 61 50-61m-53 64 53-59m-53 59c20-21 39-41 53-59m-50 61c16-15 29-35 50-61m-50 61 50-61m-53 64 54-58m-54 58c13-12 24-26 54-58m-51 61 51-61m-51 61 51-61m-53 64c18-21 39-39 54-59m-54 59c20-21 39-41 54-59m-51 62c15-20 33-42 51-62m-51 62c18-23 35-45 51-62m-54 65 54-59m-54 59c17-21 35-41 54-59m-51 61c18-20 34-39 51-61m-51 61 51-61m-53 64c14-17 30-31 54-59m-54 59 54-59m-51 62 51-62m-51 62 51-62m-55 66c22-21 40-43 56-61m-56 61 56-61m-53 63c18-19 34-38 53-63m-53 63 53-63m-55 66 55-60m-55 60c20-24 42-48 55-60m-52 63c12-18 27-32 52-63m-52 63 52-63m-55 66 55-61m-55 61c15-17 33-35 55-61m-52 64c15-18 32-36 52-64m-52 64 52-64m-54 67c16-16 30-34 56-62m-56 62 56-62m-53 64c15-16 26-31 53-64m-53 64c12-14 23-30 53-64m-56 67c17-15 33-32 57-62m-57 62 57-62m-54 65c16-23 35-44 54-65m-54 65 54-65m-57 68c23-24 47-48 58-63m-58 63c18-18 35-38 58-63m-55 66c12-16 26-31 55-66m-55 66 55-66m-58 69c16-14 31-34 58-63m-58 63c15-18 31-34 58-63m-55 66 55-66m-55 66c12-13 24-27 55-66m-58 69c21-22 44-46 59-64m-59 64 59-64m-56 67c20-27 40-49 56-67m-56 67 56-67m-58 70 59-65m-59 65c14-16 28-33 59-65m-56 67c21-26 43-55 56-67m-56 67c15-20 33-40 56-67m-59 70 59-65m-59 65c23-23 44-49 59-65m-56 68 56-68m-56 68c13-14 25-29 56-68m-58 71c22-23 44-46 60-66m-60 66 60-66m-57 69c16-18 29-38 57-69m-57 69c17-23 36-44 57-69m-60 72c12-15 26-28 61-67m-61 67c12-15 26-28 61-67m-58 69 58-69m-58 69 58-69m-61 73c13-16 30-35 61-67m-61 67 61-67m-58 70c20-22 39-48 58-70m-58 70c20-24 38-48 58-70m-61 73c17-23 37-45 62-68m-62 68c18-18 34-37 62-68m-59 70 59-70m-59 70 59-70m-61 73c22-22 44-46 62-69m-62 69c16-17 33-35 62-69m-59 72 59-72m-59 72c13-18 27-34 59-72m-62 75c21-24 42-43 62-69m-62 69c23-26 46-53 62-69m-59 72 59-72m-59 72 59-72m-62 75c21-21 40-46 64-70m-64 70c14-14 27-28 64-70m-61 72c15-15 28-30 61-72m-61 72 61-72m-63 75c15-16 30-31 64-70m-64 70 64-70m-61 73 61-73m-61 73 61-73m-65 77 66-72m-66 72 66-72m-62 74c17-20 34-43 62-74m-62 74c20-22 39-46 62-74m-65 77 65-72m-65 72 65-72m-62 75 62-75m-62 75 62-75m-65 78c19-18 33-39 66-73m-66 73 66-73m-63 76c19-20 38-42 63-76m-63 76 63-76m-65 79c22-23 45-48 66-74m-66 74 66-74m-63 76c23-26 43-51 63-76m-63 76 63-76m-66 79c20-20 36-41 67-73m-67 73 67-73m-64 76c18-22 37-42 64-76m-64 76c18-19 33-40 64-76m-67 79 68-74m-68 74 68-74m-65 76c13-16 28-31 65-76m-65 76 65-76m-68 80 69-75m-69 75 69-75m-66 78c26-33 50-64 66-78m-66 78 66-78m-68 81c19-24 37-43 68-76m-68 76 68-76m-65 78c12-16 27-35 65-78m-65 78 65-78m-68 82c15-15 28-34 69-77m-69 77 69-77m-66 79 66-79m-66 79 66-79m-69 82c23-27 49-53 70-77m-70 77 70-77m-67 80c16-19 33-42 67-80m-67 80 67-80m-69 83 70-77m-70 77c23-26 47-50 70-77m-67 79c12-17 28-32 67-79m-67 79 67-79m-70 82 71-77m-71 77c17-15 32-32 71-77m-68 80c14-16 29-32 68-80m-68 80c16-17 30-36 68-80m-71 84c17-22 34-40 72-80m-72 80c20-24 42-48 72-80m-69 82c16-22 35-42 69-82m-69 82 69-82m-72 85 73-80m-73 80c20-19 37-40 73-80m-70 83c27-28 50-60 70-83m-70 83c16-18 30-38 70-83m-72 86c19-21 39-41 72-80m-72 80c15-19 34-38 72-80m-69 83c24-28 51-58 69-83m-69 83 69-83m-72 86c19-21 38-46 73-81m-73 81 73-81m-70 83 70-83m-70 83 70-83m-73 86c9-7 13-13 32-33m-32 33c14-13 25-26 32-33m-28 36c11-11 18-24 28-36m-28 36 28-36m-1-1 43-47m-43 47c12-15 25-29 43-47m-40 49c13-13 20-25 40-49m-40 49c7-10 15-20 40-49m-73 87c2-5 9-7 13-12m-13 12 13-12m-10 15c1-4 6-10 10-15m-10 15c4-6 6-11 10-15m39-48c7-5 12-13 22-22m-22 22 22-22m-19 24c9-6 12-17 19-24m-19 24c7-7 13-16 19-24m-74 88 10-8m-10 8 10-8m-7 11c2-3 3-7 7-11m-7 11 7-11m53-65 12-10m-12 10 12-10m-9 13c4-4 6-8 9-13m-9 13 9-13m-75 89 7-5m-7 5 7-5m-4 8 4-8m-4 8 4-8m-7 11 4-1m-4 1 4-1m-1 3 1-3m-1 3 1-3"/>
<path stroke="transparent" d="M271 612c2-5 5-23 10-32 4-10 11-18 17-26l22-22c7-6 17-7 20-13 3-5 3 11-1-19l-27-159c-5-31 0-19-1-26l-4-13c-1-3 1-8-1-10-2-1-5 1-10 2l-16-1-13 2c-4 0-9-3-11-1-1 3 1 7 1 14s-2-9 0 29l10 200 2 25 1 49m-1 1c2-5 6-21 11-31 4-10 11-21 17-29 7-8 16-13 23-19 8-5 19-8 22-13 4-6 3 9-2-21l-28-160c-5-31-1-18-2-24l-2-10c0-4 1-8-1-10s-6 0-10 0l-18-2-12 1c-4 0-9-2-11 0s1 7 2 14c0 7-2-9 0 30l8 200c2 38 1 12 2 24l4 49"/>
</g>
<path fill="none" stroke="black" strokeLinecap="round" strokeWidth="4" d="m270 610 10-30a129 129 0 0 1 39-49c8-6 18-7 21-12s2 10-3-20l-24-160c-5-31-4-18-5-25l-1-13c0-4 1-7-1-8-2-2-6-1-10-1h-16l-14 1c-4 1-9-1-11 1s0 4 1 11l1 32 10 198 1 27 3 48m1 2c2-5 3-24 7-33 5-10 11-18 18-26 6-8 16-16 23-21 7-6 16-7 19-13 3-5 3 8-1-21l-24-157c-5-31-2-21-3-27-2-7-5-8-6-11 0-4 4-9 2-11-1-1-6 1-11 1l-17-1h-12c-4 1-11 0-13 3-2 2 1 5 2 13l2 31 8 196c2 37 3 14 4 27v48"/>
<g fillRule="evenodd" strokeLinecap="round">
<path fill={grip} d="m273 624-10-21c-4-8-7-18-12-26s-11-17-19-23c-7-5-21-9-27-12-5-4-5-5-7-9-2-3-5-1-5-13 0-11 3-22 5-57l6-153c2-28 1-14 5-17s10-1 17 0c8 0 25 0 29 3 5 3-1-7 0 16l4 127c3 53 8 159 11 189"/>
<path fill="none" stroke="black" strokeWidth="4" d="m272 627-11-25c-4-8-6-19-11-26-5-8-12-14-19-20s-18-13-24-16c-6-4-7-3-9-7-3-3-4-4-4-15l3-56 10-153c2-27-2-12 2-14 3-3 11 0 19 0s23-4 27-1c5 3-1-4-1 20l6 125 12 187m-2 1-10-23c-4-9-6-19-11-27s-11-14-18-20c-6-6-16-13-22-17-6-3-11-1-13-4-3-4-2-4-2-16l2-59 9-153c3-28 1-12 5-14 3-2 11 2 19 2 7 0 21-6 25-3 5 3 0-4 1 20 0 25 1 77 4 129l13 184"/>
</g>
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path stroke={blade} strokeWidth=".3" d="M207 292s0 0 0 0m0 0s0 0 0 0m1 3v-1m0 1s0 0 0 0m0 4c0-1 0-2 2-3m-3 3 3-3m-4 5c1-1 6-2 7-6m-5 7c0-2 2-3 4-6m-4 8c1-4 5-6 7-11m-9 12c4-2 5-5 10-9m-11 16c2-6 7-13 10-14m-9 9c2-3 9-7 11-13m-9 17c2-3 9-12 17-13m-19 13c8-7 11-11 13-16m-16 19 24-17m-21 17c8-6 13-13 19-19m-16 23c1-6 7-13 15-24m-17 23c4-5 10-15 18-23m-23 32c7-13 13-22 30-31m-26 28c7-10 12-18 23-28m-25 28c14-8 20-23 30-27m-28 30c7-12 19-20 28-32m-27 31c7-9 22-24 25-33m-25 38c10-17 22-28 28-37m-29 35c10-4 17-11 31-30m-33 34c12-12 21-23 32-38m-33 40c17-9 26-28 35-37m-34 39c12-12 17-19 34-43m-30 46c10-11 23-28 37-48m-39 46 38-43m-42 44c12-10 22-16 46-42m-42 43c10-9 22-22 40-45m-44 51c14-11 31-26 48-54m-44 52c10-15 25-29 44-48m-44 54c12-15 24-27 43-55m-43 55 44-56m-47 58c21-18 42-45 49-60m-46 61c12-17 27-35 47-58m-46 59c14-17 28-37 50-55m-51 56c14-18 29-38 51-58m-53 62c15-19 29-37 52-60m-50 57c17-16 31-35 53-59m-53 63c20-19 37-40 48-58m-49 59c21-26 42-49 53-59m-53 60c8-13 19-28 54-61m-54 63 53-61m-53 66 47-64m-48 63 54-62m-54 66c23-25 38-48 52-59m-54 60c13-13 23-26 53-64m-54 66c12-16 30-30 56-62m-55 63c17-15 30-34 53-62m-52 65c16-23 27-39 51-64m-52 62c20-22 42-45 53-61m-52 63c10-16 31-35 55-63m-57 66c12-12 24-25 57-64m-55 63c21-13 36-40 53-57m-54 62c15-15 27-30 54-65m-55 67c24-18 41-38 58-60m-56 61 52-66m-54 63c20-18 45-44 59-58m-59 64c17-19 34-35 56-66m-56 67c20-19 42-46 54-61m-51 60c12-17 30-33 52-59m-55 64c19-17 31-33 60-66m-58 67c15-21 34-42 53-65m-56 69c21-31 47-52 61-65m-59 61 57-60m-56 63c24-24 40-45 53-65m-55 67c14-15 26-27 55-65m-53 68c15-21 36-42 55-62m-55 64c14-18 32-39 56-65m-54 67c14-15 24-32 49-62m-52 62 55-65m-58 66c17-22 36-38 57-61m-53 64c21-24 42-50 54-67m-54 70c13-15 25-35 56-63m-57 62 57-64m-60 70c15-22 38-41 55-70m-54 68c15-18 34-36 57-65m-59 64c13-13 29-28 59-63m-56 69c18-24 36-42 56-67m-60 64c21-18 45-42 61-65m-56 70c16-22 29-37 55-67m-54 68c14-17 30-32 54-64m-57 66c14-14 28-32 60-67m-62 68c16-18 32-34 57-66m-55 65c16-15 32-32 58-63m-58 71c13-21 34-44 60-66m-61 63c23-24 44-52 60-66m-57 69c8-19 29-31 58-68m-58 67c17-18 32-41 56-66m-61 68c15-12 33-27 60-65m-57 68c16-14 31-34 59-67m-55 71c9-19 24-31 59-69m-61 70c14-21 30-36 57-69m-58 74c17-24 34-41 56-73m-57 69c20-25 43-48 59-68m-57 73c16-20 34-37 56-71m-58 69c19-22 38-45 62-69m-63 72c18-19 36-44 60-68m-60 70c17-22 35-41 62-71m-60 74c12-17 31-39 62-67m-62 67c22-25 41-53 58-73m-57 76c21-25 42-46 58-73m-59 71c10-11 24-26 58-67m-62 69c14-9 29-26 60-70m-57 74c25-29 45-56 59-74m-60 79c16-25 34-43 61-77m-61 75c11-16 26-33 61-74m-62 74c15-8 25-25 64-71m-62 72c22-26 43-48 60-71m-63 79 65-76m-61 74c16-26 37-50 58-72m-63 73c18-19 28-35 64-68m-60 67c13-18 33-35 60-68m-63 73c16-12 25-32 60-72m-59 73c21-25 39-48 64-73m-66 77c24-30 48-52 63-76m-63 73c23-23 43-46 66-72m-66 77c14-16 31-27 68-72m-67 73c19-23 36-44 64-73m-67 73c21-24 47-50 68-72m-66 74 64-75m-66 77c23-23 43-51 70-74m-65 73c11-14 29-31 64-70m-65 73c16-14 32-33 65-72m-64 74c21-27 44-53 63-76m-62 83c22-34 45-56 59-80m-62 78 65-75m-67 77c26-28 51-53 70-75m-68 73c12-12 27-31 66-75m-66 78c24-27 45-55 63-77m-64 81 66-76m-65 74c27-27 49-51 63-77m-61 81 64-75m-64 79c19-28 52-55 61-79m-62 79c22-28 43-50 65-77m-65 75c19-19 41-46 64-73m-64 75c21-27 45-54 66-76m-65 81c20-26 52-63 64-77m-67 77c26-27 49-55 67-77m-69 76c26-19 39-41 69-71m-65 74 65-77m-64 83c16-26 34-48 68-82m-70 80c12-16 26-33 66-77m-69 77c26-28 47-50 73-71m-70 74c25-28 52-62 67-76m-69 79c24-24 52-57 71-76m-69 75c18-26 42-51 65-79m-65 82c18-17 40-37 71-81m-69 81c18-24 39-49 64-77m-63 81c17-29 43-54 67-80m-67 76c18-19 36-41 64-73m-66 76c22-24 41-44 66-74m-63 74c11-19 26-32 64-73m-60 78c21-34 46-57 56-77m-59 71c23-26 48-57 62-71m-64 74c20-20 34-31 68-74m-66 73c22-22 43-45 64-71m-58 69c19-21 37-46 55-66m-58 69c22-24 43-48 59-69m-54 75c17-24 37-47 54-72m-55 68c12-21 32-39 55-67m-54 65c14-13 29-36 54-59m-54 64c15-23 32-43 56-67m-55 67c13-18 34-35 52-66m-52 67c13-18 30-37 53-64m-51 63c12-21 25-33 56-60m-58 61c14-14 27-28 53-62m-54 64c20-24 41-46 58-65m-55 64 53-61m-52 64c14-18 24-37 52-61m-49 58c16-20 36-43 50-57m-53 61c13-17 30-29 50-63m-47 60c13-15 21-28 50-55m-49 58c13-16 20-28 50-57m-49 54 46-54m-47 55c19-16 36-39 50-48m-47 50c13-16 31-37 46-51m-44 56c11-20 32-41 41-57m-43 51c19-18 37-37 47-51m-46 53c11-10 16-24 46-51m-44 53c15-18 31-35 41-51m-42 53c15-13 25-29 40-52m-38 51 41-49m-37 50c11-20 33-34 39-50m-39 48c14-15 25-32 38-45m-40 46c17-14 32-33 43-39m-40 40c6-10 20-24 35-42m-38 45c15-12 25-31 40-44m-37 41c11-10 23-23 36-40m-37 42c13-10 31-31 39-41m-34 42 35-41m-34 39c5-6 15-17 34-33m-34 38c5-13 16-21 31-43m-31 41c12-5 23-20 35-38m-36 38c15-13 24-27 36-37m-37 43c12-10 21-20 38-37m-33 34c11-11 19-25 30-37m-27 36c4-8 18-21 26-35m-28 37c7-7 14-16 28-37m-30 36c14-4 19-16 35-27m-31 31c11-15 23-28 28-33m-27 30c12-10 20-21 27-27m-30 30c10-9 21-23 30-34m-25 37c6-7 15-17 27-35m-28 34c6-11 14-19 27-30m-26 27c9-8 16-18 21-23m-22 28 24-31m-22 32c6-9 19-20 23-26m-25 27c8-7 13-17 25-28m-26 30c13-8 16-15 24-28m-22 26 26-24m-21 25 19-22m-20 24c7-11 16Line truncated
<path stroke="transparent" strokeWidth=".5" d="m272 626-11-25c-3-8-4-17-10-24-5-8-14-15-21-21s-14-14-20-17c-5-4-12-2-15-6-2-4 0-6 0-17l4-52c3-34 7-127 9-155s-1-12 3-14c3-2 12-1 19-1 8 1 22-1 26 2s-3-10-2 15c1 24 3 78 7 130l11 182m-3 0c-3-3-8-12-11-19s-3-17-8-24c-5-8-13-15-20-21l-22-20c-5-5-9-6-10-9-2-3-1 1-1-10s-1-20 1-56c1-35 4-130 7-159 2-28 4-9 8-11 5-1 13 2 19 3 7 0 17-4 21-1 3 3 0-4 1 20s1 73 5 125l14 188"/>
</g>
<path fill="none" stroke="black" strokeLinecap="round" strokeWidth="4" d="m271 626-10-23c-4-8-7-18-12-26s-10-15-17-21l-25-16c-6-4-8-3-10-7-2-3-2-2-2-14l3-56 9-154c2-28-2-12 2-14 3-2 11 1 18 1 8 0 22-6 27-3 4 3-1-3 0 21a9897 9897 0 0 0 17 312m2 2-13-24c-3-8-4-18-8-26-5-8-13-15-20-21-7-7-18-13-24-17-5-4-8-1-10-4-2-4-2-6-2-18s-1-20 1-55l8-155c2-28-2-11 1-13 4-3 14-1 22-1s23-1 28 2c4 3-3-7-2 17a4634 4634 0 0 0 17 312"/>
<path fill="none" stroke={blade} strokeLinecap="round" strokeWidth="8" d="m255 296 12 320m-15-322 21 325"/>
</svg>
)
}
export const saveIcon = (isDirty: boolean) => {
return (
<svg
+2 -2
View File
@@ -70,7 +70,7 @@ export class EmbeddableMenu {
};
private async actionMarkdownSelection (file: TFile, isExcalidrawFile: boolean, subpath: string, element: ExcalidrawEmbeddableElement) {
this.view.updateScene({appState: {activeEmbeddable: null}});
this.view.updateScene({appState: {activeEmbeddable: null}, storeAction: "update"});
const sections = (await app.metadataCache.blockCache
.getForFile({ isCancelled: () => false },file))
.blocks.filter((b: any) => b.display && b.node?.type === "heading")
@@ -98,7 +98,7 @@ export class EmbeddableMenu {
private async actionMarkdownBlock (file: TFile, subpath: string, element: ExcalidrawEmbeddableElement) {
if(!file) return;
this.view.updateScene({appState: {activeEmbeddable: null}});
this.view.updateScene({appState: {activeEmbeddable: null}, storeAction: "update"});
const paragraphs = (await app.metadataCache.blockCache
.getForFile({ isCancelled: () => false },file))
.blocks.filter((b: any) => b.display && b.node &&
+4 -2
View File
@@ -34,7 +34,8 @@ export function setPen (pen: PenStyle, api: any) {
currentItemRoughness: st.currentItemRoughness,
}}
: null,
}
},
storeAction: "update",
})
}
@@ -50,7 +51,8 @@ export function resetStrokeOptions (resetCustomPen:any, api: ExcalidrawImperativ
}: null,
resetCustomPen: null,
...clearCurrentStrokeOptions ? {currentStrokeOptions: null} : null,
}
},
storeAction: "update",
});
}
+138 -12
View File
@@ -2,6 +2,8 @@ import {
App,
ButtonComponent,
DropdownComponent,
getIcon,
Modifier,
normalizePath,
PluginSettingTab,
Setting,
@@ -13,7 +15,7 @@ import ExcalidrawView from "./ExcalidrawView";
import { t } from "./lang/helpers";
import type ExcalidrawPlugin from "./main";
import { PenStyle } from "./PenTypes";
import { DynamicStyle } from "./types";
import { DynamicStyle } from "./types/types";
import { PreviewImageType } from "./utils/UtilTypes";
import { setDynamicStyle } from "./utils/DynamicStyling";
import {
@@ -36,6 +38,9 @@ import { ModifierKeySettingsComponent } from "./dialogs/ModifierKeySettings";
import { ANNOTATED_PREFIX, CROPPED_PREFIX } from "./utils/CarveOut";
import { EDITOR_FADEOUT } from "./CodeMirrorExtension/EditorHandler";
import { setDebugging } from "./utils/DebugHelper";
import { Rank } from "./menu/ActionIcons";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { HotkeyEditor } from "./dialogs/HotkeyEditor";
export interface ExcalidrawSettings {
folder: string;
@@ -47,6 +52,7 @@ export interface ExcalidrawSettings {
compress: boolean;
decompressForMDView: boolean;
onceOffCompressFlagReset: boolean; //used to reset compress to true in 2.2.0
onceOffGPTVersionReset: boolean; //used to reset GPT version in 2.2.11
autosave: boolean;
autosaveIntervalDesktop: number;
autosaveIntervalMobile: number;
@@ -74,6 +80,7 @@ export interface ExcalidrawSettings {
matchThemeTrigger: boolean;
defaultMode: string;
defaultPenMode: "never" | "mobile" | "always";
penModeDoubleTapEraser: boolean;
penModeCrosshairVisible: boolean;
renderImageInMarkdownReadingMode: boolean,
renderImageInHoverPreviewForMDNotes: boolean,
@@ -164,6 +171,7 @@ export interface ExcalidrawSettings {
numberOfCustomPens: number;
pdfScale: number;
pdfBorderBox: boolean;
pdfFrame: boolean;
pdfGapSize: number;
pdfGroupPages: boolean;
pdfLockAfterImport: boolean;
@@ -177,6 +185,7 @@ export interface ExcalidrawSettings {
COLOR: string,
};
embeddableMarkdownDefaults: EmbeddableMDCustomProps;
markdownNodeOneClickEditing: boolean;
canvasImmersiveEmbed: boolean,
startupScriptPath: string,
openAIAPIToken: string,
@@ -196,6 +205,9 @@ export interface ExcalidrawSettings {
longPressDesktop: number;
longPressMobile: number;
isDebugMode: boolean;
rank: Rank;
modifierKeyOverrides: {modifiers: Modifier[], key: string}[];
showSplashscreen: boolean;
}
declare const PLUGIN_VERSION:string;
@@ -210,9 +222,10 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
compress: true,
decompressForMDView: false,
onceOffCompressFlagReset: false,
onceOffGPTVersionReset: false,
autosave: true,
autosaveIntervalDesktop: 15000,
autosaveIntervalMobile: 10000,
autosaveIntervalDesktop: 30000,
autosaveIntervalMobile: 20000,
drawingFilenamePrefix: "Drawing ",
drawingEmbedPrefixWithFilename: true,
drawingFilnameEmbedPostfix: " ",
@@ -237,6 +250,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
matchThemeTrigger: false,
defaultMode: "normal",
defaultPenMode: "never",
penModeDoubleTapEraser: true,
penModeCrosshairVisible: true,
renderImageInMarkdownReadingMode: false,
renderImageInHoverPreviewForMDNotes: false,
@@ -333,6 +347,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
numberOfCustomPens: 0,
pdfScale: 4,
pdfBorderBox: true,
pdfFrame: false,
pdfGapSize: 20,
pdfGroupPages: false,
pdfLockAfterImport: true,
@@ -356,11 +371,12 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
borderOpacity: 0,
filenameVisible: false,
},
markdownNodeOneClickEditing: false,
canvasImmersiveEmbed: true,
startupScriptPath: "",
openAIAPIToken: "",
openAIDefaultTextModel: "gpt-3.5-turbo-1106",
openAIDefaultVisionModel: "gpt-4-vision-preview",
openAIDefaultVisionModel: "gpt-4o",
openAIDefaultImageGenerationModel: "dall-e-3",
openAIURL: "https://api.openai.com/v1/chat/completions",
openAIImageGenerationURL: "https://api.openai.com/v1/images/generations",
@@ -451,6 +467,13 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
longPressDesktop: 500,
longPressMobile: 500,
isDebugMode: false,
rank: "Bronze",
modifierKeyOverrides: [
{modifiers: ["Mod"], key:"Enter"},
{modifiers: ["Mod"], key:"k"},
{modifiers: ["Mod"], key:"G"},
],
showSplashscreen: true,
};
export class ExcalidrawSettingTab extends PluginSettingTab {
@@ -459,6 +482,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
private requestReloadDrawings: boolean = false;
private requestUpdatePinnedPens: boolean = false;
private requestUpdateDynamicStyling: boolean = false;
private hotkeyEditor: HotkeyEditor;
//private reloadMathJax: boolean = false;
//private applyDebounceTimer: number = 0;
@@ -485,21 +509,25 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}
this.plugin.saveSettings();
if (this.requestUpdatePinnedPens) {
app.workspace.getLeavesOfType(VIEW_TYPE_EXCALIDRAW).forEach(v=> {
this.app.workspace.getLeavesOfType(VIEW_TYPE_EXCALIDRAW).forEach(v=> {
if (v.view instanceof ExcalidrawView) v.view.updatePinnedCustomPens()
})
}
if (this.requestUpdateDynamicStyling) {
app.workspace.getLeavesOfType(VIEW_TYPE_EXCALIDRAW).forEach(v=> {
this.app.workspace.getLeavesOfType(VIEW_TYPE_EXCALIDRAW).forEach(v=> {
if (v.view instanceof ExcalidrawView) {
setDynamicStyle(this.plugin.ea,v.view,v.view.previousBackgroundColor,this.plugin.settings.dynamicStyling);
}
})
}
this.hotkeyEditor.unload();
if (this.hotkeyEditor.isDirty) {
this.plugin.registerHotkeyOverrides();
}
if (this.requestReloadDrawings) {
const exs =
app.workspace.getLeavesOfType(VIEW_TYPE_EXCALIDRAW);
this.app.workspace.getLeavesOfType(VIEW_TYPE_EXCALIDRAW);
for (const v of exs) {
if (v.view instanceof ExcalidrawView) {
await v.view.save(false);
@@ -539,6 +567,46 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
},
});
coffeeImg.height = 45;
const iconLinks = [
{
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"></path><path d="M9 18c-4.51 2-5-2-7-2"></path></svg>`,
href: "https://github.com/zsviczian/obsidian-excalidraw-plugin/issues",
aria: "Report bugs and raise feature requsts on the plugin's GitHub page",
text: "Bugs and Feature Requests",
},
{
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19c-2.3 0-6.4-.2-8.1-.6-.7-.2-1.2-.7-1.4-1.4-.3-1.1-.5-3.4-.5-5s.2-3.9.5-5c.2-.7.7-1.2 1.4-1.4C5.6 5.2 9.7 5 12 5s6.4.2 8.1.6c.7.2 1.2.7 1.4 1.4.3 1.1.5 3.4.5 5s-.2 3.9-.5 5c-.2.7-.7 1.2-1.4 1.4-1.7.4-5.8.6-8.1.6 0 0 0 0 0 0z"></path><polygon points="10 15 15 12 10 9"></polygon></svg>`,
href: "https://www.youtube.com/@VisualPKM",
aria: "Check out my YouTube channel to learn about Visual Thinking and Excalidraw",
text: "Visual PKM on YouTube",
},
{
icon: `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" stroke="none" strokeWidth="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 640 512"><path d="M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"/></svg>`,
href: "https://discord.gg/DyfAXFwUHc",
aria: "Join the Visual Thinking Workshop Discord Server",
text: "Community on Discord",
},
{
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z"></path></svg>`,
href: "https://twitter.com/zsviczian",
aria: "Follow me on Twitter",
text: "Follow me on Twitter",
},
{
icon: getIcon("graduation-cap").outerHTML,
href: "https://visual-thinking-workshop.com",
aria: "Learn about Visual PKM, Excalidraw, Obsidian, ExcaliBrain and more",
text: "Join the Visual Thinking Workshop",
}
];
const linksEl = containerEl.createDiv("setting-item-description excalidraw-settings-links-container");
iconLinks.forEach(({ icon, href, aria, text }) => {
linksEl.createEl("a",{href, attr: { "aria-label": aria }}, (a)=> {
a.innerHTML = icon + text;
});
});
// ------------------------------------------------
// Saving
@@ -694,7 +762,8 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
.setDesc(fragWithHTML(t("AUTOSAVE_INTERVAL_DESKTOP_DESC")))
.addDropdown((dropdown) =>
dropdown
.addOption("15000", "Frequent (every 15 seconds)")
.addOption("15000", "Very frequent (every 15 seconds)")
.addOption("30000", "Frequent (every 30 seconds)")
.addOption("60000", "Moderate (every 60 seconds)")
.addOption("300000", "Rare (every 5 minutes)")
.addOption("900000", "Practically never (every 15 minutes)")
@@ -710,7 +779,8 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
.setDesc(fragWithHTML(t("AUTOSAVE_INTERVAL_MOBILE_DESC")))
.addDropdown((dropdown) =>
dropdown
.addOption("10000", "Frequent (every 10 seconds)")
.addOption("10000", "Very frequent (every 10 seconds)")
.addOption("20000", "Frequent (every 20 seconds)")
.addOption("30000", "Moderate (every 30 seconds)")
.addOption("60000", "Rare (every 1 minute)")
.addOption("300000", "Practically never (every 5 minutes)")
@@ -977,6 +1047,17 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
.setName(t("DISABLE_DOUBLE_TAP_ERASER_NAME"))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.penModeDoubleTapEraser)
.onChange(async (value) => {
this.plugin.settings.penModeDoubleTapEraser = value;
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("SHOW_PEN_MODE_FREEDRAW_CROSSHAIR_NAME"))
.setDesc(fragWithHTML(t("SHOW_PEN_MODE_FREEDRAW_CROSSHAIR_DESC")))
@@ -989,7 +1070,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
const readingModeEl = new Setting(detailsEl)
.setName(t("SHOW_DRAWING_OR_MD_IN_READING_MODE_NAME"))
.setDesc(fragWithHTML(t("SHOW_DRAWING_OR_MD_IN_READING_MODE_DESC")))
.addToggle((toggle) =>
@@ -1000,6 +1081,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
readingModeEl.nameEl.setAttribute("id",TAG_MDREADINGMODE);
new Setting(detailsEl)
.setName(t("SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_NAME"))
@@ -1030,6 +1112,29 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
);
addIframe(detailsEl, "H8Njp7ZXYag",999);
new Setting(detailsEl)
.setName(t("TOGGLE_SPLASHSCREEN"))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.showSplashscreen)
.onChange((value)=> {
this.plugin.settings.showSplashscreen = value;
this.applySettingsUpdate();
})
)
detailsEl = displayDetailsEl.createEl("details");
detailsEl.createEl("summary", {
text: t("HOTKEY_OVERRIDE_HEAD"),
cls: "excalidraw-setting-h3",
});
detailsEl.createEl("span", {}, (el) => {
el.innerHTML = t("HOTKEY_OVERRIDE_DESC");
});
this.hotkeyEditor = new HotkeyEditor(detailsEl, this.plugin.settings, this.applySettingsUpdate);
this.hotkeyEditor.onload();
detailsEl = displayDetailsEl.createEl("details");
detailsEl.createEl("summary", {
text: t("THEME_HEAD"),
@@ -1790,7 +1895,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
});
addIframe(detailsEl, "wTtaXmRJ7wg",171);
new Setting(detailsEl)
const pdfExportEl = new Setting(detailsEl)
.setName(t("SHOW_DRAWING_OR_MD_IN_EXPORTPDF_NAME"))
.setDesc(fragWithHTML(t("SHOW_DRAWING_OR_MD_IN_EXPORTPDF_DESC")))
.addToggle((toggle) =>
@@ -1801,6 +1906,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
pdfExportEl.nameEl.setAttribute("id",TAG_PDFEXPORT);
new Setting(detailsEl)
.setName(t("EXPORT_EMBED_SCENE_NAME"))
@@ -1940,6 +2046,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
text: t("EXPORT_HEAD"),
cls: "excalidraw-setting-h4",
});
detailsEl.setAttribute("id",TAG_AUTOEXPORT);
new Setting(detailsEl)
.setName(t("EXPORT_SYNC_NAME"))
@@ -2060,7 +2167,26 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
text: t("MD_EMBED_CUSTOMDATA_HEAD_NAME"),
cls: "excalidraw-setting-h3",
});
detailsEl.createEl("span", {text: t("MD_EMBED_CUSTOMDATA_HEAD_DESC")});
new Setting(detailsEl)
.setName(t("MD_EMBED_SINGLECLICK_EDIT_NAME"))
.setDesc(fragWithHTML(t("MD_EMBED_SINGLECLICK_EDIT_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.markdownNodeOneClickEditing)
.onChange(async (value) => {
this.plugin.settings.markdownNodeOneClickEditing = value;
this.applySettingsUpdate();
})
);
detailsEl.createEl("hr", { cls: "excalidraw-setting-hr" });
detailsEl.createEl("span", {}, (el) => {
el.innerHTML = t("MD_EMBED_CUSTOMDATA_HEAD_DESC");
});
new EmbeddalbeMDFileCustomDataSettingsComponent(
detailsEl,
+83 -82
View File
@@ -1,83 +1,84 @@
import { ExcalidrawAutomate } from "./ExcalidrawAutomate";
import { ExcalidrawLib } from "./ExcalidrawLib";
export type ConnectionPoint = "top" | "bottom" | "left" | "right" | null;
export type Packages = {
react: any,
reactDOM: any,
excalidrawLib: typeof ExcalidrawLib,
}
export type ValueOf<T> = T[keyof T];
export type DynamicStyle = "none" | "gray" | "colorful";
export type DeviceType = {
isDesktop: boolean,
isPhone: boolean,
isTablet: boolean,
isMobile: boolean,
isLinux: boolean,
isMacOS: boolean,
isWindows: boolean,
isIOS: boolean,
isAndroid: boolean
};
declare global {
interface Window {
ExcalidrawAutomate: ExcalidrawAutomate;
}
}
declare module "obsidian" {
interface App {
internalPlugins: any;
isMobile(): boolean;
getObsidianUrl(file:TFile): string;
metadataTypeManager: {
setType(name:string, type:string): void;
};
}
interface Keymap {
getRootScope(): Scope;
}
interface Scope {
keys: any[];
}
interface Workspace {
on(
name: "hover-link",
callback: (e: MouseEvent) => any,
ctx?: any,
): EventRef;
}
interface DataAdapter {
url: {
pathToFileURL(path: string): URL;
},
basePath: string;
}
interface FoldPosition {
from: number;
to: number;
}
interface FoldInfo {
folds: FoldPosition[];
lines: number;
}
interface MarkdownSubView {
applyFoldInfo(foldInfo: FoldInfo): void;
getFoldInfo(): FoldInfo | null;
}
/*interface Editor {
insertText(data: string): void;
}*/
interface MetadataCache {
getBacklinksForFile(file: TFile): any;
getLinks(): { [id: string]: Array<{ link: string; displayText: string; original: string; position: any }> };
}
import { ExcalidrawAutomate } from "../ExcalidrawAutomate";
import { ExcalidrawLib } from "../ExcalidrawLib";
export type ConnectionPoint = "top" | "bottom" | "left" | "right" | null;
export type Packages = {
react: any,
reactDOM: any,
excalidrawLib: typeof ExcalidrawLib,
}
export type ValueOf<T> = T[keyof T];
export type DynamicStyle = "none" | "gray" | "colorful";
export type DeviceType = {
isDesktop: boolean,
isPhone: boolean,
isTablet: boolean,
isMobile: boolean,
isLinux: boolean,
isMacOS: boolean,
isWindows: boolean,
isIOS: boolean,
isAndroid: boolean,
};
declare global {
interface Window {
ExcalidrawAutomate: ExcalidrawAutomate;
pdfjsLib: any;
}
}
declare module "obsidian" {
interface App {
internalPlugins: any;
isMobile(): boolean;
getObsidianUrl(file:TFile): string;
metadataTypeManager: {
setType(name:string, type:string): void;
};
}
interface Keymap {
getRootScope(): Scope;
}
interface Scope {
keys: any[];
}
interface Workspace {
on(
name: "hover-link",
callback: (e: MouseEvent) => any,
ctx?: any,
): EventRef;
}
interface DataAdapter {
url: {
pathToFileURL(path: string): URL;
},
basePath: string;
}
interface FoldPosition {
from: number;
to: number;
}
interface FoldInfo {
folds: FoldPosition[];
lines: number;
}
interface MarkdownSubView {
applyFoldInfo(foldInfo: FoldInfo): void;
getFoldInfo(): FoldInfo | null;
}
/*interface Editor {
insertText(data: string): void;
}*/
interface MetadataCache {
getBacklinksForFile(file: TFile): any;
getLinks(): { [id: string]: Array<{ link: string; displayText: string; original: string; position: any }> };
}
}
+4
View File
@@ -0,0 +1,4 @@
declare module "web-worker:*" {
const WorkerFactory: new (options: any) => Worker;
export default WorkerFactory;
}
+12 -1
View File
@@ -249,4 +249,15 @@ export const extractCodeBlocks = (markdown: string): { data: string, type: strin
}
return result;
}
}
export const errorHTML = (message: string) => `<html>
<body style="margin: 0; text-align: center">
<div style="display: flex; align-items: center; justify-content: center; flex-direction: column; height: 100vh; padding: 0 60px">
<div style="color:red">There was an error during generation</div>
</br>
</br>
<div>${message}</div>
</div>
</body>
</html>`;
+2 -3
View File
@@ -6,7 +6,6 @@ import { Notice } from "obsidian";
import { getEA } from "src";
import { ExcalidrawAutomate, cloneElement } from "src/ExcalidrawAutomate";
import { ExportSettings } from "src/ExcalidrawView";
import { embedFontsInSVG } from "./Utils";
import { nanoid } from "src/constants/constants";
export class CropImage {
@@ -92,7 +91,7 @@ export class CropImage {
isMask: false,
}
const maskSVG = await this.maskEA.createSVG(null,false,exportSettings,null,null,0);
const maskSVG = await this.maskEA.createSVG(null,true,exportSettings,null,null,0);
const defs = maskSVG.querySelector("defs");
const styleEl = maskSVG.querySelector("style");
const style = styleEl ? styleEl.outerHTML : "";
@@ -138,7 +137,7 @@ export class CropImage {
async getCroppedPNG(): Promise<Blob> {
//@ts-ignore
const PLUGIN = app.plugins.plugins["obsidian-excalidraw-plugin"];
const svg = embedFontsInSVG(await this.buildSVG(), PLUGIN);
const svg = await this.buildSVG();
return new Promise((resolve, reject) => {
const svgData = new XMLSerializer().serializeToString(svg);
const canvas = document.createElement('canvas');
+25 -1
View File
@@ -10,9 +10,33 @@ export let DEBUGGING = false;
export const log = console.log.bind(window.console);
export const debug = (fn: Function, fnName: string, ...messages: unknown[]) => {
console.log(fnName,fn,...messages);
//console.log(fnName,fn,...messages);
console.log(fnName, ...messages);
};
let timestamp: number[] = [];
let tsOrigin: number = 0;
export function tsInit(msg: string) {
tsOrigin = Date.now();
timestamp = [tsOrigin, tsOrigin, tsOrigin, tsOrigin, tsOrigin]; // Initialize timestamps for L0 to L4
console.log("0ms: " + msg);
}
export function ts(msg: string, level: number) {
if (level < 0 || level > 4) {
console.error("Invalid level. Please use level 0, 1, 2, 3, or 4.");
return;
}
const now = Date.now();
const diff = now - timestamp[level];
timestamp[level] = now;
const elapsedFromOrigin = now - tsOrigin;
console.log(`L${level} (${elapsedFromOrigin}ms) ${diff}ms: ${msg}`);
}
export class CustomMutationObserver {
private originalCallback: MutationCallback;
private observer: MutationObserver | null;
+6 -4
View File
@@ -1,8 +1,8 @@
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
import { ColorMaster } from "colormaster";
import { ColorMaster } from "@zsviczian/colormaster";
import { ExcalidrawAutomate } from "src/ExcalidrawAutomate";
import ExcalidrawView from "src/ExcalidrawView";
import { DynamicStyle } from "src/types";
import { DynamicStyle } from "src/types/types";
import { cloneElement } from "src/ExcalidrawAutomate";
import { ExcalidrawFrameElement } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { addAppendUpdateCustomData } from "./Utils";
@@ -16,7 +16,7 @@ export const setDynamicStyle = (
) => {
if(dynamicStyle === "none") {
view.excalidrawContainer?.removeAttribute("style");
setTimeout(()=>view.updateScene({appState:{dynamicStyle: ""}}));
setTimeout(()=>view.updateScene({appState:{dynamicStyle: ""}, storeAction: "update"}));
const toolspanel = view.toolsPanelRef?.current?.containerRef?.current;
if(toolspanel) {
let toolsStyle = toolspanel.getAttribute("style");
@@ -74,6 +74,7 @@ export const setDynamicStyle = (
const str = (cm: ColorMaster) => cm.stringHEX({alpha:false});
const styleObject:{[x: string]: string;} = {
['backgroundColor']: str(cmBG()),
[`--color-primary`]: str(accent()),
[`--color-surface-low`]: str(gray1()),
[`--color-surface-mid`]: str(gray1()),
@@ -167,7 +168,8 @@ export const setDynamicStyle = (
appState:{
frameColor,
dynamicStyle: styleObject
}
},
storeAction: "update",
});
view = null;
ea = null;
+45
View File
@@ -0,0 +1,45 @@
import { ExcalidrawArrowElement, ExcalidrawElement, ExcalidrawTextElement } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { Mutable } from "@zsviczian/excalidraw/types/excalidraw/utility-types";
export function updateElementIdsInScene(
{elements: sceneElements}: {elements: Mutable<ExcalidrawElement>[]},
elementToChange: Mutable<ExcalidrawElement>,
newID: string
) {
if(elementToChange.type === "text") {
const textElement = elementToChange as Mutable<ExcalidrawTextElement>;
if(textElement.containerId) {
const containerEl = sceneElements.find(el=>el.id === textElement.containerId) as unknown as Mutable<ExcalidrawElement>;
containerEl.boundElements?.filter(x=>x.id === textElement.id).forEach( x => {
(x.id as Mutable<string>) = newID;
});
}
}
if(elementToChange.boundElements?.length>0) {
elementToChange.boundElements.forEach( binding => {
const boundEl = sceneElements.find(el=>el.id === binding.id) as unknown as Mutable<ExcalidrawElement>;
boundEl.boundElements?.filter(x=>x.id === elementToChange.id).forEach( x => {
(x.id as Mutable<string>) = newID;
});
if(boundEl.type === "arrow") {
const arrow = boundEl as Mutable<ExcalidrawArrowElement>;
if(arrow.startBinding?.elementId === elementToChange.id) {
arrow.startBinding.elementId = newID;
}
if(arrow.endBinding?.elementId === elementToChange.id) {
arrow.endBinding.elementId = newID;
}
}
});
}
if(elementToChange.type === "frame") {
sceneElements.filter(el=>el.frameId === elementToChange.id).forEach(x => {
(x.frameId as Mutable<string>) = newID;
});
}
elementToChange.id = newID;
}
+23 -16
View File
@@ -2,10 +2,10 @@
import { MAX_IMAGE_SIZE, IMAGE_TYPES, ANIMATED_IMAGE_TYPES, MD_EX_SECTIONS } from "src/constants/constants";
import { App, Notice, TFile, WorkspaceLeaf } from "obsidian";
import { ExcalidrawAutomate } from "src/ExcalidrawAutomate";
import { REGEX_LINK, REG_LINKINDEX_HYPERLINK, getExcalidrawMarkdownHeaderSection } from "src/ExcalidrawData";
import { REGEX_LINK, REG_LINKINDEX_HYPERLINK, getExcalidrawMarkdownHeaderSection, REGEX_TAGS } from "src/ExcalidrawData";
import ExcalidrawView from "src/ExcalidrawView";
import { ExcalidrawElement, ExcalidrawFrameElement } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import { getLinkParts } from "./Utils";
import { getEmbeddedFilenameParts, getLinkParts, isImagePartRef } from "./Utils";
import { cleanSectionHeading } from "./ObsidianUtils";
import { getEA } from "src";
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
@@ -18,8 +18,9 @@ export async function insertImageToView(
position: { x: number, y: number },
file: TFile | string,
scale?: boolean,
shouldInsertToView: boolean = true,
):Promise<string> {
ea.clear();
if(shouldInsertToView) {ea.clear();}
ea.style.strokeColor = "transparent";
ea.style.backgroundColor = "transparent";
const api = ea.getExcalidrawAPI();
@@ -30,7 +31,7 @@ export async function insertImageToView(
file,
scale,
);
await ea.addElementsToView(false, true, true);
if(shouldInsertToView) {await ea.addElementsToView(false, true, true);}
return id;
}
@@ -39,12 +40,13 @@ export async function insertEmbeddableToView (
position: { x: number, y: number },
file?: TFile,
link?: string,
shouldInsertToView: boolean = true,
):Promise<string> {
ea.clear();
if(shouldInsertToView) {ea.clear();}
ea.style.strokeColor = "transparent";
ea.style.backgroundColor = "transparent";
if(file && (IMAGE_TYPES.contains(file.extension) || ea.isExcalidrawFile(file)) && !ANIMATED_IMAGE_TYPES.contains(file.extension)) {
return await insertImageToView(ea, position, link??file);
return await insertImageToView(ea, position, link??file, undefined, shouldInsertToView);
} else {
const id = ea.addEmbeddable(
position.x,
@@ -54,7 +56,7 @@ export async function insertEmbeddableToView (
link,
file,
);
await ea.addElementsToView(false, true, true);
if(shouldInsertToView) {await ea.addElementsToView(false, true, true);}
return id;
}
}
@@ -72,24 +74,26 @@ export function getLinkTextFromLink (text: string): string {
return linktext;
}
export function openTagSearch (link:string, app: App, view?: ExcalidrawView) {
const tags = link
.matchAll(/#([\p{Letter}\p{Emoji_Presentation}\p{Number}\/_-]+)/gu)
.next();
if (!tags.value || tags.value.length < 2) {
export function openTagSearch(link: string, app: App, view?: ExcalidrawView) {
const tags = REGEX_TAGS.getResList(link);
if (!tags.length || !tags[0].value || tags[0].value.length < 2) {
return;
}
const search = app.workspace.getLeavesOfType("search");
if (search.length == 0) {
if (search.length === 0) {
return;
}
//@ts-ignore
search[0].view.setQuery(`tag:${tags.value[1]}`);
search[0].view.setQuery(`tag:${tags[0].value[1]}`);
app.workspace.revealLeaf(search[0]);
if (view && view.isFullscreen()) {
view.exitFullscreen();
}
return;
}
@@ -236,8 +240,8 @@ export async function addBackOfTheNoteCard(
const el = ea.getViewElements().find(el=>el.id === id);
api.selectElements([el]);
if(activate) {
setTimeout(()=>{
api.updateScene({appState: {activeEmbeddable: {element: el, state: "active"}}});
window.setTimeout(()=>{
api.updateScene({appState: {activeEmbeddable: {element: el, state: "active"}}, storeAction: "update"});
if(found) view.getEmbeddableLeafElementById(el.id)?.editNode?.();
});
}
@@ -367,6 +371,9 @@ export function isTextImageTransclusion (
const link = match.value[1] ?? match.value[2];
const file = view.app.metadataCache.getFirstLinkpathDest(link?.split("#")[0], view.file.path);
if(view.file === file) {
if(link?.split("#")[1] && !isImagePartRef(getEmbeddedFilenameParts(link))) {
return false;
}
new Notice(t("RECURSIVE_INSERT_ERROR"));
return false;
}
+1 -2
View File
@@ -11,6 +11,7 @@ import { getAttachmentsFolderAndFilePath } from "./ObsidianUtils";
/**
* Splits a full path including a folderpath and a filename into separate folderpath and filename components
* @param filepath
* @returns folderpath will be normalized. This means "/" for root folder and no trailing "/" for other folders
*/
type ImageExtension = keyof typeof IMAGE_MIME_TYPES;
@@ -290,9 +291,7 @@ export const blobToBase64 = async (blob: Blob): Promise<string> => {
}
export const getPDFDoc = async (f: TFile): Promise<any> => {
//@ts-ignore
if(typeof window.pdfjsLib === "undefined") await loadPdfJs();
//@ts-ignore
return await window.pdfjsLib.getDocument(app.vault.getResourcePath(f)).promise;
}
+11 -7
View File
@@ -21,11 +21,13 @@ export type ImageKey = {
previewImageType: PreviewImageType;
scale: number;
isTransparent: boolean;
inlineFonts: boolean;
} & FILENAMEPARTS;
const getKey = (key: ImageKey): string =>
`${key.filepath}#${key.blockref??""}#${key.sectionref??""}#${key.isDark ? 1 : 0}#${
key.hasGroupref}#${key.hasArearef}#${key.hasFrameref}#${key.hasClippedFrameref}#${key.hasSectionref}#${
key.hasGroupref}#${key.hasArearef}#${key.hasFrameref}#${key.hasClippedFrameref}#${
key.hasSectionref}#${key.inlineFonts}#${
key.previewImageType === PreviewImageType.SVGIMG
? 1
: key.previewImageType === PreviewImageType.PNG
@@ -172,7 +174,7 @@ class ImageCache {
const cursor = (event.target as IDBRequest<IDBCursorWithValue | null>).result;
if(cursor) {
const key = cursor.key as string;
const isLegacyKey = key.split("#").length-1 < 11; // introduced hasGroupref, etc. in 1.9.28 // introduced hasClippedFrameref in 2.2.10
const isLegacyKey = key.split("#").length-1 < 12; // introduced hasGroupref, etc. in 1.9.28 // introduced hasClippedFrameref in 2.2.10 //introduced inlineFonts 2.2.11
const filepath = key.split("#")[0];
const fileExists = files.some((f: TFile) => f.path === filepath);
const file = fileExists ? files.find((f: TFile) => f.path === filepath) : null;
@@ -251,16 +253,16 @@ class ImageCache {
});
}
private async getObjectStore(mode: IDBTransactionMode, storeName: string): Promise<IDBObjectStore> {
private getObjectStore(mode: IDBTransactionMode, storeName: string): IDBObjectStore {
const transaction = this.db!.transaction(storeName, mode);
return transaction.objectStore(storeName);
}
private async getCacheData(key: string): Promise<FileCacheData | null> {
const store = await this.getObjectStore("readonly", this.cacheStoreName);
const store = this.getObjectStore("readonly", this.cacheStoreName);
const request = store.get(key);
return new Promise<FileCacheData | null>((resolve, reject) => {
return await new Promise<FileCacheData | null>((resolve, reject) => {
request.onsuccess = () => {
const result = request.result as FileCacheData;
resolve(result || null);
@@ -273,7 +275,7 @@ class ImageCache {
}
private async getBackupData(key: BackupKey): Promise<BackupData | null> {
const store = await this.getObjectStore("readonly", this.backupStoreName);
const store = this.getObjectStore("readonly", this.backupStoreName);
const request = store.get(key);
return new Promise<BackupData | null>((resolve, reject) => {
@@ -306,7 +308,9 @@ class ImageCache {
? await this.getCacheData(key)
: await Promise.race([
this.getCacheData(key),
new Promise<undefined>((_,reject) => setTimeout(() => reject(undefined), 100))
new Promise<undefined>((_,reject) => setTimeout(() => {
reject(undefined);
}, 100))
]);
this.fullyInitialized = true;
if(!cachedData) return undefined;
+23
View File
@@ -1,3 +1,4 @@
import { Modifier } from "obsidian";
import { DEVICE } from "src/constants/constants";
import { ExcalidrawSettings } from "src/settings";
export type ModifierKeys = {shiftKey:boolean, ctrlKey: boolean, metaKey: boolean, altKey: boolean};
@@ -177,4 +178,26 @@ export const emulateKeysForLinkClick = (action: PaneTarget): ModifierKeys => {
export const anyModifierKeysPressed = (e: ModifierKeys): boolean => {
return e.shiftKey || e.ctrlKey || e.metaKey || e.altKey;
}
export function modifierLabel(modifiers: Modifier[], platform?: "Mac" | "Other"): string {
const isMacPlatform = platform === "Mac" ||
(platform === undefined && (DEVICE.isIOS || DEVICE.isMacOS));
return modifiers.map(modifier => {
switch (modifier) {
case "Mod":
return isMacPlatform ? "CMD" : "CTRL";
case "Ctrl":
return "CTRL";
case "Meta":
return isMacPlatform ? "CMD" : "WIN";
case "Shift":
return "SHIFT";
case "Alt":
return isMacPlatform ? "OPTION" : "ALT";
default:
return modifier;
}
}).join("+");
}
+23 -5
View File
@@ -3,13 +3,14 @@ import {
Editor,
FrontMatterCache,
MarkdownView,
normalizePath, OpenViewState, parseFrontMatterEntry, TFile, View, Workspace, WorkspaceLeaf, WorkspaceSplit
normalizePath, OpenViewState, parseFrontMatterEntry, TFile, View, ViewState, Workspace, WorkspaceLeaf, WorkspaceSplit
} from "obsidian";
import ExcalidrawPlugin from "../main";
import { checkAndCreateFolder, splitFolderAndFilename } from "./FileUtils";
import { linkClickModifierType, ModifierKeys } from "./ModifierkeyHelper";
import { REG_BLOCK_REF_CLEAN, REG_SECTION_REF_CLEAN } from "src/constants/constants";
import { REG_BLOCK_REF_CLEAN, REG_SECTION_REF_CLEAN, VIEW_TYPE_EXCALIDRAW } from "src/constants/constants";
import yaml, { Mark } from "js-yaml";
import { debug, DEBUGGING } from "./DebugHelper";
export const getParentOfClass = (element: Element, cssClass: string):HTMLElement | null => {
let parent = element.parentElement;
@@ -300,7 +301,7 @@ export const openLeaf = ({
return {leaf, promise};
}
export const mergeMarkdownFiles = (template: string, target: string): string => {
export function mergeMarkdownFiles (template: string, target: string): string {
// Extract frontmatter from the template
const templateFrontmatterEnd = template.indexOf('---', 4); // Find end of frontmatter
const templateFrontmatter = template.substring(4, templateFrontmatterEnd).trim();
@@ -312,8 +313,8 @@ export const mergeMarkdownFiles = (template: string, target: string): string =>
// Extract frontmatter from the target if it exists
let targetFrontmatterObj: FrontMatterCache = {};
let targetContent = '';
if (target.includes('---')) {
const targetFrontmatterEnd = target.indexOf('---', 4); // Find end of frontmatter
if (target.startsWith('---\n') && target.indexOf('---\n', 4) > 0) {
const targetFrontmatterEnd = target.indexOf('---\n', 4); // Find end of frontmatter
const targetFrontmatter = target.substring(4, targetFrontmatterEnd).trim();
targetContent = target.substring(targetFrontmatterEnd + 3); // Skip frontmatter and ---
@@ -392,3 +393,20 @@ export const foldExcalidrawSection = (view: MarkdownView) => {
view.currentMode.applyFoldInfo({ folds: foldPositions, lines: lineCount });
}
};
export async function setExcalidrawView(leaf: WorkspaceLeaf) {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(setExcalidrawView,`setExcalidrawView`, leaf);
await leaf.setViewState({
type: VIEW_TYPE_EXCALIDRAW,
state: leaf.view.getState(),
popstate: true,
} as ViewState);
}
export async function closeLeafView(leaf: WorkspaceLeaf) {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(setExcalidrawView,`setExcalidrawView`, leaf);
await leaf.setViewState({
type: "empty",
state: {},
});
}
+83 -39
View File
@@ -1,18 +1,12 @@
import {
App,
Notice,
request,
requestUrl,
request,requestUrl,
TFile,
TFolder,
} from "obsidian";
import { Random } from "roughjs/bin/math";
import { BinaryFileData, DataURL} from "@zsviczian/excalidraw/types/excalidraw/types";
import {
ASSISTANT_FONT,
CASCADIA_FONT,
VIRGIL_FONT,
} from "src/constants/constFonts";
import {
exportToSvg,
exportToBlob,
@@ -33,7 +27,8 @@ import { Mutable } from "@zsviczian/excalidraw/types/excalidraw/utility-types";
import { cleanBlockRef, cleanSectionHeading, getFileCSSClasses } from "./ObsidianUtils";
import { updateElementLinksToObsidianLinks } from "src/ExcalidrawAutomate";
import { CropImage } from "./CropImage";
import opentype from 'opentype.js';
import { runCompressionWorker } from "src/workers/compression-worker";
declare const PLUGIN_VERSION:string;
declare var LZString: any;
@@ -314,6 +309,7 @@ export async function getSVG (
exportPadding: exportSettings.frameRendering ? 0 : padding,
exportingFrame: null,
renderEmbeddables: true,
skipInliningFonts: exportSettings.skipInliningFonts,
});
}
if(svg) {
@@ -404,34 +400,6 @@ export async function getQuickImagePreview (
}
};
export function embedFontsInSVG(
svg: SVGSVGElement,
plugin: ExcalidrawPlugin,
localOnly: boolean = false,
): SVGSVGElement {
//replace font references with base64 fonts)
const includesVirgil = !localOnly &&
svg.querySelector("text[font-family^='Virgil']") !== null;
const includesCascadia = !localOnly &&
svg.querySelector("text[font-family^='Cascadia']") !== null;
const includesAssistant = !localOnly &&
svg.querySelector("text[font-family^='Assistant']") !== null;
const includesLocalFont =
svg.querySelector("text[font-family^='LocalFont']") !== null;
const defs = svg.querySelector("defs");
if (defs && (includesCascadia || includesVirgil || includesLocalFont || includesAssistant)) {
let style = defs.querySelector("style");
if (!style) {
style = document.createElement("style");
defs.appendChild(style);
}
style.innerHTML = `${includesVirgil ? (VIRGIL_FONT + "\n") : ""}${
includesCascadia ? (CASCADIA_FONT + "\n") : ""}${
includesAssistant ? (ASSISTANT_FONT + "\n") : ""
}${includesLocalFont ? (plugin.fourthFontDef + "\n") : ""}`;
}
return svg;
};
export async function getImageSize (
src: string,
@@ -561,12 +529,37 @@ export function getLinkParts (fname: string, file?: TFile): LinkParts {
};
};
export async function compressAsync (data: string): Promise<string> {
return await runCompressionWorker(data, "compress");
}
export function compress (data: string): string {
return LZString.compressToBase64(data).replace(/(.{256})/g, "$1\n\n");
const compressed = LZString.compressToBase64(data);
let result = '';
const chunkSize = 256;
for (let i = 0; i < compressed.length; i += chunkSize) {
result += compressed.slice(i, i + chunkSize) + '\n\n';
}
return result.trim();
};
export function decompress (data: string): string {
return LZString.decompressFromBase64(data.replaceAll("\n", "").replaceAll("\r", ""));
export async function decompressAsync (data: string): Promise<string> {
return await runCompressionWorker(data, "decompress");
};
export function decompress (data: string, isAsync:boolean = false): string {
let cleanedData = '';
const length = data.length;
for (let i = 0; i < length; i++) {
const char = data[i];
if (char !== '\n' && char !== '\r') {
cleanedData += char;
}
}
return LZString.decompressFromBase64(cleanedData);
};
export function isMaskFile (
@@ -780,6 +773,10 @@ export function getEmbeddedFilenameParts (fname:string): FILENAMEPARTS {
}
}
export function isImagePartRef (parts: FILENAMEPARTS): boolean {
return (parts.hasGroupref || parts.hasArearef || parts.hasFrameref || parts.hasClippedFrameref);
}
export function fragWithHTML (html: string) {
return createFragment((frag) => (frag.createDiv().innerHTML = html));
}
@@ -924,4 +921,51 @@ export function addIframe (containerEl: HTMLElement, link:string, startAt?: numb
sandbox: "allow-forms allow-presentation allow-same-origin allow-scripts allow-modals",
},
});
}
export interface FontMetrics {
unitsPerEm: number;
ascender: number;
descender: number;
lineHeight: number;
fontName: string;
}
export async function getFontMetrics(fontUrl: string, name: string): Promise<FontMetrics | null> {
try {
const font = await opentype.load(fontUrl);
const unitsPerEm = font.unitsPerEm;
const ascender = font.ascender;
const descender = font.descender;
const lineHeight = (ascender - descender) / unitsPerEm;
const fontName = font.names.fontFamily.en ?? name;
return {
unitsPerEm,
ascender,
descender,
lineHeight,
fontName,
};
} catch (error) {
console.error('Error loading font:', error);
return null;
}
}
// Thanks https://stackoverflow.com/a/54555834
export function cropCanvas(
srcCanvas: HTMLCanvasElement,
crop: { left: number, top: number, width: number, height: number },
output: { width: number, height: number } = { width: crop.width, height: crop.height })
{
const dstCanvas = createEl('canvas');
dstCanvas.width = output.width;
dstCanvas.height = output.height;
dstCanvas.getContext('2d')!.drawImage(
srcCanvas,
crop.left, crop.top, crop.width, crop.height,
0, 0, output.width, output.height
);
return dstCanvas;
}
+90
View File
@@ -0,0 +1,90 @@
import { THEME } from "../constants/constants";
import type { Theme } from "@zsviczian/excalidraw/types/excalidraw/element/types";
import type { DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
import type { OpenAIInput, OpenAIOutput } from "@zsviczian/excalidraw/types/excalidraw/data/ai/types";
export type MagicCacheData =
| {
status: "pending";
}
| { status: "done"; html: string }
| {
status: "error";
message?: string;
code: "ERR_GENERATION_INTERRUPTED" | string;
};
const SYSTEM_PROMPT = `You are a skilled front-end developer who builds interactive prototypes from wireframes, and is an expert at CSS Grid and Flex design.
Your role is to transform low-fidelity wireframes into working front-end HTML code.
YOU MUST FOLLOW FOLLOWING RULES:
- Use HTML, CSS, JavaScript to build a responsive, accessible, polished prototype
- Leverage Tailwind for styling and layout (import as script <script src="https://cdn.tailwindcss.com"></script>)
- Inline JavaScript when needed
- Fetch dependencies from CDNs when needed (using unpkg or skypack)
- Source images from Unsplash or create applicable placeholders
- Interpret annotations as intended vs literal UI
- Fill gaps using your expertise in UX and business logic
- generate primarily for desktop UI, but make it responsive.
- Use grid and flexbox wherever applicable.
- Convert the wireframe in its entirety, don't omit elements if possible.
If the wireframes, diagrams, or text is unclear or unreadable, refer to provided text for clarification.
Your goal is a production-ready prototype that brings the wireframes to life.
Please output JUST THE HTML file containing your best attempt at implementing the provided wireframes.`;
export async function diagramToHTML({
image,
apiKey,
text,
theme = THEME.LIGHT,
}: {
image: DataURL;
apiKey: string;
text: string;
theme?: Theme;
}) {
const body: OpenAIInput.ChatCompletionCreateParamsBase = {
model: "gpt-4-vision-preview",
// 4096 are max output tokens allowed for `gpt-4-vision-preview` currently
max_tokens: 4096,
temperature: 0.1,
messages: [
{
role: "system",
content: SYSTEM_PROMPT,
},
{
role: "user",
content: [
{
type: "image_url",
image_url: {
url: image,
detail: "high",
},
},
{
type: "text",
text: `Above is the reference wireframe. Please make a new website based on these and return just the HTML file. Also, please make it for the ${theme} theme. What follows are the wireframe's text annotations (if any)...`,
},
{
type: "text",
text,
},
],
},
],
};
let result:
| ({ ok: true } & OpenAIOutput.ChatCompletion)
| ({ ok: false } & OpenAIOutput.APIError);
return await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify(body),
});
}
+100
View File
@@ -0,0 +1,100 @@
function createWorkerBlob(jsCode:string) {
// Create a new Blob with the JavaScript code
const blob = new Blob([jsCode], { type: 'text/javascript' });
// Create a URL for the Blob
const url = URL.createObjectURL(blob);
return url;
}
const workerCode = `
var LZString=function(){var r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(r,o){if(!e[r]){e[r]={};for(var n=0;n<r.length;n++)e[r][r.charAt(n)]=n}return e[r][o]}var i={compressToBase64:function(r){if(null==r)return"";var n=i._compress(r,6,function(r){return o.charAt(r)});switch(n.length%4){default:case 0:return n;case 1:return n+"===";case 2:return n+"==";case 3:return n+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(n){return t(o,r.charAt(n))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(r){return null==r?"":""==r?null:i._decompress(r.length,16384,function(o){return r.charCodeAt(o)-32})},compressToUint8Array:function(r){for(var o=i.compress(r),n=new Uint8Array(2*o.length),e=0,t=o.length;e<t;e++){var s=o.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null==o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;e<t;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(r){return null==r?"":i._compress(r,6,function(r){return n.charAt(r)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(o){return t(n,r.charAt(o))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(r,o,n){if(null==r)return"";var e,t,i,s={},u={},a="",p="",c="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<r.length;i+=1)if(a=r.charAt(i),Object.prototype.hasOwnProperty.call(s,a)||(s[a]=f++,u[a]=!0),p=c+a,Object.prototype.hasOwnProperty.call(s,p))c=p;else{if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e<h;e++)m<<=1,v==o-1?(v=0,d.push(n(m)),m=0):v++;for(t=c.charCodeAt(0),e=0;e<8;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;e<h;e++)m=m<<1|t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=c.charCodeAt(0),e=0;e<16;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++),s[p]=f++,c=String(a)}if(""!==c){if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e<h;e++)m<<=1,v==o-1?(v=0,d.push(n(m)),m=0):v++;for(t=c.charCodeAt(0),e=0;e<8;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;e<h;e++)m=m<<1|t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=c.charCodeAt(0),e=0;e<16;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==o-1){d.push(n(m));break}v++}return d.join("")},decompress:function(r){return null==r?"":""==r?null:i._decompress(r.length,32768,function(o){return r.charCodeAt(o)})},_decompress:function(o,n,e){var t,i,s,u,a,p,c,l=[],f=4,h=4,d=3,m="",v=[],g={val:e(0),position:n,index:1};for(t=0;t<3;t+=1)l[t]=t;for(s=0,a=Math.pow(2,2),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 2:return""}for(l[3]=c,i=c,v.push(c);;){if(g.index>o)return"";for(s=0,a=Math.pow(2,d),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(c=s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[c])m=l[c];else{if(c!==h)return null;m=i+i.charAt(0)}v.push(m),l[h++]=i+m.charAt(0),i=m,0==--f&&(f=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module?module.exports=LZString:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return LZString});
self.onmessage = function(e) {
const { data, action } = e.data;
try {
switch (action) {
case 'compress':
if (!data) throw new Error("No input string provided for compression.");
const compressed = LZString.compressToBase64(data);
let result = '';
const chunkSize = 256;
for (let i = 0; i < compressed.length; i += chunkSize) {
result += compressed.slice(i, i + chunkSize) + '\\n\\n';
}
self.postMessage({ compressed: result.trim() });
break;
case 'decompress':
if (!data) throw new Error("No input string provided for decompression.");
let cleanedData = '';
const length = data.length;
for (let i = 0; i < length; i++) {
const char = data[i];
if (char !== '\\n' && char !== '\\r') {
cleanedData += char;
}
}
const decompressed = LZString.decompressFromBase64(cleanedData);
self.postMessage({ decompressed });
break;
default:
throw new Error("Unknown action.");
}
} catch (error) {
// Post the error message back to the main thread
self.postMessage({ error: error.message });
}
};
`;
let worker:Worker | null = null;
export function initCompressionWorker() {
if(!worker) {
worker = new Worker(createWorkerBlob(workerCode));
}
}
export async function runCompressionWorker(data:string, action: 'compress' | 'decompress'): Promise<string> {
return new Promise((resolve, reject) => {
worker.onmessage = function(e) {
const { compressed, decompressed, error } = e.data;
if (error) {
reject(new Error(error));
} else if (compressed || decompressed) {
resolve(compressed || decompressed);
} else {
reject(new Error('Unexpected response from worker'));
}
};
// Set up the worker's error handler
worker.onerror = function(error) {
reject(new Error(error.message));
};
// Post the message to the worker
worker.postMessage({ data, action });
});
}
export function terminateCompressionWorker() {
worker.terminate();
worker = null;
}
export let IS_WORKER_SUPPORTED = false;
function canCreateWorkerFromBlob() {
try {
const blob = new Blob(["self.onmessage = function() {}"]);
const url = URL.createObjectURL(blob);
const worker = new Worker(url);
worker.terminate();
URL.revokeObjectURL(url);
IS_WORKER_SUPPORTED = true;
} catch (e) {
IS_WORKER_SUPPORTED = false;
}
}
canCreateWorkerFromBlob();
+35
View File
@@ -594,4 +594,39 @@ root {
textarea.excalidraw-wysiwyg, .excalidraw input {
caret-color: var(--excalidraw-caret-color);
}
.excalidraw-settings-links-container {
display: flex; /* Align SVG and text horizontally */
align-items: center; /* Center SVG and text vertically */
text-decoration: none; /* Remove underline from links */
color: inherit; /* Inherit text color */
text-align: center;
}
.excalidraw-settings-links-container a {
display: flex; /* Align children horizontally */
align-items: center; /* Center items vertically */
text-align: left;
}
.excalidraw-settings-links-container svg {
margin-right: 8px;
height: 30px;
width: 30px;
}
.excalidraw-rank {
text-align: center;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.excalidraw-rank svg {
height: 8rem;
width: 8rem;
}
.excalidraw .color-picker-content input[type="color"] {
filter: var(--theme-filter);
}
+6 -7
View File
@@ -2,9 +2,9 @@
"compilerOptions": {
"baseUrl": ".",
"sourceMap": false,
"module": "ES2015",
"target": "es2018", //es2017 because script engine requires for async execution
"allowJs": true,
"module": "es2020",
"target": "es2022", //min es2017 because script engine requires for async execution and min es2018 for named capture groups
"allowJs": false,
"noImplicitAny": true,
"moduleResolution": "node",
"esModuleInterop": true,
@@ -13,16 +13,15 @@
"lib": [
"dom",
"scripthost",
"es2015",
"esnext",
"es2022",
"DOM.Iterable"
],
"jsx": "react",
"inlineSourceMap": true
"inlineSourceMap": true,
},
"include": [
"**/*.ts",
"**/*.tsx", "src/Dialogs/OpenDrawing.ts",
"src/types.d.ts"
"src/types/types.d.ts",
]
}
+6 -7
View File
@@ -2,9 +2,9 @@
"compilerOptions": {
"baseUrl": ".",
"sourceMap": false,
"module": "es2015",
"target": "es2018", //es2017 because script engine requires for async execution //es2018 for named capture groups
"allowJs": true,
"module": "es2020",
"target": "es2022", //min es2017 because script engine requires for async execution and min es2018 for named capture groups
"allowJs": false,
"noImplicitAny": true,
"moduleResolution": "node",
"esModuleInterop": true,
@@ -13,15 +13,14 @@
"lib": [
"dom",
"scripthost",
"es2015",
"esnext",
"es2022",
"DOM.Iterable"
],
"jsx": "react"
"jsx": "react",
},
"include": [
"**/*.ts",
"**/*.tsx", "src/Dialogs/OpenDrawing.ts",
"src/types.d.ts"
"src/types/types.d.ts",
]
}