Compare commits

..
562 Commits
Author SHA1 Message Date
zsviczian 121c3538e4 2.20.5 2026-02-19 08:02:03 +01:00
zsviczian a42450bcd1 2.20.5-beta-3, 0.18.0-79 2026-02-18 20:55:22 +01:00
zsviczian 6c2e3f06a6 Merge pull request #2674 from playermiller109/2026-02-18
Update zh-cn.ts to 376738f
2026-02-18 19:21:21 +01:00
playermiller109 8db62c1a73 Update zh-cn.ts to 376738f 2026-02-18 13:05:10 +08:00
zsviczian 376738f894 2.20.5-beta-2, 0.18.0-78 2026-02-17 21:27:40 +01:00
zsviczian 6a69d61f2d 2.20.5-beta-1 2026-02-16 23:06:36 +01:00
zsviczian 2ddf503df8 update docs 2026-02-14 20:37:04 +01:00
zsviczian 6b55cc62b6 2.20.4, 0.18.0-77 2026-02-13 20:24:10 +01:00
zsviczian 5384105e63 2.20.4-beta-1, 0.18.0-76 2026-02-12 21:43:27 +01:00
zsviczian 37397933b2 Merge pull request #2668 from TravisLEBLANC1/latex-scaling2
add back latex scale on update
2026-02-12 21:37:06 +01:00
zsviczian 48fba1d64d fixed nativeSVG sizing in obsidian 1.12.1 2026-02-12 14:33:33 +00:00
TravisLeblanc1 eee1bec4a0 add back latex scale on update 2026-02-12 10:34:45 +01:00
zsviczian ee74a567a9 2.20.3, 0.18.0-75 2026-02-08 13:08:34 +01:00
zsviczian 45d46bdb5d Mindmap builder fixes 2026-02-07 16:58:07 +01:00
zsviczian 555046ad66 Merge pull request #2655 from superle3/feat/latex_editor_keymaps
feat: add default keymap to latex editor
2026-02-07 14:38:36 +01:00
zsviczian 90e15a1388 Merge branch 'master' of https://github.com/zsviczian/obsidian-excalidraw-plugin 2026-02-07 14:37:01 +01:00
zsviczian 059b072a2b fix main import 2026-02-07 14:36:16 +01:00
zsviczian d15e18f80c Merge pull request #2658 from Ev357/fix-build
fix: incorrect import
2026-02-07 14:35:12 +01:00
zsviczian 3a0c0a15ed addElementsToView awaits image load 2026-02-07 14:34:08 +01:00
zsviczian b465abe2f0 update stroke width and branch color when promoting / demoting 2026-02-07 12:09:38 +01:00
zsviczian a179968af4 performance optimization 2026-02-07 12:01:01 +01:00
Ev357 5cd50698fb fix: incorrect import 2026-02-07 10:59:44 +01:00
zsviczian 72206f33da optimized getDecorationAndCrossLinkIdsForBranches 2026-02-07 10:20:57 +01:00
zsviczian 8b8f5ac675 improved grouping 2026-02-07 10:07:57 +01:00
zsviczian b6d3a2b8ae LAYOUT settings update map when values are changed 2026-02-07 06:33:52 +01:00
zsviczian 4695c328a9 fixed saving layout settings 2026-02-07 05:57:30 +01:00
zsviczian f050dd5544 save LAYOUT_METADATA 2026-02-05 22:03:50 +01:00
zsviczian 26fdb744c4 autoLayoutDisabled typo 2026-02-05 21:47:14 +01:00
zsviczian 972193c236 fix deconstruct selected elements undefined check 2026-02-05 20:54:22 +01:00
superle3 efa7c93e18 feat: add default keymap to latex editor
Add default keymap of codemirror to the latex editor,
such that users can use familiar keybindings
and that deletion works properly for decorations/atomic ranges
and thus works for latex suite delayed concealment.
2026-02-05 18:16:18 +01:00
zsviczian b4226cbf78 commitEdit selective element updates 2026-02-04 22:59:40 +01:00
zsviczian 75538bb87d addElementsToView change 2026-02-04 22:42:10 +01:00
zsviczian 20e6d6da86 Merge pull request #2654 from rlan/feat/zh-tw/d9f65d00
Update zh-tw.ts at d9f65d00
2026-02-04 19:36:04 +01:00
Rick Lan a03e515ac8 Update zh-tw.ts at d9f65d00 2026-02-04 09:55:31 -08:00
zsviczian d9f65d00e8 Update styles.css 2026-02-04 13:08:18 +01:00
zsviczian 45fe0fec25 2.20.2, 0.18.0-74 2026-02-01 16:52:53 +01:00
zsviczian bb0f508e6e more robust value initialization 2026-02-01 11:18:37 +01:00
zsviczian 266e6f87c3 captureUpdte 2026-02-01 07:22:41 +01:00
zsviczian d04a6d4eae disableTabEvents 2026-01-31 22:11:09 +01:00
zsviczian 18d79c18f8 focusSelected, and zoomToFit should not activate input, if map is selected 2026-01-31 14:55:24 +01:00
zsviczian 7d22bc0970 focus inputEl, reveal sidepanel tab if not visible 2026-01-31 14:44:39 +01:00
zsviczian f5d125e21f llm doc update 2026-01-31 14:30:13 +01:00
zsviczian 92e3b44234 ontology errors 2026-01-31 14:29:55 +01:00
zsviczian 50306f5834 2.20.1, 0.18.0-73 2026-01-31 12:03:34 +01:00
zsviczian 077274f343 tab navigation on iPad, boundary z-index during paste 2026-01-31 08:07:11 +01:00
zsviczian a55e9c061f ontology hidden when not relevant 2026-01-31 07:17:49 +01:00
zsviczian e4db79addb ontology editing 2026-01-30 21:20:28 +01:00
zsviczian fe9bbbf5a8 stroke width scale 2026-01-30 18:10:18 +01:00
zsviczian 8e84be734d copy/paste mindmap branch ontology 2026-01-30 08:23:52 +00:00
zsviczian e23523c713 addUpdateArrowLabel 2026-01-30 07:38:53 +00:00
zsviczian 1969a45085 fixed fileExplorerObserver 2026-01-29 22:39:49 +01:00
zsviczian 61388ddd17 updated mindmap builder 2026-01-29 20:02:31 +01:00
zsviczian ebe9b6d357 ACTION_FOCUS, ACTION_ZOOM to select most recently active node and activate inputEl 2026-01-29 19:55:41 +01:00
zsviczian 16fbe0bff1 radial sweep, paste fix 2026-01-29 19:25:05 +01:00
zsviczian 105289a0cc fixed promote / demote, up/down 2026-01-29 18:07:17 +01:00
zsviczian 30abb1b7a7 2.2.20, 0.18.0-72 2026-01-27 20:48:39 +01:00
zsviczian 9c17d3f7a0 Merge pull request #2631 from playermiller109/2026-01-26
Update zh-cn.ts to e250835
2026-01-26 20:59:44 +01:00
playermiller109 8a74120640 Update zh-cn.ts to e250835 2026-01-26 09:37:19 +08:00
zsviczian e25083504b fix workspace freeze on load 2026-01-25 16:43:13 +01:00
zsviczian ff5780b703 shade master formatting 2026-01-25 15:51:08 +01:00
zsviczian 465b99edb8 reveal tab issue: restore tab no longer overrides new tab 2026-01-25 15:49:58 +01:00
zsviczian e977a3d9d3 2.20.0-beta-4, 0.18.0-71 2026-01-25 15:06:26 +01:00
zsviczian c3b0803676 fixed inverted color in export when export theme !== current view theme 2026-01-25 14:47:41 +01:00
zsviczian 1e696bdcc1 context menu to set image inversion 2026-01-25 13:30:30 +01:00
zsviczian 99cf5c26e2 PDF.js config fixes: wasmUrl, cMapUrl, standardFontDataUrl, iccUrl 2026-01-25 12:17:30 +01:00
zsviczian dd81b137e4 mixed pdf page dimensions #2578 2026-01-25 11:13:39 +01:00
zsviczian 82a41e7cc1 shade master migrated to sidepanel 2026-01-25 10:21:03 +01:00
zsviczian 5b7644e5a3 2.20.0-beta-3, 0.18.0-70 2026-01-24 20:38:29 +01:00
zsviczian bdd55aea2c Merge branch 'master' of https://github.com/zsviczian/obsidian-excalidraw-plugin 2026-01-24 18:35:18 +01:00
zsviczian b26cb5d067 mermaidToExcelidraw Type 2026-01-24 18:35:15 +01:00
zsviczian d2e1d72678 fix fold_all label 2026-01-24 08:06:17 +01:00
zsviczian 76e5d82c0f 2.20.0-beta-2 2026-01-23 20:28:07 +01:00
zsviczian 9391ba45a3 Merge pull request #2623 from playermiller109/2026-01-22
Update zh-cn.ts to cfa18cd
2026-01-23 20:09:15 +01:00
zsviczian e08db69c4c invert latex and SVG and ea.setTheme fixes 2026-01-23 19:31:56 +01:00
playermiller109 59d2650a99 Update zh-cn.ts to cfa18cd 2026-01-23 11:04:29 +08:00
playermiller109 fcecb19d11 feat(MindmapBuilder/i18n): Add translation 2026-01-23 11:04:12 +08:00
playermiller109 5cbe209666 fix(MindmapBuilder): Match the ACTION_FOLD_ALL tooltip 2026-01-23 09:02:12 +08:00
playermiller109 922aa5d17b fix(MindmapBuilder): Add the missing ACTION_REARRANGE key mapping 2026-01-23 09:02:12 +08:00
playermiller109 6206962185 fix(MindmapBuilder): Correct translation keys for Copy/Cut/Paste actions 2026-01-23 09:02:12 +08:00
playermiller109 0204a1d19c style(MindmapBuilder/i18n): Unify key-spacing 2026-01-23 09:02:12 +08:00
zsviczian cfa18cdd6d 2.20.0-beta-1, 0.18.0-69 2026-01-22 21:51:52 +01:00
zsviczian ab3bed01cd mindmap builder update 2026-01-22 20:58:30 +01:00
zsviczian 711142a899 save crosslink ontology to markdown, align text in containers during globalLayout 2026-01-22 19:21:16 +01:00
zsviczian cc5a3006c9 fixed mobile nav-bar and implemented new chat interface for TextToDiagram 2026-01-21 23:08:50 +01:00
zsviczian 03d3e25611 2.20.0 - draft recovered 2026-01-21 18:02:01 +01:00
zsviczian 478fca4306 2.19.2 2026-01-18 23:38:59 +01:00
zsviczian 0446b3dbed Added new mindmap builder video 2026-01-18 21:13:48 +01:00
zsviczian b0b2afb972 Merge pull request #2611 from zsviczian/mindmap-hotkeys
Mindmap hotkeys
2026-01-18 18:37:21 +01:00
zsviczian 5d5970c62d min plugin version 2026-01-18 17:50:49 +01:00
zsviczian 4bcb9be49d Fixed LayoutConfigModal and folding of groups 2026-01-18 17:47:49 +01:00
zsviczian 8d9546f4cd minor fixes 2026-01-18 16:47:51 +01:00
zsviczian 5257a0a73f fixed recursive ungrouping 2026-01-17 23:40:26 +01:00
zsviczian 955b0de308 generate library script 2026-01-17 23:28:02 +01:00
zsviczian e2739fe34c bugs 2026-01-17 23:22:43 +01:00
zsviczian 3ac427f813 fix addSibling, toggleBox 2026-01-17 20:29:48 +01:00
zsviczian 36044e41a1 fold indicator position 2026-01-17 17:57:32 +01:00
zsviczian 91156279c5 update sub-tree font size 2026-01-17 12:24:01 +01:00
zsviczian 1083c9fb10 subtreeheight to include boundary 2026-01-17 12:01:07 +01:00
zsviczian 1e40fe28db improved radial 2026-01-17 10:42:43 +01:00
zsviczian c3d8f8e5d5 side swap 2026-01-17 10:23:02 +01:00
zsviczian 49d657aad9 demote node 2026-01-17 10:04:46 +01:00
zsviczian d844daaaec Demote skeleton 2026-01-17 09:56:50 +01:00
zsviczian ecd24f57a6 promote/demote 2026-01-17 09:41:49 +01:00
zsviczian 30c901e6f3 parseImageInput file undefined 2026-01-16 13:55:34 +00:00
zsviczian 2d7873ad0d Add sibling, improve navigate children 2026-01-16 13:28:48 +00:00
zsviczian b1786a35e8 mindmap builder deploy script 2026-01-15 20:35:50 +01:00
zsviczian 7033020101 updated description 2026-01-15 20:22:47 +01:00
zsviczian 9853b6b0fc 2.19.1 2026-01-15 19:30:30 +01:00
zsviczian bfc4e4561a Merge pull request #2604 from TravisLEBLANC1/latex-scaling
latex scaling on update
2026-01-15 19:15:43 +01:00
zsviczian c557d1c0e8 workspace-drawer observer for Obsidian Mobile 2026-01-15 18:16:43 +01:00
zsviczian e912ab698b InlineLinkSuggester to support headings and block references 2026-01-15 17:39:43 +01:00
zsviczian 1657837830 validate imageInfo has value 2026-01-15 14:39:22 +00:00
TravisLeblanc1 20e305931b copy last modified latex's scaling
When creating a new latex, we copy the last
modified latex'scaling
2026-01-15 10:09:56 +01:00
TravisLeblanc1 33be7275b1 add scaleX/scaleY to ea.addLaTex 2026-01-15 10:09:15 +01:00
zsviczian 97f425b6de support for adding back of the node card to maps 2026-01-14 20:27:34 +01:00
zsviczian 46d69db8a6 updated MindMap Builder script .md 2026-01-14 19:20:33 +01:00
zsviczian 6326c62bcd fixed node.fontSize in toggleFoldIndicator 2026-01-14 19:18:37 +01:00
zsviczian f0e231a3e5 refactor triggerGlobalLayout 2026-01-14 18:36:36 +01:00
zsviczian 7b1d91ce0d touched 2026-01-14 14:14:38 +00:00
zsviczian b6fd3bd665 layout settings 2026-01-13 23:09:45 +01:00
zsviczian 7c24821011 fixed grouped root leads to blowup 2026-01-13 20:51:31 +01:00
zsviczian 9ae74c7af0 radialL1Distribution 2026-01-13 20:02:39 +01:00
zsviczian 14d5521483 refactor layoutL1nodes 2026-01-13 18:43:50 +01:00
zsviczian 6865fdf33c elliptical radial, drag and drop rearrange, removed dead code 2026-01-13 18:23:17 +01:00
zsviczian c573d2cba3 copy/paste crosslinks and boundaries 2026-01-12 22:36:14 +01:00
zsviczian 9186537a1a nodes in right-left in proper sequence 2026-01-12 20:18:45 +01:00
zsviczian d89a212c46 save settings to mindmap root, other miner fixes 2026-01-12 19:37:16 +01:00
zsviczian 6a1d773d87 unified updateRootNodeCustomData, added arrowType to customData on root, disabled editing of multi line roots. 2026-01-12 18:34:22 +01:00
zsviczian 4c23be299c fixed custom parent issues 2026-01-12 17:50:51 +01:00
TravisLeblanc1 4e9baf72ec rename "widthscale" for "scaleX" 2026-01-12 15:45:41 +01:00
zsviczian 1136f19bb6 to-do 2026-01-12 13:36:52 +00:00
zsviczian 230c0e9c4b import headings, add Embeddables, performAction 2026-01-12 13:33:09 +00:00
zsviczian a0e251af36 Merge pull request #2602 from rlan/feat/zh-tw/4ac8dcc
Update zh-tw.ts at 4ac8dcc
2026-01-12 07:41:30 +01:00
zsviczian dddd13e439 fixed handling frame, group ref embes, handling starting map from custom node, renamed manualMode to batch mode, exit key handler on escape if floating modal or input el is not active. Migrated most functions to getMindmapNodeFromSelection() from ea.getViewSelectedElement() 2026-01-11 22:08:24 +01:00
zsviczian 83337cbec7 fixed pinning boxed nodes 2026-01-11 19:47:55 +01:00
zsviczian 7c14328226 fixed navigation when boxed element 2026-01-11 17:05:28 +01:00
zsviczian dd579e8d52 fixed crosslink visibility when crosslink between decoration and node during folding / unfolding 2026-01-11 16:02:43 +01:00
zsviczian c5b34b0e50 default to Right-Left, select node if replace 2026-01-11 15:46:37 +01:00
zsviczian 6651db8c3a unified, updated comments 2026-01-11 15:10:20 +01:00
zsviczian 60a692ba7b decorations and cross links move when replacing text with imge node and vice versa 2026-01-11 14:52:05 +01:00
zsviczian a21481aae5 commitEdit handles node replacement 2026-01-11 13:59:16 +01:00
zsviczian e1ec75f7c7 extracted addImage to its own function, added leaf change to event remover 2026-01-11 13:11:54 +01:00
zsviczian b15a9cff91 folding to hide decorations and crosslinks, navigation on the left side should be reverse, always check for the existence of window.MindmapBuilder 2026-01-11 12:37:53 +01:00
TravisLeblanc1 375c29171c latex scaling on update
add current latex scaling in customData.latexscale
before updating it
2026-01-11 12:05:18 +01:00
zsviczian c7bbb0ca0f updateUI for foldAll 2026-01-11 11:49:00 +01:00
zsviczian 3dd3f6c5a3 Fold/Unfold all 2026-01-11 11:45:26 +01:00
zsviczian 3931fa95b8 batch paste and radial root arrows 2026-01-11 10:26:50 +01:00
zsviczian fc03c0bfd2 radial layout nodes are from the center 2026-01-11 10:01:05 +01:00
zsviczian 00ce6b1883 layout fixes 2026-01-11 09:39:51 +01:00
zsviczian a9a2c63873 left-right mode 2026-01-11 08:42:09 +01:00
zsviczian 4bd42bff9a deconstructed functions 2026-01-11 08:09:15 +01:00
zsviczian a2ae59965b reshuffled code 2026-01-11 07:24:07 +01:00
zsviczian 49d6e2180e paste message 2026-01-10 21:10:11 +01:00
zsviczian 75f69af2cd curved arrows 2026-01-10 20:48:09 +01:00
Rick Lan 0a5a7660fc Update zh-tw.ts 2026-01-10 10:43:20 -08:00
zsviczian f2eed2a755 reinstated fixed pinning 2026-01-10 19:07:07 +01:00
zsviczian 9b0c656e0b removed unused variables 2026-01-10 17:52:41 +01:00
zsviczian ada0caea1a fixed fold indicator positioning 2026-01-10 17:24:38 +01:00
zsviczian 37c1c2459f button row styling and inputEl focus 2026-01-10 15:50:21 +01:00
zsviczian 38ad0c9eed fixed node sort logic to use node position not nodeBox position 2026-01-10 13:19:00 +01:00
zsviczian dd37894ddd disable folding when no eligible nodes are available 2026-01-10 13:01:45 +01:00
zsviczian 54bb7558f7 improve group handling 2026-01-10 12:37:50 +01:00
zsviczian d698f2d3f7 reposition non-mindmap elements grouped with branches 2026-01-10 11:40:16 +01:00
zsviczian 135e634df3 transform non-mindmap arrow arrow during map rearrange 2026-01-10 11:01:32 +01:00
zsviczian bec690c792 Boundary layering 2026-01-10 10:46:57 +01:00
zsviczian d57d8ecc9d Added group, box, zoom, focus buttons to floating modal 2026-01-10 10:08:07 +01:00
zsviczian ab5d26078c Added unfolding extras to floating modal, removed focusInput from most actions 2026-01-10 09:35:39 +01:00
zsviczian 1b7f9c19de added isBoundary to boundary to help with updateUI 2026-01-10 09:07:40 +01:00
zsviczian 22324613f3 reverted "docked", "floating", "sidebar" modes 2026-01-10 08:36:59 +01:00
zsviczian 3baf7de216 fixed group button 2026-01-10 07:55:05 +01:00
zsviczian 250a1a14d5 DEFAULT_HOTKEYS 2026-01-10 07:26:34 +01:00
zsviczian fd0d84d240 retain buttons in sidepanel 2026-01-10 07:26:19 +01:00
zsviczian a9ffdde8e5 boundaries v1 2026-01-09 19:51:24 +01:00
zsviczian 5206aff1cf INDICATOR_OFFSET fix 2026-01-09 17:21:50 +01:00
zsviczian 8022f9a89b fixed greedy grouping 2026-01-09 13:33:27 +00:00
zsviczian 5216d81db9 added layout configuration modal 2026-01-09 12:29:19 +00:00
zsviczian 949789ec8c more compact default 2026-01-09 11:13:07 +00:00
zsviczian 53f21bca9b textElement.autoresize on edit, veritical spacing fix 2026-01-09 08:06:17 +00:00
zsviczian 1246eca2f3 Layout nodes on an ellipse instead of a circle 2026-01-09 07:37:04 +00:00
zsviczian 06014da0b7 double layout during paste 2026-01-09 07:17:24 +00:00
zsviczian 24b6a610b8 moved to commonBoundingBox 2026-01-09 07:04:40 +00:00
zsviczian 35dd6dd650 Instructions moved to language dictionary 2026-01-08 23:41:29 +01:00
zsviczian 26ce6dfe0d shortened documentation in script 2026-01-08 23:28:50 +01:00
zsviczian ebaab2702c language, unfold all, TAB support, fold buttons, restructure code 2026-01-08 23:23:47 +01:00
zsviczian 1638d9cc42 fixed special hotkeys, fixed unfold when add node, fixed ... color and display (when no child), honor number of tabs based on obsidian setting. 2026-01-08 18:29:43 +01:00
zsviczian 9bb5d7249e minor styling fixes 2026-01-08 13:48:26 +00:00
zsviczian 7986ed4000 scroll to focus element 2026-01-08 12:30:32 +00:00
zsviczian 4d9a8d90ba improved root navigate logic 2026-01-08 12:03:00 +00:00
zsviczian 3994f63e69 unfold when navigating to folded node 2026-01-08 11:36:07 +00:00
zsviczian 956cdf07ea handling pinned nodes during folding 2026-01-08 10:14:50 +00:00
zsviczian 03692dfd77 initial folding logic 2026-01-08 09:01:49 +00:00
zsviczian 5340669fd6 PDF paste 2026-01-07 21:56:39 +01:00
zsviczian 4ac8dcc4de addImage supports PDF++ image links 2026-01-07 21:35:16 +01:00
zsviczian aa6f07e652 Revert "migrating to restoreElements to follow recent Excalidraw changes"
This reverts commit 1efb8f3049.
2026-01-07 20:54:07 +01:00
zsviczian df281889ff paste single line 2026-01-07 20:46:59 +01:00
zsviczian 25629ee5eb performance fixes and memory leaks 2026-01-07 20:35:14 +01:00
zsviczian e6e61d3a99 Obsidian hotkey conflicts 2026-01-07 19:32:12 +01:00
zsviczian 7c9a2e9d57 fixed popScope 2026-01-07 18:05:12 +01:00
zsviczian 41177030ae wip - not working 2026-01-07 15:59:51 +00:00
zsviczian 6a09b3f873 hotkey isGlobal, isInputOnly, sync DEFAULT_HOTKEYS 2026-01-06 13:33:08 +00:00
zsviczian 0acacc8f9f renderLinksToText 2026-01-06 08:29:25 +00:00
zsviczian 1efb8f3049 migrating to restoreElements to follow recent Excalidraw changes 2026-01-06 08:12:37 +01:00
zsviczian 7d99259cdc button disable behavior 2026-01-05 16:57:33 +00:00
zsviczian a97d90653f working on grouping 2026-01-05 14:34:56 +00:00
zsviczian 06debd4106 group-ungroup 2026-01-05 13:07:40 +00:00
zsviczian 62ae0b8230 box node moved next to toggle 2026-01-05 11:37:25 +00:00
zsviczian 0e2044ba72 Merge pull request #2592 from playermiller109/2026-01-05
Update zh-cn.ts to 9319b39
2026-01-05 12:09:09 +01:00
playermiller109 0db8ab9cda Update zh-cn.ts to 9319b39 2026-01-05 11:23:36 +08:00
zsviczian 9319b39c96 only remove group ids for elements connected to the map 2026-01-04 19:00:20 +01:00
zsviczian 75cbc47bc5 Merge pull request #2591 from zsviczian/sidepanels
feat: Side panels, ColorPicker, Link Autocomplete, Mindmap Builder Improvements
2026-01-04 16:13:30 +01:00
zsviczian 66e31110e2 updated collaboration frame release date 2026-01-04 16:11:23 +01:00
zsviczian a0ec16cdf1 fixed mindmap builder after merge 2026-01-04 16:09:15 +01:00
zsviczian a5105688e4 Merge branch 'master' into sidepanels 2026-01-04 16:01:15 +01:00
zsviczian 60fe7a413f 2.19.0 2026-01-04 15:52:42 +01:00
zsviczian ee3da19290 image width to constant 2026-01-04 07:58:54 +01:00
zsviczian 4a71042fea added image support, fixed dock, undock 2026-01-03 22:44:32 +01:00
zsviczian fc51cf9a15 fixed enter navigation 2026-01-03 21:35:45 +01:00
zsviczian 1b5a6ae18a Fixed double enter, added support to add images as nodes 2026-01-03 21:21:49 +01:00
zsviczian fee74f4edd save settings when dock/undock 2026-01-03 20:44:31 +01:00
zsviczian bfcab155ca updated mindmap builder documentation 2026-01-03 17:25:51 +01:00
zsviczian 56934e0279 sidepanel.reveal, Mindmap Builder fixes, inlinesuggester fixes 2026-01-03 17:16:15 +01:00
zsviczian d89ef4caeb updated shade master with the new color picker 2026-01-02 07:21:43 +01:00
zsviczian f939db2cba 2.19.0-beta-6, see sidepanels branch for changes 2026-01-01 21:53:22 +01:00
zsviczian 04e9723048 2.19.0-beta-6, 0.18.0-65
ColorPicker, updated Pen Settings, Scribble Helper and Mindmap Builder, reintroduced insertLinkAction for mobiles and tablets,
2026-01-01 21:52:41 +01:00
zsviczian 5e68f29f7c implemented colorpicker 2026-01-01 18:45:59 +01:00
zsviczian b82ab59126 fixed suggester suggestions to be more relevant, root node of mindmap will be inverted color of current background color, If inputEl has a selection link suggester will not be displayed 2026-01-01 12:26:48 +01:00
zsviczian 894906cebb fixed inlineLinkSuggester ranking 2026-01-01 10:40:59 +01:00
zsviczian b0828011e2 2.19.0-beta-5, see sidepanels branch for the actual changes 2026-01-01 10:04:05 +01:00
zsviczian ef70901263 2.19.0-beta-5 2026-01-01 10:03:31 +01:00
zsviczian b934c429bc Added edit Node to Mindmap Builder. ea.addElementsToView now honors setting.syncElementLinkWithText 2026-01-01 00:04:13 +01:00
zsviczian 57b00f7c69 2.19.0-beta-4, see sidepanels branch for details 2025-12-31 19:05:25 +01:00
zsviczian 1e245f1136 removed INSERT_LINK from context menu 2025-12-31 19:04:17 +01:00
zsviczian a5632866b0 2.19.0-beta-4, 0.18.0-64 2025-12-31 18:57:55 +01:00
zsviczian a96f0d0889 removed insertLinkAction, implemented syncElementLinkWithText in ExcalidrawData 2025-12-31 18:26:16 +01:00
zsviczian 5cbaf5b203 syncElementLinkWithText 2025-12-31 10:42:23 +01:00
zsviczian 3cd05b0be2 Implemented attachInlineLinkSuggester for Excalidraw component, 0.18.0-63 2025-12-31 09:25:42 +01:00
zsviczian 70a6c0167d fix suggester pointer events, implement minwidth, obsidianUtils attachInlineLinkSuggester call 2025-12-30 22:07:27 +01:00
zsviczian 7150aaf795 improved spacing when subbranches are large 2025-12-30 19:10:47 +01:00
zsviczian ad3874889e Fixed add order 2025-12-29 22:37:35 +01:00
zsviczian 15d15b35e7 fix sibling navigation order 2025-12-29 22:32:11 +01:00
zsviczian 7680396b99 hotkey configuration 2025-12-29 22:08:36 +01:00
zsviczian 3f582d87fe moved shortcuts to HOKEYS. Tweaked random colors. 2025-12-29 20:48:41 +01:00
zsviczian b37ed015e3 updated llm docs 2025-12-28 16:04:10 +01:00
zsviczian 22cf76b1f9 updated mindmap builder and link suggester sorting 2025-12-28 15:43:57 +01:00
zsviczian 588dfc5dc2 2.19.0-beta-3 (see sidepanels branch for actual changes) 2025-12-28 14:59:35 +01:00
zsviczian e1f36d910b 2.19.0-beta-3 2025-12-28 14:58:24 +01:00
zsviczian cbec7f4d9f inlineSuggester 2025-12-28 11:38:44 +01:00
zsviczian 6585a75b6e InlineLinkSuggester v0 2025-12-28 07:41:00 +01:00
zsviczian d3b8d07d9c updated training file 2025-12-28 06:52:55 +01:00
zsviczian 9cda26faad active-leaf-change listner 2025-12-27 22:51:50 +01:00
zsviczian cc18cf9166 2.19.0-beta-2: see sidepanels branch for the actual implementation 2025-12-27 22:19:00 +01:00
zsviczian 8ce71c262b 2.19.0-beta-2 2025-12-27 22:17:55 +01:00
zsviczian 0116125a10 keyboard event management, intelligent undock, dock 2025-12-27 20:19:50 +01:00
zsviczian f214633db8 more robust keydown handlers... 2025-12-27 10:04:38 +01:00
zsviczian bd191f0d2d added scope.register to override obsidian hotkeys while using mindmap builder 2025-12-27 09:41:18 +01:00
zsviczian afa8fbff80 zoom 2025-12-27 09:09:26 +01:00
zsviczian 5236a73a1e 2.19.0-beta-1 2025-12-27 00:04:45 +01:00
zsviczian 45d95856ca 2.19.0-beta-1 2025-12-27 00:03:48 +01:00
zsviczian 4e050f76e1 center and zoom root node after creation 2025-12-26 23:37:25 +01:00
zsviczian aee74ca6d9 implemented ExcalidrawViewClosed call in 2025-12-26 22:46:07 +01:00
zsviczian c6459b6a87 onWindowMigrated initial implementation 2025-12-26 21:50:32 +01:00
zsviczian 0eb4b2a1f5 floatingmodal fix, getSidepanelLeaf, sidepanel startup, MindmapBuilder sidepanel 2025-12-26 20:27:49 +01:00
zsviczian 23b793d21f Added getHostEA and checkForActiveSidepanelTabForScript 2025-12-26 13:12:15 +01:00
zsviczian 77dd95f089 added checkForActiveSidepanelTab 2025-12-26 10:39:23 +01:00
zsviczian faa900a352 ownerWindow? 2025-12-26 10:33:52 +01:00
zsviczian 2ceebab04f refactor UI Modal 2025-12-26 10:15:47 +01:00
zsviczian 0b0232aa62 removed sidepaneltaboptions, removed unnecessary / ambigous functions from ExcalidrawAutomate 2025-12-26 09:35:54 +01:00
zsviczian 497125d7cc lint 2025-12-26 08:13:45 +01:00
zsviczian 4e8baed49f remove end of line spaces 2025-12-26 07:55:40 +01:00
zsviczian 3f93be3b45 typo, unused const 2025-12-26 07:47:34 +01:00
zsviczian bb17694219 refactor, bug fixes 2025-12-26 07:22:34 +01:00
zsviczian 51ffcdf3de Added LLM documentation, type definitions, etc. 2025-12-25 22:07:33 +01:00
zsviczian 12bc2a1680 added box/unbox to toolbar 2025-12-25 19:01:03 +01:00
zsviczian 4c8ed3fe57 replace tabs with dropdown 2025-12-25 14:14:07 +01:00
zsviczian bbb3a63106 setDisabled 2025-12-25 13:36:00 +01:00
zsviczian b801a1e4d2 silent restore, persist panel ea 2025-12-25 13:19:53 +01:00
zsviczian 96bf5d4880 Implemented onFocus 2025-12-25 12:36:31 +01:00
zsviczian 0962eadcf9 sidepanelTab mimics Modal functions 2025-12-25 11:38:23 +01:00
zsviczian 4d57bf6fb5 hostEA stored, title persisted 2025-12-25 11:19:23 +01:00
zsviczian da8937499b deleted resolveSidepanelTab 2025-12-25 09:58:28 +01:00
zsviczian 4818d23f8b feat(sidepanel): add first draft solution for sidepanels 2025-12-25 09:51:44 +01:00
zsviczian a1561de832 ea.setView improvements 2025-12-24 09:23:46 +01:00
zsviczian 1900cfcf84 modified training files 2025-12-23 14:51:41 +01:00
zsviczian aa47d1375b updated mindmap builder 2025-12-23 14:46:50 +01:00
zsviczian 61ae34968a added ALT+C,X,V to cut,copy,paste 2025-12-23 14:46:11 +01:00
zsviczian 296ac84f08 2.18.3, 0.18.0-63 2025-12-23 12:36:40 +01:00
zsviczian bcd63ad7fe fix isSolidArrow overwritten in centerText, and fix grouping of non-autolayed out element 2025-12-22 22:15:32 +01:00
zsviczian 1fec09c367 smaller minimized view 2025-12-22 17:48:27 +01:00
zsviczian 4cd5dde3d6 option to center text, added force rearrange button 2025-12-22 15:29:02 +01:00
zsviczian 36ee7f6e52 canvas pointer listener 2025-12-22 14:46:39 +01:00
zsviczian 32f76d4ea4 add branch pinning, added connector arrow handling 2025-12-22 12:39:24 +01:00
zsviczian 53aed86777 publishing linear calendar generator 2025-12-22 07:48:44 +01:00
zsviczian 573587bd88 publish linear calenar 2025-12-22 07:40:06 +01:00
zsviczian 558d0105a5 Merge pull request #2584 from superle3/fix/latex_suite_display_math
fix: use displaymath in latex mock parser
2025-12-22 07:06:59 +01:00
superle3 76910a3352 fix: use displaymath in latex mock parser
For latex suite, the mocked opening math node should be math-begin-math-block to indicate that its displaymath and newlines can be entered and thus snippets with newlines are used instead of those without.
2025-12-22 00:04:08 +01:00
zsviczian e2c9e2b256 removed - node.width/2 from 2025-12-21 22:43:53 +01:00
zsviczian 9630db68a4 2.18.3-beta-1, 0.18.0-63 2025-12-21 22:29:33 +01:00
zsviczian 7541fa22b4 Merge pull request #2583 from TravisLEBLANC1/latex-suite-integration
Latex suite integration
2025-12-21 21:25:19 +01:00
zsviczian c5cf6d630f fixed rollup.config, and caret-color 2025-12-21 20:22:56 +00:00
Travis LEBLANC 2f296c7a46 Merge branch 'zsviczian:master' into latex-suite-integration 2025-12-21 19:59:17 +01:00
zsviczian 095ff057cd Merge pull request #2549 from zsviczian/dependabot/npm_and_yarn/MathjaxToSVG/nanoid-5.0.9
Bump nanoid from 4.0.2 to 5.0.9 in /MathjaxToSVG
2025-12-21 12:54:06 +01:00
zsviczian b38956cb51 changed markdown embed customize link to lucide.dev icon 2025-12-21 12:52:34 +01:00
zsviczian 03392db757 0.18.0-63, prompt.ts update 2025-12-21 12:35:58 +01:00
zsviczian 2bd252fcff Merge branch 'master' into latex-suite-integration 2025-12-21 11:20:19 +01:00
zsviczian 12b52e42f2 adding fallback if latex suit is not avaiable 2025-12-21 11:17:05 +01:00
zsviczian 76675591fe minor fixes 2025-12-21 10:57:14 +01:00
zsviczian 966f6b53ea added documentation 2025-12-21 10:10:17 +01:00
TravisLeblanc1 efbca80f74 adding grammar in comments 2025-12-21 09:11:27 +01:00
zsviczian ee8ac2f7ad compact mode for mindmap builder 2025-12-20 23:38:34 +01:00
zsviczian 0ac7ccde66 mindmap builder v1 2025-12-20 22:32:04 +01:00
zsviczian b5bd27f115 mindmap builder copy/paste 2025-12-20 22:27:47 +01:00
zsviczian 600b2d9621 disable autolayout 2025-12-20 21:53:35 +01:00
TravisLeblanc1 c709562925 solving field error and remove Prec 2025-12-20 20:51:19 +01:00
zsviczian c3cfe0b0ed Arrow update, mindmap builder 2025-12-20 20:39:09 +01:00
TravisLeblanc1 686ff92f4d adding extensions if latexsuite not active 2025-12-20 20:29:25 +01:00
TravisLeblanc1 37f3937bd6 adding Ctrl+Enter to submit 2025-12-20 20:15:30 +01:00
TravisLeblanc1 16c61c44ce add history extension 2025-12-20 15:57:52 +01:00
TravisLeblanc1 2f968a7bbc improve math-only parser 2025-12-20 14:52:41 +01:00
zsviczian 475492beda remove youtube links from LLM training data 2025-12-19 21:38:03 +01:00
zsviczian ab11258d0d updated doc, added space to youtube links to prevent aistudio gemini 3 automatically reading those youtube videos 2025-12-19 21:30:05 +01:00
TravisLeblanc1 1ab682e726 adding latex-suite support 2025-12-19 12:24:02 +01:00
zsviczian cb370645b7 2.18.2, 0.18.0-62 2025-12-19 07:10:59 +01:00
zsviczian c80420772e Merge pull request #2577 from playermiller109/2025-12-17
Update zh-cn.ts to 2e52744
2025-12-19 05:41:43 +01:00
zsviczian 5fd76e07ba fix copy group link 2025-12-18 22:29:38 +01:00
playermiller109 fda8d5ce77 Update zh-cn.ts to 2e52744 2025-12-17 08:46:56 +08:00
zsviczian 2e52744743 2.18.1, 0.18.0-61 2025-12-16 20:55:14 +01:00
zsviczian a634d24f6b Merge pull request #2576 from TravisLEBLANC1/back_of_note_fix
Bug fix: incorrectly-replaced back-of-note
2025-12-16 20:38:05 +01:00
zsviczian ebc0ecbfc4 Merge pull request #2575 from parkero/popover-size
Fix popover image sizing to match embeds more closely
2025-12-16 20:31:00 +01:00
zsviczian 9622e137ba Merge pull request #2565 from TravisLEBLANC1/addLaTex_fix
Bug fix: ExcalidrawAutomate addLaTex guard condition
2025-12-16 20:25:35 +01:00
zsviczian b3bf3b5a60 added cancel handling 2025-12-16 20:25:20 +01:00
zsviczian cc1ae730d1 moved copyLinkToSelectedElementToClipboard to its own file, implemented framename and anchor checkboxes 2025-12-16 20:12:05 +01:00
zsviczian 9841941431 updated frameName regexp, added new settings for copy frame link, added strings to en.ts 2025-12-16 19:30:39 +01:00
zsviczian f179b6720b fixed hover preview, unnecessary settings save 2025-12-16 19:16:28 +01:00
TravisLeblanc1 b44d2a4a9a fix uncaught promise with latex 2025-12-11 23:12:01 +01:00
TravisLeblanc1 6a82011bdb fix incorrectly-replaced back-of-note 2025-12-08 14:13:13 +01:00
parkero c835943fc5 Fix popover image sizing
They were not responding to the default width parameter in the settings.
Also prior to this if you added a default height, but removed the
default width, they would render at 0 width.
2025-12-07 21:05:49 -07:00
TravisLeblanc1 a4f0676686 addLaTex guard condition 2025-12-06 00:05:10 +01:00
zsviczian e69487c456 added refocus current slide button to the navigation panel 2025-12-04 18:14:04 +01:00
zsviczian e7a067d53a 2.18.0 2025-12-02 21:46:17 +01:00
zsviczian fe8ece275a ModalEl styling when onscreen keyboard is detected
https://discord.com/channels/1026825302900494357/1445155859100602368/1445355939355033611
2025-12-02 14:34:17 +01:00
zsviczian a5f2da74ba Update ExcalidrawView.ts
Extend wait times for scheduledBatchDelays - keyboard out event
2025-12-02 13:59:08 +01:00
zsviczian ce602b8268 2.18.0-beta-6, 0.18.0-60 (on-screen keyboard detection improved) 2025-12-01 21:52:56 +01:00
zsviczian 7bb718da81 Merge pull request #2556 from rlan/feat/zh-tw/44588ab
Update zh-tw.ts to 44588ab
2025-12-01 18:15:58 +01:00
Rick Lan cceb2cae82 Merge branch 'master' into feat/zh-tw/44588ab 2025-12-01 09:10:07 -08:00
Rick Lan f5f0134509 Update zh-tw.ts to 44588ab 2025-12-01 08:28:58 -08:00
zsviczian 44588ab4b8 improve getHighlightColor 2025-12-01 06:14:00 +01:00
zsviczian 989e7969dc renderScriptButtons, referenced view in toolspanel with weak reference 2025-11-30 21:05:46 +01:00
zsviczian f5c7820315 Merge pull request #2554 from rlan/feat/zh-tw/ba5d1aa
Update zh-tw.ts to ba5d1aa
2025-11-30 20:52:03 +01:00
zsviczian c416c21985 Merge pull request #2553 from playermiller109/2025-11-30
Update zh-cn.ts to ba5d1aa
2025-11-30 20:51:50 +01:00
zsviczian e5f6466542 improved ExcalidrawView onClose cleanup and timer removal 2025-11-30 16:44:13 +01:00
zsviczian 95ba981445 fix markdownPostProcessor blob leak 2025-11-30 16:34:56 +01:00
zsviczian 31cc45ff6d fixed prompt.ts event listner release 2025-11-30 16:31:54 +01:00
zsviczian 62f51511ed fixed suggestionmodal event listners release 2025-11-30 16:28:43 +01:00
zsviczian 5c628e08f4 fix remove debunceActiveLeafChangeHandlerTimer; cleanup observerManager; clear timers in ExcalidrawView onunload 2025-11-30 16:14:17 +01:00
zsviczian 0e11150055 fixed embeddedFileLoader memory stuck interval issue 2025-11-30 16:04:05 +01:00
zsviczian 37b4cdd44a fix memory leak with updateEmbeddableLeafRef and ImageCache obsidianURL 2025-11-30 15:55:05 +01:00
zsviczian a2a33bc463 fixed memory issues with updateEmbeddableRef, highlight color cache, embeddable onKeyDown event handler 2025-11-30 15:41:01 +01:00
Rick Lan 00531325ea Update zh-tw.ts to ba5d1aa 2025-11-29 22:34:11 -08:00
zsviczian a7d4d59619 updated getHighlightColor (only use background, not stroke) 2025-11-30 07:05:02 +01:00
playermiller109 b05e26d138 Unify the translation of 'opacity'
In the design field, '不透明度' is widely recognized.
As for general users, while '透明度' and '不透明度' are often interchangeable in daily use,
recent AI-powered tools reliably translate it as '不透明度'.
Unifying it as '不透明度' should be clear to both general users and future maintainers.
2025-11-30 13:01:24 +08:00
playermiller109 ce3cda7a1d Update zh-cn.ts to ba5d1aa 2025-11-30 10:17:18 +08:00
zsviczian ba5d1aa6d6 2.18.0-beta-4, 0.18.0-58 2025-11-29 14:42:21 +01:00
zsviczian 686f462716 Merge pull request #2550 from playermiller109/2025-11-27
Update zh-cn.ts to 168b1d1
2025-11-29 09:56:44 +01:00
playermiller109 21dec11170 Update zh-cn.ts to 168b1d1 2025-11-27 08:39:50 +08:00
zsviczian 168b1d1871 2.18.0-beta-3, 0.18.0-56 2025-11-26 21:22:11 +01:00
zsviczian 8df45aed14 2.18.0-beta-2, 0.18.0-55 (export-internal-links) 2025-11-26 21:11:57 +01:00
zsviczian 2e9b5ce593 2.18.0-beta-1 2025-11-25 21:10:38 +01:00
dependabot[bot] c332608bb5 Bump nanoid from 4.0.2 to 5.0.9 in /MathjaxToSVG
Bumps [nanoid](https://github.com/ai/nanoid) from 4.0.2 to 5.0.9.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/4.0.2...5.0.9)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-version: 5.0.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-22 15:43:48 +00:00
zsviczian ed9fe5f3d4 2.17.2, 0.18.0-53 2025-11-22 16:42:47 +01:00
zsviczian 57afd6f134 Merge pull request #2540 from threeq/hotfix/openai
fix(openai): 添加对自定义OpenAI URL的支持
2025-11-22 08:05:12 +01:00
zsviczian 63e0c1368f Merge pull request #2543 from dddrop/master
Add configurable max tokens setting for OpenAI API
2025-11-22 07:58:45 +01:00
zsviczian 3b2f7d2c98 fixed toggle context menu on phones 2025-11-22 07:58:23 +01:00
dddrop 684d19eebd feat(i18n): add max tokens translations for zh-cn, zh-tw, es, and ru
- Add AI_OPENAI_DEFAULT_MAX_TOKENS_NAME and AI_OPENAI_DEFAULT_MAX_TOKENS_DESC translations
- Support for Chinese (Simplified), Chinese (Traditional), Spanish, and Russian languages
2025-11-18 17:04:21 +09:00
dddrop d65e967e4b feat(ai): add configurable max tokens setting for OpenAI API
- Add openAIDefaultTextModelMaxTokens setting to allow users to configure max_tokens parameter
- Add UI setting control with validation for max tokens input
- Update AIUtils to use configurable max_tokens instead of hardcoded value
- Support omitting max_tokens field when set to 0 (for models like GPT-5 that don't support this parameter)
2025-11-18 17:02:28 +09:00
three3q 59fe5abfa8 fix(openai): 添加对自定义OpenAI URL的支持
允许通过配置指定OpenAI API的URL地址,增强API调用的灵活性
2025-11-16 14:27:48 +08:00
zsviczian 919913044d Fixed hover preview 2025-11-15 14:02:11 +01:00
zsviczian 306e6db564 Merge pull request #2533 from rlan/feat/zh-tww/c1ea206
Update zh-tw.ts to c1ea206
2025-11-11 20:39:14 +01:00
zsviczian c32d0cb350 fix floatingmodal close 2025-11-11 12:44:30 +01:00
Rick Lan a43e527602 Update zh-tw.ts to c1ea206 2025-11-10 18:20:24 -08:00
zsviczian 2e48ee8484 2.17.1, 0.18.0-52 2025-11-09 23:01:59 +01:00
zsviczian d568003915 updated docs 2025-11-08 11:35:41 +01:00
zsviczian 247685b13f 2.17.0 2025-11-07 22:09:59 +01:00
zsviczian 73c20e0d9d Add tool-icon pen mode rule 2025-11-07 11:43:17 +01:00
zsviczian 222ff139d8 Merge pull request #2531 from playermiller109/2025-11-07
Update zh-cn.ts to ae72262
2025-11-07 11:42:23 +01:00
playermiller109 0e0774d973 Update zh-cn.ts to ae72262 2025-11-07 11:47:04 +08:00
zsviczian ae722623e5 2.17.0-beta-8, 0.18.0-50 2025-11-06 20:07:34 +01:00
zsviczian 65ab00a932 Merge pull request #2530 from playermiller109/2025-11-06
Update zh-cn.ts to b2f051e
2025-11-06 07:33:06 +01:00
playermiller109 418063e9b6 Update zh-cn.ts to b2f051e 2025-11-06 10:58:27 +08:00
zsviczian b2f051e088 2.17.0-beta-7, 0.18.0-49 2025-11-05 21:51:53 +01:00
zsviczian c884db0840 Merge pull request #2529 from playermiller109/2025-11-05
Update zh-cn.ts to 97da7c6
2025-11-05 11:24:19 +01:00
playermiller109 e4d1b509f7 Update zh-cn.ts to 97da7c6 2025-11-05 10:21:48 +08:00
zsviczian 97da7c680f 2.17.0-beta-6, 0.18.0-48 (merged EditorInterface refactor) 2025-11-04 23:45:31 +01:00
zsviczian 5696a33e60 Merge pull request #2527 from KTibow/master
fix bug (no isparsed) in compat mode and restructure to make sure it can't happen again
2025-11-04 23:41:58 +01:00
zsviczian b68e8c0b20 desktopUI changes 2025-11-04 23:40:53 +01:00
zsviczian 3a43571f3e Merge pull request #2528 from duianto/typo
Fix typo excalidarw
2025-11-04 23:39:03 +01:00
zsviczian 65c3a11fba 2.17.0-beta-5 (slightly polluted with new device handling in Excalidraw (what will be 0.18.0-48...) 2025-11-04 22:00:51 +01:00
duianto 010fd5c624 Fix typo excalidarw 2025-11-04 15:59:02 +01:00
KTibow 8ddf03cdd3 fix bug (no isparsed) in compat mode and restructure to make sure it
can't happen again
2025-11-03 18:22:20 -08:00
zsviczian a5fd91a33c updated docs 2025-11-03 19:33:29 +01:00
zsviczian d8de0db423 Updated docs with custom pens 2025-11-03 18:05:23 +01:00
zsviczian b5d9fa4625 2.17.0-beta-4, 0.18.0-46 2025-11-02 21:43:15 +01:00
zsviczian fcc0f94974 attempt to fix mobile keyboard popup 2025-11-02 21:38:30 +01:00
zsviczian 6b7d8c8b69 2.17.0-beta-3, 0.18.0-45 2025-11-01 13:58:22 +01:00
zsviczian 259e6277ed Added ExcalidrawLib to the training file 2025-11-01 13:51:06 +01:00
zsviczian 88405af417 Merge branch 'master' of https://github.com/zsviczian/obsidian-excalidraw-plugin 2025-11-01 13:30:51 +01:00
zsviczian 8fecb75f97 removed taryModeEnabled from AppState 2025-11-01 13:30:49 +01:00
zsviczian bd1b13b58c Merge pull request #2524 from playermiller109/master
Update zh-cn.ts to 8379f93
2025-11-01 13:13:03 +01:00
playermiller109 d8cac4eacd Update zh-cn.ts to 8379f93 2025-10-28 19:28:06 +08:00
zsviczian 8379f9315e disable Context menu, 0.18.0-44 2025-10-28 06:27:28 +01:00
zsviczian 123fa12122 updated AI training prompt 2025-10-25 17:27:02 +02:00
zsviczian 46a41feaf3 2.17.0-beta-2, 0.18.0-43 2025-10-24 22:41:04 +02:00
zsviczian a043ee131f updated training files 2025-10-24 13:44:59 +02:00
zsviczian 7e9f1f6350 Auto generate training file 2025-10-24 13:14:07 +02:00
zsviczian ffc209d4b0 carved out types 2025-10-24 12:31:28 +02:00
zsviczian c1ea206d9d updated invert colors script 2025-10-23 16:44:26 +02:00
zsviczian 4587d36997 2.17.0-beta-1; 0.18.0-42 2025-10-23 07:53:39 +02:00
zsviczian 4f4035b8ef Merge pull request #2519 from rlan/feat/zh-tw/27d30c6
Update zh-tw.ts to 27d30c6
2025-10-23 07:45:57 +02:00
Rick Lan de5da38474 Update zh-tw.ts to 27d30c6 2025-10-22 22:23:46 -07:00
zsviczian 27d30c609e fix #2514
Updated documentation link for support requests.
2025-10-22 12:46:54 +02:00
zsviczian 9aaaf77daf updated slideshow script to support marker frames during printout 2025-10-17 09:07:50 +02:00
zsviczian ba0fac6f74 Palette loader date issues 2025-10-15 07:48:14 +02:00
zsviczian 802e0f2dcd Update directory-info.json with new file metadata
Updated the directory-info.json file to reflect changes in file metadata.
2025-10-09 16:10:09 +02:00
zsviczian 7bcb14b72f Merge pull request #2506 from Joakim31/master
Update es.ts to 8b198a57
2025-10-09 15:19:19 +02:00
Joakim31 21ddc4b90f Update es.ts to 8b198a57 2025-10-07 22:33:42 -05:00
zsviczian 8035e489ca 2.16.1 removing iframes 2025-10-04 22:37:01 +02:00
zsviczian bf8ae6f8bb updated script files 2025-10-04 22:03:11 +02:00
zsviczian 8b557a8461 remove iframes from index-new 2025-10-04 21:50:20 +02:00
zsviczian 35bc375356 2.16.0, 0.18.0-41 2025-10-04 16:42:15 +02:00
zsviczian 09890d8890 Merge pull request #2501 from playermiller109/2025-10-03
Update zh-cn.ts to 3e55719
2025-10-03 20:02:07 +02:00
zsviczian 5d8370234c Merge pull request #2502 from spinualexandru/chore/outdated-gallery-link
chore: Fix the outdated link to the catalogue
2025-10-03 20:01:54 +02:00
Alex Spinu e11664c826 chore: fix outdated catalogue link 2025-10-03 11:41:40 +03:00
Alex Spinu fc33805fbe chore: fix outdated catalogue link 2025-10-03 11:34:36 +03:00
playermiller109 21f202a725 Update zh-cn.ts to 3e55719 2025-10-03 15:42:38 +08:00
zsviczian 3e55719035 2.16.0-beta-2, 0.18.0-40 2025-10-02 23:14:19 +02:00
zsviczian c5ca730946 2.16.0-beta-1, 0.18.0-39 2025-09-30 19:09:07 +02:00
zsviczian 537b01f461 Merge pull request #2483 from rlan/feat/zh-tw/b976a5d
Update zh-tw.ts to b976a5d. Ran zh-cn.ts through OpenCC.
2025-09-21 12:09:28 +02:00
Rick Lan 428f2c50b6 Update zh-tw.ts to b976a5d. Ran zh-cn.ts through OpenCC. 2025-09-14 09:46:01 -07:00
zsviczian b976a5d5e6 2.15.3 2025-09-13 21:31:42 +02:00
zsviczian 9221b8c475 Merge pull request #2480 from playermiller109/2025-09-12
Update zh-cn.ts to 37543c6
2025-09-13 07:19:40 +02:00
playermiller109 6d659042ec Update zh-cn.ts to 37543c6 2025-09-12 20:35:04 +08:00
zsviczian 37543c6a56 2.15.3-beta-2 2025-09-11 20:45:07 +02:00
zsviczian 98f065c8cc Merge pull request #2476 from rlan/feat/zh-tw/2eef8d0
Update zh-tw.ts to 2eef8d0. Generated via OpenCC from zh-cn.ts.
2025-09-11 20:12:21 +02:00
Rick Lan a29d9cb7b1 Update zh-tw.ts to 2eef8d0. Generated via OpenCC. 2025-09-07 20:37:30 -07:00
zsviczian 2eef8d0151 fix back-of-the-note card placement 2025-09-07 20:46:10 +02:00
zsviczian f7676b4102 Merge pull request #2473 from PlayerMiller109/2025-09-05
Update zh-cn.ts: Supplement (2.15.1...2.15.2)
2025-09-07 20:07:43 +02:00
PlayerMiller109 ff6da66f94 Update zh-cn.ts: Supplement (2.15.1...2.15.2) 2025-09-05 21:35:51 +08:00
zsviczian 0f7def145d 2.15.2 2025-09-04 21:15:16 +02:00
zsviczian a6586803de fixes active leaf going blacnk, when DEVICE.isPhone (e.g. Kanban view) 2025-09-04 21:03:55 +02:00
zsviczian 7fe1dc5494 add pdf viewer observer 2025-09-04 20:21:25 +02:00
zsviczian b092a09c3b refactor leaf creation 2025-09-03 23:29:15 +02:00
zsviczian e67ed7ff4f updated handleClick 2025-09-03 22:26:58 +02:00
zsviczian 5ab7311e74 reworked useEffect to switch to preview mode 2025-09-03 22:16:32 +02:00
zsviczian dd05339f73 custom embeddable activate on enter, minor restructuring of CustomEmbeddable.tsx 2025-09-03 22:08:13 +02:00
zsviczian ec23f166ab Merge pull request #2466 from rlan/feat/zh-tw/ccb5590
Update zh-tw.ts to ccb5590
2025-08-31 06:54:33 +02:00
zsviczian 42af86ed9f Merge pull request #2467 from Joakim31/master
Update es.ts to 429c9b0
2025-08-31 06:52:02 +02:00
Joakim31 8b198a5785 Update es.ts to 429c9b0 2025-08-28 23:12:27 -05:00
Rick Lan 739b745e95 Update zh-tw.ts to ccb5590 2025-08-27 20:08:27 -07:00
zsviczian ccb5590f0c 2.15.1 2025-08-25 21:32:11 +02:00
zsviczian 524c33a7e5 2.15.1-beta-3, 0.18.0-37; hide raw mode, pinch zoom PDF on iPad, scroll webpage on mobile, insert LatTex and PDF page image to center 2025-08-25 20:34:19 +02:00
zsviczian 09bb5c5486 2.15.1-beta-2 2025-08-24 19:33:42 +02:00
zsviczian 434f61653d fixed Area link rendering, fixed external video autoplay 2025-08-24 17:45:10 +02:00
zsviczian 613b86e9d0 Merge branch 'master' of https://github.com/zsviczian/obsidian-excalidraw-plugin 2025-08-24 17:23:55 +02:00
zsviczian a6cad5010e Merge pull request #2455 from PlayerMiller109/master
Update zh-cn.ts to 425d830
2025-08-24 17:23:43 +02:00
zsviczian 49cf799f66 pdf stying tweaks. Added snapshot and bookmark, fixed crop, added back-of-the-note card to insert image menu 2025-08-24 15:57:06 +02:00
zsviczian 662737436a carved out setupPdfViewEnhancements to its own function 2025-08-24 12:51:11 +02:00
zsviczian 887651a4bc moved PDF view to node, resolved mobile blackout 2025-08-24 12:31:34 +02:00
PlayerMiller109 c0a40c69a1 Update zh-cn.ts to 425d830 2025-08-24 11:04:34 +08:00
PlayerMiller109 e69676f461 Correct 'ES_FILENAME_VISIBLE': '文件名' to '页内标题'
This option corresponds to Obsidian "Appearance - Show inline title" option.
When enabled in Excalidraw, if "Show inline title" is disabled in Obsidian, it will not be shown.
This differs from Canvas, where the filename floats at the top-left corner of the card.
Important to note this distinction.
2025-08-24 11:04:34 +08:00
PlayerMiller109 9582758483 [squash] Update zh-cn.ts to 89f2a3b 2025-08-24 11:03:50 +08:00
PlayerMiller109 a227c746a2 Unify '查看模式' to follow the upstream default
as it is inherited from upstream (e.g. in the right-click context menu) and cannot be changed by the plugin.
2025-08-23 18:28:55 +08:00
zsviczian 425d8304d5 2.15.1-beta-1, 0.18.0-35 2025-08-23 07:31:42 +02:00
zsviczian 1ee277c814 updated package.json 2025-08-22 21:48:19 +02:00
zsviczian 5a2cbadc9d inverted PDF as image embeds 2025-08-22 15:56:10 +02:00
zsviczian f2d0c8c6b7 escapes aborts active embeddable 2025-08-22 15:22:34 +02:00
zsviczian afecea3e67 pan PDF page in active embeddable 2025-08-22 15:16:11 +02:00
zsviczian a3b6acb0a7 mod-themed observer 2025-08-22 10:43:23 +02:00
zsviczian a7f33f3be0 setPDFViewTheme 2025-08-22 09:36:27 +02:00
zsviczian 0ec5ad1bbb customEmbeddable setColor is now selective based on viewType 2025-08-22 07:55:02 +02:00
zsviczian 89f2a3beb5 PDF fixes, insert audio files, local graph view improvements 2025-08-22 06:55:53 +02:00
zsviczian 88e27a35ef do not save on Excalidraw Error popup 2025-08-17 22:53:01 +02:00
zsviczian ea3103b650 change log 2025-08-17 18:42:12 +02:00
zsviczian 59bbbb907d modified string for new setting 2025-08-17 18:30:02 +02:00
zsviczian 488daf0fde Merge pull request #2450 from mfuria/feature/pan-with-right-mouse-button
Add setting: “Pan with right mouse button (desktop)”; wire to Excalidraw
2025-08-17 18:18:52 +02:00
zsviczian cf6128433d Merge pull request #2454 from PlayerMiller109/master
Update zh-cn.ts to 5bf7271
2025-08-17 18:16:37 +02:00
PlayerMiller109 945afffc11 Update '仓库' 2025-08-17 23:16:28 +08:00
PlayerMiller109 fe322f492e Update strings to 5bf7271 2025-08-17 23:15:55 +08:00
zsviczian 22eee5e37e Merge branch 'master' of https://github.com/zsviczian/obsidian-excalidraw-plugin 2025-08-17 15:09:39 +02:00
zsviczian 5bf7271f86 0.18.0-34 (insert image dropdown + new language strings) 2025-08-17 15:09:36 +02:00
zsviczian 1db4654fe2 Merge pull request #2452 from PlayerMiller109/master
Unify zh-cn.ts translation of 'frame' to '画框' to follow the upstream default
2025-08-17 14:35:10 +02:00
PlayerMiller109 3152ec2c58 [squash] Unify zh-cn.ts to 1bd9a70 2025-08-17 19:40:26 +08:00
zsviczian 1bd9a70635 Merge pull request #2451 from dmscode/zh-2025-08-17
Update zh-cn.ts to a0630b4
2025-08-17 13:16:47 +02:00
dmscode 4a775d81f4 Update zh-cn.ts to a0630b4 2025-08-17 07:33:26 +08:00
zsviczian a0630b4719 fix YT link 2025-08-16 15:24:09 +02:00
zsviczian 37ceca8ccd 2.15.0 2025-08-16 15:08:38 +02:00
mfuria 00acbce5f0 fix(i18n): add missing translations; restore trailing spaces; add //mfuria #329. comments
- Fill missing translation strings.
- Restore intentional trailing spaces per review.
- Add `//mfuria #329.` comments.
- No logic changes.
2025-08-16 12:37:55 +02:00
mfuria ea502134fd bugfix: Removed duplicated setting PAN_WITH_RIGHT_MOUSE_BUTTON_NAME 2025-08-16 08:48:58 +02:00
mfuria 1c5daeafae Add pan with right mouse button setting and update translations 2025-08-16 08:48:58 +02:00
zsviczian 1ca55ccfcb Merge pull request #2449 from dmscode/zh-2025-08-15
Update zh-cn.ts to dab8528
2025-08-15 08:28:10 +02:00
dmscode 24566dfb8c Update zh-cn.ts to dab8528 2025-08-15 05:48:51 +08:00
zsviczian dab8528fb6 revert print layout wizard 2025-08-14 22:43:02 +02:00
zsviczian f4c52ea675 2.15.0-prebeta, 0.18.0-31, marker frames initial implementation 2025-08-14 22:41:46 +02:00
zsviczian 10abb50a5c Merge pull request #2443 from rlan/feat/zh-tw/10fad8a
Update zh-tw.ts to 10fad8a.
2025-08-12 09:46:12 +02:00
Rick Lan 1427b0791a Update zh-tw.ts to 10fad8a. New strings by running zh-cn.ts through OpenCC. Edit code style to match en.ts, such that only string content is different. 2025-08-11 00:32:27 -07:00
zsviczian 10fad8a29c Merge pull request #2442 from Joakim31/master
Update es.ts to 6221d98
2025-08-11 07:39:41 +02:00
Joakim31 429c9b0f55 Update es.ts to 6221d98 2025-08-10 17:12:44 -05:00
zsviczian 38d524db75 added editors picks to index-new 2025-08-10 19:43:38 +02:00
zsviczian f7ef047ebd 2.14.3 2025-08-10 18:59:46 +02:00
zsviczian e167dd21c3 Merge pull request #2437 from dmscode/zh-2025-08-10
Update zh-cn.ts to 691c2fd
2025-08-10 13:44:09 +02:00
zsviczian 8baa3aa0e4 Merge pull request #2436 from rlan/zh-tw-from-dmscode-zh-2025-08-02
Update zh-tw.ts to match merged PR 3e86419
2025-08-10 13:43:57 +02:00
zsviczian 615f66393e updated printeable layout wizard 2025-08-10 08:30:59 +02:00
dmscode c621a96179 Update zh-cn.ts to 691c2fd 2025-08-10 07:06:47 +08:00
Rick Lan 65b88ab67d Run through OpenCC 2025-08-09 14:31:07 -07:00
zsviczian 691c2fdc3e simplifed palm guard 2025-08-09 20:06:42 +02:00
zsviczian 79979d38e4 updated index-new 2025-08-09 19:45:11 +02:00
zsviczian 536479c3d9 updated palmguard script 2025-08-09 17:07:37 +02:00
zsviczian 1065551196 fix palm guard script 2025-08-09 12:37:32 +02:00
zsviczian 3105d5533c 2.14.2 2025-08-09 12:07:28 +02:00
zsviczian 4cff3f013b Update feature-request.yml 2025-08-08 20:23:38 +02:00
zsviczian 4a3e527605 Update bug_report.yml 2025-08-08 20:21:13 +02:00
zsviczian fd592e9325 Update bug_report.yml 2025-08-08 20:20:18 +02:00
zsviczian 7ad928ccdc Update How-to.yml 2025-08-08 20:17:43 +02:00
zsviczian e9f632e4db fix-touch move for Floating Modal 2025-08-07 22:31:23 +02:00
zsviczian 6689d9497c 2.14.1
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-08-05 19:17:20 +02:00
zsviczian 3e86419421 Merge pull request #2431 from dmscode/zh-2025-08-02
Update zh-cn.ts to e574d84
2025-08-05 18:16:52 +02:00
dmscode d2d4f16ebd Update zh-cn.ts to e574d84 2025-08-02 06:48:05 +08:00
zsviczian e574d84b84 2.14.1-beta-2, 0.18.0-27 2025-08-01 20:49:47 +02:00
zsviczian 8f3ace89ea Merge pull request #2427 from dmscode/zh-2025-07-29
Update zh-cn.ts to 41065ce
2025-07-29 18:42:56 +02:00
zsviczian e4e4a07aa8 Merge pull request #2426 from Joakim31/master
Update es.ts to 01b0b64a
2025-07-29 07:49:43 +02:00
dmscode 7a90bf753f Update zh-cn.ts to 41065ce 2025-07-29 13:30:36 +08:00
Joakim31 6221d985ac Update es.ts to 01b0b64a 2025-07-28 20:10:04 -05:00
zsviczian 41065ce9f9 2.14.1-beta-1, 0.18.0-26 2025-07-28 21:48:44 +02:00
zsviczian 351977f0d3 Merge pull request #2421 from mnaoumov/custom-attachment-location
Use internal `app.vault.getAvailablePathForAttachments()`
2025-07-28 19:54:08 +02:00
zsviczian 01b0b64a08 Merge pull request #2425 from Joakim31/master
Add Spanish translation
2025-07-28 19:37:38 +02:00
Joakim31 938e93cc43 Add Spanish translation 2025-07-27 22:56:57 -05:00
Michael Naumov cebcd2b43c Use internal getAvailablePathForAttachments
Fixes https://github.com/RainCat1998/obsidian-custom-attachment-location/issues/179
2025-07-23 22:42:02 -06:00
zsviczian 80b6e30040 shade master help converted to Markdown
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-07-23 22:33:40 +02:00
zsviczian 6e92a6a399 fixed svg 2025-07-23 20:25:41 +02:00
zsviczian 992ae8b238 update index 2025-07-23 20:23:23 +02:00
zsviczian 5cd07e7766 update index 2025-07-23 20:22:29 +02:00
zsviczian 07817a4d2d publish script 2025-07-23 20:18:29 +02:00
zsviczian a22bb4c58c images 2025-07-23 19:56:37 +02:00
zsviczian 43e00a51be images 2025-07-23 19:55:01 +02:00
zsviczian 049b5bfa85 2.14.0 2025-07-22 08:45:29 +02:00
zsviczian 743afa73b4 Merge pull request #2413 from rlan/master
Add Taiwan-idiomatic Traditional Chinese
2025-07-22 08:17:25 +02:00
zsviczian 6469eec051 added NotebookLM link 2025-07-22 06:25:12 +02:00
zsviczian 9f46821a41 Merge pull request #2412 from dmscode/zh-2025-07-20
Update zh-cn.ts to 207fea3
2025-07-21 10:07:01 +02:00
dmscode 1fb3a47bdc Update zh-cn.ts to 207fea3 2025-07-21 14:08:59 +08:00
稻米鼠 bcd0cdda65 Merge pull request #1 from PlayerMiller109/zh-2025-07-20
Supplement (2.13.0...2.13.1)
2025-07-21 13:56:57 +08:00
zsviczian 207fea3f57 ContentSearcher.ts, added to ScriptInstallPrompt.ts and Settings.ts 2025-07-20 21:07:03 +02:00
Rick Lan e55ba3cc21 Add Taiwan-idiomatic Traditional Chinese 2025-07-20 20:54:04 +09:00
PlayerMiller109 71c87a7630 Supplement (2.13.0...2.13.1) 2025-07-20 10:31:38 +08:00
dmscode e598a91f43 Update zh-cn.ts to 972fe1b 2025-07-20 06:09:52 +08:00
zsviczian 972fe1baea copy settings to the clipboard
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-07-19 18:43:01 +02:00
zsviczian d7e1268afa updated info links in settings 2025-07-19 17:45:05 +02:00
zsviczian 7a3b937ea7 Merge pull request #2411 from dmscode/zh-2025-07-19
Fixed for issue 2175
2025-07-19 08:17:27 +02:00
dmscode c850cd15ae Fixed for issue 2175 2025-07-19 10:02:10 +08:00
zsviczian e9f70fd09e 2.13.2 2025-07-16 19:12:09 +02:00
zsviczian 2083443dfe Merge pull request #2408 from duianto/patch-1
Fix typos
2025-07-16 19:03:47 +02:00
zsviczian 69d9b8c1c9 Merge pull request #2407 from dmscode/zh-2025-07-13
Update zh-cn.ts to 6434a6e
2025-07-16 19:02:14 +02:00
duianto 65f4c9f3b3 Fix typos 2025-07-15 10:30:02 +02:00
dmscode b89a106523 Update zh-cn.ts to 6434a6e 2025-07-13 07:59:32 +08:00
zsviczian 6434a6e58a 2.13.1
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-07-12 17:55:44 +02:00
142 changed files with 98072 additions and 3812 deletions

No files matched your search

+4 -4
View File
@@ -10,10 +10,10 @@ body:
I am a one-person team working on this plugin as a part-time hobby. Please help me manage the workload by following these guidelines. **Support requests that don't include enough details may be closed without review**.
Before submitting a support request, please:
1. **Review the [documentation](https://github.com/zsviczian/obsidian-excalidraw-plugin/wiki)** – your question may already be answered.
2. **[Search issues](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues) (including closed ones)** to see if your question has already been addressed.
3. **[Watch the Feature Walkthrough Video](https://youtu.be/P_Q6avJGoWI)**: As it infact answers 90% of the typical questions I receive
4. **[Consult NotebookLM with your question](https://excalidraw-obsidian.online/WIKI/09+Video+Transcripts/Videos/Turn+any+YouTube+Channel+into+your+AI+Mentor+-+Obsidian+is+the+ultimate+automation+workbench+for+PKM)**
1. **[Consult NotebookLM with your question](https://notebooklm.google.com/notebook/42d76a2f-c11d-4002-9286-1683c43d0ab0)**
2. **Review the [documentation](https://excalidraw-obsidian.online/wiki/welcome)** – your question may already be answered.
3. **[Search issues](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues) (including closed ones)** to see if your question has already been addressed.
4. **[Watch the Feature Walkthrough Video](https://youtu.be/P_Q6avJGoWI)**: As it infact answers 90% of the typical questions I receive
- type: markdown
attributes:
+3 -3
View File
@@ -11,9 +11,9 @@ body:
Before creating a bug report, please:
1. **Review recent [release notes](https://github.com/zsviczian/obsidian-excalidraw-plugin/releases)** – maybe there is already an answer.
2. **[Search issues](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues) (including closed ones)** to see if there is anything similar.
3. **[Watch the Feature Walkthrough Video](https://youtu.be/P_Q6avJGoWI)**: As it infact answers 90% of the typical questions I receive
4. **[Consult NotebookLM with your question](https://excalidraw-obsidian.online/WIKI/09+Video+Transcripts/Videos/Turn+any+YouTube+Channel+into+your+AI+Mentor+-+Obsidian+is+the+ultimate+automation+workbench+for+PKM)** Here's the [direct link to a preloaded NotebookLM](https://notebooklm.google.com/notebook/42d76a2f-c11d-4002-9286-1683c43d0ab0)
2. **[Consult NotebookLM with your question](https://notebooklm.google.com/notebook/42d76a2f-c11d-4002-9286-1683c43d0ab0)**
3. **[Search issues](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues) (including closed ones)** to see if there is anything similar.
4. **[Watch the Feature Walkthrough Video](https://youtu.be/P_Q6avJGoWI)**: As it infact answers 90% of the typical questions I receive
- type: markdown
attributes:
@@ -7,6 +7,8 @@ body:
value: |
🛠️ **Important: Please Read Before Submitting a Feature Request** 🛠️
Before you go further, please chat with [NotebookLM](https://notebooklm.google.com/notebook/42d76a2f-c11d-4002-9286-1683c43d0ab0), it may very well be that the feature you are looking for is already there, or you can find a suitable workaround.
I develop Excalidraw primarily as a hobby, and I prioritize features that I personally use regularly. Features I don't use often break without me noticing, which is why the plugin is as stable as it is—because I rely on it every day.
**Your task isn't just to describe the feature you want, but to sell me on the idea**. If I'm not convinced that the feature would significantly benefit my own workflow, it's unlikely I'll spend my free hobby time on it.
+4 -1
View File
@@ -14,10 +14,13 @@ data.json
lib
dist
tmp
deploy.ps1
#VSCode
.vscode
yarn.lock
.DS_Store
.lock
.lock
# Obsidian files
Obsidian
+30
View File
@@ -0,0 +1,30 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsserver.log": "off",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"files.exclude": {
"**/lib": true
},
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/lib": true
}
}
+5 -5
View File
@@ -9,7 +9,7 @@
"version": "1.0.0",
"dependencies": {
"mathjax-full": "^3.2.2",
"nanoid": "^4.0.2"
"nanoid": "^5.0.9"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^26.0.1",
@@ -749,9 +749,9 @@
}
},
"node_modules/nanoid": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz",
"integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==",
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.9.tgz",
"integrity": "sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==",
"funding": [
{
"type": "github",
@@ -763,7 +763,7 @@
"nanoid": "bin/nanoid.js"
},
"engines": {
"node": "^14 || ^16 || >=18"
"node": "^18 || >=20"
}
},
"node_modules/obsidian": {
+1 -1
View File
@@ -8,7 +8,7 @@
},
"dependencies": {
"mathjax-full": "^3.2.2",
"nanoid": "^4.0.2"
"nanoid": "^5.0.9"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^26.0.1",
+6 -3
View File
@@ -6,13 +6,15 @@
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.
Excalidraw for Obsidian keeps evolving; it is extremely feature‑rich and can feel intimidating at first. The Video Walkthrough below should ease that initial overwhelm. For a comprehensive, searchable knowledge base covering features, settings, scripting, workflows, and visual thinking methods, explore the public [NotebookLM workbook](https://notebooklm.google.com/notebook/42d76a2f-c11d-4002-9286-1683c43d0ab0) (a must‑have learning resource). If you are curious about the Visual PKM philosophy behind the plugin, consider my book [Sketch Your Mind](https://sketch-your-mind.com/) and the [Visual Thinking Workshops](https://visual-thinking-workshop.com/). Finally, keep the [Excalidraw Plugin Wiki](https://excalidraw-obsidian.online/) at hand—it is an essential companion.
## Video Walkthrough
<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>
### Here's my complete catalog of videos:
<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>
<a href="https://excalidraw-obsidian.online/wiki/catalogue"><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 Part (slightly outdated) Video Walkthrough</summary>
@@ -225,7 +227,7 @@ For more details, see this [video](https://youtu.be/yZQoJg2RCKI)
- `excalidraw-link-brackets: true|false` whether or not to display brackets around links in preview
- `excalidraw-default-mode: view|zen` Open this document in view mode or zen mode by defult. The default view mode is excellent for presentation slides.
- Frontmatter tags to customize image export at a file level [519](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/519). If these keys are present, they will override the default Excalidraw embed and export settings.
- `excalidraw-export-transparent: true`:  true == Transparent / false == with background.
- `excalidraw-export-transparent: true`: true == Transparent / false == with background.
- `excalidraw-export-dark`: true == Dark mode / false == light mode.
- `excalidraw-export-padding`: Specify the export padding for the image.
- `excalidraw-export-pngscale`: This only affects export to PNG. Specify the export scale for the image. The typical range is between 0.5 and 5, but you can experiment with other values as well.
@@ -243,7 +245,7 @@ Drag the desired file from the Obsidian file explorer and hold down <kbd>SHIFT</
- Open Obsidian Developer Console (<kbd>CTRL+Shift+i</kbd>/<kbd>CMD+OPT+i</kbd>) and
- Execute the following command: `ExcalidrawAutomate.mostRecentMarkdownSVG`
- You can control the appearance of the embedded markdown file on a file by file
  bases by adding the following front matter keys to your markdown document:
bases by adding the following front matter keys to your markdown document:
- `excalidraw-font: Virgil|Cascadia|font_file_name.extension`
- `excalidraw-font-color: css-color-name|#HEXcolor|any-other-html-standard-format`,
- You can find css color names [here](https://www.w3schools.com/colors/colors_names.asp).
@@ -306,3 +308,4 @@ You can find me on Twitter [@zsviczian](https://twitter.com/zsviczian), and on m
If you enjoy Excalidraw, consider giving [ExcaliBrain](https://github.com/zsviczian/excalibrain) a try (also available via Obsidian Community Plugins).
<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>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,727 @@
/*
#exclude
```js*/
// -----------------------------
// -----------------------------
// Icon Library / Bases Search
// -----------------------------
// -----------------------------
const IMAGE_LIBRARY_FOLDER = ea.obsidian.normalizePath("Assets/nosync");
const IMAGE_LIBRARY_FILENAME = "Image Library.base"
const ICONTYPES = [
{name: "Icon", pattern: "icon"},
{name: "Stickfigure", pattern: "stickfigure"},
{name: "Logo", pattern: "logo"}
];
const IMAGE_LIBRARY_PATH = ea.obsidian.normalizePath(IMAGE_LIBRARY_FOLDER + "/" + IMAGE_LIBRARY_FILENAME);
async function initializeImageLibrary() {
await ea.checkAndCreateFolder(IMAGE_LIBRARY_FOLDER);
const syncPlugin = app.internalPlugins.plugins["sync"]?.instance;
if(syncPlugin && !syncPlugin.ignoreFolders.includes(IMAGE_LIBRARY_FOLDER)) {
syncPlugin.setIgnoreFolders(syncPlugin.ignoreFolders.concat(IMAGE_LIBRARY_FOLDER));
}
const imgLibFile = app.vault.getFileByPath(IMAGE_LIBRARY_PATH);
if(!imgLibFile) {
//The bases file is very sensitive to spaces, indents, and formatting
//take care when modifying this
const baseTemplate = `formulas:\n` +
` Icon: image(file.path)\n` +
` keywords: file.name.split(" - ")[1]\n` +
` icon-path: link(if(file.ext == "md", "Assets/" + file.name.split(" - ")[0] + "s/" + file.name + ".svg", file.path))\n` +
`views:\n` +
` - type: cards\n` +
` name: View\n` +
` filters:\n` +
` and:\n` +
` - /^(icon|stickfigure|logo) \\- /i.matches(file.name.lower())\n` +
` - '!file.path.startsWith("Assets/")'\n` +
` - /./i.matches(formula.keywords)\n` +
` order:\n` +
` - formula.keywords\n` +
` sort:\n` +
` - property: formula.keywords\n` +
` direction: ASC\n` +
` cardSize: 130\n` +
` imageFit: contain\n` +
` image: formula.icon-path\n` +
` imageAspectRatio: 0.8\n`;
await app.vault.create(IMAGE_LIBRARY_PATH, baseTemplate);
}
}
initializeImageLibrary();
async function revealIconLibrary() {
const file = app.vault.getFileByPath(IMAGE_LIBRARY_PATH);
if(!file) return;
let leaf;
app.workspace.iterateAllLeaves(l=>{
if(leaf) return;
if(l.view?.getViewType() === "bases" && l.view.getState().file === file.path) leaf = l;
});
if(leaf) {
app.workspace.revealLeaf(leaf);
return file;
}
leaf = app.workspace.getRightLeaf();
await leaf.openFile(file);
app.workspace.revealLeaf(leaf);
return file;
}
if(ea.verifyMinimumPluginVersion("2.13.2")) {
ea.plugin.addCommand({
id: "base-filter-keywords",
name: "Icon Library",
icon: "images",
callback: async () => {
// Check if the active file is a .base file
const file = await revealIconLibrary();
if(!file) return false;
let baseContent = await app.vault.read(file);
// Check if the file has the specific patterns for filtering
if (!baseContent.includes(".matches(formula.keywords)")) return;
// Create a modal using Obsidian's Modal class
const Modal = ea.FloatingModal;
const modal = new Modal(app);
const { contentEl } = modal;
contentEl.createEl("style", {
text: `
input[type="checkbox"]:focus-visible {
outline: 2px solid ${app.getAccentColor()} !important;
outline-offset: 2px !important;
}
`
});
// Set title
contentEl.createEl("h3", {
text: "Icon Library"
});
// ---------------------
// Create keyword filter
// ---------------------
const inputContainer = contentEl.createDiv();
inputContainer.style.margin = "20px 0";
const input = contentEl.createEl("input", {
type: "text",
placeholder: "Enter filter term (leave empty for wildcard, you may use regular expression)",
});
input.style.width = "100%";
input.style.padding = "8px";
// Extract current keyword filter
const keywordFilterRegex = /(- +)\/(.*?)\/i?\.matches\(formula\.keywords\)/;
const keywordMatch = baseContent.match(keywordFilterRegex);
if (keywordMatch && keywordMatch[2] && keywordMatch[2] !== ".") {
input.value = keywordMatch[2];
}
// Set focus on the input
setTimeout(() => input.focus(), 50);
// ------------------
// Create toggle switches for file type filters
// ------------------
const toggleContainer = contentEl.createDiv();
toggleContainer.style.margin = "20px 0";
toggleContainer.style.display = "flex";
toggleContainer.style.gap = "15px";
toggleContainer.style.flexWrap = "wrap";
// Get current filter pattern to determine initial toggle states
const fileNameFilterRegex = /\/\^(.*?) \\- \/i?\.matches\(file\.name\.lower\(\)\)/;
const match = baseContent.match(fileNameFilterRegex);
let currentFilters = [];
if (match && match[1]) {
currentFilters = match[1].replace(/[\(\)]/g, '').split('|');
}
// Create toggle function
const createToggle = (label, value) => {
const toggleWrapper = toggleContainer.createDiv();
toggleWrapper.style.display = "flex";
toggleWrapper.style.alignItems = "center";
const checkbox = toggleWrapper.createEl("input", {
type: "checkbox",
attr: { id: `toggle-${value}` }
});
checkbox.checked = currentFilters.includes(value);
const labelEl = toggleWrapper.createEl("label", {
text: label,
attr: { for: `toggle-${value}` }
});
labelEl.style.marginLeft = "5px";
return checkbox;
};
// Create toggles dynamically based on ICONTYPES array
const typeToggles = {};
ICONTYPES.forEach(iconType => {
typeToggles[iconType.pattern] = createToggle(iconType.name, iconType.pattern);
});
// Function to apply the filter
const applyFilter = async () => {
// Get selected file types
const selectedTypes = [];
ICONTYPES.forEach(iconType => {
if (typeToggles[iconType.pattern].checked) selectedTypes.push(iconType.pattern);
});
// Build file type filter pattern
const fileTypePattern = selectedTypes.length > 0
? `/^(${selectedTypes.join('|')}) \\- /i`
: `/^() \\- /i`; // Empty pattern if none selected
// Get keyword filter
const keywordTerm = input.value.trim() || ".";
// Update both filter patterns in the base file
let updatedContent = baseContent;
// Update file name filter
updatedContent = updatedContent.replace(
/\/\^.*? \\\- \/i?\.matches\(file\.name\.lower\(\)\)/,
`${fileTypePattern}.matches(file.name.lower())`
);
// Update keyword filter
updatedContent = updatedContent.replace(
/(- +)\/.*\/i?\.matches\(formula\.keywords\)/g,
`$1/${keywordTerm}/i.matches(formula.keywords)`
);
// Save the updated file
if (updatedContent !== baseContent) {
await app.vault.modify(file, updatedContent);
baseContent = updatedContent; // Update base content to prevent duplicate updates
}
};
// -------------------
// Add event listeners for input changes to apply filter immediately
// -------------------
contentEl.querySelectorAll("input").forEach(el => {
el.addEventListener("input", applyFilter);
});
// Handle Enter key in the input field
contentEl.querySelectorAll("input").forEach(el => {
el.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
e.preventDefault();
modal.close();
}
});
});
modal.open();
},
});
} else {
new Notice("Icon Library not initialized. Please update to the latest Excalidraw Plugin version", 0);
}
// -----------------
// -----------------
// Throttle Sync
// -----------------
// -----------------
const sync = app.internalPlugins.plugins["sync"]?.instance
function throttleSync() {
function setPause(newState) {
if (newState && sync.getStatus() !== "synced") {
setTimeout(() => setPause(true), 10000) //20 seconds
return;
}
sync.setPause(newState);
//console.log(`${moment().format("HH:mm:ss")} - ${sync.getStatus()}`);
if (newState) {
//unpause after 2 minutes
setTimeout(() => setPause(false), 120000) //2 minutes
} else {
//pause after 20 seconds of sync
setTimeout(() => setPause(true), 20000) //20 seconds
}
}
if (sync) {
if (ea.DEVICE.isDesktop) {
setPause(false);
console.log("Sync throttle started");
} else {
sync.setPause(false);
}
}
}
if (sync) {
sync.setPause(false);
}
//throttleSync();
// ----------------------
// ----------------------
// Move settings button
// ----------------------
// ----------------------
try {
if (ea.DEVICE.isDesktop) {
const actions = document.querySelector(".workspace-drawer-vault-actions");
actions.style.display = "none";
const setting = actions.children[1];
const header = document.querySelector(".workspace-tab-header-container");
const toggle = document.querySelector(".sidebar-toggle-button.mod-left");
header.appendChild(setting);
if (header === toggle.parentElement) header.insertBefore(setting, toggle);
}
} catch (e) {
console.log("Excalidraw Startup Move Settings Button", e);
}
// --------------
// --------------
// Debug logger
// --------------
// --------------
window.logger = (label, values) => {
if (!window.log) window.log = [];
window.log.push({
label,
timestamp: performance.now(),
stack: new Error().stack,
values,
});
return false;
}
window.printLog = () => {
console.log(window.log.map(l => {
return `${moment(l.timestamp).format("HH:mm:ss.SSS")} ${
l.label}\n${l.stack.split("\n").slice(3).map(x=>x.trim()).join("\n")
}\n------------------------`;
}).join("\n"))
}
if (window.electron) {
const alignElectronSpellcheckWithObsidianSettings = () => {
const session = window.electron.remote.getCurrentWebContents().session;
session.setSpellCheckerEnabled(app.vault.config.spellcheck);
if (app.vault.config.spellcheck) {
session.setSpellCheckerLanguages(navigator.languages);
}
};
const body = document.body;
const observer = new MutationObserver((mutationsList, observer) => {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
mutation.removedNodes.forEach(node => {
if (node.classList && node.classList.contains('modal-container')) {
alignElectronSpellcheckWithObsidianSettings();
}
});
}
}
});
const config = {
childList: true
};
observer.observe(body, config);
alignElectronSpellcheckWithObsidianSettings();
}
// ------------------------
// ------------------------
// Excalidraw Event Hooks
// ------------------------
// ------------------------
/**
* If set, this callback is triggered when the user closes an Excalidraw view.
* onViewUnloadHook: (view: ExcalidrawView) => void = null;
*/
//ea.onViewUnloadHook = (view) => {};
/**
* If set, this callback is triggered, when the user changes the view mode.
* You can use this callback in case you want to do something additional when the user switches to view mode and back.
* onViewModeChangeHook: (isViewModeEnabled:boolean, view: ExcalidrawView, ea: ExcalidrawAutomate) => void = null;
*/
//ea.onViewModeChangeHook = (isViewModeEnabled, view, ea) => {};
/**
* If set, this callback is triggered, when the user hovers a link in the scene.
* You can use this callback in case you want to do something additional when the onLinkHover event occurs.
* This callback must return a boolean value.
* In case you want to prevent the excalidraw onLinkHover action you must return false, it will stop the native excalidraw onLinkHover management flow.
* onLinkHoverHook: (
* element: NonDeletedExcalidrawElement,
* linkText: string,
* view: ExcalidrawView,
* ea: ExcalidrawAutomate
* ) => boolean = null;
*/
//ea.onLinkHoverHook = (element, linkText, view, ea) => {};
/**
* If set, this callback is triggered, when the user clicks a link in the scene.
* You can use this callback in case you want to do something additional when the onLinkClick event occurs.
* This callback must return a boolean value.
* In case you want to prevent the excalidraw onLinkClick action you must return false, it will stop the native excalidraw onLinkClick management flow.
* onLinkClickHook:(
* element: ExcalidrawElement,
* linkText: string,
* event: MouseEvent,
* view: ExcalidrawView,
* ea: ExcalidrawAutomate
* ) => boolean = null;
*/
//ea.onLinkClickHook = (element,linkText,event, view, ea) => {};
/**
* If set, this callback is triggered, when Excalidraw receives an onDrop event.
* You can use this callback in case you want to do something additional when the onDrop event occurs.
* This callback must return a boolean value.
* In case you want to prevent the excalidraw onDrop action you must return false, it will stop the native excalidraw onDrop management flow.
* onDropHook: (data: {
* ea: ExcalidrawAutomate;
* event: React.DragEvent<HTMLDivElement>;
* draggable: any; //Obsidian draggable object
* type: "file" | "text" | "unknown";
* payload: {
* files: TFile[]; //TFile[] array of dropped files
* text: string; //string
* };
* excalidrawFile: TFile; //the file receiving the drop event
* view: ExcalidrawView; //the excalidraw view receiving the drop
* pointerPosition: { x: number; y: number }; //the pointer position on canvas at the time of drop
* }) => boolean = null;
*/
ea.onDropHook = (data) => {
const {view,draggable} = data;
if(!draggable) return;
const {file, type} = draggable;
if(!file || type !== "link") return;
const {extension} = file;
if(!(
data.ea.isExcalidrawFile(file) ||
["jpeg", "jpg", "png", "gif", "svg", "webp", "bmp", "ico", "jtif", "tif", "jfif", "avif"].contains(extension)
)) return;
const ea = data.ea.getAPI(view);
const idBefore = new Set(ea.getViewElements().map(el=>el.id));
setTimeout(()=>{
const newElements = ea.getViewElements().filter(el=>!idBefore.has(el.id));
if(newElements.length !== 1 || newElements[0].type !== "image") return;
const f = ea.getViewFileForImageElement(newElements[0]);
if(f !== file) return;
ea.copyViewElementsToEAforEditing(newElements);
ea.getElements().forEach(el=>{
const l = Math.max(el.width, el.height);
el.width = Math.round(el.width * 180/l);
el.height = Math.round(el.height * 180/l);
});
ea.addElementsToView();
},100);
}
/**
* If set, this callback is triggered, when Excalidraw receives an onPaste event.
* You can use this callback in case you want to do something additional when the
* onPaste event occurs.
* This callback must return a boolean value.
* In case you want to prevent the excalidraw onPaste action you must return false,
* it will stop the native excalidraw onPaste management flow.
* onPasteHook: (data: {
* ea: ExcalidrawAutomate;
* payload: ClipboardData;
* event: ClipboardEvent;
* excalidrawFile: TFile; //the file receiving the paste event
* view: ExcalidrawView; //the excalidraw view receiving the paste
* pointerPosition: { x: number; y: number }; //the pointer position on canvas
* }) => boolean = null;
*/
ea.onPasteHook = (data) => {
const {ea,payload} = data;
if (payload?.elements) {
payload.elements.filter(el => el.locked).forEach(el => {
el.locked = false;
});
/* data.payload.elements
.filter(el=>el.type==="text" && !el.hasOwnProperty("rawText"))
.forEach(el=>el.rawText = el.originalText);*/
}
/*
const getFileFromObsidianURL = (data) => {
if(!data) return null;
if(!data.startsWith("obsidian://")) return null;
try {
const url = new URL(data);
const fileParam = url.searchParams.get("file");
if(!fileParam) return null;
return decodeURIComponent(fileParam);
} catch {
return null;
}
}
if(payload.text) {
link = getFileFromObsidianURL(payload.text);
await ea.addImage(0,0,link);
await ea.addElementsToView(true,true,true);
return false;
}
*/
};
/**
* if set, this callback is triggered, when an Excalidraw file is opened
* You can use this callback in case you want to do something additional when the file is opened.
* This will run before the file level script defined in the `excalidraw-onload-script` frontmatter.
* onFileOpenHook: (data: {
* ea: ExcalidrawAutomate;
* excalidrawFile: TFile; //the file being loaded
* view: ExcalidrawView;
* }) => Promise<void>;
*/
//ea.onFileOpenHook = (data) => {};
/**
* if set, this callback is triggered, when an Excalidraw file is created
* see also: https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1124
* onFileCreateHook: (data: {
* ea: ExcalidrawAutomate;
* excalidrawFile: TFile; //the file being created
* view: ExcalidrawView;
* }) => Promise<void>;
*/
/*ea.onFileCreateHook = (data) => {
app.fileManager.promptForFileRename(data.excalidrawFile);
};*/
/**
* If set, this callback is triggered when a image is being saved in Excalidraw.
* You can use this callback to customize the naming and path of pasted images to avoid
* default names like "Pasted image 123147170.png" being saved in the attachments folder,
* and instead use more meaningful names based on the Excalidraw file or other criteria,
* plus save the image in a different folder.
*
* If the function returns null or undefined, the normal Excalidraw operation will continue
* with the excalidraw generated name and default path.
* If a filepath is returned, that will be used. Include the full Vault filepath and filename
* with the file extension.
* The currentImageName is the name of the image generated by excalidraw or provided during paste.
*
* @param data - An object containing the following properties:
* @property {string} [currentImageName] - Default name for the image.
* @property {string} drawingFilePath - The file path of the Excalidraw file where the image is being used.
*
* @returns {string} - The new filepath for the image including full vault path and extension.
*
* Example usage:
* ```
* onImageFilePathHook: (data) => {
* const { currentImageName, drawingFilePath } = data;
* const ext = currentImageName.split('.').pop();
* // Generate a new filepath based on the drawing file name and other criteria
* return `${drawingFileName} - ${currentImageName || 'image'}.${ext}`;
* }
* ```
* onImageFilePathHook: (data: {
* currentImageName: string; // Excalidraw generated name of the image, or the name received from the file system.
* drawingFilePath: string; // The full filepath of the Excalidraw file where the image is being used.
* }) => string = null;
*/
// ea.onImageFilePathHook = (data) => { console.log(data); };
/**
* If set, this callback is triggered when the Excalidraw image is being exported to
* .svg, .png, or .excalidraw.
* You can use this callback to customize the naming and path of the images. This allows
* you to place images into an assets folder.
*
* If the function returns null or undefined, the normal Excalidraw operation will continue
* with the currentImageName and in the same folder as the Excalidraw file
* If a filepath is returned, that will be used. Include the full Vault filepath and filename
* with the file extension.
* !!!! If an image already exists on the path, that will be overwritten. When returning
* your own image path, you must take care of unique filenames (if that is a requirement) !!!!
* The current image name is the name generated by Excalidraw:
* - my-drawing.png
* - my-drawing.svg
* - my-drawing.excalidraw
* - my-drawing.dark.svg
* - my-drawing.light.svg
* - my-drawing.dark.png
* - my-drawing.light.png
*
* @param data - An object containing the following properties:
* @property {string} exportFilepath - Default export filepath for the image.
* @property {string} excalidrawFile - TFile: The Excalidraw file being exported.
* @property {ExcalidrawAutomate} ea - The ExcalidrawAutomate instance associated with the hook.
* @property {string} [oldExcalidrawPath] - If action === "move" The old path of the Excalidraw file, else undefined
* @property {string} action - The action being performed: "export", "move", or "delete". move and delete reference the change to the Excalidraw file.
*
* @returns {string} - The new filepath for the image including full vault path and extension.
*
* action === "move" || action === "delete" is only possible if "keep in sync" is enabled
* in plugin export settings
*
* Example usage:
* ```
* onImageFilePathHook: (data) => {
* const { currentImageName, drawingFilePath, frontmatter } = data;
* // Generate a new filepath based on the drawing file name and other criteria
* const ext = currentImageName.split('.').pop();
* if(frontmatter && frontmatter["my-custom-field"]) {
* }
* return `${drawingFileName} - ${currentImageName || 'image'}.${ext}`;
* }
* ```
*/
ea.onImageExportPathHook = (data) => {
//debugger; //remove comment to debug using Developer Console
let {
excalidrawFile,
exportFilepath,
exportExtension,
oldExcalidrawPath,
action
} = data;
const frontmatter = app.metadataCache.getFileCache(excalidrawFile)?.frontmatter;
//console.log(data, frontmatter);
const excalidrawFilename = action === "move" ?
ea.splitFolderAndFilename(excalidrawFile.name).filename :
excalidrawFile.name
if (excalidrawFilename.match(/^icon - /i)) {
const {
folderpath,
filename,
basename,
extension
} = ea.splitFolderAndFilename(exportFilepath);
exportFilepath = "Assets/icons/" + filename;
return exportFilepath;
}
if (excalidrawFilename.match(/^stickfigure - /i)) {
const {
folderpath,
filename,
basename,
extension
} = ea.splitFolderAndFilename(exportFilepath);
exportFilepath = "Assets/stickfigures/" + filename;
return exportFilepath;
}
if (excalidrawFilename.match(/^logo - /i)) {
const {
folderpath,
filename,
basename,
extension
} = ea.splitFolderAndFilename(exportFilepath);
exportFilepath = "Assets/logos/" + filename;
return exportFilepath;
}
// !!!! frontmatter will be undefined when action === "delete"
// this means if you base your logic on frontmatter properties, then
// plugin settings keep files in sync will break for those files when
// deleting the Excalidraw file. The images will not be deleted, or worst
// your logic might result in deleting other files. This hook gives you
// powerful control, but the hook function logic requires careful testing
// on your part.
//if(frontmatter && frontmatter["is-asset"]) { //custom frontmatter property
// exportFilepath = ea.obsidian.normalizePath("assets/" + exportFilepath);
// return exportFilepath;
//}
return exportFilepath;
};
/**
* Excalidraw supports auto-export of Excalidraw files to .png, .svg, and .excalidraw formats.
*
* Auto-export of Excalidraw files can be controlled at multiple levels.
* 1) In plugin settings where you can set up default auto-export applicable to all your Excalidraw files.
* 2) However, if you do not want to auto-export every file, you can also control auto-export
* at the file level using the 'excalidraw-autoexport' frontmatter property.
* 3) This hook gives you an additional layer of control over the auto-export process.
*
* This hook is triggered when an Excalidraw file is being saved.
*
* interface AutoexportConfig {
* png: boolean; // Whether to auto-export to PNG
* svg: boolean; // Whether to auto-export to SVG
* excalidraw: boolean; // Whether to auto-export to Excalidraw format
* theme: "light" | "dark" | "both"; // The theme to use for the export
* }
*
* @param {Object} data - The data for the hook.
* @param {AutoexportConfig} data.autoexportConfig - The current autoexport configuration.
* @param {TFile} data.excalidrawFile - The Excalidraw file being auto-exported.
* @returns {AutoexportConfig | null} - Return a modified AutoexportConfig to override the export behavior, or null to use the default.
*/
ea.onTriggerAutoexportHook = (data) => {
let {
autoexportConfig,
excalidrawFile
} = data;
//const frontmatter = app.metadataCache.getFileCache(excalidrawFile)?.frontmatter;
//console.log(data, frontmatter);
//logic based on filepath and frontmatter
if (excalidrawFile.name.match(/^(?:icon|stickfigure|logo) - /i)) {
autoexportConfig.theme = "light";
autoexportConfig.svg = true;
autoexportConfig.png = false;
autoexportConfig.excalidraw = false;
return autoexportConfig;
}
return autoexportConfig;
};
/**
* If set, this callback is triggered whenever the active canvas color changes
* onCanvasColorChangeHook: (
* ea: ExcalidrawAutomate,
* view: ExcalidrawView, //the excalidraw view
* color: string,
* ) => void = null;
*/
//ea.onCanvasColorChangeHook = (ea, view, color) => {};
/**
* If set, this callback is triggered whenever a drawing is exported to SVG.
* The string returned will replace the link in the exported SVG.
* The hook is only executed if the link is to a file internal to Obsidian
* see: https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1605
* onUpdateElementLinkForExportHook: (data: {
* originalLink: string,
* obsidianLink: string,
* linkedFile: TFile | null,
* hostFile: TFile,
* }) => string = null;
*/
//ea.onUpdateElementLinkForExportHook = (data) => {
// const decodedObsidianURI = decodeURIComponent(data.obsidianLink);
//};
+3 -1
View File
@@ -577,9 +577,11 @@ export declare class ExcalidrawAutomate {
* @param {number} topX - The x-coordinate of the top-left corner.
* @param {number} topY - The y-coordinate of the top-left corner.
* @param {string} tex - The LaTeX equation string.
* @param {number} [scaleX=1] - The x-scaling factor (post mathjax creation)
* @param {number} [scaleY=1] - The y-scaling factor (post mathjax creation)
* @returns {Promise<string>} Promise resolving to the ID of the added LaTeX image element.
*/
addLaTex(topX: number, topY: number, tex: string): Promise<string>;
addLaTex(topX: number, topY: number, tex: string, scaleX?: number, scaleY?: number): Promise<string>;
/**
* Returns the base64 dataURL of the LaTeX equation rendered as an SVG.
* @param {string} tex - The LaTeX equation string.
+2 -2
View File
@@ -3011,7 +3011,7 @@ Fix:
- Transcluded text will now exclude ^block-references at end of lines
- Phantom duplicates of the drawing appear when "zoom to fit" results in a zoom value below 10% and there are many objects on the canvas [#850](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/850)
- CTRL+Wheel will increase/decrease zoom in steps of 5% matching the behavior of the "+" & "-" zoom buttons.
- Latest updates from Excalidarw.com
- Latest updates from Excalidraw.com
- Freedraw flip not scaling correctly [#5752](https://github.com/excalidraw/excalidraw/pull/5752)
- Multiple elements resizing regressions [#5586](https://github.com/excalidraw/excalidraw/pull/5586)
@@ -4339,7 +4339,7 @@ Fixed:
# 1.5.8
- minor fix to ExcalidarwAutomate addText to handle non-container bound text wrapping correctly.
- minor fix to ExcalidrawAutomate addText to handle non-container bound text wrapping correctly.
# 1.5.7
+3 -1
View File
@@ -577,9 +577,11 @@ export declare class ExcalidrawAutomate {
* @param {number} topX - The x-coordinate of the top-left corner.
* @param {number} topY - The y-coordinate of the top-left corner.
* @param {string} tex - The LaTeX equation string.
* @param {number} [scaleX=1] - The x-scaling factor (post mathjax creation)
* @param {number} [scaleY=1] - The y-scaling factor (post mathjax creation)
* @returns {Promise<string>} Promise resolving to the ID of the added LaTeX image element.
*/
addLaTex(topX: number, topY: number, tex: string): Promise<string>;
addLaTex(topX: number, topY: number, tex: string, scaleX?: number, scaleY?: number): Promise<string>;
/**
* Returns the base64 dataURL of the LaTeX equation rendered as an SVG.
* @param {string} tex - The LaTeX equation string.
+2 -2
View File
@@ -3011,7 +3011,7 @@ Fix:
- Transcluded text will now exclude ^block-references at end of lines
- Phantom duplicates of the drawing appear when "zoom to fit" results in a zoom value below 10% and there are many objects on the canvas [#850](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/850)
- CTRL+Wheel will increase/decrease zoom in steps of 5% matching the behavior of the "+" & "-" zoom buttons.
- Latest updates from Excalidarw.com
- Latest updates from Excalidraw.com
- Freedraw flip not scaling correctly [#5752](https://github.com/excalidraw/excalidraw/pull/5752)
- Multiple elements resizing regressions [#5586](https://github.com/excalidraw/excalidraw/pull/5586)
@@ -4339,7 +4339,7 @@ Fixed:
# 1.5.8
- minor fix to ExcalidarwAutomate addText to handle non-container bound text wrapping correctly.
- minor fix to ExcalidrawAutomate addText to handle non-container bound text wrapping correctly.
# 1.5.7
+3 -2
View File
@@ -7,7 +7,8 @@ If you are enjoying the Excalidraw plugin then please support my work and enthus
Jump ahead to the [[#List of available scripts]]
# Introducing Excalidraw Automate Script Engine
<iframe width="560" height="315" src="https://www.youtube.com/embed/hePJcObHIso" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<a href="https://www.youtube.com/watch?v=hePJcObHIso" target="_blank"><img src ="https://i.ytimg.com/vi/hePJcObHIso/maxresdefault.jpg" style="width:560px;"></a>
Script Engine scripts are installed in the `Downloaded` subfolder of the `Excalidraw Automate script folder` specified in plugin settings.
@@ -243,7 +244,7 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/OCR%20-%20Optical%20Character%20Recognition.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/OCR%20-%20Optical%20Character%20Recognition.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">REQUIRES EXCALIDRAW 1.5.15<br>The script will 1) send the selected image file to [taskbone.com](https://taskbone.com) to extract the text from the image, and 2) will add the text to your drawing as a text element.<br><mark>⚠ Note that you will need to manually paste your token into the script after the first run! ⚠</mark><br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-ocr.jpg'><br><iframe width="560" height="315" src="https://www.youtube.com/embed/W2NMzR8s4eE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></td></tr></table>
<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/OCR%20-%20Optical%20Character%20Recognition.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">REQUIRES EXCALIDRAW 1.5.15<br>The script will 1) send the selected image file to [taskbone.com](https://taskbone.com) to extract the text from the image, and 2) will add the text to your drawing as a text element.<br><mark>⚠ Note that you will need to manually paste your token into the script after the first run! ⚠</mark><br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-ocr.jpg'><br><a href="https://www.youtube.com/watch?v=W2NMzR8s4eE" target="_blank"><img src ="https://i.ytimg.com/vi/W2NMzR8s4eE/maxresdefault.jpg" style="width:560px;"></a></td></tr></table>
## Organic Line
```excalidraw-script-install
@@ -3,12 +3,13 @@
Select some elements in the scene. The script will take these elements and move them into a new Excalidraw file, and open that file. The selected elements will also be replaced in your original drawing with the embedded Excalidraw file (the one that was just created). You will be prompted for the file name of the new deconstructed image. The script is useful if you want to break a larger drawing into smaller reusable parts that you want to reference in multiple drawings.
<iframe width="560" height="315" src="https://www.youtube.com/embed/HRtaaD34Zzg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<a href="https://www.youtube.com/watch?v=HRtaaD34Zzg" target="_blank"><img src ="https://i.ytimg.com/vi/HRtaaD34Zzg/maxresdefault.jpg" style="width:560px;"></a>
<iframe width="560" height="315" src="https://www.youtube.com/embed/mvMQcz401yo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<a href="https://www.youtube.com/watch?v=mvMQcz401yo" target="_blank"><img src ="https://i.ytimg.com/vi/mvMQcz401yo/maxresdefault.jpg" style="width:560px;"></a>
```javascript
```js
*/
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.7.3")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
return;
@@ -21,16 +22,57 @@ const excalidrawTemplates = ea.getListOfTemplateFiles();
if(typeof window.ExcalidrawDeconstructElements === "undefined") {
window.ExcalidrawDeconstructElements = {
openDeconstructedImage: true,
templatePath: excalidrawTemplates?.[0].path??""
reuseTab: true,
templatePath: excalidrawTemplates?.[0]?.path??""
};
} else if (typeof window.ExcalidrawDeconstructElements.reuseTab === "undefined") {
window.ExcalidrawDeconstructElements.reuseTab = true;
}
const splitFolderAndFilename = (filepath) => {
const lastIndex = filepath.lastIndexOf("/");
return {
foldername: ea.obsidian.normalizePath(filepath.substring(0, lastIndex)),
filename: (lastIndex == -1 ? filepath : filepath.substring(lastIndex + 1)) + ".md"
};
// Helper class for Folder Autocomplete
class FolderSuggest extends ea.obsidian.AbstractInputSuggest {
constructor(app, inputEl) {
super(app, inputEl);
this.inputEl = inputEl;
}
getSuggestions(query) {
const folders = app.vault.getAllLoadedFiles().filter(f => f instanceof ea.obsidian.TFolder);
const lowerQuery = query.toLowerCase();
// Filter folders that match the query
const matches = folders.filter(f => f.path.toLowerCase().includes(lowerQuery));
// Custom Sort
matches.sort((a, b) => {
const aPath = a.path;
const bPath = b.path;
const aLower = aPath.toLowerCase();
const bLower = bPath.toLowerCase();
// Priority 1: Starts with query (e.g. "Projects" comes before "Hobbies/Projects")
const aStarts = aLower.startsWith(lowerQuery);
const bStarts = bLower.startsWith(lowerQuery);
if (aStarts && !bStarts) return -1;
if (!aStarts && bStarts) return 1;
// Priority 2: Alphabetical
return aPath.localeCompare(bPath);
});
return matches.map(f => f.path);
}
renderSuggestion(value, el) {
el.setText(value);
}
selectSuggestion(value, evt) {
this.inputEl.value = value;
this.inputEl.dispatchEvent(new Event('input'));
this.close();
}
}
let settings = ea.getScriptSettings();
@@ -76,12 +118,13 @@ if (els.length === 0) {
const bb = ea.getBoundingBox(els);
ea.copyViewElementsToEAforEditing(els);
// Handle Image elements logic from original script
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);
const hyperlink = img?.hyperlink;
if(img && (path || hyperlink)) {
const colorMap = ea.getColorMapForImageElement(el);
const colorMap = ea.getColorMapForImageElement(el);
ea.imagesDict[el.fileId] = {
mimeType: img.mimeType,
id: el.fileId,
@@ -96,7 +139,7 @@ ea.getElements().filter(el=>el.type==="image").forEach(el=>{
return;
}
const equation = ea.targetView.excalidrawData.getEquation(el.fileId);
eqImg = ea.targetView.getScene()?.files[el.fileId]
const eqImg = ea.targetView.getScene()?.files[el.fileId]
if(equation && eqImg) {
ea.imagesDict[el.fileId] = {
mimeType: eqImg.mimeType,
@@ -112,28 +155,107 @@ ea.getElements().filter(el=>el.type==="image").forEach(el=>{
});
// ------------
// Input prompt
// ------------
let shouldAnchor = false;
const actionButtons = [
{
caption: "Insert @100%",
tooltip: "Anchor to 100% size",
action: () => {
shouldAnchor = true;
}
},
{
caption: "Insert",
tooltip: "Insert without anchoring",
action: () => {
shouldAnchor = false;
}
}];
// ----------------------
// Execution Logic
// ----------------------
const executeDeconstruction = async (folderPath, fileName, shouldAnchor) => {
// Ensure filename has extension
if (!fileName.endsWith(".md")) fileName += ".md";
// Construct full path
// normalizePath handles cases where folderPath might be empty or root
const fullPath = ea.obsidian.normalizePath(`${folderPath}/${fileName}`);
// Separate back into folder and filename for ea.create
const pathParts = fullPath.split("/");
const finalFileName = pathParts.pop();
const finalFolderName = pathParts.join("/");
const customControls = (container) => {
new ea.obsidian.Setting(container)
// We use silent: true to prevent ea.create from opening the file automatically.
// We handle opening manually based on user preference.
const newPath = await ea.create ({
filename: finalFileName,
foldername: finalFolderName,
templatePath: window.ExcalidrawDeconstructElements.templatePath,
onNewPane: true,
silent: true
});
let f = app.vault.getAbstractFileByPath(newPath);
let counter = 0;
while((!f || !ea.isExcalidrawFile(f)) && counter++<100) {
await sleep(50);
f = app.vault.getAbstractFileByPath(newPath);
}
if(!f || !ea.isExcalidrawFile(f)) {
new Notice("Something went wrong");
return;
}
let padding = parseFloat(app.metadataCache.getCache(f.path)?.frontmatter["excalidraw-export-padding"]);
if(isNaN(padding)) {
padding = ea.plugin.settings.exportPaddingSVG;
}
// Remove elements from current view and replace with image of new file
ea.getElements().forEach(el=>el.isDeleted = true);
await ea.addImage(bb.topX-padding, bb.topY-padding, f, false, shouldAnchor);
await ea.addElementsToView(false, true, true);
ea.getExcalidrawAPI().history.clear();
if(window.ExcalidrawDeconstructElements.openDeconstructedImage) {
const reuse = window.ExcalidrawDeconstructElements.reuseTab;
if (reuse) {
ea.openFileInNewOrAdjacentLeaf(f);
} else {
// Force new tab
await app.workspace.getLeaf('tab').openFile(f);
}
} else {
new Notice("Deconstruction ready");
}
};
// ----------------------
// Floating Modal UI
// ----------------------
const modal = new ea.FloatingModal(ea.plugin.app);
modal.titleEl.setText("Deconstruct Elements");
modal.onOpen = () => {
const content = modal.contentEl;
content.empty();
// -- Folder Path Input --
const folderDiv = content.createDiv({ cls: "setting-item" });
folderDiv.createDiv({ cls: "setting-item-info" }).createEl("label", { text: "Folder path" });
const folderControl = folderDiv.createDiv({ cls: "setting-item-control" });
const folderInput = new ea.obsidian.TextComponent(folderControl);
// Set default folder to current file's parent
const currentFolder = ea.targetView.file.parent.path;
folderInput.setValue(currentFolder);
folderInput.inputEl.style.width = "100%";
// Attach Autocomplete
new FolderSuggest(ea.plugin.app, folderInput.inputEl);
// -- Filename Input --
const fileDiv = content.createDiv({ cls: "setting-item" });
fileDiv.createDiv({ cls: "setting-item-info" }).createEl("label", { text: "File name" });
const fileControl = fileDiv.createDiv({ cls: "setting-item-control" });
const fileInput = new ea.obsidian.TextComponent(fileControl);
fileInput.setValue(DEFAULT_FILENAME);
fileInput.inputEl.style.width = "100%";
// Set focus to file input
setTimeout(() => fileInput.inputEl.focus(), 50);
// -- Template Dropdown --
new ea.obsidian.Setting(content)
.setName(`Select template`)
.addDropdown(dropdown => {
templates.forEach(file => dropdown.addOption(file.path, file.basename));
@@ -143,64 +265,67 @@ const customControls = (container) => {
.onChange(value => {
window.ExcalidrawDeconstructElements.templatePath = value;
})
})
});
new ea.obsidian.Setting(container)
// -- Open Toggle --
new ea.obsidian.Setting(content)
.setName(`Open deconstructed image`)
.addToggle((toggle) => toggle
.setValue(window.ExcalidrawDeconstructElements.openDeconstructedImage)
.onChange(value => {
window.ExcalidrawDeconstructElements.openDeconstructedImage = value;
// Update visibility of the sub-toggle
reuseSetting.settingEl.style.display = value ? "" : "none";
})
)
}
);
const path = await utils.inputPrompt(
"Filename for new file",
"Filename",
await ea.getAttachmentFilepath(DEFAULT_FILENAME),
actionButtons,
2,
false,
customControls
);
// -- Reuse Tab Toggle --
const reuseSetting = new ea.obsidian.Setting(content)
.setName(`Reuse existing tab`)
.setDesc("If available, open in an adjacent tab. Otherwise open in a new tab.")
.setClass("reuse-tab-setting")
.addToggle((toggle) => toggle
.setValue(window.ExcalidrawDeconstructElements.reuseTab)
.onChange(value => {
window.ExcalidrawDeconstructElements.reuseTab = value;
})
);
// Initialize visibility and style
reuseSetting.settingEl.style.display = window.ExcalidrawDeconstructElements.openDeconstructedImage ? "" : "none";
reuseSetting.settingEl.style.borderTop = "none";
// -- Buttons --
const buttonContainer = content.createDiv({ cls: "excalidraw-dialog-buttons", style: "margin-top: 20px; display: flex; gap: 12px; justify-content: flex-end;" });
const btnInsert = new ea.obsidian.ButtonComponent(buttonContainer)
.setButtonText("Insert")
.setTooltip("Insert without anchoring")
.onClick(async () => {
const folder = folderInput.getValue();
const filename = fileInput.getValue();
if (!filename) {
new Notice("Filename is required");
return;
}
modal.close();
await executeDeconstruction(folder, filename, false);
});
if(!path) return;
const btnInsertAnchor = new ea.obsidian.ButtonComponent(buttonContainer)
.setButtonText("Insert @100%")
.setTooltip("Anchor to 100% size")
.setCta()
.onClick(async () => {
const folder = folderInput.getValue();
const filename = fileInput.getValue();
if (!filename) {
new Notice("Filename is required");
return;
}
modal.close();
await executeDeconstruction(folder, filename, true);
});
};
// ----------------------
// Execute deconstruction
// ----------------------
const {foldername, filename} = splitFolderAndFilename(path);
const newPath = await ea.create ({
filename,
foldername,
templatePath: window.ExcalidrawDeconstructElements.templatePath,
onNewPane: true,
silent: !window.ExcalidrawDeconstructElements.openDeconstructedImage
});
let f = app.vault.getAbstractFileByPath(newPath);
let counter = 0;
while((!f || !ea.isExcalidrawFile(f)) && counter++<100) {
await sleep(50);
f = app.vault.getAbstractFileByPath(newPath);
}
if(!f || !ea.isExcalidrawFile(f)) {
new Notice("Something went wrong");
return;
}
let padding = parseFloat(app.metadataCache.getCache(f.path)?.frontmatter["excalidraw-export-padding"]);
if(isNaN(padding)) {
padding = ea.plugin.settings.exportPaddingSVG;
}
ea.getElements().forEach(el=>el.isDeleted = true);
await ea.addImage(bb.topX-padding,bb.topY-padding,f,false, shouldAnchor);
await ea.addElementsToView(false, true, true);
ea.getExcalidrawAPI().history.clear();
if(!window.ExcalidrawDeconstructElements.openDeconstructedImage) {
new Notice("Deconstruction ready");
}
modal.open();
+3 -1
View File
@@ -1,5 +1,7 @@
/*
<iframe width="560" height="315" 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>
<a href="https://www.youtube.com/watch?v=A1vrSGBbWgo" target="_blank"><img src ="https://i.ytimg.com/vi/A1vrSGBbWgo/maxresdefault.jpg" style="width:560px;"></a>
![](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-draw-a-ui.jpg)
```js*/
+1 -1
View File
@@ -5,7 +5,7 @@ const room = Array.from(window.crypto.getRandomValues(new Uint8Array(10))).map((
const key = (await window.crypto.subtle.exportKey("jwk",await window.crypto.subtle.generateKey({name:"AES-GCM",length:128},true,["encrypt", "decrypt"]))).k;
const link = `https://excalidraw.com/#room=${room},${key}`;
ea.addIFrame(0,0,800,600,link);
ea.addEmbeddable(0,0,800,600,link);
ea.addElementsToView(true,true);
window.navigator.clipboard.writeText(link);
+64 -14
View File
@@ -6,12 +6,23 @@ You can download the sample Obsidian Templater file from [here](https://gist.git
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") {
if (!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.20.2")) {
new Notice("Please update the Excalidraw Plugin to version 2.20.2 or higher.");
return;
}
let selectedElements = ea.getViewSelectedElements();
const selectedTextElement = ea.getBoundTextElement(selectedElements, true)?.sceneElement;
if ((!selectedTextElement && selectedElements.length !== 1) || selectedElements[0].type === "arrow") {
new Notice("Select a single element that is not an arrow and not a frame");
return;
}
// Detect Mindmap Builder nodes
const startNode = selectedElements[0];
const isMindMap = typeof startNode.customData?.growthMode !== "undefined" || typeof startNode.customData?.mindmapOrder !== "undefined";
const visited = new Set(); // Avoiding recursive infinite loops
delete window.ewm;
@@ -111,9 +122,8 @@ function getImageLink(f) {
}
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" : "";
const text = ea.getBoundTextElement(el,true)?.sceneElement?.rawText;
return text ? text + "\n" : "";
}
async function getSectionText(file, section) {
@@ -174,8 +184,9 @@ async function getBlockText(file, blockref) {
}
async function getElementText(el) {
if (el.type === "text") {
return el.originalText;
const maybeTextEl = ea.getBoundTextElement(el,true)?.sceneElement;
if (maybeTextEl) {
return maybeTextEl.rawText;
}
if (el.type === "image") {
const f = ea.getViewFileForImageElement(el);
@@ -213,16 +224,55 @@ async function crawl(el, level, isFirst = false) {
visited.add(el.id);
let result = await getElementText(el) + "\n";
let itemsToTraverse = [];
// Process all arrows connected to this element
const boundElementsData = el.boundElements.filter(x => x.type === "arrow");
const isFork = boundElementsData.length > (isFirst ? 1 : 2);
if (isMindMap) {
// --- Mindmap Traversal Logic ---
// 1. Get all elements to lookup connections
const allElements = ea.getViewElements();
// 2. Find outgoing arrows marked as branches
const branchArrows = allElements.filter(a =>
a.type === "arrow" &&
a.customData?.isBranch &&
a.startBinding?.elementId === el.id // Only traverse downwards (Parent -> Child)
);
// 3. Map arrows to their target nodes for sorting
const childNodes = branchArrows.map(arrow => {
const node = allElements.find(e => e.id === arrow.endBinding?.elementId);
return { arrow, nextEl: node };
}).filter(x => x.nextEl); // Safety check
// 4. Sort by mindmapOrder (visual order)
childNodes.sort((a, b) => {
const orderA = a.nextEl.customData?.mindmapOrder ?? 0;
const orderB = b.nextEl.customData?.mindmapOrder ?? 0;
return orderA - orderB;
});
itemsToTraverse = childNodes;
} else {
// --- Standard Traversal Logic (Legacy) ---
// Use boundElements (incoming and outgoing) in creation order
const boundElementsData = el.boundElements?.filter(x => x.type === "arrow") || [];
itemsToTraverse = boundElementsData.map(bindingData => {
const arrow = ea.getViewElements().find(x => x.id === bindingData.id);
if (!arrow) return null;
const nextEl = getNextElementFollowingArrow(el, arrow);
return { arrow, nextEl };
}).filter(x => x && x.nextEl);
}
// Determine indentation trigger (Fork)
const isFork = itemsToTraverse.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)) {
// Recursive Traversal
for(const {arrow, nextEl} of itemsToTraverse) {
if (!visited.has(nextEl.id)) {
if(isFork) result += `\n${"#".repeat(level)} `;
const arrowLabel = getBoundText(arrow);
if (arrowLabel) {
+2 -1
View File
@@ -1,5 +1,6 @@
/*
<iframe width="560" height="315" 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>
<a href="https://www.youtube.com/watch?v=A1vrSGBbWgo" target="_blank"><img src ="https://i.ytimg.com/vi/A1vrSGBbWgo/maxresdefault.jpg" style="width:560px;"></a>
![](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-draw-a-ui.jpg)
```js*/
+1 -2
View File
@@ -6,8 +6,7 @@ The script performs two different functions depending on the elements selected i
![](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/golden-ratio.jpg)
<iframe width="560" height="315" src="https://www.youtube.com/embed/2SHn_ruax-s" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<a href="https://www.youtube.com/watch?v=2SHn_ruax-s" target="_blank"><img src ="https://i.ytimg.com/vi/2SHn_ruax-s/maxresdefault.jpg" style="width:560px;"></a>
Gravitational point of spiral: $$\left[x,y\right]=\left[ x + \frac{{\text{width} \cdot \phi^2}}{{\phi^2 + 1}}\;, \; y + \frac{{\text{height} \cdot \phi^2}}{{\phi^2 + 1}} \right]$$
Dimensions of inner rectangles in case of Double Spiral: $$[width, height] = \left[\frac{width\cdot(\phi^2+1)}{2\phi^2}\;, \;\frac{height\cdot(\phi^2+1)}{2\phi^2}\right]$$
+100 -44
View File
@@ -1,65 +1,121 @@
/*
![](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-invert-colors.jpg)
The script inverts the colors on the canvas including the color palette in Element Properties.
```javascript
*/
const defaultColorPalette = { // https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.6.8
elementStroke:["#000000","#343a40","#495057","#c92a2a","#a61e4d","#862e9c","#5f3dc4","#364fc7","#1864ab","#0b7285","#087f5b","#2b8a3e","#5c940d","#e67700","#d9480f"],
elementBackground:["transparent","#ced4da","#868e96","#fa5252","#e64980","#be4bdb","#7950f2","#4c6ef5","#228be6","#15aabf","#12b886","#40c057","#82c91e","#fab005","#fd7e14"],
canvasBackground:["#ffffff","#f8f9fa","#f1f3f5","#fff5f5","#fff0f6","#f8f0fc","#f3f0ff","#edf2ff","#e7f5ff","#e3fafc","#e6fcf5","#ebfbee","#f4fce3","#fff9db","#fff4e6"]
This script inverts all the colors in the current Excalidraw drawing. It applies the inversion to:
1. The stroke and background colors of every element on the canvas.
2. The main canvas background color.
3. All colors within the user's custom color palette, handling all possible configurations (simple arrays, nested arrays, and objects).
4. The currently selected stroke and background colors in the UI.
A default color palette is defined to use as a fallback if the current drawing's palette is missing or empty. // This is based on the standard Excalidraw palette from version [1.6.8.](https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.6.8)
You'll find a detailed description of the color palette data structure on the [Excalidraw-Obsidian Wiki](https://excalidraw-obsidian.online/wiki/color-palette)
```js*/
const defaultColorPalette = {
elementStroke: ["#000000", "#343a40", "#495057", "#c92a2a", "#a61e4d", "#862e9c", "#5f3dc4", "#364fc7", "#1864ab", "#0b7285", "#087f5b", "#2b8a3e", "#5c940d", "#e67700", "#d9480f"],
elementBackground: ["transparent", "#ced4da", "#868e96", "#fa5252", "#e64980", "#be4bdb", "#7950f2", "#4c6ef5", "#228be6", "#15aabf", "#12b886", "#40c057", "#82c91e", "#fab005", "#fd7e14"],
canvasBackground: ["#ffffff", "#f8f9fa", "#f1f3f5", "#fff5f5", "#fff0f6", "#f8f0fc", "#f3f0ff", "#edf2ff", "#e7f5ff", "#e3fafc", "#e6fcf5", "#ebfbee", "#f4fce3", "#fff9db", "#fff4e6"]
};
// Get the Excalidraw API and the current application state.
const api = ea.getExcalidrawAPI();
const st = api.getAppState();
// Retrieve the current color palette, falling back to the default if necessary.
let colorPalette = st.colorPalette ?? defaultColorPalette;
if (Object.entries(colorPalette).length === 0) colorPalette = defaultColorPalette;
if(!colorPalette.elementStroke || Object.entries(colorPalette.elementStroke).length === 0) colorPalette.elementStroke = defaultColorPalette.elementStroke;
if(!colorPalette.elementBackground || Object.entries(colorPalette.elementBackground).length === 0) colorPalette.elementBackground = defaultColorPalette.elementBackground;
if(!colorPalette.canvasBackground || Object.entries(colorPalette.canvasBackground).length === 0) colorPalette.canvasBackground = defaultColorPalette.canvasBackground;
if (!colorPalette || Object.keys(colorPalette).length === 0) {
colorPalette = defaultColorPalette;
}
// Ensure each key in the palette has a default value if it's missing.
if (!colorPalette.elementStroke || colorPalette.elementStroke.length === 0) {
colorPalette.elementStroke = defaultColorPalette.elementStroke;
}
if (!colorPalette.elementBackground || colorPalette.elementBackground.length === 0) {
colorPalette.elementBackground = defaultColorPalette.elementBackground;
}
if (!colorPalette.canvasBackground || colorPalette.canvasBackground.length === 0) {
colorPalette.canvasBackground = defaultColorPalette.canvasBackground;
}
/**
* Inverts a single color string by reversing its lightness value.
* This function uses the ColorMaster utility provided by Excalidraw Automate.
* It correctly handles various color formats (HEX, RGB, HSL) and preserves transparency.
* @param {string} color - The color to be inverted (e.g., "#FF0000").
* @returns {string} The inverted color string.
*/
const invertColor = (color) => {
if(color.toLowerCase()==="transparent") return color;
const cm = ea.getCM(color);
const lightness = cm.lightness;
cm.lightnessTo(Math.abs(lightness-100));
switch (cm.format) {
case "hsl": return cm.stringHSL();
case "rgb": return cm.stringRGB();
case "hsv": return cm.stringHSV();
default: return cm.stringHEX({alpha: false});
}
}
function invertColorsRecursively(obj) {
if (typeof obj === 'string') {
return invertColor(obj);
} else if (Array.isArray(obj)) {
return obj.map(item => invertColorsRecursively(item));
} else if (typeof obj === 'object' && obj !== null) {
const result = {};
Object.keys(obj).forEach(key => result[key] = invertColorsRecursively(obj[key]));
return result;
} else {
return obj;
const cm = ea.getCM(color);
const opts = cm.alpha !== 1 ? { alpha: true } : { alpha: false };
const lightness = cm.lightness;
cm.lightnessTo(Math.abs(lightness - 100)); // Invert lightness on a 0-100 scale.
switch (cm.format) {
case "hsl": return cm.stringHSL(opts);
case "rgb": return cm.stringRGB(opts);
case "hsv": return cm.stringHSV(opts);
default: return cm.stringHEX(opts);
}
}
colorPalette = invertColorsRecursively(colorPalette);
};
/**
* Recursively traverses a color palette data structure and inverts every color string found.
* This robustly handles all valid `colorPalette` configurations, including nested arrays
* (`string[][]`), simple arrays (`string[]`), and objects (`topPicks`).
* @param {any} palette - A color string, an array of colors, an array of arrays, or an object palette.
* @returns {any} A new palette structure with all colors inverted.
*/
const invertPaletteStructure = (palette) => {
if (typeof palette === 'string') {
// Base case: If the item is a color string, invert it.
return invertColor(palette);
}
if (Array.isArray(palette)) {
// If it's an array, recursively call this function for each item.
return palette.map(item => invertPaletteStructure(item));
}
if (typeof palette === 'object' && palette !== null) {
// If it's an object, create a new object and recursively process its values.
const newPalette = {};
for (const key in palette) {
if (Object.prototype.hasOwnProperty.call(palette, key)) {
newPalette[key] = invertPaletteStructure(palette[key]);
}
}
return newPalette;
}
// Return any other data types (like numbers or null) unchanged.
return palette;
};
// Generate the new, fully inverted color palette.
const invertedColorPalette = invertPaletteStructure(colorPalette);
// Load all elements from the current view into the Excalidraw Automate workbench for editing.
ea.copyViewElementsToEAforEditing(ea.getViewElements());
ea.getElements().forEach(el=>{
el.strokeColor = invertColor(el.strokeColor);
el.backgroundColor = invertColor(el.backgroundColor);
// Iterate over all elements and invert their stroke and background colors.
ea.getElements().forEach(el => {
if (el.strokeColor) {
el.strokeColor = invertColor(el.strokeColor);
}
if (el.backgroundColor) {
el.backgroundColor = invertColor(el.backgroundColor);
}
});
// Finally, update the Excalidraw scene with the inverted elements and application state.
ea.viewUpdateScene({
appState:{
colorPalette,
viewBackgroundColor: invertColor(st.viewBackgroundColor),
currentItemStrokeColor: invertColor(st.currentItemStrokeColor),
currentItemBackgroundColor: invertColor(st.currentItemBackgroundColor)
appState: {
colorPalette: invertedColorPalette,
viewBackgroundColor: invertColor(st.viewBackgroundColor),
currentItemStrokeColor: invertColor(st.currentItemStrokeColor),
currentItemBackgroundColor: invertColor(st.currentItemBackgroundColor)
},
elements: ea.getElements()
elements: ea.getElements(),
storeAction: "capture" // Ensures the change is saved and added to the undo/redo history.
});
+209
View File
@@ -0,0 +1,209 @@
/*
This script generates a linear (horizontal) calendar for a specified year, with days flowing left to right and months as rows.
![300](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-Linear-Calendar-Generator.jpg)
## Features
- Horizontal timeline layout with days of the week as columns
- Month names displayed on both left and right sides
- Weekend days (Saturday & Sunday) highlighted
- Day-of-week headers at top and bottom
## Customizable Colors
You can personalize the calendar's appearance by defining your own colors:
1. Create two rectangles in your design.
2. Select both rectangles before running the script:
• The **fill and stroke colors of the first rectangle** will be applied to weekdays.
• The **fill and stroke colors of the second rectangle** will be used for weekends.
If no rectangles are selected, the default color schema will be used (white and light blue-gray for weekends).
```javascript
*/
// -------------------------------------
// Constants initiation
// -------------------------------------
const CELL_WIDTH = 176; // Width of each day cell
const CELL_HEIGHT = 288; // Height of each day cell
const START_X = 0; // X start position
const START_Y = 0; // Y start position
const ROW_SPACING = 32; // Space between month rows
const MONTH_LABEL_WIDTH = 240; // Space for month labels on sides
// Colors
let COLOR_WEEKEND = "#e8eaed";
let COLOR_WEEKDAY = "#ffffff";
let COLOR_TEXT = "#000000";
let COLOR_WEEKEND_TEXT = "#000000";
let COLOR_HEADER_TEXT = "#000000";
const COLOR_STROKE = "#d0d4db";
let STROKE_WIDTH = 1;
let FILLSTYLE = "solid";
const ROUGHNESS = 0; // 0 = Architect, 1 = Artist, 2 = Cartoonist
const FONT_FAMILY = 3; // 1 = Virgil, 2 = Helvetica, 3 = Cascadia (code), 4 = Little One
// Font sizes
const FONT_SIZE_DAY = 56;
const FONT_SIZE_HEADER = 48;
const FONT_SIZE_MONTH = 64;
const FONT_SIZE_YEAR = 112;
// Day constants
const SATURDAY = 6;
const SUNDAY = 0;
const JANUARY = 0;
const FIRST_DAY_OF_THE_MONTH = 1;
// Day names (short)
const DAY_NAMES = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
// Month names (short)
const MONTH_NAMES = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
// Number of day columns needed (max 37 to cover all possible month alignments: 6 days offset + 31 days)
const NUM_COLUMNS = 37;
// -------------------------------------
// Ask for requested Year
let requestedYear = parseFloat(new Date().getFullYear());
requestedYear = parseFloat(await utils.inputPrompt("Year?", requestedYear, requestedYear));
if (isNaN(requestedYear)) {
new Notice("Invalid number");
return;
}
// -------------------------------------
// Use selected elements for calendar style
// -------------------------------------
let elements = ea.getViewSelectedElements();
if (elements.length >= 1) {
COLOR_WEEKDAY = elements[0].backgroundColor;
FILLSTYLE = elements[0].fillStyle;
STROKE_WIDTH = elements[0].strokeWidth;
}
if (elements.length >= 2) {
COLOR_WEEKEND = elements[1].backgroundColor;
}
// -------------------------------------
// Helper function to get days in a month
// -------------------------------------
function getDaysInMonth(year, month) {
return new Date(year, month + 1, 0).getDate();
}
// -------------------------------------
// Helper function to get the day of week for first day of month
// -------------------------------------
function getFirstDayOfMonth(year, month) {
return new Date(year, month, 1).getDay();
}
// -------------------------------------
// Draw day-of-week headers
// -------------------------------------
function drawDayHeaders(yPosition) {
ea.style.fontSize = FONT_SIZE_HEADER;
ea.style.strokeColor = COLOR_TEXT;
ea.style.fontFamily = FONT_FAMILY;
for (let col = 0; col < NUM_COLUMNS; col++) {
const dayIndex = col % 7;
const x = START_X + MONTH_LABEL_WIDTH + (col * CELL_WIDTH);
// Center the text in the cell (approximate width of 2 chars)
const textX = x + (CELL_WIDTH / 2) - (FONT_SIZE_HEADER * 0.6);
ea.addText(textX, yPosition, DAY_NAMES[dayIndex]);
}
}
// -------------------------------------
// Draw month row
// -------------------------------------
function drawMonthRow(year, month, rowIndex) {
const daysInMonth = getDaysInMonth(year, month);
const firstDayOfWeek = getFirstDayOfMonth(year, month);
const y = START_Y + 160 + (rowIndex * (CELL_HEIGHT + ROW_SPACING));
// Draw month label on the left
ea.style.fontSize = FONT_SIZE_MONTH;
ea.style.strokeColor = COLOR_TEXT;
ea.style.fontFamily = FONT_FAMILY;
const monthLabelY = y + (CELL_HEIGHT / 2) - (FONT_SIZE_MONTH / 2);
ea.addText(START_X, monthLabelY, MONTH_NAMES[month]);
// Draw day cells
for (let day = 1; day <= daysInMonth; day++) {
const date = new Date(year, month, day);
const dayOfWeek = date.getDay();
const col = firstDayOfWeek + day - 1; // Column position based on day of week alignment
const x = START_X + MONTH_LABEL_WIDTH + (col * CELL_WIDTH);
const isWeekend = dayOfWeek === SATURDAY || dayOfWeek === SUNDAY;
// Set cell style
ea.style.backgroundColor = isWeekend ? COLOR_WEEKEND : COLOR_WEEKDAY;
ea.style.strokeColor = COLOR_STROKE;
ea.style.strokeWidth = STROKE_WIDTH;
ea.style.fillStyle = FILLSTYLE;
ea.style.roughness = ROUGHNESS;
// Draw cell rectangle
ea.addRect(x, y, CELL_WIDTH, CELL_HEIGHT);
// Draw day number
ea.style.fontSize = FONT_SIZE_DAY;
ea.style.strokeColor = COLOR_TEXT;
ea.style.fontFamily = FONT_FAMILY;
// Position the day number at top center of the cell
const dayStr = String(day).padStart(2, "0");
const charWidth = FONT_SIZE_DAY * 0.6; // Approximate character width
const textWidth = dayStr.length * charWidth;
const textX = x + (CELL_WIDTH - textWidth) / 2;
const textY = y + 32; // 32px padding from top
ea.addText(textX, textY, dayStr);
}
// Draw month label on the right
ea.style.fontSize = FONT_SIZE_MONTH;
ea.style.strokeColor = COLOR_TEXT;
const rightLabelX = START_X + MONTH_LABEL_WIDTH + (NUM_COLUMNS * CELL_WIDTH) + 60;
ea.addText(rightLabelX, monthLabelY, MONTH_NAMES[month]);
}
// -------------------------------------
// Main calendar generation
// -------------------------------------
// Draw year title (centered above calendar)
ea.style.fontSize = FONT_SIZE_YEAR;
ea.style.strokeColor = COLOR_TEXT;
ea.style.fontFamily = FONT_FAMILY;
const yearX = START_X + MONTH_LABEL_WIDTH + ((NUM_COLUMNS * CELL_WIDTH) / 2) - 120;
ea.addText(yearX, START_Y - 200, String(requestedYear));
// Draw top day-of-week headers
drawDayHeaders(START_Y);
// Draw all 12 months
for (let month = 0; month < 12; month++) {
drawMonthRow(requestedYear, month, month);
}
// Draw bottom day-of-week headers
const bottomHeaderY = START_Y + 160 + (12 * (CELL_HEIGHT + ROW_SPACING)) + 40;
drawDayHeaders(bottomHeaderY);
await ea.addElementsToView(false, false, true);
+24
View File
@@ -0,0 +1,24 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50.097575068473816 56.100231877975375" width="50.097575068473816" height="56.100231877975375" class="excalidraw-svg">
<!-- Linear calendar icon (same size/viewBox as original) -->
<g stroke="#1e1e1e" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" fill="none">
<!-- Binding rings -->
<path d="M16 3 L16 12" />
<path d="M34.5 3 L34.5 12" />
<!-- Outer calendar body -->
<rect x="4" y="9" width="42.097575068473816" height="44.100231877975375" rx="5" ry="5" />
<!-- Header separator -->
<path d="M4 19 L46.097575068473816 19" />
<!-- A single highlighted date block -->
<rect x="10" y="23" width="8" height="8" rx="1.5" ry="1.5" />
<!-- Linear agenda lines -->
<path d="M22 27 L42 27" />
<path d="M10 35 L42 35" />
<path d="M10 43 L42 43" />
<path d="M10 51 L30 51" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 929 B

+45
View File
@@ -0,0 +1,45 @@
async function compress () {
ea = ExcalidrawAutomate;
const f = app.workspace.activeLeaf.view.file;
const data = await app.vault.read(f);
const compressed = ea.compressToBase64(data);
let result = '';
const chunkSize = 256;
for (let i = 0; i < compressed.length; i += chunkSize) {
result += compressed.slice(i, i + chunkSize) + '\n\n';
}
await app.vault.modify(f,`/*
# Mind Map Builder: Technical Specification & User Guide
## Overview
**Mind Map Builder** transforms the Obsidian-Excalidraw canvas into a rapid brainstorming environment, allowing users to build complex, structured, and visually organized mind maps using primarily keyboard shortcuts.
The script balances **automation** (auto-layout, recursive grouping, and contrast-aware coloring) with **explicit flexibility** (node pinning and redirection logic), ensuring that the mind map stays organized even as it grows to hundreds of nodes. It leverages the Excalidraw Sidepanel API to provide a persistent control interface utilizing the Obsidian sidepanel, that can also be undocked into a floating modal.
> [!Note]
> Mindmap Builder is Minified for reasons of size and performance. You can find the source here: [Mindmap Builder.js](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.js)
\`\`\`js*/
if (!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.0")) {
new Notice("Please update the Excalidraw Plugin to version 2.19.0 or higher.");
return;
}
const existingTab = ea.checkForActiveSidepanelTabForScript();
if (existingTab) {
const hostEA = existingTab.getHostEA();
if (hostEA && hostEA !== ea) {
hostEA.activateMindmap = true;
hostEA.setView(ea.targetView);
existingTab.open();
return;
}
};
const mmbSource = \`${result}\`;
const script = ea.decompressFromBase64(mmbSource.replaceAll("\\n", "").trim())
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
await new AsyncFunction("ea", "utils", script)(ea, utils);
`);
}
File diff suppressed because it is too large. Load diff
+716
View File
@@ -0,0 +1,716 @@
/*
# Mind Map Builder
![](https://youtu.be/5G9QF-u9w0Q)
## Overview
**Mind Map Builder** transforms the Obsidian-Excalidraw canvas into a rapid brainstorming environment, allowing users to build complex, structured, and visually organized mind maps using primarily keyboard shortcuts.
The script balances **automation** (auto-layout, recursive grouping, and contrast-aware coloring) with **explicit flexibility** (node pinning and redirection logic), ensuring that the mind map stays organized even as it grows to hundreds of nodes. It leverages the Excalidraw Sidepanel API to provide a persistent control interface utilizing the Obsidian sidepanel, that can also be undocked into a floating modal.
> [!Tip]
> 🚀 Become a MindMap Builder Pro with the Official [MindMap Builder Course](https://www.visual-thinking-workshop.com/mindmap)!
> [!Info]
> Mindmap Builder is Minified and compressed to reduce size and improve performance. You can find the source here: [Mindmap Builder.js](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.js)
## Show Your Love!
💖 **If you love MindMap Builder** say thank you, and [Buy me a Coffee](https://ko-fi.com/zsolt) 🍵
## The Script
```js*/
const VERSION = "v26.02.13";
if (!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.1")) {
new Notice("Please update the Excalidraw Plugin to version 2.19.1 or higher.");
return;
}
const existingTab = ea.checkForActiveSidepanelTabForScript();
if (existingTab) {
const hostEA = existingTab.getHostEA();
if (hostEA && hostEA !== ea) {
hostEA.activateMindmap = true;
hostEA.setView(ea.targetView);
existingTab.open(false);
return;
}
};
const mmbSource = `
DYUwLgBAlgvAFAShgPgN4HcoDsAmB7dAOgFlscBbAQwAcAhAVymBxACcAyduTXAksqnUbM2hANYgAnvnRYAEpVyhWAZ0IAzPKwCilAMYALOCBSowrSahCIAvnsphDxhKj14sKvKEJtWWuABEpLiCEAxMLKwAXBDarH6sEKwg5HgAbtgA5hAS0gRYEAaKOMpRAQA0IAg2NgjlPDL8ITThIqziUjLyxcoqMADaALrV5XjwSGhQiADc5pYNfMEULcKR
APyE1HjUAPIARipQOFCKcnhguQDKbtQgG7b2jkZVru6e3r7+QQI0YatsMTiCQgW2o1CyhXOuQgKhuIDKlWqcwwZEWPyEETYG2SqTSIAACnhsGA2AARfIKJRYwgPBxOF5uDxeEA+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iZzELzBcxAYjhrLC0mzEu/uImstwq/JgsgQAY1nURq4Cpfv5WuRFOIFYOhz7/IWb2EzGE2hYxeX5mfkogFT5osVU+blDNPpdgkGINPkh+WLEofsJAbT7ZngZMuZ4y1Eu+CVop7oJkOJ4cLHiehgAEnjwgRJ4knoA0yayYlkc0a1T+Vs0hVoFIwfaun7o9
4lXwYz4KfmAAkz7pIa0qJgh0ZOmgJvDm4bZurSq4vgqc8rHe4ebwmMELzP2U6j5pTMcxxBrtvC/2PSyKrBjWkEyiNHCx8hHUkZ7qj4oIsc/uTSH3HIMxv0HuJPtm7PqrlrwR4TFflkZWioAdBuGBLT6RgVYy0YHJJq4x2r7SvsKgfj5sXiGxCr7Q0kq+ZrGBsRq+dLHe0Yy+4Sy0ohCeIwCzMRIxuLHfMuq6AuEIAEAAA===`;
const script = ea.decompressFromBase64(mmbSource.replaceAll("\n", "").trim())
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
await new AsyncFunction("ea", "utils", "VERSION", script)(ea, utils, VERSION);
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="skip"><path d="m11 19-1.106-.552a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0l4.212 2.106a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619V12"/><path d="M15 5.764V12"/><path d="M18 15v6"/><path d="M21 18h-6"/><path d="M9 3.236v15"/></svg>

After

Width:  |  Height:  |  Size: 485 B

+1 -2
View File
@@ -1,8 +1,7 @@
/*
Copies the text from the selected PDF page on the Excalidraw canvas to the clipboard.
<iframe width="560" height="315" src="https://www.youtube.com/embed/Kwt_8WdOUT4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Link:: https://youtu.be/Kwt_8WdOUT4
<a href="https://www.youtube.com/watch?v=Kwt_8WdOUT4" target="_blank"><img src ="https://i.ytimg.com/vi/Kwt_8WdOUT4/maxresdefault.jpg" style="width:560px;"></a>
```js*/
+2 -5
View File
@@ -1,11 +1,8 @@
/*
<a href="https://www.youtube.com/watch?v=epYNx2FSf2w" target="_blank"><img src ="https://i.ytimg.com/vi/epYNx2FSf2w/maxresdefault.jpg" style="width:560px;"></a>
<iframe width="560" height="315" src="https://www.youtube.com/embed/epYNx2FSf2w" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Link:: https://youtu.be/epYNx2FSf2w
<iframe width="560" height="315" src="https://www.youtube.com/embed/diBT5iaoAYo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Link:: https://youtu.be/diBT5iaoAYo
<a href="https://www.youtube.com/watch?v=diBT5iaoAYo" target="_blank"><img src ="https://i.ytimg.com/vi/diBT5iaoAYo/maxresdefault.jpg" style="width:560px;"></a>
Design your palette at http://paletton.com/
Once you are happy with your colors, click Tables/Export in the bottom right of the screen:
+215
View File
@@ -0,0 +1,215 @@
/*
Palm Guard: A mobile-friendly drawing mode for Excalidraw that prevents accidental palm touches by hiding UI controls and entering fullscreen mode. Perfect for drawing with a stylus on tablets.
Features:
- Enters fullscreen to maximize drawing space (configurable in plugin script settings)
- Hides all UI controls to prevent accidental taps
- Provides a minimal floating toolbar with toggle visibility button
- Enables a completely distraction-free canvas even on desktop devices by hiding the main toolbar and all chrome while keeping a tiny movable toggle control (addresses immersive canvas / beyond Zen Mode request)
- Draggable toolbar can be positioned anywhere on screen
- Exit Palm Guard mode with a single tap
- Press the hotkey you configured for this script in Obsidian's Hotkey settings (e.g., ALT+X) to toggle UI visibility; if no hotkey is set, use the on-screen toggle button.
![Palm Guard Script](https://youtu.be/A_udjVjgWN0)
```js
*/
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.14.2")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
return;
}
async function run() {
if(window.excalidrawPalmGuard) {
window.excalidrawPalmGuard()
return;
}
const modal = new ea.FloatingModal(ea.plugin.app);
const FULLSCREEN = "Goto fullscreen?";
let settings = ea.getScriptSettings() || {};
if(!settings[FULLSCREEN]) {
settings[FULLSCREEN] = { value: true };
await ea.setScriptSettings(settings);
}
//added only to clean up settings if someone installed the initial version of the script
const HOTKEY_MODIFIERS = "PalmGuard Toggle UI Hotkey Modifiers";
const HOTKEY_KEY = "PalmGuard Toggle UI Hotkey Key";
if(settings[HOTKEY_MODIFIERS] || settings[HOTKEY_KEY]) {
delete settings[HOTKEY_MODIFIERS];
delete settings[HOTKEY_KEY];
await ea.setScriptSettings(settings);
}
const enableFullscreen = settings[FULLSCREEN].value;
// Initialize state
let uiHidden = true;
let currentIcon = "eye";
let layerUIWrapper = ea.targetView.contentEl.querySelector(".excalidraw.excalidraw-container > .layer-ui__wrapper");
const toolbar = ea.targetView.contentEl.querySelector(".excalidraw > .Island");
let toolbarActive = toolbar?.style.display === "block";
let prevHiddenState = false;
// Function to toggle UI visibility
const toggleUIVisibility = (hidden) => {
if(hidden === prevHiddenState) return hidden;
prevHiddenState = hidden;
if (!!layerUIWrapper) {
try {
if(hidden) {
layerUIWrapper.style.display = "none";
} else {
layerUIWrapper.style.display = "block";
}
} catch {};
} else {
try{
const topBar = ea.targetView.containerEl.querySelector(".App-top-bar");
const bottomBar = ea.targetView.containerEl.querySelector(".App-bottom-bar");
const sidebarToggle = ea.targetView.containerEl.querySelector(".sidebar-toggle");
const plugins = ea.targetView.containerEl.querySelector(".plugins-container");
if(hidden) {
if (toolbarActive && (toolbar?.style.display === "none")) {
toolbarActive = false;
}
if (toolbarActive = toolbar?.style.display === "block") {
toolbarActive = true;
};
}
const display = hidden ? "none" : "";
if (topBar) topBar.style.display = display;
if (bottomBar) bottomBar.style.display = display;
if (sidebarToggle) sidebarToggle.style.display = display;
if (plugins) plugins.style.display = display;
if (toolbarActive) toolbar.style.display = hidden ? "none" : "block";
modal.modalEl.style.opacity = hidden ? "0.4" : "0.8";
} catch {};
};
return hidden;
};
// Enter fullscreen view mode
if(enableFullscreen) ea.targetView.gotoFullscreen();
setTimeout(()=>toggleUIVisibility(true),100);
// Create floating toolbar modal
Object.assign(modal.modalEl.style, {
width: "fit-content",
minWidth: "fit-content",
height: "fit-content",
minHeight: "fit-content",
paddingBottom: "4px",
paddingTop: "16px",
paddingRight: "4px",
paddingLeft: "4px"
});
modal.headerEl.style.display = "none";
// Configure modal
modal.titleEl.setText(""); // No title for minimal UI
// Create modal content
modal.contentEl.createDiv({ cls: "palm-guard-toolbar" }, div => {
const container = div.createDiv({
attr: {
style: "display: flex; flex-direction: column; background-color: var(--background-secondary); border-radius: 4px;"
}
});
// Button container
const buttonContainer = container.createDiv({
attr: {
style: "display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;"
}
});
// Toggle UI visibility button
const toggleButton = buttonContainer.createEl("button", {
cls: "palm-guard-btn clickable-icon",
attr: {
style: "background-color: var(--interactive-accent); color: var(--text-on-accent);"
}
});
toggleButton.innerHTML = ea.obsidian.getIcon("eye").outerHTML;
// Keyboard hotkey listener (only acts if hotkey configured)
window.excalidrawPalmGuard = () => toggleButton.click();
toggleButton.addEventListener("click", () => {
uiHidden = !uiHidden;
toggleUIVisibility(uiHidden);
// Toggle icon
currentIcon = uiHidden ? "eye" : "eye-off";
toggleButton.innerHTML = ea.obsidian.getIcon(currentIcon).outerHTML;
});
// Exit button
const exitButton = buttonContainer.createEl("button", {
cls: "palm-guard-btn clickable-icon",
attr: {
style: "background-color: var(--background-secondary-alt); color: var(--text-normal);"
}
});
exitButton.innerHTML = ea.obsidian.getIcon("cross").outerHTML;
exitButton.addEventListener("click", () => {
modal.close();
});
// Add CSS
div.createEl("style", {
text: `
.palm-guard-btn:hover {
filter: brightness(1.1);
}
.modal-close-button {
display: none;
}
.palm-guard-btn {
display: flex;
justify-content: center;
align-items: center;
padding: 4px;
border-radius: 10%;
width: 2em;
height: 2em;
cursor: pointer;
}
`
});
});
const autocloseTimer = setInterval(()=>{
if(!ea.targetView) modal.close();
},1000);
// Handle modal close (exit Palm Guard mode)
modal.onClose = () => {
// Show all UI elements
toggleUIVisibility(false);
// Exit fullscreen
if(ea.targetView && enableFullscreen) ea.targetView.exitFullscreen();
clearInterval(autocloseTimer);
delete window.excalidrawPalmGuard;
};
// Open the modal
modal.open();
// Position the modal in the top left initially
setTimeout(() => {
const modalEl = modal.modalEl;
const rect = ea.targetView.contentEl.getBoundingClientRect();
if (modalEl) {
modalEl.style.left = `${rect.left+10}px`;
modalEl.style.top = `${rect.top+10}px`;
}
}, 100);
}
run();
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="skip"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"/><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg>

After

Width:  |  Height:  |  Size: 459 B

+864
View File
@@ -0,0 +1,864 @@
/*
Export Excalidraw to PDF Pages: Define printable page areas using frames, then export each frame as a separate page in a multi-page PDF. Perfect for turning your Excalidraw drawings into printable notes, handouts, or booklets. Supports standard and custom page sizes, margins, and easy frame arrangement.
![](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-layout-wizard-01.png)
![](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-layout-wizard-02.png)
![](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-layout-wizard-03.png)
![Marker Frames](https://youtu.be/DqDnzCOoYMc)
![Printable Layout Wizard](https://youtu.be/29EWeglRm7s)
```js
*/
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.15.0")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
return;
}
if(window.excalidrawPrintableLayoutWizardModal) {
window.excalidrawPrintableLayoutWizardModal.open();
return;
}
// Help text for the script
const HELP_TEXT = `
**Easily split your Excalidraw drawing into printable pages!**
If you find this script helpful, consider [buying me a coffee](https://ko-fi.com/zsolt). Thank you.
---
### How it works
- **Define Pages:** Use frames to mark out each page area in your drawing. You can create the first frame with this script (choose a standard size or orientation), or draw your own frame for a custom page size.
- **Add More Pages:** Select a frame, then use the arrow buttons to add new frames next to it. All new frames will match the size of the selected one.
- **Rename Frames:** You can rename frames as you like. When exporting to PDF, pages will be ordered alphabetically by frame name.
---
### Important Notes
- **Same Size & Orientation:** All frames must have the same size and orientation (e.g., all A4 Portrait) to export to PDF. Excalidraw currently does not support PDFs with different-sized pages.
- **Custom Sizes:** If you draw your own frame, the PDF will use that exact size—great for custom page layouts!
- **Margins:** If you set a margin, the page size stays the same, but your content will shrink to fit inside the printable area.
- **No Frame Borders/Titles in Print:** Frame borders and frame titles will *not* appear in the PDF.
- **No Frame Clipping:** The script disables frame clipping for this drawing.
- **Templates:** You can save a template document with prearranged frames (even locked ones) for reuse.
- **Lock Frames:** Frames only define print areas—they don't "contain" elements. Locking frames is recommended to prevent accidental movement.
- **Outside Content:** Anything outside the frames will *not* appear in the PDF.
---
### Printing
- **Export to PDF:** Click the printer button to export each frame as a separate page in a PDF.
- **Order:** Pages are exported in alphabetical order of frame names.
---
### Settings
You can also access script settings at the bottom of Excalidraw Plugin settings. The script stores your preferences for:
- Locking new frames after creation
- Zooming to new frames
- Closing the dialog after adding a frame
- Default page size and orientation
- Print margin
---
**Tip:** For more on templates, see [Mastering Excalidraw Templates](https://youtu.be/jgUpYznHP9A). For referencing pages in markdown, see [Image Fragments](https://youtu.be/sjZfdqpxqsg) and [Image Block References](https://youtu.be/yZQoJg2RCKI).
![Marker Frames](https://youtu.be/DqDnzCOoYMc)
![Printable Layout Wizard](https://youtu.be/29EWeglRm7s)
`;
async function run() {
modal = new ea.FloatingModal(ea.plugin.app);
window.excalidrawPrintableLayoutWizardModal = modal;
modal.contentEl.empty();
let shouldRestart = false;
// Enable frame rendering
const st = ea.getExcalidrawAPI().getAppState();
let {enabled, clip, name, outline, markerName, markerEnabled} = st.frameRendering;
if(!enabled || !name || !outline || !markerEnabled || !markerName) {
ea.viewUpdateScene({
appState: {
frameRendering: {
enabled: true,
clip: clip,
name: true,
outline: true,
markerName: true,
markerEnabled: true
}
}
});
}
// Page size options (using standard sizes from ExcalidrawAutomate)
const PAGE_SIZES = [
"A0", "A1", "A2", "A3", "A4", "A5", "A6",
"Letter", "Legal", "Tabloid", "Ledger"
];
const PAGE_ORIENTATIONS = ["portrait", "landscape"];
// Margin sizes in points
const MARGINS = {
"none": 0,
"tiny": 10,
"normal": 60,
};
// Initialize settings
let settings = ea.getScriptSettings();
let dirty = false;
// Define setting keys
const PAGE_SIZE = "Page size";
const ORIENTATION = "Page orientation";
const MARGIN = "Print-margin";
const LOCK_FRAME = "Lock frame after it is created";
const SHOULD_ZOOM = "Should zoom after adding page";
const SHOULD_CLOSE = "Should close after adding page";
const PRINT_EMPTY = "Print empty pages";
const PRINT_MARKERS_ONLY = "Print only marker frames";
// Set default values on first run
if (!settings[PAGE_SIZE]) {
settings = {};
settings[PAGE_SIZE] = { value: "A4", valueset: PAGE_SIZES };
settings[ORIENTATION] = { value: "portrait", valueset: PAGE_ORIENTATIONS };
settings[MARGIN] = { value: "none", valueset: Object.keys(MARGINS)};
settings[SHOULD_ZOOM] = { value: false };
settings[SHOULD_CLOSE] = { value: false };
settings[LOCK_FRAME] = { value: true };
settings[PRINT_EMPTY] = { value: false };
settings[PRINT_MARKERS_ONLY] = { value: true };
dirty = true;
}
//once off correction. In the first version I incorrectly used valueSet with wrong casing.
if(settings[PAGE_SIZE].valueSet) {
settings[PAGE_SIZE].valueset = settings[PAGE_SIZE].valueSet;
delete settings[PAGE_SIZE].valueSet;
settings[ORIENTATION].valueset = settings[ORIENTATION].valueSet;
delete settings[ORIENTATION].valueSet;
settings[MARGIN].valueset = settings[MARGIN].valueSet;
delete settings[MARGIN].valueSet;
dirty = true;
}
if(!settings[LOCK_FRAME]) {
settings[LOCK_FRAME] = { value: true };
dirty = true;
}
if(!settings[PRINT_EMPTY]) {
settings[PRINT_EMPTY] = { value: false };
dirty = true;
}
if(!settings[PRINT_MARKERS_ONLY]) {
settings[PRINT_MARKERS_ONLY] = { value: true };
dirty = true;
}
let lockFrame = settings[LOCK_FRAME].value;
let shouldClose = settings[SHOULD_CLOSE].value;
let shouldZoom = settings[SHOULD_ZOOM].value;
let printEmptyPages = settings[PRINT_EMPTY].value;
let printMarkersOnly = settings[PRINT_MARKERS_ONLY].value;
const getSortedFrames = () => {
return ea.getViewElements()
.filter(el => isEligibleFrame(el))
.sort((a, b) => {
const nameA = a.name || "";
const nameB = b.name || "";
return nameA.localeCompare(nameB);
});
};
// Find existing page frames and determine next page number
const findExistingPages = (selectLastFrame = false) => {
const frameElements = getSortedFrames();
// Extract page numbers from frame names
const pageNumbers = frameElements
.map(frame => {
const match = frame.name?.match(/(?:Page\s+)?(\d+)/i);
return match ? parseInt(match[1]) : 0;
})
.filter(num => !isNaN(num));
// Find the highest page number
const nextPageNumber = pageNumbers.length > 0
? Math.max(...pageNumbers) + 1
: 1;
if(selectLastFrame && frameElements.length > 0) {
ea.selectElementsInView([frameElements[frameElements.length-1]]);
}
return {
frames: frameElements,
nextPageNumber: nextPageNumber
};
};
const isEligibleFrame = (el) => el.type === "frame" && (printMarkersOnly ? el.frameRole === "marker" : true);
// Check if there are frames in the scene and if a frame is selected
let existingFrames = ea.getViewElements().filter(el => isEligibleFrame(el));
let selectedFrame = ea.getViewSelectedElements().find(el => isEligibleFrame(el));
const hasFrames = existingFrames.length > 0;
if(hasFrames && !selectedFrame) {
if(st.activeLockedId && existingFrames.find(f=>f.id === st.activeLockedId)) {
selectedFrame = existingFrames.find(f=>f.id === st.activeLockedId);
ea.viewUpdateScene({ appState: { activeLockedId: null }});
ea.selectElementsInView([selectedFrame]);
} else {
findExistingPages(true);
selectedFrame = ea.getViewSelectedElements().find(el => isEligibleFrame(el));
}
}
const hasSelectedFrame = !!selectedFrame;
// rotation is now a temporary UI state controlled by the center button
let rotateOnAdd = false;
let centerRotateBtn = null;
const setRotateBtnActive = (active) => {
if (!centerRotateBtn) return;
centerRotateBtn.classList.toggle("is-accent", active);
centerRotateBtn.setAttribute("aria-pressed", active ? "true" : "false");
};
// Show notice if there are frames but none selected
if (hasFrames && !hasSelectedFrame) {
new Notice("Select a frame before running the script", 7000);
return;
}
// Create the first frame
const createFirstFrame = async (pageSize, orientation) => {
// Use ExcalidrawAutomate's built-in function to get page dimensions
const dimensions = ea.getPagePDFDimensions(pageSize, orientation);
if (!dimensions) {
new Notice("Invalid page size selected");
return;
}
// Save settings when creating first frame
if (settings[PAGE_SIZE].value !== pageSize) {
settings[PAGE_SIZE].value = pageSize;
dirty = true;
}
if (settings[ORIENTATION].value !== orientation) {
settings[ORIENTATION].value = orientation;
dirty = true;
}
// Format page number with leading zero
const pageName = "01";
// Calculate position to center the frame
const appState = ea.getExcalidrawAPI().getAppState();
const x = (appState.width - dimensions.width) / 2;
const y = (appState.height - dimensions.height) / 2;
return await addFrameElement(x, y, dimensions.width, dimensions.height, pageName, true);
};
// Add new page frame
const addPage = async (direction, pageSize, orientation) => {
selectedFrame = ea.getViewSelectedElements().find(el => isEligibleFrame(el));
if (!selectedFrame) {
const { activeLockedId } = ea.getExcalidrawAPI().getAppState();
if(activeLockedId) {
selectedFrame = ea.getViewElements().find(el=>el.id === activeLockedId && isEligibleFrame(el));
}
if (!selectedFrame) return;
}
ea.viewUpdateScene({appState: {activeLockedId: null}});
const { frames, nextPageNumber } = findExistingPages();
// Get dimensions from selected frame, support optional rotation
const dimensions = {
width: rotateOnAdd ? selectedFrame.height : selectedFrame.width,
height: rotateOnAdd ? selectedFrame.width : selectedFrame.height
};
// Format page number with leading zero
const pageName = `${nextPageNumber.toString().padStart(2, '0')}`;
// Calculate position based on direction and selected frame
let x = 0;
let y = 0;
switch (direction) {
case "right":
x = selectedFrame.x + selectedFrame.width;
y = selectedFrame.y;
break;
case "left":
x = selectedFrame.x - dimensions.width;
y = selectedFrame.y;
break;
case "down":
x = selectedFrame.x;
y = selectedFrame.y + selectedFrame.height;
break;
case "up":
x = selectedFrame.x;
y = selectedFrame.y - dimensions.height;
break;
}
const added = await addFrameElement(x, y, dimensions.width, dimensions.height, pageName);
// reset the rotate toggle after adding the frame
rotateOnAdd = false;
setRotateBtnActive(false);
return added;
};
addFrameElement = async (x, y, width, height, pageName, repositionToCursor = false) => {
const frameId = ea.addFrame(x, y, width, height, pageName);
ea.getElement(frameId).frameRole = "marker";
if(lockFrame) {
ea.getElement(frameId).locked = true;
}
await ea.addElementsToView(repositionToCursor);
const addedFrame = ea.getViewElements().find(el => el.id === frameId);
if(shouldZoom) {
ea.viewZoomToElements(true, [addedFrame]);
} else {
ea.selectElementsInView([addedFrame]);
}
//ready for the next frame
ea.clear();
selectedFrame = addedFrame;
if(shouldClose) {
modal.close();
}
return addedFrame;
}
const translateToZero = ({ x, y, width, height }, padding=0) => {
const top = y, left = x, right = x + width, bottom = y + height;
const {topX, topY, width:w, height:h} = ea.getBoundingBox(ea.getViewElements());
const newTop = top - (topY - padding);
const newLeft = left - (topX - padding);
const newBottom = bottom - (topY - padding);
const newRight = right - (topX - padding);
return {
top: newTop,
left: newLeft,
bottom: newBottom,
right: newRight,
};
}
// NEW: detect if any non-frame element overlaps the given area
const hasElementsInArea = (area) => ea.getElementsInArea(ea.getViewElements(), area).length>0;
const checkFrameSizes = (frames) => {
if (frames.length <= 1) return true;
const referenceWidth = frames[0].width;
const referenceHeight = frames[0].height;
return frames.every(frame =>
Math.abs(frame.width - referenceWidth) < 1 &&
Math.abs(frame.height - referenceHeight) < 1
);
};
const printToPDF = async (marginSize) => {
const margin = MARGINS[marginSize] || 0;
// Save margin setting
if (settings[MARGIN].value !== marginSize) {
settings[MARGIN].value = marginSize;
dirty = true;
}
// Get all frame elements and sort by name
const frames = getSortedFrames();
if (frames.length === 0) {
new Notice("No frames found to print");
return;
}
// Create a notice during processing
const notice = new Notice("Preparing PDF, please wait...", 0);
// Create SVGs for each frame
const svgPages = [];
let placeholderRects = [];
ea.clear();
for (const frame of frames) {
ea.style.opacity = 0;
ea.style.roughness = 0;
ea.style.fillStyle = "solid";
ea.style.backgroundColor = "black"
ea.style.strokeWidth = 0.01;
ea.addRect(frame.x, frame.y, frame.width, frame.height);
}
const svgScene = await ea.createViewSVG({
withBackground: true,
theme: st.theme,
//frameRendering: { enabled: false, name: false, outline: false, clip: false },
padding: 0,
selectedOnly: false,
skipInliningFonts: false,
embedScene: false,
elementsOverride: ea.getViewElements().concat(ea.getElements()),
});
ea.clear();
for (const frame of frames) {
// NEW: skip empty frames unless user opted to print them
if(!printEmptyPages && !hasElementsInArea(frame)) continue;
const { top, left, bottom, right } = translateToZero(frame);
//always create the new SVG in the main Obsidian workspace (not the popout window, if present)
const host = window.createDiv();
host.innerHTML = svgScene.outerHTML;
const clonedSVG = host.firstElementChild;
const width = Math.abs(left-right);
const height = Math.abs(top-bottom);
clonedSVG.setAttribute("viewBox", `${left} ${top} ${width} ${height}`);
clonedSVG.setAttribute("width", `${width}`);
clonedSVG.setAttribute("height", `${height}`);
svgPages.push(clonedSVG);
}
// NEW: abort if nothing to print
if(svgPages.length === 0) {
notice.hide();
new Notice("No pages to print (all selected frames are empty)");
notice.hide();
return;
}
// Use dimensions from the first frame
const width = frames[0].width;
const height = frames[0].height;
// Create PDF
await ea.createPDF({
SVG: svgPages,
scale: { fitToPage: true },
pageProps: {
dimensions: {},
//dimensions: { width, height },
backgroundColor: "#ffffff",
margin: {
left: margin,
right: margin,
top: margin,
bottom: margin
},
alignment: "center"
},
filename: ea.targetView.file.basename + "-pages.pdf"
});
notice.hide();
};
// -----------------------
// Create a floating modal
// -----------------------
modal.titleEl.setText("Page Management");
modal.titleEl.style.textAlign = "center";
modal.onClose = async () => {
delete window.excalidrawPrintableLayoutWizardModal;
if (dirty) {
await ea.setScriptSettings(settings);
}
ea.viewUpdateScene({
appState: {
frameRendering: {enabled, clip, name, outline, markerName, markerEnabled}
}
});
if(shouldRestart) setTimeout(()=>run());
};
// Create modal content
modal.contentEl.createDiv({ cls: "excalidraw-page-manager" }, div => {
const container = div.createDiv({
attr: {
style: "display: flex; flex-direction: column; gap: 15px; padding: 10px;"
}
});
// Help section
const helpDiv = container.createDiv({
attr: {
style: "margin-bottom: 10px;"
}
});
helpDiv.createEl("details", {}, (details) => {
details.createEl("summary", {
text: "Help & Information",
attr: {
style: "cursor: pointer; font-weight: bold; margin-bottom: 10px;"
}
});
details.createEl("div", {
attr: {
style: "padding: 10px; border: 1px solid var(--background-modifier-border); border-radius: 4px; margin-top: 8px; font-size: 0.9em; max-height: 300px; overflow-y: auto;"
}
}, div => {
ea.obsidian.MarkdownRenderer.render(ea.plugin.app, HELP_TEXT, div, "", ea.plugin)
});
});
// Tabs (show only when frames exist)
let framesTabEl, printingTabEl, tabsHeaderEl, marginDropdown;
if (hasFrames) {
tabsHeaderEl = container.createDiv({
attr: { style: "display:flex; gap:8px; border-bottom:1px solid var(--background-modifier-border); padding-bottom:0;" }
});
tabsHeaderEl.addClass("tabs-header"); // NEW
const framesTabBtn = tabsHeaderEl.createEl("button", {
text: "Frames",
attr: { style: "padding:8px 12px; cursor:pointer;" }
});
framesTabBtn.addClass("tab-btn"); // NEW
const printingTabBtn = tabsHeaderEl.createEl("button", {
text: "Printing",
attr: { style: "padding:8px 12px; cursor:pointer;" }
});
printingTabBtn.addClass("tab-btn"); // NEW
const tabsBody = container.createDiv();
tabsBody.addClass("tab-panels"); // NEW
framesTabEl = tabsBody.createDiv({ attr: { style: "display:block;" } });
framesTabEl.addClass("tab-panel"); // NEW
printingTabEl = tabsBody.createDiv({ attr: { style: "display:none;" } });
printingTabEl.addClass("tab-panel"); // NEW
const activate = (tab) => {
if (tab === "frames") {
framesTabEl.style.display = "";
printingTabEl.style.display = "none";
framesTabBtn.classList.add("is-active");
printingTabBtn.classList.remove("is-active");
} else {
framesTabEl.style.display = "none";
printingTabEl.style.display = "";
framesTabBtn.classList.remove("is-active");
printingTabBtn.classList.add("is-active");
}
};
framesTabBtn.addEventListener("click", () => {
window.excalidrawPrintLayoutWizard = "frames";
activate("frames")
});
printingTabBtn.addEventListener("click", () => {
window.excalidrawPrintLayoutWizard = "printing";
activate("printing")
});
activate(window.excalidrawPrintLayoutWizard ?? "frames");
} else {
// No frames yet, only frames tab content
framesTabEl = container.createDiv();
}
const createOptionsContainerCommonControls = (optionsContainer) => {
new ea.obsidian.Setting(optionsContainer)
.setName("Lock")
.setDesc("Lock the new frame element after it is created.")
.addToggle(toggle => {
toggle.setValue(lockFrame).onChange(value => {
lockFrame = value;
if (settings[LOCK_FRAME].value !== value) {
settings[LOCK_FRAME].value = value; dirty = true;
}
});
});
new ea.obsidian.Setting(optionsContainer)
.setName("Zoom to new frame")
.setDesc("Automatically zoom to the newly created frame")
.addToggle(toggle => {
toggle.setValue(shouldZoom).onChange(value => {
shouldZoom = value;
if (settings[SHOULD_ZOOM].value !== value) {
settings[SHOULD_ZOOM].value = value; dirty = true;
}
});
});
new ea.obsidian.Setting(optionsContainer)
.setName("Close after adding")
.setDesc("Close this dialog after adding a new frame")
.addToggle(toggle => {
toggle.setValue(shouldClose).onChange(value => {
shouldClose = value;
if (settings[SHOULD_CLOSE].value !== value) {
settings[SHOULD_CLOSE].value = value; dirty = true;
}
});
});
new ea.obsidian.Setting(optionsContainer)
.setName("Use only Marker Frames")
.setDesc("When off, all frames will be printed (not just marker frames)")
.addToggle(toggle => {
toggle.setValue(printMarkersOnly).onChange(value => {
printMarkersOnly = value;
if (settings[PRINT_MARKERS_ONLY].value !== value) {
settings[PRINT_MARKERS_ONLY].value = value;
dirty = true;
shouldRestart = true;
modal.close();
}
});
});
}
// FRAMES TAB CONTENT
// When no frames yet: initial size/orientation inputs and Create First Frame button
if (!hasFrames) {
const settingsContainer = framesTabEl.createDiv({
attr: {
// four columns: label + input, label + input
style: "display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 10px; align-items: center;"
}
});
// Page Size
settingsContainer.createEl("label", { text: "Page Size:" });
const pageSizeDropdown = settingsContainer.createEl("select", {
cls: "dropdown",
attr: { style: "width: 100%;" }
});
PAGE_SIZES.forEach(size => pageSizeDropdown.createEl("option", { text: size, value: size }));
pageSizeDropdown.value = settings[PAGE_SIZE].value;
// Orientation
settingsContainer.createEl("label", { text: "Orientation:" });
const orientationDropdown = settingsContainer.createEl("select", {
cls: "dropdown",
attr: { style: "width: 100%;" }
});
PAGE_ORIENTATIONS.forEach(orientation => orientationDropdown.createEl("option", { text: orientation, value: orientation }));
orientationDropdown.value = settings[ORIENTATION].value;
const optionsContainer = framesTabEl.createDiv({ attr: { style: "margin-top: 10px;" } });
createOptionsContainerCommonControls(optionsContainer);
// Create First Frame button
const buttonContainer = framesTabEl.createDiv({
attr: { style: "display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px;" }
});
const createFirstBtn = buttonContainer.createEl("button", {
cls: "page-btn",
attr: { style: "height: 40px; background-color: var(--interactive-accent); color: var(--text-on-accent);" }
});
createFirstBtn.textContent = "Create First Frame";
createFirstBtn.addEventListener("click", async () => {
const tmpShouldClose = shouldClose;
shouldClose = true;
await createFirstFrame(pageSizeDropdown.value, orientationDropdown.value);
shouldClose = tmpShouldClose;
if(!shouldClose) {
shouldRestart = true;
modal.close()
}
});
} else {
// hasFrames: frame-management options + arrow buttons
const optionsContainer = framesTabEl.createDiv({ attr: { style: "margin-top: 10px;" } });
createOptionsContainerCommonControls(optionsContainer);
// Arrow buttons with center rotate toggle
const buttonContainer = framesTabEl.createDiv({
attr: {
style: "display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px;"
}
});
const upBtn = buttonContainer.createEl("button", {
cls: "page-btn",
attr: { style: "grid-column: 2; grid-row: 1; height: 40px;" }
});
upBtn.innerHTML = ea.obsidian.getIcon("arrow-big-up").outerHTML;
upBtn.addEventListener("click", async () => { await addPage("up"); });
buttonContainer.createDiv({ attr: { style: "grid-column: 3; grid-row: 1;" } });
const leftBtn = buttonContainer.createEl("button", {
cls: "page-btn",
attr: { style: "grid-column: 1; grid-row: 2; height: 40px;" }
});
leftBtn.innerHTML = ea.obsidian.getIcon("arrow-big-left").outerHTML;
leftBtn.addEventListener("click", async () => { await addPage("left"); });
// Center toggle: Rotate next page
centerRotateBtn = buttonContainer.createEl("button", {
cls: "page-btn",
attr: { style: "grid-column: 2; grid-row: 2; height: 40px;" }
});
centerRotateBtn.textContent = "Rotate next page";
centerRotateBtn.addEventListener("click", () => {
rotateOnAdd = !rotateOnAdd;
setRotateBtnActive(rotateOnAdd);
});
setRotateBtnActive(rotateOnAdd);
const rightBtn = buttonContainer.createEl("button", {
cls: "page-btn",
attr: { style: "grid-column: 3; grid-row: 2; height: 40px;" }
});
rightBtn.innerHTML = ea.obsidian.getIcon("arrow-big-right").outerHTML;
rightBtn.addEventListener("click", async () => { await addPage("right"); });
const downBtn = buttonContainer.createEl("button", {
cls: "page-btn",
attr: { style: "grid-column: 2; grid-row: 3; height: 40px;" }
});
downBtn.innerHTML = ea.obsidian.getIcon("arrow-big-down").outerHTML;
downBtn.addEventListener("click", async () => { await addPage("down"); });
buttonContainer.createDiv({ attr: { style: "grid-column: 1; grid-row: 3;" } });
}
// PRINTING TAB CONTENT (only when hasFrames)
if (hasFrames && printingTabEl) {
const marginContainer = printingTabEl.createDiv({
attr: {
style: "display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-top: 6px;"
}
});
marginContainer.createEl("label", { text: "Print Margin:" });
marginDropdown = marginContainer.createEl("select", { cls: "dropdown", attr: { style: "width: 100%;" } });
Object.keys(MARGINS).forEach(margin => marginDropdown.createEl("option", { text: margin, value: margin }));
marginDropdown.value = settings[MARGIN].value;
const printingOptions = printingTabEl.createDiv({ attr: { style: "margin-top: 10px;" } });
new ea.obsidian.Setting(printingOptions)
.setName(PRINT_EMPTY)
.setDesc("Include frames with no content in the PDF")
.addToggle(toggle => {
toggle.setValue(printEmptyPages).onChange(value => {
printEmptyPages = value;
if(settings[PRINT_EMPTY].value !== value) {
settings[PRINT_EMPTY].value = value;
dirty = true;
}
});
});
const printBtnRow = printingTabEl.createDiv({ attr: { style: "margin-top: 10px; display:flex; justify-content:flex-start;" } });
const printBtn = printBtnRow.createEl("button", {
cls: "page-btn",
attr: { style: "height: 40px; background-color: var(--interactive-accent);" }
});
printBtn.innerHTML = ea.obsidian.getIcon("printer").outerHTML;
printBtn.addEventListener("click", async () => { await printToPDF(marginDropdown.value); });
}
// CSS
div.createEl("style", {
text: `
.page-btn {
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 4px;
}
.page-btn:hover {
background-color: var(--interactive-hover);
}
.dropdown {
height: 30px;
background-color: var(--background-secondary);
color: var(--text-normal);
border-radius: 4px;
border: 1px solid var(--background-modifier-border);
padding: 0 10px;
}
.is-active {
background-color: var(--background-modifier-hover);
border-radius: 4px;
}
/* Tabs styling - NEW */
.tabs-header {
gap: 8px;
border-bottom: 1px solid var(--background-modifier-border);
}
.tabs-header .tab-btn {
background: var(--background-primary);
color: var(--text-normal);
border: 1px solid var(--background-modifier-border);
border-bottom: none;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
padding: 8px 12px;
margin-bottom: -1px; /* sit on top of the panel border */
}
.tabs-header .tab-btn:hover {
background: var(--background-modifier-hover);
}
.tabs-header .tab-btn.is-active {
background: var(--background-secondary);
color: var(--text-normal);
position: relative;
z-index: 2;
}
.tab-panels {
border: 1px solid var(--background-modifier-border);
border-radius: 0 6px 6px 6px; /* merge with active tab */
padding: 12px;
background: var(--background-primary);
}
/* accent styling for center rotate toggle when active */
.page-btn.is-accent {
background-color: var(--interactive-accent);
color: var(--text-on-accent);
}
.page-btn.is-accent:hover {
background-color: var(--interactive-accent-hover, var(--interactive-accent));
}
`
});
});
modal.open();
}
run();
+1
View File
@@ -0,0 +1 @@
<svg class="skip" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><path d="M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"/><rect x="6" y="14" width="12" height="8" rx="1"/></svg>

After

Width:  |  Height:  |  Size: 386 B

+15 -46
View File
@@ -3,11 +3,11 @@
Scribble Helper can improve handwriting and add links. It lets you create and edit text elements, including wrapped text and sticky notes, by double-tapping on the canvas. When you run the script, it creates an event handler that will activate the editor when you double-tap. If you select a text element on the canvas before running the script, it will open the editor for that element. If you use a pen, you can set it up to only activate Scribble Helper when you double-tap with the pen. The event handler is removed when you run the script a second time or switch to a different tab.
<iframe width="560" height="315" src="https://www.youtube.com/embed/BvYkOaly-QM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<a href="https://www.youtube.com/watch?v=BvYkOaly-QM" target="_blank"><img src ="https://i.ytimg.com/vi/BvYkOaly-QM/maxresdefault.jpg" style="width:560px;"></a>
```javascript
```js
*/
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.11.0")) {
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.0")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
return;
}
@@ -58,39 +58,10 @@ if(typeof win.ExcalidrawScribbleHelper.action === "undefined") {
// Helper Functions
//---------------------------------------
// Color Palette for stroke color setting
// https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.6.8
const defaultStrokeColors = [
"#000000", "#343a40", "#495057", "#c92a2a", "#a61e4d",
"#862e9c", "#5f3dc4", "#364fc7", "#1864ab", "#0b7285",
"#087f5b", "#2b8a3e", "#5c940d", "#e67700", "#d9480f"
];
function loadColorPalette() {
const st = api.getAppState();
const strokeColors = new Set();
let strokeColorPalette = st.colorPalette?.elementStroke ?? defaultStrokeColors;
if(Object.entries(strokeColorPalette).length === 0) {
strokeColorPalette = defaultStrokeColors;
}
ea.getViewElements().forEach(el => {
if(el.strokeColor.toLowerCase()==="transparent") return;
strokeColors.add(el.strokeColor);
});
strokeColorPalette.forEach(color => {
strokeColors.add(color)
});
strokeColors.add(st.currentItemStrokeColor ?? ea.style.strokeColor);
return strokeColors;
}
// Event handler management
function addEventHandler(handler) {
if(win.ExcalidrawScribbleHelper.eventHandler) {
win.removeEventListner("pointerdown", handler);
win.removeEventListener("pointerdown", handler);
}
win.addEventListener("pointerdown",handler);
win.ExcalidrawScribbleHelper.eventHandler = handler;
@@ -147,19 +118,17 @@ function customControls (container) {
const viewBackground = api.getAppState().viewBackgroundColor;
const el1 = new ea.obsidian.Setting(container)
.setName(`Text color`)
.addDropdown(dropdown => {
Array.from(loadColorPalette()).forEach(color => {
const options = dropdown.addOption(color, color).selectEl.options;
options[options.length-1].setAttribute("style",`color: ${color
}; background: ${viewBackground};`);
});
dropdown
.setValue(ea.style.strokeColor)
.onChange(value => {
ea.style.strokeColor = value;
el1.nameEl.style.color = value;
})
})
.addButton(button => button
.setIcon("swatch-book")
.onClick(async () => {
const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");
if(selected) {
ea.style.strokeColor = selected;
el1.nameEl.style.color = selected;
}
})
);
el1.nameEl.style.color = ea.style.strokeColor;
el1.nameEl.style.background = viewBackground;
el1.nameEl.style.fontWeight = "bold";
+214 -157
View File
@@ -7,35 +7,43 @@ This script modifies the color lightness/hue/saturation/transparency of selected
- The color of SVG elements and nested Excalidraw drawings will only be mapped. When mapping colors, the original image remains unchanged, only a mapping table is created and the image is recolored during rendering of your Excalidraw screen. In case you want to make manual changes you can also edit the mapping in Markdown View Mode under `## Embedded Files`
If you select only a single SVG or nested Excalidraw element, then the script offers an additional feature. You can map colors one by one in the image.
```js*/
```js
*/
const HELP_TEXT = `
<ul>
<li dir="auto">Select SVG images, nested Excalidraw drawings and/or regular Excalidraw elements</li>
<li dir="auto">For a single selected image, you can map colors individually in the color mapping section</li>
<li dir="auto">For Excalidraw elements: stroke and background colors are modified permanently</li>
<li dir="auto">For SVG/nested drawings: original files stay unchanged, color mapping is stored under <code>## Embedded Files</code></li>
<li dir="auto">Using color maps helps maintain links between drawings while allowing different color themes</li>
<li dir="auto">Sliders work on relative scale - the amount of change is applied to current values</li>
<li dir="auto">Unlike Excalidraw's opacity setting which affects the whole element:
<ul>
<li dir="auto">Shade Master can set different opacity for stroke vs background</li>
<li dir="auto">Note: SVG/nested drawing colors are mapped at color name level, thus "black" is different from "#000000"</li>
<li dir="auto">Additionally if the same color is used as fill and stroke the color can only be mapped once</li>
</ul>
</li>
<li dir="auto">This is an experimental script - contributions welcome on GitHub via PRs</li>
</ul>
<div class="excalidraw-videoWrapper"><div>
<iframe src="https://www.youtube.com/embed/ISuORbVKyhQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></div>
- Select SVG images, nested Excalidraw drawings and/or regular Excalidraw elements
- For a single selected image, you can map colors individually in the color mapping section
- For Excalidraw elements: stroke and background colors are modified permanently
- For SVG/nested drawings: original files stay unchanged, color mapping is stored under \`## Embedded Files\`
- Using color maps helps maintain links between drawings while allowing different color themes
- Sliders work on relative scale - the amount of change is applied to current values
- Unlike Excalidraw's opacity setting which affects the whole element:
- Shade Master can set different opacity for stroke vs background
- **Note:** SVG/nested drawing colors are mapped at color name level, thus "black" is different from "#000000"
- Additionally if the same color is used as fill and stroke the color can only be mapped once
- This is an experimental script - contributions welcome on GitHub via PRs
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://storage.ko-fi.com/cdn/kofi6.png?v=6" border="0" alt="Buy Me a Coffee at ko-fi.com" height=45></a></div>
<a href="https://www.youtube.com/watch?v=ISuORbVKyhQ" target="_blank"><img src ="https://i.ytimg.com/vi/ISuORbVKyhQ/maxresdefault.jpg" style="max-width:560px; width:100%"></a>
`;
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.7.2")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.1")) {
new Notice("Please update the Excalidraw Plugin to version 2.19.1 or higher.");
return;
}
const existingTab = ea.checkForActiveSidepanelTabForScript();
if (existingTab) {
const hostEA = existingTab.getHostEA();
if (hostEA && hostEA !== ea) {
hostEA.setView(ea.targetView);
existingTab.open();
return;
}
}
/*
SVGColorInfo is returned by ea.getSVGColorInfoForImgElement. Color info will all the color strings in the SVG file plus "fill" which represents the default fill color for SVG icons set at the SVG root element level. Fill if not set defaults to black:
@@ -51,22 +59,10 @@ interface ColorMap {
};
*/
// Main script execution
const allElements = ea.getViewSelectedElements();
const svgImageElements = allElements.filter(el => {
if(el.type !== "image") return false;
const file = ea.getViewFileForImageElement(el);
if(!file) return false;
return el.type === "image" && (
file.extension === "svg" ||
ea.isExcalidrawFile(file)
);
});
if(allElements.length === 0) {
new Notice("Select at least one rectangle, ellipse, diamond, line, arrow, freedraw, text or SVG image elment");
return;
}
// Main script state variables
let allElements = [];
let svgImageElements = [];
let lastSelectionIds = "";
const originalColors = new Map();
const currentColors = new Map();
@@ -97,10 +93,11 @@ if(!settings[STROKE]) {
}
function getRegularElements() {
if (!ea.targetView) return [];
ea.clear();
//loading view elements again as element objects change when colors are updated
const allElements = ea.getViewSelectedElements();
return allElements.filter(el =>
const viewElements = ea.getViewSelectedElements();
return viewElements.filter(el =>
["rectangle", "ellipse", "diamond", "line", "arrow", "freedraw", "text"].includes(el.type)
);
}
@@ -122,6 +119,10 @@ function updateViewImageColors() {
}
async function storeOriginalColors() {
// Clear previous state
originalColors.clear();
currentColors.clear();
// Store colors for regular elements
for (const el of getRegularElements()) {
const key = el.id;
@@ -147,6 +148,7 @@ async function storeOriginalColors() {
}
function copyOriginalsToCurrent() {
currentColors.clear();
for (const [key, value] of originalColors.entries()) {
if(value.type === "regular") {
currentColors.set(key, {...value});
@@ -326,25 +328,40 @@ function slider(contentEl, action, min, max, step, invert) {
}
}
function showModal() {
let debounceColorPicker = true;
const modal = new ea.obsidian.Modal(app);
let dirty = false;
let debounceColorPicker = true;
modal.onOpen = async () => {
const { contentEl, modalEl } = modal;
const { width, height } = ea.getExcalidrawAPI().getAppState();
modal.bgOpacity = 0;
contentEl.createEl('h2', { text: 'Shade Master' });
const helpDiv = contentEl.createEl("details", {
attr: { style: "margin-bottom: 1em;background: var(--background-secondary); padding: 1em; border-radius: 4px;" }});
helpDiv.createEl("summary", { text: "Help & Usage Guide", attr: { style: "cursor: pointer; color: var(--text-accent);" } });
const helpDetailsDiv = helpDiv.createEl("div", {
attr: { style: "margin-top: 0em; " }
function renderSidepanel(contentEl) {
contentEl.empty();
contentEl.createEl('h2', { text: 'Shade Master' });
const helpDiv = contentEl.createEl("details", {
attr: { style: "margin-bottom: 1em;background: var(--background-secondary); padding: 1em; border-radius: 4px;" }});
helpDiv.createEl("summary", { text: "Help & Usage Guide", attr: { style: "cursor: pointer; color: var(--text-accent);" } });
const helpDetailsDiv = helpDiv.createEl("div", {
attr: { style: "margin-top: 0em; " }
});
ea.obsidian.MarkdownRenderer.render(ea.plugin.app, HELP_TEXT, helpDetailsDiv, "", ea.plugin);
if (!ea.targetView) {
contentEl.createEl("p", {
text: "No active Excalidraw view found. Please open a drawing and select elements to use Shade Master.",
attr: { style: "color: var(--text-muted);" }
});
helpDetailsDiv.innerHTML = HELP_TEXT;
return;
}
const { width, height } = ea.getExcalidrawAPI().getAppState();
if(allElements.length === 0) {
contentEl.createEl("p", {
text: "Select at least one rectangle, ellipse, diamond, line, arrow, freedraw, text or SVG image element",
attr: { style: "color: var(--text-warning);" }
});
// return; // Removed early return to allow rendering of the Close button
} else {
// Only render controls if elements are selected
const component = new ea.obsidian.Setting(contentEl)
.setName(FORMAT)
.setDesc("Output color format")
@@ -390,6 +407,7 @@ function showModal() {
// The range for Hue is 360 since regarless of the position on the circle moving
// the slider to the two extremes will travel the entire circle
// To modify blacks and whites, lightness first needs to be changed to value between 1% and 99%
sliderResetters.length = 0; // Clear existing resetters
sliderResetters.push(slider(contentEl, "Hue", 0, 360, 1, false));
sliderResetters.push(slider(contentEl, "Saturation", 0, 200, 1, false));
sliderResetters.push(slider(contentEl, "Lightness", 0, 200, 1, false));
@@ -405,6 +423,8 @@ function showModal() {
const colorSection = contentEl.createDiv();
colorSection.createEl('h3', { text: 'SVG Colors' });
colorInputs.clear(); // Clear old inputs map
for (const [color, info] of initialColorInfo.entries()) {
const row = new ea.obsidian.Setting(colorSection)
.setName(color === "fill" ? "SVG default" : color)
@@ -495,7 +515,51 @@ function showModal() {
.setValue(ea.getCM(info.mappedTo).stringHEX({alpha: false}).toLowerCase());
colorPicker.colorPickerEl.style.maxWidth = "2.5rem";
// Add palette picker button
const paletteButton = new ea.obsidian.Setting(row.controlEl)
.addButton(button => button
.setIcon("swatch-book")
.setTooltip("Pick from Palette")
.onClick(async () => {
const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");
if (selected) {
try {
const cm = ea.getCM(selected);
if (cm) {
const format = settings[FORMAT].value;
// Preserve alpha from original color
const currentInfo = currentColors.get(svgElement.id).colors.get(color);
const originalAlpha = ea.getCM(currentInfo.mappedTo).alpha;
cm.alphaTo(originalAlpha);
const alpha = originalAlpha < 1 ? true : false;
const newColor = format === "RGB"
? cm.stringRGB({alpha , precision }).toLowerCase()
: format === "HEX"
? cm.stringHEX({alpha}).toLowerCase()
: cm.stringHSL({alpha, precision }).toLowerCase();
// Update text input
textInput.setValue(newColor);
// Update Color Picker visual
colorPicker.setValue(cm.stringHEX({alpha: false}).toLowerCase());
// Update SVG mapping
currentInfo.mappedTo = newColor;
run("Update SVG color");
}
} catch (e) {
console.error("Invalid color value:", e);
}
}
}));
paletteButton.settingEl.style.padding = "0";
paletteButton.settingEl.style.border = "0";
paletteButton.infoEl.style.display = "none";
// Store references to the components
colorInputs.set(color, {
textInput,
@@ -539,106 +603,39 @@ function showModal() {
});
}
}
}
const buttons = new ea.obsidian.Setting(contentEl);
if(svgImageElements.length > 0) {
buttons.addButton(button => button
.setButtonText("Initialize SVG Colors")
.onClick(() => {
debounceColorPicker = true;
clearSVGMapping();
})
);
}
const buttons = new ea.obsidian.Setting(contentEl);
if(svgImageElements.length > 0) {
buttons.addButton(button => button
.setButtonText("Initialize SVG Colors")
.onClick(() => {
debounceColorPicker = true;
clearSVGMapping();
})
);
}
buttons
.addButton(button => button
.setButtonText("Reset")
.onClick(() => {
for (const resetter of sliderResetters) {
resetter();
}
copyOriginalsToCurrent();
setColors(originalColors);
}))
.addButton(button => button
.setButtonText("Close")
.setCta(true)
.onClick(() => modal.close()));
if (allElements.length > 0) {
buttons.addButton(button => button
.setButtonText("Reset")
.onClick(() => {
for (const resetter of sliderResetters) {
resetter();
}
copyOriginalsToCurrent();
setColors(originalColors);
}));
}
makeModalDraggable(modalEl);
const maxHeight = Math.round(height * 0.6);
const maxWidth = Math.round(width * 0.9);
modalEl.style.maxHeight = `${maxHeight}px`;
modalEl.style.maxWidth = `${maxWidth}px`;
};
modal.onClose = () => {
terminate = true;
if (dirty) {
ea.setScriptSettings(settings);
}
if(ea.targetView.isDirty()) {
ea.targetView.save(false);
}
};
modal.open();
}
/**
* Add draggable functionality to the modal element.
* @param {HTMLElement} modalEl - The modal element to make draggable.
*/
function makeModalDraggable(modalEl) {
let isDragging = false;
let startX, startY, initialX, initialY;
const header = modalEl.querySelector('.modal-titlebar') || modalEl; // Default to modalEl if no titlebar
header.style.cursor = 'move';
const onPointerDown = (e) => {
// Ensure the event target isn't an interactive element like slider, button, or input
if (e.target.tagName === 'INPUT' || e.target.tagName === 'BUTTON') return;
isDragging = true;
startX = e.clientX;
startY = e.clientY;
const rect = modalEl.getBoundingClientRect();
initialX = rect.left;
initialY = rect.top;
modalEl.style.position = 'absolute';
modalEl.style.margin = '0';
modalEl.style.left = `${initialX}px`;
modalEl.style.top = `${initialY}px`;
};
const onPointerMove = (e) => {
if (!isDragging) return;
const dx = e.clientX - startX;
const dy = e.clientY - startY;
modalEl.style.left = `${initialX + dx}px`;
modalEl.style.top = `${initialY + dy}px`;
};
const onPointerUp = () => {
isDragging = false;
};
header.addEventListener('pointerdown', onPointerDown);
document.addEventListener('pointermove', onPointerMove);
document.addEventListener('pointerup', onPointerUp);
// Clean up event listeners on modal close
modalEl.addEventListener('remove', () => {
header.removeEventListener('pointerdown', onPointerDown);
document.removeEventListener('pointermove', onPointerMove);
document.removeEventListener('pointerup', onPointerUp);
});
buttons.addButton(button => button
.setButtonText("Close")
.onClick(() => {
if(ea.sidepanelTab) {
ea.sidepanelTab.close();
}
ea.toggleSidepanelView();
}));
}
function executeChange(isDecrease, step, action) {
@@ -724,6 +721,66 @@ function run(action="Hue", isDecrease=true, step=0) {
if (!isRunning) processQueue();
}
await storeOriginalColors();
showModal();
processQueue();
// Function to refresh internal state based on current selection
function refreshSelectionState() {
if (!ea.targetView) {
allElements = [];
svgImageElements = [];
lastSelectionIds = "";
return;
}
allElements = ea.getViewSelectedElements();
svgImageElements = allElements.filter(el => {
if(el.type !== "image") return false;
const file = ea.getViewFileForImageElement(el);
if(!file) return false;
return el.type === "image" && (
file.extension === "svg" ||
ea.isExcalidrawFile(file)
);
});
lastSelectionIds = allElements.map(e => e.id).sort().join(",");
}
// Sidepanel initialization and logic
ea.createSidepanelTab("Shade Master", false, true).then(tab => {
if (!tab) return;
const initializeAndRender = async () => {
refreshSelectionState();
await storeOriginalColors();
renderSidepanel(tab.contentEl);
processQueue();
};
tab.onOpen = async () => {
terminate = false;
// Initial load
await initializeAndRender();
};
tab.onFocus = async (view) => {
if (view && view !== ea.targetView) {
ea.setView(view);
ea.clear();
}
// Check if selection changed
const currentSelectionStr = ea.getViewSelectedElements().map(e => e.id).sort().join(",");
if (currentSelectionStr !== lastSelectionIds) {
await initializeAndRender();
}
};
tab.onClose = async () => {
terminate = true;
if (dirty) {
ea.setScriptSettings(settings);
}
if(ea.targetView && ea.targetView.isDirty()) {
ea.targetView.save(false);
}
};
tab.open();
});
+39 -3
View File
@@ -48,6 +48,7 @@ const EDIT_ZOOMOUT = 0.7; //70% of original slide zoom, set to a value between 1
const FADE_LEVEL = 0.1; //opacity of the slideshow controls after fade delay (value between 0 and 1)
const PRINT_SLIDE_WIDTH = 1920;
const PRINT_SLIDE_HEIGHT = 1080;
const MAX_ZOOM = 30; //3000%
//using outerHTML because the SVG object returned by Obsidin is in the main workspace window
//but excalidraw might be open in a popout window which has a different document object
const SVG_COG = ea.obsidian.getIcon("lucide-settings").outerHTML;
@@ -60,6 +61,7 @@ const SVG_MINIMIZE = ea.obsidian.getIcon("lucide-minimize").outerHTML;
const SVG_LASER_ON = ea.obsidian.getIcon("lucide-hand").outerHTML;
const SVG_LASER_OFF = ea.obsidian.getIcon("lucide-wand").outerHTML;
const SVG_PRINTER = ea.obsidian.getIcon("lucide-printer").outerHTML;
const SVG_REFOCUS = ea.obsidian.getIcon("lucide-scan-eye").outerHTML;
//-------------------------------
//utility & convenience functions
@@ -278,7 +280,7 @@ const getNavigationRect = ({ x1, y1, x2, y2, printDimensions }) => {
const { width, height } = printDimensions ? printDimensions : excalidrawAPI.getAppState();
const ratioX = width / Math.abs(x1 - x2);
const ratioY = height / Math.abs(y1 - y2);
let ratio = Math.min(Math.max(ratioX, ratioY), 30);
let ratio = Math.min(Math.max(ratioX, ratioY), MAX_ZOOM);
const scaledWidth = Math.abs(x1 - x2) * ratio;
const scaledHeight = Math.abs(y1 - y2) * ratio;
@@ -499,9 +501,22 @@ const createPresentationNavigationPanel = () => {
}
});
el.createEl("button",{
attr: {
title: "Re-focus current slide (shortcut: HOME)"
}
}, button => {
button.innerHTML = SVG_REFOCUS;
button.onclick = () => {
debugger;
slide--;
navigate("fwd");
}
});
el.createEl("button",{
attr: {
title: "Toggle fullscreen. If you hold ALT/OPT when starting the presentation it will not go fullscreen."
title: "Toggle fullscreen. If you hold ALT/OPT when starting the presentation it will not go fullscreen. (shortcut: f)"
},
}, button => {
toggleFullscreenButton = button;
@@ -590,7 +605,7 @@ const keydownListener = (e) => {
navigate("fwd");
break;
case "Home":
slide = -1;
slide--;
navigate("fwd");
break;
case "e":
@@ -600,6 +615,9 @@ const keydownListener = (e) => {
exitPresentation(true);
})()
break;
case "f":
toggleFullscreen();
break;
}
}
@@ -793,6 +811,22 @@ const translateToZero = ({ top, left, bottom, right }, padding) => {
};
}
const getElementPlaceholdersForMarkerFrames = () => {
const viewMarkerFrames = ea.getViewElements().filter(el=>el.type === "frame" && el.frameRole === "marker");
if(viewMarkerFrames.length === 0) return;
ea.clear();
ea.style.opacity = 0;
ea.style.roughness = 0;
ea.style.fillStyle = "solid";
ea.style.backgroundColor = "black"
ea.style.strokeWidth = 0.01;
for (const frame of viewMarkerFrames) {
ea.addRect(frame.x, frame.y, frame.width, frame.height);
}
return ea.getViewElements().concat(ea.getElements());
}
const printToPDF = async (e) => {
const slideWidth = e.shiftKey ? excalidrawAPI.getAppState().width : PRINT_SLIDE_WIDTH;
const slideHeight = e.shiftKey ? excalidrawAPI.getAppState().height : PRINT_SLIDE_HEIGHT;
@@ -803,6 +837,7 @@ const printToPDF = async (e) => {
const padding = shouldClipFrames ? 0 : Math.round(Math.max(slideWidth,slideHeight)/2)+10;
const st = ea.getExcalidrawAPI().getAppState();
setSingleNotice("Generating image. This can take a longer time depending on the size of the image and speed of your device");
const elementsOverride = getElementPlaceholdersForMarkerFrames();
const svg = await ea.createViewSVG({
withBackground: true,
theme: st.theme,
@@ -811,6 +846,7 @@ const printToPDF = async (e) => {
selectedOnly: false,
skipInliningFonts: false,
embedScene: false,
elementsOverride,
});
const pages = [];
for(i=0;i<slides.length;i++) {
+1 -1
View File
@@ -1 +1 @@
[{"fname":"Mindmap connector.md","mtime":1658686599427},{"fname":"Mindmap connector.svg","mtime":1658686599427},{"fname":"Add Connector Point.md","mtime":1735420748564},{"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":1747585400113},{"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":1748189277Line truncated
[{"fname":"Mindmap connector.md","mtime":1658686599427},{"fname":"Mindmap connector.svg","mtime":1658686599427},{"fname":"Add Connector Point.md","mtime":1735420748564},{"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":1767536720161},{"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":1748189277Line truncated
+74 -12
View File
@@ -7,7 +7,7 @@ If you are enjoying the Excalidraw plugin then please support my work and enthus
Jump ahead to the [[#List of available scripts]]
# Introducing Excalidraw Automate Script Engine
<iframe width="560" height="315" src="https://www.youtube.com/embed/hePJcObHIso" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<a href="https://www.youtube.com/watch?v=hePJcObHIso" target="_blank"><img src ="https://i.ytimg.com/vi/hePJcObHIso/maxresdefault.jpg" style="width:560px;"></a>
Script Engine scripts are installed in the `Downloaded` subfolder of the `Excalidraw Automate script folder` specified in plugin settings.
@@ -26,6 +26,37 @@ I would love to include your contribution in the script library. If you have a s
# List of available scripts
## Editors Picks
These are the scripts I use most often. I tried to order them by importance, but usefulness is situational—some days Crop Vintage Mask is as helpful as Deconstruct Selected Elements. I do deconstruct drawings daily; the entries lower in the Editors’ Picks list are still valuable, just needed less frequently.
| | |
|----|-----|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Deconstruct%20selected%20elements%20into%20new%20drawing.svg"/></div>|[[#Deconstruct selected elements into new drawing]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Slideshow.svg"/></div>|[[#Slideshow]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Shade%20Master.svg"/></div>|[[#Shade Master]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Palette%20loader.svg"/></div>|[[#Palette Loader]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Palm%20Guard.svg"/></div>|[[#Palm Guard]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Rename%20Image.svg"/></div>|[[#Rename Image]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Select%20Elements%20of%20Type.svg"/></div>|[[#Select Elements of Type]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Select%20Similar%20Elements.svg"/></div>|[[#Select Similar Elements]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Boolean%20Operations.svg"/></div>|[[#Boolean Operations]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Split%20Ellipse.svg"/></div>|[[#Split Ellipse]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Text%20to%20Path.svg"/></div>|[[#Text to Path]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Set%20Dimensions.svg"/></div>|[[#Set Dimensions]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Set%20Stroke%20Width%20of%20Selected%20Elements.svg"/></div>|[[#Set Stroke Width of Selected Elements]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Scribble%20Helper.svg"/></div>|[[#Scribble Helper]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Split%20text%20by%20lines.svg"/></div>|[[#Split text by lines]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Text%20Aura.svg"/></div>|[[#Text Aura]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Golden%20Ratio.svg"/></div>|[[#Golden Ratio]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Printable%20Layout%20Wizard.svg"/></div>|[[#Printable Layout Wizard]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Concatenate%20lines.svg"></div>|[[#Concatenate lines]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Repeat%20Elements.svg"/></div>|[[#Repeat Elements]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Set%20background%20color%20of%20unclosed%20line%20object%20by%20adding%20a%20shadow%20clone.svg"/></div>|[[#Set background color of unclosed line object by adding a shadow clone]]|
|<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/Convert%20freedraw%20to%20line.svg"/></div>|[[#Convert freedraw to line]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Crop%20Vintage%20Mask.svg"/></div>|[[#Crop Vintage Mask]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Mindmap%20Builder.svg"/></div>|[[#Mindmap Builder]]|
## Layout and Organization
**Keywords**: Design, Placement, Arrangement, Structure, Formatting, Alignment
@@ -46,7 +77,9 @@ 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/Fixed%20vertical%20distance.svg"/></div>|[[#Fixed vertical distance]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Golden%20Ratio.svg"/></div>|[[#Golden Ratio]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Grid%20Selected%20Images.svg"/></div>|[[#Grid selected images]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-mindmap-builder.png"/></div>|[[#Mindmap Builder]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Mindmap%20format.svg"/></div>|[[#Mindmap format]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Printable%20Layout%20Wizard.svg"/></div>|[[#Printable Layout Wizard]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Zoom%20to%20Fit%20Selected%20Elements.svg"/></div>|[[#Zoom to Fit Selected Elements]]|
## Connectors and Arrows
@@ -123,6 +156,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/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/Palette%20loader.svg"/></div>|[[#Palette Loader]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Palm%20Guard.svg"/></div>|[[#Palm Guard]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/PDF%20Page%20Text%20to%20Clipboard.svg"/></div>|[[#PDF Page Text to Clipboard]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Rename%20Image.svg"/></div>|[[#Rename Image]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Repeat%20Elements.svg"/></div>|[[#Repeat Elements]]|
@@ -149,6 +183,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/Convert%20freedraw%20to%20line.svg"/></div>|[[#Convert freedraw to line]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Deconstruct%20selected%20elements%20into%20new%20drawing.svg"/></div>|[[#Deconstruct selected elements into new drawing]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Full-Year%20Calendar%20Generator.svg"/></div>|[[#Full-Year Calendar Generator]]|
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Linear%20Calendar%20Generator.svg"/></div>|[[#Linear Calendar Generator]]|
## Masking and cropping
**Keywords**: Crop, Mask, Transform images
@@ -257,7 +292,7 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Create%20DrawIO%20file.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/Create%20DrawIO%20file.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">The script will prompt you for a filename, then create a new draw.io diagram file and open the file in the <a href='https://github.com/zapthedingbat/drawio-obsidian'>Diagram plugin</a>, in a new tab.<br><iframe width="400" height="225" src="https://www.youtube.com/embed/DJcosmN-q2s" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></td></tr></table>
<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/Create%20DrawIO%20file.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">The script will prompt you for a filename, then create a new draw.io diagram file and open the file in the <a href='https://github.com/zapthedingbat/drawio-obsidian'>Diagram plugin</a>, in a new tab.<br><a href="https://www.youtube.com/watch?v=DJcosmN-q2s" target="_blank"><img src ="https://i.ytimg.com/vi/DJcosmN-q2s/maxresdefault.jpg" style="width:400px;"></a></td></tr></table>
## Create new markdown file and embed into active drawing
```excalidraw-script-install
@@ -289,7 +324,7 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Deconstruct%20selected%20elements%20into%20new%20drawing.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/Deconstruct%20selected%20elements%20into%20new%20drawing.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Select some elements in the scene. The script will take these elements and move them into a new Excalidraw file, and open that file. The selected elements will also be replaced in your original drawing with the embedded Excalidraw file (the one that was just created). You will be prompted for the file name of the new deconstructed image. The script is useful if you want to break a larger drawing into smaller reusable parts that you want to reference in multiple drawings.<br><iframe width="400" height="225" src="https://www.youtube.com/embed/HRtaaD34Zzg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-deconstruct.jpg'></td></tr></table>
<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/Deconstruct%20selected%20elements%20into%20new%20drawing.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Select some elements in the scene. The script will take these elements and move them into a new Excalidraw file, and open that file. The selected elements will also be replaced in your original drawing with the embedded Excalidraw file (the one that was just created). You will be prompted for the file name of the new deconstructed image. The script is useful if you want to break a larger drawing into smaller reusable parts that you want to reference in multiple drawings.<br><a href="https://www.youtube.com/watch?v=HRtaaD34Zzg" target="_blank"><img src ="https://i.ytimg.com/vi/HRtaaD34Zzg/maxresdefault.jpg" style="width:400px;"></a><br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-deconstruct.jpg'></td></tr></table>
## Elbow connectors
```excalidraw-script-install
@@ -307,7 +342,7 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Excalidraw%20Collaboration%20Frame.md
```
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/1-2-3'>@1-2-3</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%20Collaboration%20Frame.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Creates a new Excalidraw.com collaboration room and places the link to the room on the clipboard.<iframe width="400" height="225" src="https://www.youtube.com/embed/7isRfeAhEH4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></td></tr></table>
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/1-2-3'>@1-2-3</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%20Collaboration%20Frame.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Creates a new Excalidraw.com collaboration room and places the link to the room on the clipboard.<a href="https://www.youtube.com/watch?v=7isRfeAhEH4" target="_blank"><img src ="https://i.ytimg.com/vi/7isRfeAhEH4/maxresdefault.jpg" style="width:400px;"></a></td></tr></table>
## Expand rectangles horizontally keep text centered
```excalidraw-script-install
@@ -375,7 +410,7 @@ 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/Golden%20Ratio.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">The script performs two different functions depending on the elements selected in the view.<br>
1) In case you select text elements, the script will cycle through a set of font scales. First the 2 larger fonts following the Fibonacci sequence (fontsize * φ; fonsize * φ^2), then the 2 smaller fonts (fontsize / φ; fontsize / φ^2), finally the original size, followed again by the 2 larger fonts. If you wait 2 seconds, the sequence clears and starts from which ever font size you are on. So if you want the 3rd larges font, then toggle twice, wait 2 sec, then toggle again.<br>
2) In case you select a single rectangle, the script will open the "Golden Grid", "Golden Spiral" window, where you can set up the type of grid or spiral you want to insert into the document.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/golden-ratio.jpg'><br><iframe width="400" height="225" src="https://www.youtube.com/embed/2SHn_ruax-s" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></td></tr></table>
2) In case you select a single rectangle, the script will open the "Golden Grid", "Golden Spiral" window, where you can set up the type of grid or spiral you want to insert into the document.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/golden-ratio.jpg'><br><a href="https://www.youtube.com/watch?v=2SHn_ruax-s" target="_blank"><img src ="https://i.ytimg.com/vi/2SHn_ruax-s/maxresdefault.jpg" style="width:400px;"></a></td></tr></table>
## Grid selected images
```excalidraw-script-install
@@ -387,13 +422,13 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/ExcaliAI.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/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>
<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><a href="https://www.youtube.com/watch?v=A1vrSGBbWgo" target="_blank"><img src ="https://i.ytimg.com/vi/A1vrSGBbWgo/maxresdefault.jpg" style="width:400px;"></a><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>
<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><a href="https://www.youtube.com/watch?v=zvRpCOZAUSs" target="_blank"><img src ="https://i.ytimg.com/vi/zvRpCOZAUSs/maxresdefault.jpg" style="width:400px;"></a><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>
## Full-Year Calendar Generator
```excalidraw-script-install
@@ -405,7 +440,7 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/GPT-Draw-a-UI.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/GPT-Draw-a-UI.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">This script was discontinued in favor of ExcaliAI. Draw a UI and let GPT create the code for you.<br><iframe width="400" height="225" src="https://www.youtube.com/embed/y3kHl_6Ll4w" 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>
<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/GPT-Draw-a-UI.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">This script was discontinued in favor of ExcaliAI. Draw a UI and let GPT create the code for you.<br><a href="https://www.youtube.com/watch?v=y3kHl_6Ll4w" target="_blank"><img src ="https://i.ytimg.com/vi/y3kHl_6Ll4w/maxresdefault.jpg" style="width:400px;"></a><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-draw-a-ui.jpg'></td></tr></table>
## Image Occlusion
```excalidraw-script-install
@@ -425,6 +460,18 @@ 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/1-2-3'>@1-2-3</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/Lighten%20background%20color.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">This script lightens the background color of the selected element by 2% at a time. You can use this script several times until you are satisfied. It is recommended to set a shortcut key for this script so that you can quickly try to DARKEN and LIGHTEN the color effect.In contrast to the `Modify background color opacity` script, the advantage is that the background color of the element is not affected by the canvas color, and the color value does not appear in a strange rgba() form.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/darken-lighten-background-color.png'></td></tr></table>
## Linear Calendar Generator
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Linear%20Calendar%20Generator.md
```
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/iwanhoogendoorn'>@iwanhoogendoorn</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/Linear%20Calendar%20Generator.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Generates a complete calendar for a specified year.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-Linear-Calendar-Generator.jpg'></td></tr></table>
## Mindmap Builder
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Mindmap%20Builder.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/Mindmap%20Builder.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Rapid mind mapping workflow driven by keyboard shortcuts: add sibling/child nodes, auto-layout and branch styling, quick navigation, optional recursive grouping, and Markdown copy/paste import/export for bullet-list sync.Sign up for the <a href="https://visual-thinking-workshop.com/mindmap" target="_blank">MindMap Builder Self-Paced Course</a>!<br><a href="https://www.youtube.com/watch?v=qY66yoobaX4" target="_blank"><img src ="https://i.ytimg.com/vi/qY66yoobaX4/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/qY66yoobaX4' target='_blank'>Link to video on YouTube</a><br><a href="https://www.youtube.com/watch?v=5G9QF-u9w0Q" target="_blank"><img src ="https://i.ytimg.com/vi/5G9QF-u9w0Q/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/5G9QF-u9w0Q' target='_blank'>Link to video on YouTube</a><br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-mindmap-builder.png'></td></tr></table>
## Mindmap connector
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Mindmap%20connector.md
@@ -467,11 +514,19 @@ 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/Palette%20loader.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Design your palette at <a href="http://paletton.com/" target="_blank">paletton.com</a> Once you are happy with your colors, click Tables/Export in the bottom right of the screen. Then click "Color swatches/as Sketch Palette", and copy the contents of the page to a markdown file in the palette folder of your vault (default is Excalidraw/Palette)<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-sketch-palette-loader-1.jpg'></td></tr></table>
## Palm Guard
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Palm%20Guard.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/Palm%20Guard.md'>File on GitHub</a></td></tr>
<tr valign='top'><td class="label">Description</td><td class="data">Mobile & desktop palm‑rejection and distraction‑free drawing mode: optionally enters fullscreen, hides ALL Excalidraw UI chrome (top toolbar, side / bottom bars, plugin panels) for a clean / zen / immersive / kiosk / focus mode canvas. Provides a tiny draggable micro toolbar (toggle visibility + exit) so you gain maximum drawing area while preventing accidental palm taps. Uses the hotkey you assign in Obsidian’s Hotkey settings for this script to instantly show / hide controls (if no hotkey is set, use the on‑screen toggle). Ideal for stylus sketching, presentations, screen recording, split‑view space saving, or anyone searching for: palm rejection, hide toolbar, hide UI controls, clean mode, distraction free Excalidraw.<br><a href="https://www.youtube.com/watch?v=A_udjVjgWN0" target="_blank"><img src ="https://i.ytimg.com/vi/A_udjVjgWN0/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/A_udjVjgWN0' target='_blank'>Link to video on YouTube</a></td></tr></table>
## PDF Page Text to Clipboard
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/PDF%20Page%20Text%20to%20Clipboard.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/PDF%20Page%20Text%20to%20Clipboard.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Copies the text from the selected PDF page on the Excalidraw canvas to the clipboard.<br><iframe width="400" height="225" src="https://www.youtube.com/embed/Kwt_8WdOUT4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><br><a href='https://youtu.be/Kwt_8WdOUT4' target='_blank'>Link to video on YouTube</a></td></tr></table>
<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/PDF%20Page%20Text%20to%20Clipboard.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Copies the text from the selected PDF page on the Excalidraw canvas to the clipboard.<br><a href="https://www.youtube.com/watch?v=Kwt_8WdOUT4" target="_blank"><img src ="https://i.ytimg.com/vi/Kwt_8WdOUT4/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/Kwt_8WdOUT4' target='_blank'>Link to video on YouTube</a></td></tr></table>
## Relative Font Size Cycle
```excalidraw-script-install
@@ -507,7 +562,7 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Scribble%20Helper.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/Scribble%20Helper.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">iOS scribble helper for better handwriting experience with text elements. If no elements are selected then the creates a text element at pointer position and you can use the edit box to modify the text with scribble. If a text element is selected then opens the input prompt where you can modify this text with scribble.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-scribble-helper.jpg'><br><iframe width="560" height="315" src="https://www.youtube.com/embed/BvYkOaly-QM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></td></tr></table>
<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/Scribble%20Helper.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">iOS scribble helper for better handwriting experience with text elements. If no elements are selected then the creates a text element at pointer position and you can use the edit box to modify the text with scribble. If a text element is selected then opens the input prompt where you can modify this text with scribble.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-scribble-helper.jpg'><br><a href="https://www.youtube.com/watch?v=BvYkOaly-QM" target="_blank"><img src ="https://i.ytimg.com/vi/BvYkOaly-QM/maxresdefault.jpg" style="width:560px;"></a></td></tr></table>
## Select Elements of Type
```excalidraw-script-install
@@ -575,14 +630,14 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Shade%20Master.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/Shade%20Master.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">You can modify the colors of SVG images, embedded files, and Excalidraw elements in a drawing by changing Hue, Saturation, Lightness and Transparency; and if only a single SVG or nested Excalidraw drawing is selected, then you can remap image colors.<br><iframe width="560" height="315" src="https://www.youtube.com/embed/ISuORbVKyhQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></td></tr></table>
<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/Shade%20Master.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">You can modify the colors of SVG images, embedded files, and Excalidraw elements in a drawing by changing Hue, Saturation, Lightness and Transparency; and if only a single SVG or nested Excalidraw drawing is selected, then you can remap image colors.<br><a href="https://www.youtube.com/watch?v=ISuORbVKyhQ" target="_blank"><img src ="https://i.ytimg.com/vi/ISuORbVKyhQ/maxresdefault.jpg" style="width:560px;"></a></td></tr></table>
## Slideshow
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Slideshow.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/Slideshow.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">The script will convert your drawing into a slideshow presentation.<br><iframe width="560" height="315" src="https://www.youtube.com/embed/JwgtCrIVeEU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></td></tr></table>
<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/Slideshow.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">The script will convert your drawing into a slideshow presentation.<br><a href="https://www.youtube.com/watch?v=JwgtCrIVeEU" target="_blank"><img src ="https://i.ytimg.com/vi/JwgtCrIVeEU/maxresdefault.jpg" style="width:560px;"></a></td></tr></table>
## Split Ellipse
```excalidraw-script-install
@@ -632,6 +687,13 @@ 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/Uniform%20size.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data"><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-uniform-size.jpg"><br>The script will standardize the sizes of rectangles, diamonds and ellipses adjusting all the elements to match the largest width and height within the group.</td></tr></table>
# Printable Layout Wizard
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Printable%20Layout%20Wizard.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/Printable%20Layout%20Wizard.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Export Excalidraw to PDF Pages: Define printable page areas using frames, then export each frame as a separate page in a multi-page PDF. Perfect for turning your Excalidraw drawings into printable notes, handouts, or booklets. Supports standard and custom page sizes, margins, and easy frame arrangement.<br><a href="https://www.youtube.com/watch?v=29EWeglRm7s" target="_blank"><img src ="https://i.ytimg.com/vi/29EWeglRm7s/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/29EWeglRm7s' target='_blank'>Link to video on YouTube</a><br><a href="https://www.youtube.com/watch?v=DqDnzCOoYMc" target="_blank"><img src ="https://i.ytimg.com/vi/DqDnzCOoYMc/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/DqDnzCOoYMc' target='_blank'>Link to video on YouTube</a><br><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-layout-wizard-01.png" style="max-width: 400px;"><br><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-layout-wizard-02.png" style="max-width: 400px;"></td></tr></table>
## Zoom to Fit Selected Elements
```excalidraw-script-install
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Zoom%20to%20Fit%20Selected%20Elements.md
+776
View File
@@ -0,0 +1,776 @@
/*
This is an experimental script. If you find bugs, please consider debugging yourself then submitting a PR on github with the fix, instead of raising an issue. Thank you!
This script modifies the color lightness/hue/saturation/transparency of selected Excalidraw elements and SVG and nested Excalidraw drawings. Select eligible elements in the scene, then run the script.
- The color of Excalidraw elements (lines, ellipses, rectangles, etc.) will be changed by the script.
- The color of SVG elements and nested Excalidraw drawings will only be mapped. When mapping colors, the original image remains unchanged, only a mapping table is created and the image is recolored during rendering of your Excalidraw screen. In case you want to make manual changes you can also edit the mapping in Markdown View Mode under `## Embedded Files`
If you select only a single SVG or nested Excalidraw element, then the script offers an additional feature. You can map colors one by one in the image.
```js
*/
const HELP_TEXT = `
- Select SVG images, nested Excalidraw drawings and/or regular Excalidraw elements
- For a single selected image, you can map colors individually in the color mapping section
- For Excalidraw elements: stroke and background colors are modified permanently
- For SVG/nested drawings: original files stay unchanged, color mapping is stored under \`## Embedded Files\`
- Using color maps helps maintain links between drawings while allowing different color themes
- Sliders work on relative scale - the amount of change is applied to current values
- Unlike Excalidraw's opacity setting which affects the whole element:
- Shade Master can set different opacity for stroke vs background
- **Note:** SVG/nested drawing colors are mapped at color name level, thus "black" is different from "#000000"
- Additionally if the same color is used as fill and stroke the color can only be mapped once
- This is an experimental script - contributions welcome on GitHub via PRs
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://storage.ko-fi.com/cdn/kofi6.png?v=6" border="0" alt="Buy Me a Coffee at ko-fi.com" height=45></a></div>
<a href="https://www.youtube.com/watch?v=ISuORbVKyhQ" target="_blank"><img src ="https://i.ytimg.com/vi/ISuORbVKyhQ/maxresdefault.jpg" style="max-width:560px; width:100%"></a>
`;
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.1")) {
new Notice("Please update the Excalidraw Plugin to version 2.19.1 or higher.");
return;
}
const existingTab = ea.checkForActiveSidepanelTabForScript();
if (existingTab) {
const hostEA = existingTab.getHostEA();
if (hostEA && hostEA !== ea) {
hostEA.setView(ea.targetView);
existingTab.open();
return;
}
}
/*
SVGColorInfo is returned by ea.getSVGColorInfoForImgElement. Color info will all the color strings in the SVG file plus "fill" which represents the default fill color for SVG icons set at the SVG root element level. Fill if not set defaults to black:
type SVGColorInfo = Map<string, {
mappedTo: string;
fill: boolean;
stroke: boolean;
}>;
In the Excalidraw file under `## Embedded Files` the color map is included after the file. That color map implements ColorMap. ea.updateViewSVGImageColorMap takes a ColorMap as input.
interface ColorMap {
[color: string]: string;
};
*/
// Main script state variables
let allElements = [];
let svgImageElements = [];
let lastSelectionIds = "";
const originalColors = new Map();
const currentColors = new Map();
const colorInputs = new Map();
const sliderResetters = [];
let terminate = false;
const FORMAT = "Color Format";
const STROKE = "Modify Stroke Color";
const BACKGROUND = "Modify Background Color"
const ACTIONS = ["Hue", "Lightness", "Saturation", "Transparency"];
const precision = [1,2,2,3];
const minLigtness = 1/Math.pow(10,precision[2]);
const maxLightness = 100 - minLigtness;
const minSaturation = 1/Math.pow(10,precision[2]);
let settings = ea.getScriptSettings();
//set default values on first run
if(!settings[STROKE]) {
settings = {};
settings[FORMAT] = {
value: "HEX",
valueset: ["HSL", "RGB", "HEX"],
description: "Output color format."
};
settings[STROKE] = { value: true }
settings[BACKGROUND] = {value: true }
ea.setScriptSettings(settings);
}
function getRegularElements() {
if (!ea.targetView) return [];
ea.clear();
//loading view elements again as element objects change when colors are updated
const viewElements = ea.getViewSelectedElements();
return viewElements.filter(el =>
["rectangle", "ellipse", "diamond", "line", "arrow", "freedraw", "text"].includes(el.type)
);
}
const updatedImageElementColorMaps = new Map();
let isWaitingForSVGUpdate = false;
function updateViewImageColors() {
if(terminate || isWaitingForSVGUpdate || updatedImageElementColorMaps.size === 0) {
return;
}
isWaitingForSVGUpdate = true;
elementArray = Array.from(updatedImageElementColorMaps.keys());
colorMapArray = Array.from(updatedImageElementColorMaps.values());
updatedImageElementColorMaps.clear();
ea.updateViewSVGImageColorMap(elementArray, colorMapArray).then(()=>{
isWaitingForSVGUpdate = false;
updateViewImageColors();
});
}
async function storeOriginalColors() {
// Clear previous state
originalColors.clear();
currentColors.clear();
// Store colors for regular elements
for (const el of getRegularElements()) {
const key = el.id;
const colorData = {
type: "regular",
strokeColor: el.strokeColor,
backgroundColor: el.backgroundColor
};
originalColors.set(key, colorData);
}
// Store colors for SVG elements
for (const el of svgImageElements) {
const colorInfo = await ea.getSVGColorInfoForImgElement(el);
const svgColors = new Map();
for (const [color, info] of colorInfo.entries()) {
svgColors.set(color, {...info});
}
originalColors.set(el.id, {type: "svg",colors: svgColors});
}
copyOriginalsToCurrent();
}
function copyOriginalsToCurrent() {
currentColors.clear();
for (const [key, value] of originalColors.entries()) {
if(value.type === "regular") {
currentColors.set(key, {...value});
} else {
const newColorMap = new Map();
for (const [color, info] of value.colors.entries()) {
newColorMap.set(color, {...info});
}
currentColors.set(key, {type: "svg", colors: newColorMap});
}
}
}
function clearSVGMapping() {
for (const resetter of sliderResetters) {
resetter();
}
// Reset SVG elements
if (svgImageElements.length === 1) {
const el = svgImageElements[0];
const original = originalColors.get(el.id);
const current = currentColors.get(el.id);
if (original && original.type === "svg") {
for (const color of original.colors.keys()) {
current.colors.get(color).mappedTo = color;
}
}
} else {
for (const el of svgImageElements) {
const original = originalColors.get(el.id);
const current = currentColors.get(el.id);
if (original && original.type === "svg") {
for (const color of original.colors.keys()) {
current.colors.get(color).mappedTo = color;
}
}
}
}
run("clear");
}
// Set colors
async function setColors(colors) {
debounceColorPicker = true;
const regularElements = getRegularElements();
if (regularElements.length > 0) {
ea.copyViewElementsToEAforEditing(regularElements);
for (const el of ea.getElements()) {
const original = colors.get(el.id);
if (original && original.type === "regular") {
if (original.strokeColor) el.strokeColor = original.strokeColor;
if (original.backgroundColor) el.backgroundColor = original.backgroundColor;
}
}
await ea.addElementsToView(false, false);
}
// Reset SVG elements
if (svgImageElements.length === 1) {
const el = svgImageElements[0];
const original = colors.get(el.id);
if (original && original.type === "svg") {
const newColorMap = {};
for (const [color, info] of original.colors.entries()) {
newColorMap[color] = info.mappedTo;
// Update UI components
const inputs = colorInputs.get(color);
if (inputs) {
if(info.mappedTo === "fill") {
info.mappedTo = "black";
//"fill" is a special value in case the SVG has no fill color defined (i.e black)
inputs.textInput.setValue("black");
inputs.colorPicker.setValue("#000000");
} else {
const cm = ea.getCM(info.mappedTo);
inputs.textInput.setValue(info.mappedTo);
inputs.colorPicker.setValue(cm.stringHEX({alpha: false}).toLowerCase());
}
}
}
updatedImageElementColorMaps.set(el, newColorMap);
}
} else {
for (const el of svgImageElements) {
const original = colors.get(el.id);
if (original && original.type === "svg") {
const newColorMap = {};
for (const [color, info] of original.colors.entries()) {
newColorMap[color] = info.mappedTo;
}
updatedImageElementColorMaps.set(el, newColorMap);
}
}
}
updateViewImageColors();
}
function modifyColor(color, isDecrease, step, action) {
if (!color) return null;
const cm = ea.getCM(color);
if (!cm) return color;
let modified = cm;
if (modified.lightness === 0) modified = modified.lightnessTo(minLigtness);
if (modified.lightness === 100) modified = modified.lightnessTo(maxLightness);
if (modified.saturation === 0) modified = modified.saturationTo(minSaturation);
switch(action) {
case "Lightness":
// handles edge cases where lightness is 0 or 100 would convert saturation and hue to 0
let lightness = cm.lightness;
const shouldRoundLight = (lightness === minLigtness || lightness === maxLightness);
if (shouldRoundLight) lightness = Math.round(lightness);
lightness += isDecrease ? -step : step;
if (lightness <= 0) lightness = minLigtness;
if (lightness >= 100) lightness = maxLightness;
modified = modified.lightnessTo(lightness);
break;
case "Hue":
modified = isDecrease ? modified.hueBy(-step) : modified.hueBy(step);
break;
case "Transparency":
modified = isDecrease ? modified.alphaBy(-step) : modified.alphaBy(step);
break;
default:
let saturation = cm.saturation;
const shouldRoundSat = saturation === minSaturation;
if (shouldRoundSat) saturation = Math.round(saturation);
saturation += isDecrease ? -step : step;
if (saturation <= 0) saturation = minSaturation;
modified = modified.saturationTo(saturation);
}
const hasAlpha = modified.alpha < 1;
const opts = { alpha: hasAlpha, precision };
const format = settings[FORMAT].value;
switch(format) {
case "RGB": return modified.stringRGB(opts).toLowerCase();
case "HEX": return modified.stringHEX(opts).toLowerCase();
default: return modified.stringHSL(opts).toLowerCase();
}
}
function slider(contentEl, action, min, max, step, invert) {
let prevValue = (max-min)/2;
let debounce = false;
let sliderControl;
new ea.obsidian.Setting(contentEl)
.setName(action)
.addSlider(slider => {
sliderControl = slider;
slider
.setLimits(min, max, step)
.setValue(prevValue)
.onChange(async (value) => {
if (debounce) return;
const isDecrease = invert ? value > prevValue : value < prevValue;
const step = Math.abs(value-prevValue);
prevValue = value;
if(step>0) {
run(action, isDecrease, step);
}
});
}
);
return () => {
debounce = true;
prevValue = (max-min)/2;
sliderControl.setValue(prevValue);
debounce = false;
}
}
let debounceColorPicker = true;
function renderSidepanel(contentEl) {
contentEl.empty();
contentEl.createEl('h2', { text: 'Shade Master' });
const helpDiv = contentEl.createEl("details", {
attr: { style: "margin-bottom: 1em;background: var(--background-secondary); padding: 1em; border-radius: 4px;" }});
helpDiv.createEl("summary", { text: "Help & Usage Guide", attr: { style: "cursor: pointer; color: var(--text-accent);" } });
const helpDetailsDiv = helpDiv.createEl("div", {
attr: { style: "margin-top: 0em; " }
});
ea.obsidian.MarkdownRenderer.render(ea.plugin.app, HELP_TEXT, helpDetailsDiv, "", ea.plugin);
if (!ea.targetView) {
contentEl.createEl("p", {
text: "No active Excalidraw view found. Please open a drawing and select elements to use Shade Master.",
attr: { style: "color: var(--text-muted);" }
});
return;
}
const { width, height } = ea.getExcalidrawAPI().getAppState();
if(allElements.length === 0) {
contentEl.createEl("p", {
text: "Select at least one rectangle, ellipse, diamond, line, arrow, freedraw, text or SVG image element",
attr: { style: "color: var(--text-warning);" }
});
// return; // Removed early return to allow rendering of the Close button
} else {
// Only render controls if elements are selected
const component = new ea.obsidian.Setting(contentEl)
.setName(FORMAT)
.setDesc("Output color format")
.addDropdown(dropdown => dropdown
.addOptions({
"HSL": "HSL",
"RGB": "RGB",
"HEX": "HEX"
})
.setValue(settings[FORMAT].value)
.onChange(value => {
settings[FORMAT].value = value;
run();
dirty = true;
})
);
new ea.obsidian.Setting(contentEl)
.setName(STROKE)
.addToggle(toggle => toggle
.setValue(settings[STROKE].value)
.onChange(value => {
settings[STROKE].value = value;
dirty = true;
})
);
new ea.obsidian.Setting(contentEl)
.setName(BACKGROUND)
.addToggle(toggle => toggle
.setValue(settings[BACKGROUND].value)
.onChange(value => {
settings[BACKGROUND].value = value;
dirty = true;
})
);
sliderResetters.length = 0; // Clear existing resetters
sliderResetters.push(slider(contentEl, "Hue", 0, 360, 1, false));
sliderResetters.push(slider(contentEl, "Saturation", 0, 200, 1, false));
sliderResetters.push(slider(contentEl, "Lightness", 0, 200, 1, false));
sliderResetters.push(slider(contentEl, "Transparency", 0, 2, 0.05, true));
// Add color pickers if a single SVG image is selected
if (svgImageElements.length === 1) {
const svgElement = svgImageElements[0];
const initialColorInfo = currentColors.get(svgElement.id).colors;
const colorSection = contentEl.createDiv();
colorSection.createEl('h3', { text: 'SVG Colors' });
colorInputs.clear(); // Clear old inputs map
for (const [color, info] of initialColorInfo.entries()) {
const row = new ea.obsidian.Setting(colorSection)
.setName(color === "fill" ? "SVG default" : color)
.setDesc(`${info.fill ? "Fill" : ""}${info.fill && info.stroke ? " & " : ""}${info.stroke ? "Stroke" : ""}`);
row.descEl.style.width = "100px";
row.nameEl.style.width = "100px";
// Create color preview div
const previewDiv = row.controlEl.createDiv();
previewDiv.style.width = "50px";
previewDiv.style.height = "20px";
previewDiv.style.border = "1px solid var(--background-modifier-border)";
if (color === "transparent") {
previewDiv.style.backgroundImage = "linear-gradient(45deg, #808080 25%, transparent 25%), linear-gradient(-45deg, #808080 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #808080 75%), linear-gradient(-45deg, transparent 75%, #808080 75%)";
previewDiv.style.backgroundSize = "10px 10px";
previewDiv.style.backgroundPosition = "0 0, 0 5px, 5px -5px, -5px 0px";
} else {
previewDiv.style.backgroundColor = ea.getCM(color).stringHEX({alpha: false}).toLowerCase();
}
const resetButton = new ea.obsidian.Setting(row.controlEl)
.addButton(button => button
.setButtonText(">>")
.setClass("reset-color-button")
.onClick(async () => {
const original = originalColors.get(svgElement.id);
const current = currentColors.get(svgElement.id);
if (original?.type === "svg") {
const originalInfo = original.colors.get(color);
const currentInfo = current.colors.get(color);
if (originalInfo) {
currentInfo.mappedTo = color;
run("reset single color");
}
}
}))
resetButton.settingEl.style.padding = "0";
resetButton.settingEl.style.border = "0";
// Add text input for color value
const textInput = new ea.obsidian.TextComponent(row.controlEl)
.setValue(info.mappedTo)
.setPlaceholder("Color value");
textInput.inputEl.style.width = "100%";
textInput.onChange(value => {
const lower = value.toLowerCase();
if (lower === color) return;
textInput.setValue(lower);
})
const applyButtonComponent = new ea.obsidian.Setting(row.controlEl)
.addButton(button => button
.setIcon("check")
.setTooltip("Apply")
.onClick(async () => {
const value = textInput.getValue();
try {
if(!CSS.supports("color",value)) {
new Notice (`${value} is not a valid color string`);
return;
}
const cm = ea.getCM(value);
if (cm) {
const format = settings[FORMAT].value;
const alpha = cm.alpha < 1 ? true : false;
const newColor = format === "RGB"
? cm.stringRGB({alpha , precision }).toLowerCase()
: format === "HEX"
? cm.stringHEX({alpha}).toLowerCase()
: cm.stringHSL({alpha, precision }).toLowerCase();
textInput.setValue(newColor);
const currentInfo = currentColors.get(svgElement.id).colors;
currentInfo.get(color).mappedTo = newColor;
run("Update SVG color");
debounceColorPicker = true;
colorPicker.setValue(cm.stringHEX({alpha: false}).toLowerCase());
}
} catch (e) {
console.error("Invalid color value:", e);
}
}));
applyButtonComponent.settingEl.style.padding = "0";
applyButtonComponent.settingEl.style.border = "0";
// Add color picker
const colorPicker = new ea.obsidian.ColorComponent(row.controlEl)
.setValue(ea.getCM(info.mappedTo).stringHEX({alpha: false}).toLowerCase());
colorPicker.colorPickerEl.style.maxWidth = "2.5rem";
// Add palette picker button
const paletteButton = new ea.obsidian.Setting(row.controlEl)
.addButton(button => button
.setIcon("swatch-book")
.setTooltip("Pick from Palette")
.onClick(async () => {
const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");
if (selected) {
try {
const cm = ea.getCM(selected);
if (cm) {
const format = settings[FORMAT].value;
// Preserve alpha from original color
const currentInfo = currentColors.get(svgElement.id).colors.get(color);
const originalAlpha = ea.getCM(currentInfo.mappedTo).alpha;
cm.alphaTo(originalAlpha);
const alpha = originalAlpha < 1 ? true : false;
const newColor = format === "RGB"
? cm.stringRGB({alpha , precision }).toLowerCase()
: format === "HEX"
? cm.stringHEX({alpha}).toLowerCase()
: cm.stringHSL({alpha, precision }).toLowerCase();
// Update text input
textInput.setValue(newColor);
// Update Color Picker visual
colorPicker.setValue(cm.stringHEX({alpha: false}).toLowerCase());
// Update SVG mapping
currentInfo.mappedTo = newColor;
run("Update SVG color");
}
} catch (e) {
console.error("Invalid color value:", e);
}
}
}));
paletteButton.settingEl.style.padding = "0";
paletteButton.settingEl.style.border = "0";
paletteButton.infoEl.style.display = "none";
// Store references to the components
colorInputs.set(color, {
textInput,
colorPicker,
previewDiv,
resetButton
});
colorPicker.colorPickerEl.addEventListener('click', () => {
debounceColorPicker = false;
});
colorPicker.onChange(async (value) => {
try {
if(!debounceColorPicker) {
const currentInfo = currentColors.get(svgElement.id).colors.get(color);
// Preserve alpha from original color
const originalAlpha = ea.getCM(currentInfo.mappedTo).alpha;
const cm = ea.getCM(value);
cm.alphaTo(originalAlpha);
const alpha = originalAlpha < 1 ? true : false;
const format = settings[FORMAT].value;
const newColor = format === "RGB"
? cm.stringRGB({alpha, precision }).toLowerCase()
: format === "HEX"
? cm.stringHEX({alpha}).toLowerCase()
: cm.stringHSL({alpha, precision }).toLowerCase();
// Update text input
textInput.setValue(newColor);
// Update SVG
currentInfo.mappedTo = newColor;
run("Update SVG color");
}
} catch (e) {
console.error("Invalid color value:", e);
} finally {
debounceColorPicker = true;
}
});
}
}
}
const buttons = new ea.obsidian.Setting(contentEl);
if(svgImageElements.length > 0) {
buttons.addButton(button => button
.setButtonText("Initialize SVG Colors")
.onClick(() => {
debounceColorPicker = true;
clearSVGMapping();
})
);
}
if (allElements.length > 0) {
buttons.addButton(button => button
.setButtonText("Reset")
.onClick(() => {
for (const resetter of sliderResetters) {
resetter();
}
copyOriginalsToCurrent();
setColors(originalColors);
}));
}
buttons.addButton(button => button
.setButtonText("Close")
.onClick(() => {
if(ea.sidepanelTab) {
ea.sidepanelTab.close();
}
ea.toggleSidepanelView();
}));
}
function executeChange(isDecrease, step, action) {
const modifyStroke = settings[STROKE].value;
const modifyBackground = settings[BACKGROUND].value;
const regularElements = getRegularElements();
// Process regular elements
if (regularElements.length > 0) {
for (const el of regularElements) {
const currentColor = currentColors.get(el.id);
if (modifyStroke && currentColor.strokeColor) {
currentColor.strokeColor = modifyColor(el.strokeColor, isDecrease, step, action);
}
if (modifyBackground && currentColor.backgroundColor) {
currentColor.backgroundColor = modifyColor(el.backgroundColor, isDecrease, step, action);
}
}
}
// Process SVG image elements
if (svgImageElements.length === 1) { // Only update UI for single SVG
const el = svgImageElements[0];
colorInfo = currentColors.get(el.id).colors;
// Process each color in the SVG
for (const [color, info] of colorInfo.entries()) {
let shouldModify = (modifyBackground && info.fill) || (modifyStroke && info.stroke);
if (shouldModify) {
const modifiedColor = modifyColor(info.mappedTo, isDecrease, step, action);
colorInfo.get(color).mappedTo = modifiedColor;
// Update UI components if they exist
const inputs = colorInputs.get(color);
if (inputs) {
const cm = ea.getCM(modifiedColor);
inputs.textInput.setValue(modifiedColor);
inputs.colorPicker.setValue(cm.stringHEX({alpha: false}).toLowerCase());
}
}
}
} else {
if (svgImageElements.length > 0) {
for (const el of svgImageElements) {
const colorInfo = currentColors.get(el.id).colors;
// Process each color in the SVG
for (const [color, info] of colorInfo.entries()) {
let shouldModify = (modifyBackground && info.fill) || (modifyStroke && info.stroke);
if (shouldModify) {
const modifiedColor = modifyColor(info.mappedTo, isDecrease, step, action);
colorInfo.get(color).mappedTo = modifiedColor;
}
}
}
}
}
}
let isRunning = false;
let queue = false;
function processQueue() {
if (!terminate && !isRunning && queue) {
queue = false;
isRunning = true;
setColors(currentColors).then(() => {
isRunning = false;
if (queue) processQueue();
});
}
}
function run(action="Hue", isDecrease=true, step=0) {
// passing invalid action (such as "clear") will bypass rewriting of colors using CM
// this is useful when resetting colors to original values
if(ACTIONS.includes(action)) {
executeChange(isDecrease, step, action);
}
queue = true;
if (!isRunning) processQueue();
}
// Function to refresh internal state based on current selection
function refreshSelectionState() {
if (!ea.targetView) {
allElements = [];
svgImageElements = [];
lastSelectionIds = "";
return;
}
allElements = ea.getViewSelectedElements();
svgImageElements = allElements.filter(el => {
if(el.type !== "image") return false;
const file = ea.getViewFileForImageElement(el);
if(!file) return false;
return el.type === "image" && (
file.extension === "svg" ||
ea.isExcalidrawFile(file)
);
});
lastSelectionIds = allElements.map(e => e.id).sort().join(",");
}
// Sidepanel initialization and logic
ea.createSidepanelTab("Shade Master", false, true).then(tab => {
if (!tab) return;
const initializeAndRender = async () => {
refreshSelectionState();
await storeOriginalColors();
renderSidepanel(tab.contentEl);
processQueue();
};
tab.onOpen = async () => {
terminate = false;
// Initial load
await initializeAndRender();
};
tab.onFocus = async (view) => {
if (view && view !== ea.targetView) {
ea.setView(view);
ea.clear();
}
// Check if selection changed
const currentSelectionStr = ea.getViewSelectedElements().map(e => e.id).sort().join(",");
if (currentSelectionStr !== lastSelectionIds) {
await initializeAndRender();
}
};
tab.onClose = async () => {
terminate = true;
if (dirty) {
ea.setScriptSettings(settings);
}
if(ea.targetView && ea.targetView.isDirty()) {
ea.targetView.save(false);
}
};
tab.open();
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

+3 -3
View File
@@ -1,9 +1,9 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.13.0",
"minAppVersion": "1.5.7",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"version": "2.20.5",
"minAppVersion": "1.5.7",
"description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.",
"author": "Zsolt Viczian",
"authorUrl": "https://excalidraw-obsidian.online",
"isDesktopOnly": false
+3 -3
View File
@@ -1,12 +1,12 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.13.0",
"version": "2.20.5",
"minAppVersion": "1.5.7",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.",
"author": "Zsolt Viczian",
"authorUrl": "https://excalidraw-obsidian.online",
"fundingUrl": "https://ko-fi.com/zsolt",
"helpUrl": "https://github.com/zsviczian/obsidian-excalidraw-plugin#readme",
"isDesktopOnly": false
}
}
+6673 -778
View File
File diff suppressed because it is too large. Load diff
+5 -3
View File
@@ -16,14 +16,16 @@
"build:mathjax": "cd MathjaxToSVG && npm run build",
"build:all": "npm run build:mathjax && npm run build",
"dev:mathjax": "cd MathjaxToSVG && npm run dev",
"dev:all": "npm run dev:mathjax && npm run dev"
"dev:all": "npm run dev:mathjax && npm run dev",
"doc": "npm run lib && node scripts/generate-script-library.js",
"mindmap": "node scripts/deploy-mindmap-builder.js"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/excalidraw": "0.18.0-25",
"@zsviczian/excalidraw": "0.18.0-79",
"chroma-js": "^3.1.2",
"clsx": "^2.0.0",
"@zsviczian/colormaster": "^1.2.2",
@@ -73,7 +75,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"lz-string": "^1.5.0",
"obsidian": "^1.7.2",
"obsidian": "^1.10.0",
"prettier": "^3.0.1",
"rollup": "^2.70.1",
"rollup-plugin-copy": "^3.5.0",
+6 -4
View File
@@ -49,7 +49,7 @@ const jsxRuntimeShim = `
const mathjaxtosvg_pkg = isLib ? "" : fs.readFileSync("./MathjaxToSVG/dist/index.js", "utf8");
const LANGUAGES = ['ru', 'zh-cn']; //english is not compressed as it is always loaded by default
const LANGUAGES = ['ru', 'zh-cn', 'zh-tw', 'es']; //english is not compressed as it is always loaded by default
function trimLastSemicolon(input) {
if (input.endsWith(";")) {
@@ -101,7 +101,7 @@ if (!isLib) {
? fs.readFileSync("./node_modules/@zsviczian/excalidraw/dist/styles.production.css", "utf8")
: fs.readFileSync("./node_modules/@zsviczian/excalidraw/dist/styles.development.css", "utf8");
const plugin_styles = fs.readFileSync("./styles.css", "utf8");
const styles = plugin_styles + excalidraw_styles;
const styles = excalidraw_styles + plugin_styles;
cssnano()
.process(styles) // Process the CSS
.then(result => {
@@ -188,8 +188,10 @@ const BUILD_CONFIG = {
},
}),
postprocess([
[/React=require\("react"\),state=require\("@codemirror\/state"\),view=require\("@codemirror\/view"\)/,
`state=require("@codemirror/state"),view=require("@codemirror/view")` + packageString],
[
/(var[^;]*?),\s*React\s*=\s*require\(["']react["']\)([^;]*;)/,
(_, g1, g2) => `${g1}${g2}${packageString}`
],
]),
] : [
postprocess([ [/var React = require\('react'\);/, packageString] ]),
+134
View File
@@ -0,0 +1,134 @@
const path = require("path");
const fs = require("fs/promises");
const { minify } = require("uglify-js");
const LZString = require("lz-string");
const CHUNK_SIZE = 256;
const NEEDLE = "const removeKeydownHandlers";
const root = path.resolve(__dirname, "..");
const sourcePath = path.join(root, "ea-scripts", "Mindmap Builder.js");
const outputPath = path.join(root, "ea-scripts", "Mindmap Builder.md");
const HEADER = `/*
# Mind Map Builder
![](https://youtu.be/5G9QF-u9w0Q)
## Overview
**Mind Map Builder** transforms the Obsidian-Excalidraw canvas into a rapid brainstorming environment, allowing users to build complex, structured, and visually organized mind maps using primarily keyboard shortcuts.
The script balances **automation** (auto-layout, recursive grouping, and contrast-aware coloring) with **explicit flexibility** (node pinning and redirection logic), ensuring that the mind map stays organized even as it grows to hundreds of nodes. It leverages the Excalidraw Sidepanel API to provide a persistent control interface utilizing the Obsidian sidepanel, that can also be undocked into a floating modal.
> [!Tip]
> 🚀 Become a MindMap Builder Pro with the Official [MindMap Builder Course](https://www.visual-thinking-workshop.com/mindmap)!
> [!Info]
> Mindmap Builder is Minified and compressed to reduce size and improve performance. You can find the source here: [Mindmap Builder.js](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.js)
## Show Your Love!
💖 **If you love MindMap Builder** say thank you, and [Buy me a Coffee](https://ko-fi.com/zsolt) 🍵
## The Script
\`\`\`js*/
`;
const FOOTER = `
const VERSION = "v${new Date().toISOString().slice(2, 10).replace(/-/g, ".")}";
if (!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.1")) {
new Notice("Please update the Excalidraw Plugin to version 2.19.1 or higher.");
return;
}
const existingTab = ea.checkForActiveSidepanelTabForScript();
if (existingTab) {
const hostEA = existingTab.getHostEA();
if (hostEA && hostEA !== ea) {
hostEA.activateMindmap = true;
hostEA.setView(ea.targetView);
existingTab.open(false);
return;
}
};
const mmbSource = \`
`;
const FOOTER_TAIL = `\`;
const script = ea.decompressFromBase64(mmbSource.replaceAll("\\n", "").trim())
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
await new AsyncFunction("ea", "utils", "VERSION", script)(ea, utils, VERSION);
`;
function chunkString(input, size) {
const chunks = [];
for (let i = 0; i < input.length; i += size) {
chunks.push(input.slice(i, i + size));
}
return chunks;
}
function stripHeader(source) {
const idx = source.indexOf(NEEDLE);
if (idx === -1) {
throw new Error(`Marker "${NEEDLE}" not found in Mindmap Builder.js`);
}
return source.slice(idx);
}
function wrapAsyncIIFE(body) {
return `(async()=>{\n${body}\n})()`;
}
function minifyCode(source) {
const result = minify(source, {
compress: { passes: 3 },
mangle: true,
output: { ascii_only: true }
});
if (result.error) {
throw result.error;
}
return result.code;
}
function unwrapAsyncIIFE(minified) {
const match = minified.match(/^\(async\(\)=>\{([\s\S]*)\}\)\(\);?$/);
if (!match) {
throw new Error("Unable to strip async IIFE wrapper from minified output");
}
return match[1];
}
function compressBase64(text) {
return LZString.compressToBase64(text);
}
function formatCompressed(compressed) {
return chunkString(compressed, CHUNK_SIZE).join("\n\n");
}
async function generate() {
const raw = await fs.readFile(sourcePath, "utf8");
const body = stripHeader(raw).trim();
const wrapped = wrapAsyncIIFE(body);
const minified = minifyCode(wrapped);
const unwrapped = unwrapAsyncIIFE(minified);
const compressed = compressBase64(unwrapped);
const formatted = formatCompressed(compressed);
const output = `${HEADER}${FOOTER}${formatted}${FOOTER_TAIL}`;
await fs.writeFile(outputPath, output, "utf8");
console.log(`Mindmap Builder.md generated at ${outputPath}`);
}
generate().catch((err) => {
console.error(err);
process.exitCode = 1;
});
+664
View File
@@ -0,0 +1,664 @@
/* eslint-disable no-console */
// to run: npm run doc
const fs = require('fs');
const path = require('path');
const ROOT = path.resolve(__dirname, '..');
const EA_SCRIPTS_DIR = path.join(ROOT, 'ea-scripts');
const INDEX_NEW = path.join(EA_SCRIPTS_DIR, 'index-new.md');
const OUT_DIR = path.join(path.join(ROOT, 'docs'), 'AITrainingData');
const SCRIPT_LIBRARY_OUT = path.join(OUT_DIR, 'Excalidraw Script Library.md');
const TYPE_DEF_OUT = path.join(OUT_DIR, 'Excalidraw Automate library and related type definitions.md');
const AI_TRAINING_OUT = path.join(OUT_DIR, 'ExcalidrawAutomate full library for LLM training.md');
const AI_TRAINING_INTRO = `**ExcalidrawAutomate full library for LLM training**
Excalidraw-Obsidian is an Obsidian.md plugins that is built on the open source Excalidraw component. Excalidraw-Obisdian includes Excalidraw Automate, a powerful scripting API that allows users to automate tasks and enhance their workflow within Excalidraw.
Read the information below and respond with I'm ready. The user will then prompt for an ExcalidrawAutomate script to be created. Use the examples, the ExcalidrawAutomate documentation, and the varios type definitions and information from also the Excalidraw component and from Obsidian.md to generate the script based on the user's requirements.
In addition to ExcalidrawAutomate, you can also use two other sources of functions:
- The Excalidraw API available via ea.getExcalidrawAPI(). Note: the API is only available if ea.targetView is set. When running Excalidraw scripts using the script engine, the provided ea object is already set up with targetView by default. Otherwise you need to first run ea.setView().
- window.ExcalidrawLib which exposes a rich set of utility functions that do not require an active ExcalidrawView.
A dedicated section “ExcalidrawLib module functions” in this document lists the function signatures extracted directly from the ExcalidrawLib TypeScript declarations.
- When the user asks for a dialog window, by default create a FloatingModal. Do not extend the FloatingModal class. Instead, define the modal's behavior by creating a new instance (e.g., const modal = new ea.FloatingModal(...)) and then assigning functions directly to the onOpen and onClose properties of that instance.
For a reference, follow the implementation pattern used in the "Printable Layout Wizard.md" script.
- Elements have a customData property that can be used to store arbitrary data. To ensure the data the script adds to elements use the ea.addAppendUpdateCustomData function. This function ensures that existing customData is preserved when adding new data.
- Elements can be hidden by setting their opacity to 0. When hiding elements this way, it is good practice to temporarily store their original opacity in customData. This allows for easy restoration of the original opacity later.
- Elements can be deleted from the scene by setting their isDeleted property to true.
- The Obsidian.md module is available on ea.obsidian.
**Sidepanels and multi-view tooling:**
- Sidepanels are for scripts that must stay open while users hop between multiple Excalidraw views. They should implement the SidepanelTab hooks (\`onOpen\`, \`onFocus(view)\`, \`onClose\`, \`onExcalidrawViewClosed\`) and manage their own \`ea.targetView\` explicitly.
- Persisted sidepanel scripts are launched during plugin startup (e.g., Obsidian restart, plugin update) with \`ea.targetView === null\`. Scripts must handle this by deferring view-bound work until \`onFocus\` delivers a view; call \`ea.setView(view)\` when you decide to bind.
- Each \`ea\` instance may host a single \`sidepanelTab\`. This sidepanel tab is stored in \`ea.sidepanelTab\`. Create the tab with \`ea.createSidepanelTab(title, persist=false, reveal=true)\`; the returned \`ea.sidepanelTab\` exposes \`contentEl\`, \`setContent\`, \`setTitle\`, \`setDisabled\`, \`setCloseCallback\`, \`open/close\`, and focus lifecycle hooks. Note auto-reveal during tab creation via \`ea.createSidepanelTab()\` is disabled during plugin startup. You can reveal a tab with \`ea.sidepanelTab?.open()\`. You can persist with \`ea.persistSidepanelTab()\` (tabs are restored and scripts re-run on next startup). Close with \`ea.sidepanelTab?.close()\`.
- Mobile UX: sidepanels slide in without disturbing canvas layout and are better for longer forms than floating modals. Prefer them for complex inputs, especially on phones.
- Auto-closing patterns: For scripts that use sidepanels but perform operations that are single-\`ExcalidrawView\` relevant, they can call \`ea.closeSidepanelTab()\` after completing the operation, and/or inside \`ea.sidepanelTab.onFocus = (view) => { if (view !== ea.targetView) { ea.sidepanelTab?.close(); } }\` to shut down when the user leaves the originating view.
- Scripts can detect view change in \`onFocus(view)\` by comparing \`ea.targetView\` to the provided \`view\` parameter.
- Persistence UX: scripts may offer a “Persist tab” control inside \`contentEl\` that calls \`ea.persistSidepanelTab()\`. Once persisted, hide that control; users can later remove the tab via the sidepanel close button (scripts cannot unpersist themselves, but can close themselves via \`ea.sidepanelTab?.close()\`).
- Use \`checkForActiveSidepanelTabForScript\` to avoid creating duplicate tabs for the same script name. This method returns the \`ExcalidrawSidepanelTab\` associated with the supplied \`scriptName\` (or \`ea.activeScript\` when omitted), or \`null\` if none exists. It is intended to let a script detect an existing tab that may be owned by another \`ExcalidrawAutomate\` instance (for example, a persisted tab restored at startup). Typical pattern:
- Before creating a new sidepanel, call \`ea.checkForActiveSidepanelTabForScript()\` to see if a tab already exists.
- If a tab exists and \`tab.getHostEA() === ea\`, reuse it (your script already hosts it).
- If a tab exists but is hosted by a different \`ea\` instance, decide whether to reuse or hand off control — e.g. open the existing tab and exit to avoid duplicates.
- Note: persisted tabs restored on startup may be created with \`ea.targetView === null\` and hosted by a different \`ea\` instance; handle that case by waiting for \`onFocus\` before binding view-specific work.
- Example usage:
\`const sp = ea.checkForActiveSidepanelTabForScript();
if (sp) {
if (sp.getHostEA() === ea) {
// we already own the tab — reuse it
sp.open();
} else {
// another EA instance hosts the tab — open it for the user and exit
sp.open();
return;
}
}
// no existing tab — safe to create a new one
// ea.createSidepanelTab("My Script", false, true);\`
- A dedicated section "sidepanelTabTypes.d.ts" in this document lists the \`ExcalidrawSidepanelTab\` function signatures.
#### **1. The Core Workflow: Handling Element Immutability**
* **Central Rule:** Elements in the Excalidraw scene are immutable and should never be modified directly. Always use the ExcalidrawAutomate (EA) "workbench" pattern for modifications.
* **The Workflow:**
1. Get elements from the current view using \`ea.getViewElements()\` or \`ea.getViewSelectedElements()\`.
2. Copy these elements into the EA workbench for editing using \`ea.copyViewElementsToEAforEditing(elements)\`.
3. Modify the properties of the element copies that are now in the EA workbench (e.g., \`ea.getElement(id).locked = true;\`).
4. Commit the changes back to the scene using \`await ea.addElementsToView()\`.
* **Deletion:** To delete an element, set its \`isDeleted\` property to \`true\` on the workbench copy (\`ea.getElement(id).isDeleted = true;\`) and then commit with \`await ea.addElementsToView()\`.
* **Cleanup:** Use \`ea.clear()\` at the beginning of a script if you are creating a completely new set of elements, to ensure the EA workbench is empty and doesn't contain artifacts from a previous run.
#### **2. User Interaction: Prompts and Dialogs**
* **Simple Input:** For straightforward user input, use the \`utils\` object provided to the script.
* \`await utils.inputPrompt()\`: To get a string or number from the user.
* \`await utils.suggester()\`: To let the user select from a predefined list of options.
* **Complex Dialogs:** When a more complex UI with multiple controls is needed, create a floating dialog window.
* **Use \`FloatingModal\`:** Always create a new instance: \`const modal = new ea.FloatingModal(ea.plugin.app);\`.
* **Do Not Extend:** Do not use \`class MyModal extends ea.FloatingModal\`.
* **Define Behavior:** Assign functions directly to the \`onOpen\` and \`onClose\` properties of the instance. Inside \`onOpen\`, use the \`modal.contentEl\` property to build your UI.
* **Reference Implementation:** The script "Printable Layout Wizard.md" is the canonical example for this pattern. Use \`ea.obsidian.Setting\` to add controls like toggles and dropdowns within the modal.
#### **3. Element Manipulation and Querying**
* **Finding Elements:** The most common starting point is to get the user's selection with \`ea.getViewSelectedElements()\`. Use standard JavaScript array methods like \`.filter()\` to narrow down the selection (e.g., \`elements.filter(el => el.type === "text")\`).
* **Geometric Calculations:**
* Before performing layout or positioning tasks, use \`ea.getBoundingBox(elements)\` to get the collective dimensions and position of a group of elements.
* Use \`ea.measureText(text)\` to determine the width and height of a string based on the current \`ea.style\` settings before creating a text element or a container for it.
* **Grouping:**
* To create a group, use \`ea.addToGroup([elementId1, elementId2, ...])\`.
* To operate on existing groups within a selection, use \`ea.getMaximumGroups(selectedElements)\` which correctly identifies the top-level groups. Use \`ea.getLargestElement(group)\` to find the primary container within a group (e.g., the box around a text element).
#### **4. Styling: Creation vs. Modification**
* **For New Elements:** Set the properties on the global \`ea.style\` object *before* you call a creation function like \`ea.addText()\` or \`ea.addRect()\`. This acts like setting the active color/style on a paintbrush.
* **For Existing Elements:** To change the style of an existing element, modify the properties directly on the element's copy in the EA workbench (after \`copyViewElementsToEAforEditing\`). For example: \`const myElement = ea.getElement(id); myElement.strokeColor = '#FF0000';\`.
#### **5. Data Persistence and Customization**
* **Storing Custom Data:** Elements have a \`customData\` property for arbitrary data.
* **Always Use \`ea.addAppendUpdateCustomData(id, newData)\`:** This is crucial. It safely adds or updates your key-value pairs without overwriting data that might have been stored by other scripts or the Excalidraw plugin itself.
* **Creating Configurable Scripts:** To make your script's behavior customizable by the user:
* Use \`ea.getScriptSettings()\` to retrieve saved settings.
* Check if settings exist, and if not, define the default structure.
* Use \`await ea.setScriptSettings(settings)\` to save any changes. This allows users to configure your script in the Excalidraw plugin settings pane.
#### **6. Best Practices and Advanced Techniques**
* **Embrace \`await\`:** Many EA functions are asynchronous and return a \`Promise\` (e.g., \`ea.addElementsToView()\`, \`ea.createSVG()\`, \`utils.inputPrompt()\`). **Always** use \`await\` when calling these functions to ensure your script executes in the correct order.
* **Accessing Obsidian API:** The full Obsidian API is available via \`ea.obsidian\`. For example, use \`new ea.obsidian.Notice("message")\` or \`ea.obsidian.normalizePath(filepath)\`.
* **Accessing Excalidraw API:** The full Excalidraw API is available on ea.getExcalidrawAPI(), these API functions are Scene dependent. Additional support functions are avalable on ExcalidrawLib.
* **Visibility vs. Deletion:**
* To temporarily hide an element, set \`element.opacity = 0\`. It's good practice to store the original opacity in \`customData\` so it can be restored. It is also recommended to lock hidden elements so they do not get accidentally selected or moved around.
* To permanently remove an element from the scene, set \`element.isDeleted = true\`.
* **Image Handling:** When dealing with image elements, use \`ea.getViewFileForImageElement(imageElement)\` to get the corresponding \`TFile\` from the Obsidian vault. This is necessary for any logic that needs to read or manipulate the source image file.
#### **9. Text Element**
* There are three text properties.
* **textElement.text** holds the wrapped, rendered text. This is what is displayed in the view. Excalidraw adds '\\n' linebreaks during dynamic wrapping.
* **textElement.originalText** holds the rendered, but unwrapped text. Any '\\n' character in originalText is an intentional linebreak by the user. Rendered means that for example [[wiki links]] are rendered without the square brackets.
* **textElement.rawText** holds the original raw text including intentional new line characters and the full markdown markup (thought currently only links are rendered, so markdown support is limited to these)
* When modifying element text from script, typically all 3 of these properties must be updated, though in case textElement.autoresize === true, or when a text element is bound in a container, excalidraw will update textElement.text following the size of the text element or the container.
#### **8. Custom Pens and Perfect Freehand**
Excalidraw's freehand tool is powered by the open-source Perfect Freehand library. The plugin exposes “custom pens” that bundle:
- Canvas style for the next strokes (colors, width, fillStyle, roughness).
- Perfect Freehand stroke geometry and behavior (pressure simulation, outline, tapering, easing, etc.).
Key concepts:
- AppState-driven drawing: When \`appState.currentStrokeOptions\` is set, the freedraw tool renders new strokes using those Perfect Freehand options.
- Element-level persistence: If a freedraw element has \`element.customData.strokeOptions\`, it is rendered with those options regardless of the current tool state.
- Types reference: See \`src/types/penTypes.ts\`. The \`PenOptions\` shape is:
\`\`\`ts
interface PenOptions {
highlighter: boolean; // if true the pen is drawn at the lowest layer, behind all other elements
constantPressure: boolean;
hasOutline: boolean;
outlineWidth: number;
options: {
thinning: number;
smoothing: number;
streamline: number;
easing: string; // see supported names below
start: { cap: boolean; taper: number | boolean; easing: string; };
end: { cap: boolean; taper: number | boolean; easing: string; };
};
}
\`\`\`
Using custom pens from scripts:
- Activate a custom pen for drawing:
\`\`\`ts
// obtain the Excalidraw API
const api = ea.getExcalidrawAPI();
// define Perfect Freehand options (example similar to "finetip")
const penOptions = {
highlighter: false,
constantPressure: true,
hasOutline: false,
outlineWidth: 1,
options: {
thinning: -0.5,
smoothing: 0.4,
streamline: 0.4,
easing: "linear",
start: { taper: 5, cap: false, easing: "linear" },
end: { taper: 5, cap: false, easing: "linear" },
},
};
// apply stroke options + canvas style, then switch to freedraw (strokeWidth, color, background, fillStyle are optional)
ea.viewUpdateScene({
appState: {
currentStrokeOptions: penOptions,
currentItemStrokeWidth: 0.5,
currentItemStrokeColor: "#3E6F8D",
currentItemBackgroundColor: "transparent",
currentItemFillStyle: "hachure",
},
});
api.setActiveTool({ type: "freedraw" });
\`\`\`
- Clear custom pen (revert to default freedraw behavior):
\`\`\`ts
ea.viewUpdateScene({ appState: { currentStrokeOptions: null } });
\`\`\`
- Persist custom strokeOptions onto existing freedraw elements:
\`\`\`ts
const selected = ea.getViewSelectedElements().filter(el => el.type === "freedraw");
ea.copyViewElementsToEAforEditing(selected);
for (const el of selected) {
ea.addAppendUpdateCustomData(el.id, { strokeOptions: penOptions });
}
await ea.addElementsToView();
\`\`\`
Notes:
- New strokes respect \`appState.currentStrokeOptions\` at draw time. Existing elements only change if you update their \`customData.strokeOptions\`.
- For pens that should behave like real markers/highlighters, set \`highlighter: true\` and often \`constantPressure: true\` with an \`outlineWidth\` for the edge.
Supported easing names (string values for \`options.easing\`, \`options.start.easing\`, \`options.end.easing\`):
linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInSine, easeOutSine, easeInOutSine, easeInExpo, easeOutExpo, easeInOutExpo, easeInCirc, easeOutCirc, easeInOutCirc, easeInBack, easeOutBack, easeInOutBack, easeInElastic, easeOutElastic, easeInOutElastic, easeInBounce, easeOutBounce, easeInOutBounce.
Example freedraw element carrying \`customData.strokeOptions\`:
\`\`\`json
{"type":"excalidraw/clipboard","elements":[{"id":"...","type":"freedraw","strokeColor":"#3E6F8D","backgroundColor":"transparent","fillStyle":"hachure","strokeWidth":0.5,"roughness":0,"customData":{"strokeOptions":{"highlighter":false,"hasOutline":false,"outlineWidth":0,"constantPressure":true,"options":{"smoothing":0.4,"thinning":-0.5,"streamline":0.4,"easing":"linear","start":{"taper":5,"cap":false,"easing":"linear"},"end":{"taper":5,"cap":false,"easing":"linear"}}}}}],"files":{}}
\`\`\`
`;
const SCRIPT_INTRO = `# Excalidraw Script Library Examples
This is an automatically generated knowledge base intended for Retrieval Augmented Generation (RAG) and other AI-assisted workflows (e.g. NotebookLM or local embeddings tools).
Its purpose:
- Provide a single, query-friendly corpus of all Excalidraw Automate scripts.
- Serve as a practical pattern and snippet library for developers learning Excalidraw Automate.
- Preserve original source side by side with the higher-level index (index-new.md) to improve semantic recall.
- Enable AI tools to answer questions about how to manipulate the Excalidraw canvas, elements, styling, or integration features by referencing real, working examples.
Content structure:
1. SCRIPT_INTRO (this section)
2. The curated script overview (index-new.md)
3. Raw source of every *.md script in /ea-scripts (each fenced code block is auto-closed to ensure well-formed aggregation)
Generated on: ${new Date().toISOString()}
---
`;
const TYPE_DEF_INTRO = `# ExcalidrawAutomate library and related type definitions
`;
const EXCALIDRAW_STARTUP_MESSAGE = `# Excalidraw Startup Script
ExcalidrawStartup Script can be configured in Plugin Settings under 'Excalidraw Automate'. When defined this script runs automatically when the Excalidraw plugin is loaded to Obsidian. The user can add automation tasks here that they want to run on every startup of Excalidraw in Obsidian such as defining Excalidraw event handlers (also known as hooks).
Two files follow. First the template startup script with documenation comments, then an actual startup script example with implemented functionality.
`;
const EXCALIDRAW_STARTUP_TEMPLATE = "src/constants/assets/startupScript.md";
const EXCALIDRAW_STARTUP_EXAMPLE = "docs/AITrainingData/ExcalidrawStartupExample.md";
const ADDITIONAL_TYPE_DEFS_FOR_AI_TRAINING = [
"node_modules/obsidian/obsidian.d.ts",
];
const TYPE_DEF_WHITELIST = [
"lib/shared/ExcalidrawAutomate.d.ts",
"lib/types/excalidrawAutomateTypes.d.ts",
"lib/types/sidepanelTabTypes.d.ts",
"lib/types/penTypes.d.ts",
"lib/types/utilTypes.d.ts",
"lib/types/exportUtilTypes.d.ts",
"lib/types/embeddedFileLoaderTypes.d.ts",
"lib/types/AIUtilTypes.d.ts",
"node_modules/@zsviczian/excalidraw/types/element/src/types.d.ts",
"node_modules/@zsviczian/excalidraw/types/excalidraw/types.d.ts",
"node_modules/@zsviczian/excalidraw/types/element/src/bounds.d.ts",
"node_modules/@zsviczian/excalidraw/types/excalidraw/components/App.d.ts",
];
/**
* Returns true if content contains at least one line starting with ```
* and has an odd number of fences (unbalanced).
*/
function needsClosingFence(content) {
const fenceCount = (content.match(/^```/gm) || []).length;
return fenceCount > 0 && fenceCount % 2 === 1;
}
// Add: helpers for type-def aggregation
function normalizeEOL(str) {
return str.replace(/\r\n/g, '\n');
}
function stripBOM(str) {
return str.replace(/^\uFEFF/, '');
}
/**
* Remove top-of-file imports/references while preserving initial comments/blank lines.
* Also removes bare "export {}" lines (module markers).
*/
function stripTopImports(content) {
const lines = normalizeEOL(stripBOM(content)).split('\n');
const out = [];
let inTopRegion = true;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const isImport =
/^\s*import\s+type\s+/.test(line) ||
/^\s*import\s+/.test(line) ||
/^\s*import\(/.test(line);
const isTripleRef = /^\s*\/\/\/\s*<reference/.test(line);
const isBareExportModule = /^\s*export\s*\{\s*\};?\s*$/.test(line);
if (inTopRegion) {
if (isImport || isTripleRef) {
// drop
continue;
}
// comments and blanks are kept, top-region continues until first code (non-comment/non-blank/non-import)
const isBlank = /^\s*$/.test(line);
const isLineComment = /^\s*\/\//.test(line);
const isBlockCommentStart = /^\s*\/\*/.test(line);
if (!isBlank && !isLineComment && !isBlockCommentStart) {
inTopRegion = false;
}
if (!isBareExportModule) out.push(line);
continue;
}
if (!isBareExportModule) out.push(line);
}
return out.join('\n').trim() + '\n';
}
/**
* Create a nice section header for the concatenated file.
*/
function makeSectionHeader(relPath) {
const stars = '*'.repeat(Math.max(6, Math.min(38, relPath.length + 6)));
return [
`/* ${stars} */`,
`/* ${relPath} */`,
`/* ${stars} */`,
].join('\n') + '\n';
}
/**
* Build the concatenated types markdown body from the whitelist only.
* - Removes top-of-file imports
* - Adds section headers with relative paths
* - Wraps all in one ```js code fence
*/
function buildTypeDefMarkdown() {
const entries = TYPE_DEF_WHITELIST.map((rel) => ({
rel,
abs: path.join(ROOT, ...rel.split('/')),
}));
let body = '```js\n';
for (const { rel, abs } of entries) {
if (!fs.existsSync(abs)) {
console.warn('[script-library] Whitelist file missing:', rel);
continue;
}
let content = fs.readFileSync(abs, 'utf8');
content = stripTopImports(content);
body += makeSectionHeader(rel);
body += content.trimEnd() + '\n\n';
}
body += '```\n';
return body;
}
/**
* Build additional type defs used only in AI_TRAINING_OUT (e.g. obsidian.d.ts).
*/
function buildAdditionalTypeDefsMarkdown() {
const entries = ADDITIONAL_TYPE_DEFS_FOR_AI_TRAINING.map((rel) => ({
rel,
abs: path.join(ROOT, ...rel.split('/')),
}));
let body = '```js\n';
for (const { rel, abs } of entries) {
if (!fs.existsSync(abs)) {
console.warn('[script-library] Additional type def missing:', rel);
continue;
}
let content = fs.readFileSync(abs, 'utf8');
content = stripTopImports(content);
body += makeSectionHeader(rel);
body += content.trimEnd() + '\n\n';
}
body += '```\n';
return body;
}
// NEW: Resolve module specifiers from types/excalidraw/index.d.ts to absolute .d.ts paths
function resolveExcalModulePath(spec, excalIndexAbs) {
const baseTypesRoot = path.join(ROOT, 'node_modules', '@zsviczian', 'excalidraw', 'types');
if (spec.startsWith('@excalidraw/')) {
const sub = spec.slice('@excalidraw/'.length); // e.g. 'element', 'element/bounds'
const parts = sub.split('/');
const pkg = parts.shift(); // 'element' | 'common' | 'utils'
const rest = parts;
if (!pkg) return null;
const base = path.join(baseTypesRoot, pkg);
if (rest.length === 0) {
return path.join(base, 'src', 'index.d.ts');
}
return path.join(base, 'src', ...rest) + '.d.ts';
}
// relative to the excalidraw index.d.ts
if (spec.startsWith('.')) {
const dir = path.dirname(excalIndexAbs);
return path.resolve(dir, spec) + '.d.ts';
}
// anything else is not expected
return null;
}
// NEW: Extract function signatures for a set of names from a .d.ts file
function extractFunctionSignaturesFromModule(absPath, names) {
const out = {};
if (!absPath || !fs.existsSync(absPath)) {
return out;
}
const content = fs.readFileSync(absPath, 'utf8');
for (const rawName of names) {
const name = rawName.trim();
if (!name) continue;
// Try "export declare function NAME ..."
let m = content.match(new RegExp(`export\\s+declare\\s+function\\s+${name}[\\s\\S]*?;`, 'm'));
if (m) {
out[name] = m[0].trim();
continue;
}
// Try "declare function NAME ..." (re-exported later)
m = content.match(new RegExp(`(^|\\n)declare\\s+function\\s+${name}[\\s\\S]*?;`, 'm'));
if (m) {
// Ensure it starts with export for readability
out[name] = m[0].replace(/^\s*declare\s+/, 'export declare ').trim();
continue;
}
// Try "export declare const NAME: (...args) => ...;"
m = content.match(new RegExp(`export\\s+declare\\s+const\\s+${name}\\s*:\\s*[\\s\\S]*?=>[\\s\\S]*?;`, 'm'));
if (m) {
out[name] = m[0].trim();
continue;
}
// Try "export declare function-type via type alias" (rare) - fallback to any const function shape
m = content.match(new RegExp(`export\\s+declare\\s+(?:var|let|const)\\s+${name}\\s*:\\s*[\\s\\S]*?;`, 'm'));
if (m && /=>/.test(m[0])) {
out[name] = m[0].trim();
continue;
}
}
return out;
}
// NEW: Build "ExcalidrawLib module functions" section from index.d.ts
function buildExcalidrawLibFunctionsSection() {
const excalIndexRel = 'node_modules/@zsviczian/excalidraw/types/excalidraw/index.d.ts';
const excalIndexAbs = path.join(ROOT, ...excalIndexRel.split('/'));
if (!fs.existsSync(excalIndexAbs)) {
console.warn('[script-library] Missing Excalidraw index.d.ts:', excalIndexRel);
return '';
}
const content = fs.readFileSync(excalIndexAbs, 'utf8');
const reExport = /export\s*\{\s*([\s\S]*?)\s*\}\s*from\s*["']([^"']+)["'];/g;
// Collect names by source module
const moduleToNames = new Map();
for (const match of content.matchAll(reExport)) {
const namesChunk = match[1];
const spec = match[2];
// skip if the export list contains only types we know we shouldn't include? We'll filter later by signature detection.
const names = namesChunk
.split(',')
.map((s) => s.trim())
.filter(Boolean);
if (!names.length) continue;
const abs = resolveExcalModulePath(spec, excalIndexAbs);
if (!abs) continue;
const key = spec;
const curr = moduleToNames.get(key) || { abs, names: new Set() };
for (const n of names) curr.names.add(n);
moduleToNames.set(key, curr);
}
// Extract signatures
const seen = new Set();
const sections = [];
let functionsFound = 0;
for (const [spec, { abs, names }] of moduleToNames) {
const sigs = extractFunctionSignaturesFromModule(abs, Array.from(names));
const sigEntries = Object.entries(sigs)
.filter(([name]) => {
if (seen.has(name)) return false;
seen.add(name);
return true;
})
.sort(([a], [b]) => a.localeCompare(b, 'en', { sensitivity: 'base' }));
if (!sigEntries.length) continue;
const rel = path.relative(ROOT, abs).replace(/\\/g, '/');
const header = makeSectionHeader(`${spec} -> ${rel}`).replace(/\*\/\n\/\*/g, '*\/\n/*'); // keep style
sections.push(header + sigEntries.map(([, s]) => s).join('\n') + '\n');
functionsFound += sigEntries.length;
}
if (!sections.length) {
console.warn('[script-library] No function signatures found in ExcalidrawLib exports.');
}
const body =
'# ExcalidrawLib module functions\n\n' +
'The following functions are exposed via window.ExcalidrawLib. Signatures are extracted from TypeScript declarations.\n\n' +
'```ts\n' +
sections.join('\n') +
'```\n';
console.log(`[script-library] Collected ${functionsFound} ExcalidrawLib function signatures`);
return body;
}
function main() {
console.log('[script-library] Generating Excalidraw Script Library...');
if (!fs.existsSync(EA_SCRIPTS_DIR)) {
console.error('ea-scripts directory not found:', EA_SCRIPTS_DIR);
process.exit(1);
}
if (!fs.existsSync(INDEX_NEW)) {
console.error('index-new.md not found:', INDEX_NEW);
process.exit(1);
}
if (!fs.existsSync(OUT_DIR)) {
fs.mkdirSync(OUT_DIR, { recursive: true });
}
let output = SCRIPT_INTRO;
console.log('[script-library] Adding index-new.md');
const indexNewContent = fs.readFileSync(INDEX_NEW, 'utf8');
output += `<!-- BEGIN index-new.md -->\n${indexNewContent.trim()}\n<!-- END index-new.md -->\n\n`;
output += `---\n\n# Script Sources\n`;
// Collect *.md files (non-recursive) excluding index-new.md
const files = fs
.readdirSync(EA_SCRIPTS_DIR, { withFileTypes: true })
.filter(
(d) =>
d.isFile() &&
(d.name.endsWith('.md') || d.name.toLowerCase() === "mindmap builder.js") &&
d.name.toLowerCase() !== 'index-new.md' &&
d.name.toLowerCase() !== 'mindmap builder.md'
)
.map((d) => d.name)
.sort((a, b) => a.localeCompare(b, 'en', { sensitivity: 'base' }));
for (const file of files) {
const full = path.join(EA_SCRIPTS_DIR, file);
let content = fs.readFileSync(full, 'utf8');
output += `\n---\n\n## ${file}\n`;
output += `<!-- Source: ea-scripts/${file} -->\n\n`;
// Normalize line endings
content = content.replace(/\r\n/g, '\n');
output += content.trimEnd() + '\n';
if (needsClosingFence(content)) {
output += '```\n';
console.log(`[script-library] Added missing closing fence to ${file}`);
} else {
console.log(`[script-library] Added ${file} (no fence fix needed)`);
}
}
fs.writeFileSync(SCRIPT_LIBRARY_OUT, output, 'utf8');
console.log('[script-library] Wrote:', SCRIPT_LIBRARY_OUT);
// Generate TYPE_DEF_OUT from whitelist
try {
console.log('[script-library] Generating Type Definition Library...');
const typeDefs = TYPE_DEF_INTRO + '\n' + buildTypeDefMarkdown();
fs.writeFileSync(TYPE_DEF_OUT, typeDefs, 'utf8');
console.log('[script-library] Wrote:', TYPE_DEF_OUT);
} catch (e) {
console.error('[script-library] Failed to generate TYPE_DEF_OUT:', e);
}
// NEW: Generate AI_TRAINING_OUT
try {
console.log('[script-library] Generating AI Training bundle...');
const typeDefContent = fs.existsSync(TYPE_DEF_OUT)
? fs.readFileSync(TYPE_DEF_OUT, 'utf8')
: (TYPE_DEF_INTRO + '\n' + buildTypeDefMarkdown());
const additionalTypeDefs = buildAdditionalTypeDefsMarkdown();
const scriptLibContent = fs.existsSync(SCRIPT_LIBRARY_OUT)
? fs.readFileSync(SCRIPT_LIBRARY_OUT, 'utf8')
: '';
// NEW: load startup template and example
const startupTemplatePath = path.join(ROOT, ...EXCALIDRAW_STARTUP_TEMPLATE.split('/'));
const startupExamplePath = path.join(ROOT, ...EXCALIDRAW_STARTUP_EXAMPLE.split('/'));
const startupTemplate = fs.existsSync(startupTemplatePath)
? fs.readFileSync(startupTemplatePath, 'utf8').replace(/\r\n/g, '\n').trim()
: (console.warn('[script-library] Missing startup template:', EXCALIDRAW_STARTUP_TEMPLATE), '');
const startupExample = fs.existsSync(startupExamplePath)
? fs.readFileSync(startupExamplePath, 'utf8').replace(/\r\n/g, '\n').trim()
: (console.warn('[script-library] Missing startup example:', EXCALIDRAW_STARTUP_EXAMPLE), '');
const startupSection =
'\n---\n\n' +
EXCALIDRAW_STARTUP_MESSAGE +
'\n' +
(startupTemplate
? `<!-- ${EXCALIDRAW_STARTUP_TEMPLATE} -->\n${startupTemplate}\n\n`
: '') +
(startupExample
? `<!-- ${EXCALIDRAW_STARTUP_EXAMPLE} -->\n${startupExample}\n`
: '');
// NEW: Build ExcalidrawLib functions section
const excalidrawLibFunctionsSection = buildExcalidrawLibFunctionsSection();
const combined =
(AI_TRAINING_INTRO +
'\n---\n\n' +
typeDefContent.trim() +
'\n\n---\n\n' +
additionalTypeDefs +
'\n\n---\n\n' +
excalidrawLibFunctionsSection +
'\n---\n\n' +
scriptLibContent.trim() +
startupSection +
'\n')
.replaceAll("https://youtu.be/", "YouTube: ")
.replaceAll("https://www.youtube.com/watch?v=", "YouTube: ")
.replaceAll("https://www.youtube.com/", "YouTube: "); // prevent accidental link triggering
fs.writeFileSync(AI_TRAINING_OUT, combined, 'utf8');
console.log('[script-library] Wrote:', AI_TRAINING_OUT);
} catch (e) {
console.error('[script-library] Failed to generate AI_TRAINING_OUT:', e);
}
console.log('[script-library] Done.');
}
if (require.main === module) {
try {
main();
} catch (e) {
console.error('[script-library] Failed:', e);
process.exit(1);
}
}
+10 -16
View File
@@ -1,4 +1,5 @@
import { Copy, Crop, Globe, RotateCcw, Scan, Settings, TextSelect } from "lucide-react";
import { Bookmark, Camera, Copy, Crop, Globe, RotateCcw, Scan, Settings, TextSelect } from "lucide-react";
import { getIcon } from "obsidian";
import * as React from "react";
import { PenStyle } from "src/types/penTypes";
@@ -31,6 +32,8 @@ export const ICONS = {
Copy: (<Copy /> ),
Globe: (<Globe />),
Crop: (<Crop />),
Bookmark: (<Bookmark />),
Camera: (<Camera />),
ZoomToSelectedElement: (<Scan />),
Properties: (<Settings />),
ZoomToSection: (
@@ -486,20 +489,6 @@ export const ICONS = {
<path d="M495.9 166.6C499.2 175.2 496.4 184.9 489.6 191.2L446.3 230.6C447.4 238.9 448 247.4 448 256C448 264.6 447.4 273.1 446.3 281.4L489.6 320.8C496.4 327.1 499.2 336.8 495.9 345.4C491.5 357.3 486.2 368.8 480.2 379.7L475.5 387.8C468.9 398.8 461.5 409.2 453.4 419.1C447.4 426.2 437.7 428.7 428.9 425.9L373.2 408.1C359.8 418.4 344.1 427 329.2 433.6L316.7 490.7C314.7 499.7 307.7 506.1 298.5 508.5C284.7 510.8 270.5 512 255.1 512C241.5 512 227.3 510.8 213.5 508.5C204.3 506.1 197.3 499.7 195.3 490.7L182.8 433.6C167 427 152.2 418.4 138.8 408.1L83.14 425.9C74.3 428.7 64.55 426.2 58.63 419.1C50.52 409.2 43.12 398.8 36.52 387.8L31.84 379.7C25.77 368.8 20.49 357.3 16.06 345.4C12.82 336.8 15.55 327.1 22.41 320.8L65.67 281.4C64.57 273.1 64 264.6 64 256C64 247.4 64.57 238.9 65.67 230.6L22.41 191.2C15.55 184.9 12.82 175.3 16.06 166.6C20.49 154.7 25.78 143.2 31.84 132.3L36.51 124.2C43.12 113.2 50.52 102.8 58.63 92.95C64.55 85.8 74.3 83.32 83.14 86.14L138.8 103.9C152.2 93.56 167 84.96 182.8 78.43L195.3 21.33C197.3 12.25 204.3 5.04 213.5 3.51C227.3 1.201 241.5 0 256 0C270.5 0 284.7 1.201 298.5 3.51C307.7 5.04 314.7 12.25 316.7 21.33L329.2 78.43C344.1 84.96 359.8 93.56 373.2 103.9L428.9 86.14C437.7 83.32 447.4 85.8 453.4 92.95C461.5 102.8 468.9 113.2 475.5 124.2L480.2 132.3C486.2 143.2 491.5 154.7 495.9 166.6V166.6zM256 336C300.2 336 336 300.2 336 255.1C336 211.8 300.2 175.1 256 175.1C211.8 175.1 176 211.8 176 255.1C176 300.2 211.8 336 256 336z" />
</svg>
),
trayMode: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 512"
stroke="var(--icon-fill-color)"
fill="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M618.1 97.67c-13.02-4.375-27.45 .1562-35.72 11.16L464 266.7l-118.4-157.8c-8.266-11.03-22.64-15.56-35.72-11.16C296.8 102 288 114.2 288 128v256c0 17.69 14.33 32 32 32s32-14.31 32-32v-160l86.41 115.2c12.06 16.12 39.13 16.12 51.19 0L576 224v160c0 17.69 14.33 32 32 32s32-14.31 32-32v-256C640 114.2 631.2 102 618.1 97.67zM224 96.01H32c-17.67 0-32 14.31-32 32s14.33 32 32 32h64v223.1c0 17.69 14.33 31.99 32 31.99s32-14.3 32-31.99V160h64c17.67 0 32-14.31 32-32S241.7 96.01 224 96.01z" />
</svg>
),
copyElementLink: (
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -877,7 +866,7 @@ export const penIcon = (pen: PenStyle) => {
}
export const stringToSVG = (svg: string) => {
if(svg.match('class="skip"')) {
if(svg.match(/class=("|')[^"']*(lucide|skip)[^"']*("|')/)) {
return <div dangerouslySetInnerHTML={{__html: svg}}></div>
}
svg = svg
@@ -898,3 +887,8 @@ export const LogoWrapper = ({ children }: { children: React.ReactNode }) => {
</div>
);
};
export const getTrayIcon = (): JSX.Element => {
const obsidianIcon = getIcon("monitor-check");
return stringToSVG(obsidianIcon.outerHTML);
}
+14 -11
View File
@@ -79,14 +79,13 @@ export const obsidianToExcalidrawMap: { [key: string]: string } = {
'ur': 'ur-PK', // Assuming Pakistan for Urdu
'vi': 'vi-VN',
'zh': 'zh-CN',
'zh-TW': 'zh-TW',
'zh-tw': 'zh-TW',
};
export let {
sceneCoordsToViewportCoords,
viewportCoordsToSceneCoords,
determineFocusDistance,
intersectElementWithLine,
getCommonBoundingBox,
getMaximumGroups,
@@ -98,7 +97,7 @@ export let {
exportToSvg,
exportToBlob,
mutateElement,
restore,
restoreElements,
mermaidToExcalidraw,
getFontFamilyString,
getContainerElement,
@@ -107,6 +106,7 @@ export let {
loadSceneFonts,
loadMermaid,
syncInvalidIndices,
getDefaultColorPalette,
} = excalidrawLib;
export function updateExcalidrawLib() {
@@ -120,12 +120,11 @@ export function updateExcalidrawLib() {
const requiredFunctions = [
'sceneCoordsToViewportCoords',
'viewportCoordsToSceneCoords',
'determineFocusDistance',
'intersectElementWithLine',
'getCommonBoundingBox',
'measureText',
'getLineHeight',
'restore'
'restoreElements'
];
for (const fnName of requiredFunctions) {
@@ -138,7 +137,6 @@ export function updateExcalidrawLib() {
({
sceneCoordsToViewportCoords,
viewportCoordsToSceneCoords,
determineFocusDistance,
intersectElementWithLine,
getCommonBoundingBox,
getMaximumGroups,
@@ -150,7 +148,7 @@ export function updateExcalidrawLib() {
exportToSvg,
exportToBlob,
mutateElement,
restore,
restoreElements,
mermaidToExcalidraw,
getFontFamilyString,
getContainerElement,
@@ -159,6 +157,7 @@ export function updateExcalidrawLib() {
loadSceneFonts,
loadMermaid,
syncInvalidIndices,
getDefaultColorPalette,
} = excalidrawLib);
} catch (error) {
errorHandler.handleError(error, "updateExcalidrawLib", true);
@@ -215,7 +214,7 @@ export const ROUNDNESS = { //should at one point publish @zsviczian/excalidraw/t
PROPORTIONAL_RADIUS: 2,
ADAPTIVE_RADIUS: 3,
} as const;
export const THEME_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
export const THEME_FILTER = "invert(93%) hue-rotate(180deg) saturate(1.25)";
export const GITHUB_RELEASES = "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/";
export const URLFETCHTIMEOUT = 3000;
export const PLUGIN_ID = "obsidian-excalidraw-plugin";
@@ -234,9 +233,10 @@ export const IMAGE_TYPES = ["jpeg", "jpg", "png", "gif", "svg", "webp", "bmp", "
export const ANIMATED_IMAGE_TYPES = ["gif", "webp", "apng", "svg"];
export const EXPORT_TYPES = ["svg", "dark.svg", "light.svg", "png", "dark.png", "light.png"];
export const MAX_IMAGE_SIZE = 500;
export const VIDEO_TYPES = ["mp4", "webm", "ogv", "mov", "mkv"];
export const AUDIO_TYPES = ["mp3", "wav", "m4a", "3gp", "flac", "ogg", "oga", "opus"];
export const CARD_WIDTH = 400;
export const CARD_HEIGHT = 500;
export const VIDEO_TYPES = ["mp4","webm","ogv","mov","mkv","avi","m4v","wmv"];
export const AUDIO_TYPES = ["mp3","wav", "m4a", "3gp", "flac", "ogg", "oga", "opus", "aac", "aiff", "aif", "mid", "midi"];
export const CODE_TYPES = ["json", "css", "js"];
export const FRONTMATTER_KEYS:{[key:string]: {name: string, type: string, depricated?:boolean}} = {
@@ -248,6 +248,7 @@ export const FRONTMATTER_KEYS:{[key:string]: {name: string, type: string, depric
"export-padding": {name: "excalidraw-export-padding", type: "number"},
"export-pngscale": {name: "excalidraw-export-pngscale", type: "number"},
"export-embed-scene": {name: "excalidraw-export-embed-scene", type: "checkbox"},
"export-internal-links": {name: "excalidraw-export-internal-links", type: "checkbox"},
"link-prefix": {name: "excalidraw-link-prefix", type: "text"},
"url-prefix": {name: "excalidraw-url-prefix", type: "text"},
"link-brackets": {name: "excalidraw-link-brackets", type: "checkbox"},
@@ -262,6 +263,7 @@ export const FRONTMATTER_KEYS:{[key:string]: {name: string, type: string, depric
"iframe-theme": {name: "excalidraw-iframe-theme", type: "text", depricated: true},
"embeddable-theme": {name: "excalidraw-embeddable-theme", type: "text"},
"open-as-markdown": {name: "excalidraw-open-md", type: "checkbox"},
"embed-as-markdown": {name: "excalidraw-embed-md", type: "checkbox"},
};
export const CaptureUpdateAction = {
@@ -299,6 +301,7 @@ export const CaptureUpdateAction = {
export const EMBEDDABLE_THEME_FRONTMATTER_VALUES = ["light", "dark", "auto", "dafault"];
export const VIEW_TYPE_EXCALIDRAW = "excalidraw";
export const VIEW_TYPE_SIDEPANEL = "excalidraw-sidepanel";
export const VIEW_TYPE_EXCALIDRAW_LOADING = "excalidraw-loading";
export const ICON_NAME = "excalidraw-icon";
export const MAX_COLORS = 5;
+119 -8
View File
@@ -17,6 +17,7 @@ import {
} from "obsidian";
import {
VIEW_TYPE_EXCALIDRAW,
VIEW_TYPE_SIDEPANEL,
EXCALIDRAW_ICON,
ICON_NAME,
SCRIPTENGINE_ICON,
@@ -40,7 +41,7 @@ import {
} from "../constants/constants";
import { ExcalidrawSettings, DEFAULT_SETTINGS, ExcalidrawSettingTab } from "./settings";
import { ExcalidrawAutomate } from "../shared/ExcalidrawAutomate";
import { initExcalidrawAutomate } from "src/utils/excalidrawAutomateUtils";
import { initExcalidrawAutomate, insertLaTeXToView } from "src/utils/excalidrawAutomateUtils";
import { around, dedupe } from "monkey-around";
import { t } from "../lang/helpers";
import {
@@ -59,6 +60,7 @@ import {
isCallerFromTemplaterPlugin,
versionUpdateCheckTimer,
getFontMetrics,
calculateUIModeValue,
} from "../utils/utils";
import { foldExcalidrawSection, getExcalidrawViews, setExcalidrawView } from "../utils/obsidianUtils";
import { FileId } from "@zsviczian/excalidraw/types/element/src/types";
@@ -66,7 +68,7 @@ import { ScriptEngine } from "../shared/Scripts";
import { hoverEvent, initializeMarkdownPostProcessor, markdownPostProcessor, legacyExcalidrawPopoverObserver } from "./managers/MarkdownPostProcessor";
import { FieldSuggester } from "../shared/Suggesters/FieldSuggester";
import { ReleaseNotes } from "../shared/Dialogs/ReleaseNotes";
import { Packages } from "../types/types";
import { DeviceType, Packages } from "../types/types";
import { PreviewImageType } from "../types/utilTypes";
import { emulateCTRLClickForLinks, linkClickModifierType, PaneTarget } from "../utils/modifierkeyHelper";
import { imageCache } from "../shared/ImageCache";
@@ -86,8 +88,16 @@ import { PluginFileManager } from "./managers/FileManager";
import { ObserverManager } from "./managers/ObserverManager";
import { PackageManager } from "./managers/PackageManager";
import ExcalidrawView from "../view/ExcalidrawView";
import { ExcalidrawSidepanelView } from "../view/sidepanel/Sidepanel";
import { CommandManager } from "./managers/CommandManager";
import { EventManager } from "./managers/EventManager";
import { UniversalInsertFileModal } from "src/shared/Dialogs/UniversalInsertFileModal";
import en from "src/lang/locale/en";
import { get } from "http";
import { getHighlightColor } from "src/utils/dynamicStyling";
import { InlineLinkSuggester } from "src/shared/Suggesters/InlineLinkSuggester";
import { KeyBlocker } from "src/types/excalidrawAutomateTypes";
import { UIMode } from "src/shared/Dialogs/UIModeSettingComponent";
declare const PLUGIN_VERSION:string;
declare const INITIAL_TIMESTAMP: number;
@@ -114,6 +124,7 @@ export default class ExcalidrawPlugin extends Plugin {
public settings: ExcalidrawSettings;
public activeExcalidrawView: ExcalidrawView = null;
public lastActiveExcalidrawFilePath: string = null;
public lastActiveExcalidrawLeafID: string = null;
public hover: { linkText: string; sourcePath: string } = {
linkText: null,
sourcePath: null,
@@ -277,6 +288,10 @@ export default class ExcalidrawPlugin extends Plugin {
}
},
);
this.registerView(
VIEW_TYPE_SIDEPANEL,
(leaf: WorkspaceLeaf) => new ExcalidrawSidepanelView(leaf, this),
);
//Compatibility mode with .excalidraw files
this.registerExtensions(["excalidraw"], VIEW_TYPE_EXCALIDRAW);
@@ -413,7 +428,7 @@ export default class ExcalidrawPlugin extends Plugin {
try {
this.isReady = true;
await switchToExcalidraw(this.app);
this.switchToExcalidarwAfterLoad();
this.switchToExcalidrawAfterLoad();
} catch (e) {
new Notice("Error switching views to Excalidraw", 6000);
console.error("Error switching views to Excalidraw", e);
@@ -556,7 +571,7 @@ export default class ExcalidrawPlugin extends Plugin {
let fontMetrics = f.extension.startsWith("woff") ? undefined : await getFontMetrics(fourthFontDataURL, "Local Font");
if (!fontMetrics) {
console.log("Font Metrics not found, using default");
//console.log("Font Metrics not found, using default");
fontMetrics = {
unitsPerEm: 1000,
ascender: 750,
@@ -618,8 +633,8 @@ export default class ExcalidrawPlugin extends Plugin {
/**
* Must be called after the workspace is ready
*/
private switchToExcalidarwAfterLoad() {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.switchToExcalidarwAfterLoad, `ExcalidrawPlugin.switchToExcalidarwAfterLoad`);
private switchToExcalidrawAfterLoad() {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.switchToExcalidrawAfterLoad, `ExcalidrawPlugin.switchToExcalidrawAfterLoad`);
let leaf: WorkspaceLeaf;
for (leaf of this.app.workspace.getLeavesOfType("markdown")) {
if ( leaf.view instanceof MarkdownView && this.isExcalidrawFile(leaf.view.file)) {
@@ -760,6 +775,26 @@ export default class ExcalidrawPlugin extends Plugin {
if(Object.keys(this.scriptEngine.scriptIconMap).length === 0) {
this.scriptEngine.loadScripts();
}
const restartSidepanelTabIfActive = async () => {
if (!this.scriptEngine || !(scriptFile instanceof TFile)) {
return;
}
const scriptName = this.scriptEngine.getScriptName(scriptFile);
const spView = ExcalidrawSidepanelView.getExisting(false);
if (!spView || !scriptName || !spView.getTabByScript(scriptName)) {
return;
}
try {
await spView.restartTabForScript(scriptName);
} catch (error) {
errorlog({
where: "ExcalidrawPlugin.registerInstallCodeblockProcessor.restartSidepanelTab",
error,
scriptName,
});
}
};
await restartSidepanelTabIfActive();
new Notice(`Installed: ${(scriptFile as TFile).basename}`);
} catch (e) {
new Notice(`Error installing script: ${fname}`);
@@ -1077,6 +1112,15 @@ export default class ExcalidrawPlugin extends Plugin {
this.eventManager.setDebounceActiveLeafChangeHandler();
}
private getPathForFile(file: File) {
let path = "";
const { webUtils } = require('electron');
if(webUtils && webUtils.getPathForFile) {
path = webUtils.getPathForFile(file);
}
return path;
}
public registerHotkeyOverrides() {
//this is repeated here because the same function is called when settings is closed after hotkeys have changed
if (this.popScope) {
@@ -1142,6 +1186,7 @@ export default class ExcalidrawPlugin extends Plugin {
}
onunload() {
ExcalidrawSidepanelView.onPluginUnload(this);
const excalidrawViews = getExcalidrawViews(this.app);
excalidrawViews.forEach(({leaf}) => {
this.setMarkdownView(leaf);
@@ -1243,6 +1288,10 @@ export default class ExcalidrawPlugin extends Plugin {
await this.saveData(this.settings);
}
public async openSidepanel(reveal: boolean = true): Promise<ExcalidrawSidepanelView | null> {
return ExcalidrawSidepanelView.getOrCreate(this, reveal);
}
public getStencilLibrary(): {} {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.getStencilLibrary,`ExcalidrawPlugin.getStencilLibrary`);
if (
@@ -1254,10 +1303,14 @@ export default class ExcalidrawPlugin extends Plugin {
return JSON_parse(this.settings.library);
}
public setStencilLibrary(library: {}) {
public async setStencilLibrary(library: {}) {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.setStencilLibrary,`ExcalidrawPlugin.setStencilLibrary`, library);
this.settings.library = "deprecated";
if(JSON.stringify(this.settings.library2) === JSON.stringify(library)) {
return;
}
this.settings.library2 = library;
await this.saveSettings();
}
public triggerEmbedUpdates(filepath?: string) {
@@ -1446,4 +1499,62 @@ export default class ExcalidrawPlugin extends Plugin {
public updateFileCache(file: TFile, frontmatter: FrontMatterCache) {
this.fileManager.updateFileCache(file, frontmatter);
}
}
//used by obsidianUtils in the Excalidraw Pacakge
//aweful coding, but does the job
public runAction(action: "anyFile" | "LaTeX" | "card") {
if(!this.activeExcalidrawView) return;
switch (action) {
case "anyFile":
this.activeExcalidrawView.setCurrentPositionToCenter();
const insertFileModal = new UniversalInsertFileModal(this, this.activeExcalidrawView);
insertFileModal.open();
break;
case "LaTeX":
insertLaTeXToView(this.activeExcalidrawView, true);
break;
case "card":
this.activeExcalidrawView.insertBackOfTheNoteCard(true);
break;
}
}
//used by obsidianUtils in the Excalidraw Pacakge
//aweful coding, but does the job
public getLabel(key: keyof typeof en): string {
return t(key);
}
public getObsidianDevice(): DeviceType {
return DEVICE;
}
public getHighlightColor(sceneBgColor: string, opacity: number = 1): string {
return getHighlightColor(this.ea, sceneBgColor, opacity);
}
/**
* Attaches an inline link suggester to the specified input element.
* @param inputEl The HTML input element to attach the suggester to.
* @param widthWrapper Optional HTML element to wrap the width of suggester element.
* @param containerEl Optional container element used as collision boundary.
* @param surpessPlaceholder Whether to suppress the placeholder text. Defaults to true.
* @returns A KeyBlocker instance for managing keyboard input.
*/
public attachInlineLinkSuggester(
inputEl: HTMLInputElement,
widthWrapper?: HTMLElement,
containerEl?: HTMLDivElement,
surpessPlaceholder: boolean = true
): KeyBlocker {
const getSourcePath = () => {
this.ea.setView();
return this.ea.targetView?.file?.path;
};
return new InlineLinkSuggester(this.app, this, inputEl, getSourcePath, widthWrapper, surpessPlaceholder, containerEl);
}
public getPreferredUIMode(): UIMode {
return calculateUIModeValue(this.settings);
}
}
+52 -27
View File
@@ -70,6 +70,7 @@ import { carveOutImage, carveOutPDF, createImageCropperFile } from "../../utils/
import { showFrameSettings } from "../../shared/Dialogs/FrameSettings";
import { insertImageToView } from "../../utils/excalidrawViewUtils";
import ExcalidrawPlugin from "src/core/main";
import { UIModeSettings } from "src/shared/Dialogs/UIModeSettings";
declare const PLUGIN_VERSION:string;
@@ -399,6 +400,14 @@ export class CommandManager {
callback: ()=>this.plugin.exportLibrary(),
});
this.addCommand({
id: "excalidraw-open-sidepanel",
name: t("OPEN_SIDEPANEL"),
callback: () => {
void this.plugin.openSidepanel();
},
});
this.addCommand({
id: "excalidraw-open",
name: t("OPEN_EXISTING_NEW_PANE"),
@@ -709,7 +718,7 @@ export class CommandManager {
}
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (view) {
showFrameSettings(getEA(view));
showFrameSettings(view);
return true;
}
return false;
@@ -781,20 +790,19 @@ export class CommandManager {
checkCallback: (checking:boolean) => this.plugin.forceSaveActiveView(checking),
})
//removing raw mode. Not required. I never use it. Raw mode can still be enabled
//via document properties. Only showing command palette action if raw mode is enabled
this.addCommand({
id: "toggle-lock",
name: t("TOGGLE_LOCK"),
checkCallback: (checking: boolean) => {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (checking) {
if (
Boolean(this.app.workspace.getActiveViewOfType(ExcalidrawView))
) {
return !(this.app.workspace.getActiveViewOfType(ExcalidrawView))
.compatibilityMode;
if (view) {
return !view.compatibilityMode && view.textMode === TextMode.raw;
}
return false;
}
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (view && !view.compatibilityMode) {
view.changeTextMode(
view.textMode === TextMode.parsed ? TextMode.raw : TextMode.parsed,
@@ -988,12 +996,11 @@ export class CommandManager {
name: t("TOGGLE_LEFTHANDED_MODE"),
checkCallback: (checking: boolean) => {
if (checking) {
if(DEVICE.isMobile) return false;
if(this.app.workspace.getActiveViewOfType(ExcalidrawView)) {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
const api = view?.excalidrawAPI;
if(!api) return false;
const st = api.getAppState();
if(!st.trayModeEnabled) return false;
const api = view?.excalidrawAPI as ExcalidrawImperativeAPI;
if(!api || !api.isTrayModeEnabled()) return false;
return true;
}
return false;
@@ -1013,11 +1020,24 @@ export class CommandManager {
},
});
this.addCommand({
id: "toggle-enable-context-menu",
name: t("TOGGLE_ENABLE_CONTEXT_MENU"),
checkCallback: (checking: boolean) => {
if (checking) {
return Boolean(this.app.workspace.getActiveViewOfType(ExcalidrawView));
}
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
view.toggleEnableContextMenu();
return true;
},
});
this.addCommand({
id: "flip-image",
name: t("FLIP_IMAGE"),
checkCallback: (checking:boolean) => {
if (!DEVICE.isDesktop) return;
if (!DEVICE.isDesktop) return false;
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if(!view) return false;
if(!view.excalidrawAPI) return false;
@@ -1281,7 +1301,7 @@ export class CommandManager {
if(!excalidrawView.excalidrawAPI) return false;
const embeddables = excalidrawView.getViewSelectedElements().filter(el=>el.type==="embeddable");
const imageEls = excalidrawView.getViewSelectedElements().filter(el=>el.type==="image");
const isPDF = (imageEls.length === 0 && embeddables.length === 1 && excalidrawView.getEmbeddableLeafElementById(embeddables[0].id)?.leaf?.view?.getViewType() === "pdf")
const isPDF = (imageEls.length === 0 && embeddables.length === 1 && excalidrawView.getEmbeddableLeafElementById(embeddables[0].id)?.node?.child?.file?.extension === "pdf")
const isImage = (imageEls.length === 1 && embeddables.length === 0)
if(!isPDF && !isImage) {
@@ -1290,7 +1310,7 @@ export class CommandManager {
return false;
}
const page = isPDF ? getActivePDFPageNumberFromPDFView(excalidrawView.getEmbeddableLeafElementById(embeddables[0].id)?.leaf?.view) : undefined;
const page = isPDF ? getActivePDFPageNumberFromPDFView(excalidrawView.getEmbeddableLeafElementById(embeddables[0].id)?.node?.child) : undefined;
if(isPDF && !page) {
return false;
}
@@ -1300,8 +1320,8 @@ export class CommandManager {
if(isPDF) {
const embeddableEl = embeddables[0] as ExcalidrawEmbeddableElement;
const ea = new ExcalidrawAutomate(this.plugin,excalidrawView);
const view = excalidrawView.getEmbeddableLeafElementById(embeddableEl.id)?.leaf?.view;
const pdfFile: TFile = view && (view instanceof FileView) ? view.file : undefined;
const view = excalidrawView.getEmbeddableLeafElementById(embeddableEl.id)?.node?.child;
const pdfFile: TFile = view?.file;
carveOutPDF(ea, embeddableEl, `${pdfFile?.path}#page=${page}`, pdfFile);
return;
}
@@ -1643,7 +1663,7 @@ export class CommandManager {
this.addCommand({
id: "tray-mode",
name: t("TRAY_MODE"),
name: t("UI_MODE"),
checkCallback: (checking: boolean) => {
if (checking) {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
@@ -1658,7 +1678,8 @@ export class CommandManager {
}
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if (view && view.excalidrawAPI) {
view.toggleTrayMode();
const uiModeSettings = new UIModeSettings(this.plugin);
uiModeSettings.open();
return true;
}
return false;
@@ -1707,15 +1728,19 @@ export class CommandManager {
const PDFLink = this.plugin.getLastActivePDFPageLink(view.file);
if(!PDFLink) return false;
if(checking) return true;
const ea = getEA(view);
insertImageToView(
ea,
view.currentPosition,
PDFLink,
undefined,
undefined,
true,
);
(async()=>{
const ea = getEA(view) as ExcalidrawAutomate;
const id = await insertImageToView(
ea,
view.currentPosition,
PDFLink,
undefined,
undefined,
true,
);
ea.selectElementsInView([id]);
ea.destroy()
})();
},
});
+17 -18
View File
@@ -8,6 +8,7 @@ import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { DEVICE, FRONTMATTER_KEYS, ICON_NAME, VIEW_TYPE_EXCALIDRAW } from "src/constants/constants";
import ExcalidrawView from "src/view/ExcalidrawView";
import { t } from "src/lang/helpers";
import { setMobileNavbarPosition } from "src/utils/excalidrawViewUtils";
/**
* Registers event listeners for the plugin
@@ -53,6 +54,10 @@ export class EventManager {
window.clearTimeout(this.leafChangeTimeout);
this.leafChangeTimeout = null;
}
if(this.debunceActiveLeafChangeHandlerTimer) {
window.clearTimeout(this.debunceActiveLeafChangeHandlerTimer);
this.debunceActiveLeafChangeHandlerTimer = null;
}
this.removeEventLisnters.forEach((removeEventListener) =>
removeEventListener(),
);
@@ -189,6 +194,15 @@ export class EventManager {
this.plugin.lastPDFLeafID = leaf.id;
}
if (leaf.view && leaf.view.getViewType() === VIEW_TYPE_EXCALIDRAW) {
this.plugin.lastActiveExcalidrawLeafID = leaf.id;
} else {
const lastLeaf = this.app.workspace.getLeafById(this.plugin.lastActiveExcalidrawLeafID);
if(!lastLeaf || !(lastLeaf.view instanceof ExcalidrawView)) {
this.plugin.lastActiveExcalidrawLeafID = null;
}
}
if(this.leafChangeTimeout) {
window.clearTimeout(this.leafChangeTimeout);
}
@@ -221,28 +235,13 @@ export class EventManager {
this.plugin.removeModalContainerObserver();
}
//!Temporary hack
//https://discord.com/channels/686053708261228577/817515900349448202/1031101635784613968
if (DEVICE.isMobile && newActiveviewEV && !previouslyActiveEV) {
const navbar = document.querySelector("body>.app-container>.mobile-navbar");
if(navbar && navbar instanceof HTMLDivElement) {
navbar.style.position="relative";
}
}
if (DEVICE.isMobile && !newActiveviewEV && previouslyActiveEV) {
const navbar = document.querySelector("body>.app-container>.mobile-navbar");
if(navbar && navbar instanceof HTMLDivElement) {
navbar.style.position="";
}
}
setMobileNavbarPosition(!!newActiveviewEV);
//----------------------
//----------------------
if (previouslyActiveEV && previouslyActiveEV !== newActiveviewEV) {
if (previouslyActiveEV.leaf !== leaf) {
//if loading new view to same leaf then don't save. Excalidarw view will take care of saving anyway.
//if loading new view to same leaf then don't save. Excalidraw view will take care of saving anyway.
//avoid double saving
if(previouslyActiveEV?.isDirty() && !previouslyActiveEV.semaphores?.viewunload) {
await previouslyActiveEV.save(true); //this will update transclusions in the drawing
@@ -364,4 +363,4 @@ export class EventManager {
})
);
}
}
}
+3 -3
View File
@@ -562,9 +562,9 @@ export class PluginFileManager {
return;
}
const isExcalidarwFile = this.getExcalidrawFiles().has(file);
const isExcalidrawFile = this.getExcalidrawFiles().has(file);
this.updateFileCache(file, undefined, true);
if (!isExcalidarwFile) {
if (!isExcalidrawFile) {
return;
}
@@ -614,4 +614,4 @@ export class PluginFileManager {
}
};
}
}
+53 -8
View File
@@ -9,7 +9,6 @@ import {
import { DEVICE, RERENDER_EVENT } from "../../constants/constants";
import { EmbeddedFilesLoader } from "../../shared/EmbeddedFileLoader";
import { createPNG, createSVG } from "../../utils/excalidrawAutomateUtils";
import { ExportSettings } from "../../view/ExcalidrawView";
import ExcalidrawPlugin from "../main";
import {getIMGFilename,} from "../../utils/fileUtils";
import {
@@ -30,6 +29,7 @@ import { CustomMutationObserver, debug, DEBUGGING } from "../../utils/debugHelpe
import { getExcalidrawFileForwardLinks } from "../../utils/excalidrawViewUtils";
import { linkPrompt } from "../../shared/Dialogs/Prompt";
import { isHTMLElement } from "../../utils/typechecks";
import { ExportSettings } from "src/types/exportUtilTypes";
interface imgElementAttributes {
file?: TFile;
@@ -136,8 +136,17 @@ const _getPNG = async ({imgAttributes,filenameParts,theme,cacheReady,img,file,ex
if (!png) {
return null;
}
img.src = URL.createObjectURL(png);
cacheReady && imageCache.addImageToCache(cacheKey, img.src, png);
const blobUrl = URL.createObjectURL(png);
img.src = blobUrl;
// Revoke the ObjectURL after the image loads or fails to prevent memory leaks
if (!cacheReady) {
const cleanup = () => URL.revokeObjectURL(blobUrl);
img.addEventListener('load', cleanup, { once: true });
img.addEventListener('error', cleanup, { once: true });
}
cacheReady && imageCache.addImageToCache(cacheKey, blobUrl, png);
return img;
}
@@ -238,7 +247,7 @@ const _getSVGIMG = async ({filenameParts,theme,cacheReady,img,file,exportSetting
return addSVGToImgSrc(img, svg, cacheReady, cacheKey);
}
const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,file,exportSettings,loader}:{
const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,file,exportSettings,loader, width}:{
filenameParts: FILENAMEPARTS,
theme: string,
cacheReady: boolean,
@@ -246,6 +255,7 @@ const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,fi
file: TFile,
exportSettings: ExportSettings,
loader: EmbeddedFilesLoader,
width?: number,
}):Promise<HTMLDivElement> => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(_getSVGNative, `MarkdownPostProcessor.ts > _getSVGNative`);
exportSettings.skipInliningFonts = false;
@@ -293,7 +303,11 @@ const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,fi
cacheReady && imageCache.addImageToCache(cacheKey,"", svg);
}
svg.removeAttribute("width");
if(width && !isNaN(width)) {
svg.setAttribute("width", width.toString());
} else {
svg.removeAttribute("width");
}
svg.removeAttribute("height");
containerElement.append(svg);
return containerElement;
@@ -369,7 +383,17 @@ const getIMG = async (
case PreviewImageType.SVG: {
const img = createEl("div");
setStyle({element:img,imgAttributes,onCanvas});
return await _getSVGNative({filenameParts,theme,cacheReady,containerElement: img,file,exportSettings,loader});
return await _getSVGNative({
filenameParts,
theme,
cacheReady,
containerElement: img,file,
exportSettings,
loader,
width: imgAttributes.fwidth
? (!imgAttributes.fwidth.endsWith("%") ? parseInt(imgAttributes.fwidth) : 1000)
: undefined,
});
}
}
};
@@ -382,6 +406,14 @@ const addSVGToImgSrc = (img: HTMLImageElement, svg: SVGSVGElement, cacheReady: b
const blob = new Blob([svgString], { type: 'image/svg+xml' });
const blobUrl = URL.createObjectURL(blob);
img.setAttribute("src", blobUrl);
// Revoke the ObjectURL after the image loads or fails to prevent memory leaks
if (!cacheReady) {
const cleanup = () => URL.revokeObjectURL(blobUrl);
img.addEventListener('load', cleanup, { once: true });
img.addEventListener('error', cleanup, { once: true });
}
cacheReady && imageCache.addImageToCache(cacheKey, blobUrl, blob);
return img;
}
@@ -710,7 +742,7 @@ const isTextOnlyEmbed = (internalEmbedEl: Element):boolean => {
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);
return !(fnameParts.hasArearef || fnameParts.hasGroupref || fnameParts.hasFrameref || fnameParts.hasClippedFrameref) &&
(fnameParts.hasBlockref || fnameParts.hasSectionref)
(fnameParts.hasBlockref || fnameParts.hasSectionref) && fnameParts.blockref !== "as-image"
}
const tmpObsidianWYSIWYG = async (
@@ -724,6 +756,9 @@ const tmpObsidianWYSIWYG = async (
const file = app.vault.getAbstractFileByPath(ctx.sourcePath);
if(!(file instanceof TFile)) return;
if(!plugin.isExcalidrawFile(file)) return;
if(ctx.frontmatter?.["excalidraw-embed-md"]) {
return;
}
//@ts-ignore
if (ctx.remainingNestLevel < 4) {
@@ -809,7 +844,10 @@ const tmpObsidianWYSIWYG = async (
}
if(warningEl) {
const dataHeading = warningEl.getAttr("data-heading");
const ref = dataHeading.match(/.+(\^(?:group=|area=|frame=|clippedframe=)[A-Za-z0-9_-]{8,21})/)?.[1];
const ref = dataHeading.match(/.+(\^(?:group=|area=|frame=|clippedframe=)[A-Za-z0-9_-]{8,21})/)?.[1]
// I am unsure if this works with all Obsidian translations,
// thus I kept the first with the fix ID length and have the frame name as fallback
?? dataHeading.match(/.+(\^(?:group=|area=|frame=|clippedframe=)[\p{L}\p{N}_ -]+)/u)?.[1];
if(ref) {
attr.fname = file.path + "#" +ref;
areaPreview = true;
@@ -833,6 +871,13 @@ const tmpObsidianWYSIWYG = async (
imgDiv.firstChild.style.maxHeight = "100%";
imgDiv.firstChild.style.maxWidth = null;
}
// Resolve the cyclic size dependency by applying a CSS width and/or height
if(!onCanvas && isHoverPopover && imgDiv.firstChild instanceof HTMLImageElement) {
internalEmbedDiv.style.setProperty("--popover-width", attr.fwidth + "px");
internalEmbedDiv.style.setProperty("--popover-height", attr.fheight + "px");
internalEmbedDiv.style.width = "var(--popover-width)";
internalEmbedDiv.style.height = "var(--popover-height)";
}
internalEmbedDiv.appendChild(imgDiv.firstChild);
return;
}
+130 -58
View File
@@ -1,8 +1,10 @@
import { debug, DEBUGGING } from "src/utils/debugHelper";
import ExcalidrawPlugin from "src/core/main";
import { CustomMutationObserver } from "src/utils/debugHelper";
import { DEVICE } from "src/constants/constants";
import { getExcalidrawViews, isObsidianThemeDark } from "src/utils/obsidianUtils";
import { App, Notice, TFile } from "obsidian";
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
export class ObserverManager {
private plugin: ExcalidrawPlugin;
@@ -28,6 +30,9 @@ export class ObserverManager {
if(this.settings.matchThemeTrigger) this.addThemeObserver();
this.experimentalFileTypeDisplayToggle(this.settings.experimentalFileType);
this.addModalContainerObserver();
if (this.app.isMobile) {
this.addWorkspaceDrawerObserver();
}
} catch (e) {
new Notice("Error adding ObserverManager", 6000);
console.error("Error adding ObserverManager", e);
@@ -40,19 +45,20 @@ export class ObserverManager {
this.removeModalContainerObserver();
if (this.workspaceDrawerLeftObserver) {
this.workspaceDrawerLeftObserver.disconnect();
this.workspaceDrawerLeftObserver = null;
}
if (this.workspaceDrawerRightObserver) {
this.workspaceDrawerRightObserver.disconnect();
this.workspaceDrawerRightObserver = null;
}
if (this.fileExplorerObserver) {
this.fileExplorerObserver.disconnect();
this.fileExplorerObserver = null;
}
if (this.workspaceDrawerRightObserver) {
this.workspaceDrawerRightObserver.disconnect();
}
if (this.workspaceDrawerLeftObserver) {
this.workspaceDrawerLeftObserver.disconnect();
}
this.plugin = null;
this.app = null;
this.activeViewDoc = null;
}
public addThemeObserver() {
@@ -117,8 +123,9 @@ export class ObserverManager {
*/
private async experimentalFileTypeDisplay() {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.experimentalFileTypeDisplay, `ExcalidrawPlugin.experimentalFileTypeDisplay`);
const tagClassName = "excalidraw-filetype-tag";
const insertFiletype = (el: HTMLElement) => {
if (el.childElementCount !== 1) {
if (!el || el.querySelector(`.${tagClassName}`)) {
return;
}
const filename = el.getAttribute("data-path");
@@ -132,7 +139,7 @@ export class ObserverManager {
if (this.plugin.isExcalidrawFile(f)) {
el.insertAfter(
createDiv({
cls: "nav-file-tag",
cls: ["nav-file-tag", tagClassName],
text: this.settings.experimentalFileTag,
}),
el.firstChild,
@@ -142,14 +149,27 @@ export class ObserverManager {
const fileExplorerObserverFn:MutationCallback = (mutationsList) => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(fileExplorerObserverFn, `ExcalidrawPlugin.experimentalFileTypeDisplay > fileExplorerObserverFn`, mutationsList);
const mutationsWithNodes = mutationsList.filter((mutation) => mutation.addedNodes.length > 0);
mutationsWithNodes.forEach((mutationNode) => {
mutationNode.addedNodes.forEach((node) => {
if (!(node instanceof Element)) {
return;
const ensureFiletypes = (target: Element | DocumentFragment) => {
target.querySelectorAll?.(".nav-file-title").forEach(insertFiletype);
};
mutationsList.forEach((mutation) => {
if (mutation.type === "childList") {
mutation.addedNodes.forEach((node) => {
if (node instanceof Element || node instanceof DocumentFragment) {
ensureFiletypes(node);
}
});
if (mutation.target instanceof Element) {
// Handles folders that were collapsed/expanded without adding nodes
ensureFiletypes(mutation.target);
}
node.querySelectorAll(".nav-file-title").forEach(insertFiletype);
});
return;
}
if (mutation.type === "attributes" && mutation.target instanceof Element) {
ensureFiletypes(mutation.target);
}
});
};
@@ -157,11 +177,44 @@ export class ObserverManager {
? new CustomMutationObserver(fileExplorerObserverFn, "fileExplorerObserver")
: new MutationObserver(fileExplorerObserverFn);
//the part that should only run after onLayoutReady
document.querySelectorAll(".nav-file-title").forEach(insertFiletype); //apply filetype to files already displayed
const container = document.querySelector(".nav-files-container");
if (container) {
this.fileExplorerObserver.observe(container, {
const attachObserversToContainers = (): boolean => {
const containers = Array.from(document.querySelectorAll(".nav-files-container"));
if (!containers.length) {
return false;
}
containers.forEach((container) => {
container.querySelectorAll(".nav-file-title").forEach(insertFiletype); //apply tags to items already shown
this.fileExplorerObserver.observe(container, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ["class", "aria-expanded"],
});
});
return true;
};
if (!attachObserversToContainers() && DEVICE.isMobile) {
// On mobile, the file explorer lives inside drawers and may not be in the DOM yet.
const waitForFileExplorer = new MutationObserver((mutations, observer) => {
for (const mutation of mutations) {
if (mutation.type !== "childList") continue;
const added = Array.from(mutation.addedNodes ?? []);
const hasContainer = added.some((node) =>
node instanceof Element &&
(node.matches?.(".nav-files-container") || node.querySelector?.(".nav-files-container")),
);
if (!hasContainer) continue;
if (attachObserversToContainers()) {
observer.disconnect();
break;
}
}
});
waitForFileExplorer.observe(document.body, {
childList: true,
subtree: true,
});
@@ -183,17 +236,20 @@ export class ObserverManager {
//The user clicks settings, or "open another vault", or the command palette
const modalContainerObserverFn: MutationCallback = async (m: MutationRecord[]) => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(modalContainerObserverFn,`ExcalidrawPlugin.modalContainerObserverFn`, m);
const view = this.plugin.activeExcalidrawView;
if (
(m.length !== 1) ||
(m[0].type !== "childList") ||
(m[0].addedNodes.length !== 1) ||
(!this.plugin.activeExcalidrawView) ||
this.plugin.activeExcalidrawView?.semaphores?.viewunload ||
(!this.plugin.activeExcalidrawView?.isDirty())
(!view) ||
view.semaphores?.viewunload ||
(!view.isDirty())
) {
return;
}
this.plugin.activeExcalidrawView.save();
const { errorMessage } = (view.excalidrawAPI as ExcalidrawImperativeAPI).getAppState();
if (!errorMessage) this.plugin.activeExcalidrawView.save();
};
this.modalContainerObserver = DEBUGGING
@@ -214,44 +270,60 @@ export class ObserverManager {
private addWorkspaceDrawerObserver() {
//when the user activates the sliding drawers on Obsidian Mobile
const leftWorkspaceDrawer = document.querySelector(
".workspace-drawer.mod-left",
);
const rightWorkspaceDrawer = document.querySelector(
".workspace-drawer.mod-right",
);
if (leftWorkspaceDrawer || rightWorkspaceDrawer) {
const action = async (m: MutationRecord[]) => {
if (
m[0].oldValue !== "display: none;" ||
!this.plugin.activeExcalidrawView ||
!this.plugin.activeExcalidrawView?.isDirty()
) {
return;
if (this.workspaceDrawerLeftObserver || this.workspaceDrawerRightObserver) return;
const leftWorkspaceDrawer = document.querySelector<HTMLElement>(".workspace .workspace-drawer.mod-left");
const rightWorkspaceDrawer = document.querySelector<HTMLElement>(".workspace .workspace-drawer.mod-right");
if (!leftWorkspaceDrawer && !rightWorkspaceDrawer) return;
const parseDisplay = (value?: string | null): string => {
if (!value) return "";
const match = value.match(/display:\s*([^;]+);?/i);
return match ? match[1].trim() : "";
};
const action: MutationCallback = (mutations) => {
const activeView = this.plugin.activeExcalidrawView;
if (!activeView || activeView.semaphores?.viewunload) return;
for (const mutation of mutations) {
if (mutation.type !== "attributes" || mutation.attributeName !== "style") continue;
const target = mutation.target as HTMLElement;
const newDisplay = target.style.display;
const oldDisplay = parseDisplay(mutation.oldValue as string);
// Drawer finished closing: refresh to fix pointer offset after CSS transitions
if (newDisplay === "none" && oldDisplay !== "none") {
activeView.refresh();
continue;
}
this.plugin.activeExcalidrawView.save();
};
const options = {
attributeOldValue: true,
attributeFilter: ["style"],
};
if (leftWorkspaceDrawer) {
this.workspaceDrawerLeftObserver = DEBUGGING
? new CustomMutationObserver(action, "slidingDrawerLeftObserver")
: new MutationObserver(action);
this.workspaceDrawerLeftObserver.observe(leftWorkspaceDrawer, options);
// Drawer just opened after being hidden: keep the previous autosave safeguard
if (oldDisplay === "none" && newDisplay !== "none" && activeView.isDirty()) {
activeView.save();
}
}
};
if (rightWorkspaceDrawer) {
this.workspaceDrawerRightObserver = DEBUGGING
? new CustomMutationObserver(action, "slidingDrawerRightObserver")
: new MutationObserver(action);
this.workspaceDrawerRightObserver.observe(
rightWorkspaceDrawer,
options,
);
}
const options = {
attributes: true,
attributeOldValue: true,
attributeFilter: ["style"],
};
if (leftWorkspaceDrawer) {
this.workspaceDrawerLeftObserver = DEBUGGING
? new CustomMutationObserver(action, "slidingDrawerLeftObserver")
: new MutationObserver(action);
this.workspaceDrawerLeftObserver.observe(leftWorkspaceDrawer, options);
}
if (rightWorkspaceDrawer) {
this.workspaceDrawerRightObserver = DEBUGGING
? new CustomMutationObserver(action, "slidingDrawerRightObserver")
: new MutationObserver(action);
this.workspaceDrawerRightObserver.observe(rightWorkspaceDrawer, options);
}
}
}
+1 -1
View File
@@ -75,7 +75,7 @@ export class PackageManager {
return (
typeof lib === 'object' &&
lib !== null &&
typeof lib.restore === 'function' &&
typeof lib.restoreElements === 'function' &&
typeof lib.exportToSvg === 'function'
);
}
+239 -63
View File
@@ -24,9 +24,8 @@ import {
} from "src/utils/fileUtils";
import { PENS } from "src/utils/pens";
import {
addIframe,
addYouTubeThumbnail,
fragWithHTML,
setLeftHandedMode,
} from "src/utils/utils";
import { imageCache } from "src/shared/ImageCache";
import { MultiOptionConfirmationPrompt } from "src/shared/Dialogs/Prompt";
@@ -44,8 +43,13 @@ import { HotkeyEditor } from "src/shared/Dialogs/HotkeyEditor";
import { getExcalidrawViews } from "src/utils/obsidianUtils";
import { createSliderWithText } from "src/utils/sliderUtils";
import { PDFExportSettingsComponent, PDFExportSettings } from "src/shared/Dialogs/PDFExportSettingsComponent";
import { ContentSearcher } from "src/shared/components/ContentSearcher";
import { UIMode, UIModeSettingsComponent } from "src/shared/Dialogs/UIModeSettingComponent";
import { ScriptSettingValue } from "src/types/excalidrawAutomateTypes";
export interface ExcalidrawSettings {
copyLinkToElemenetAnchorTo100: boolean;
copyFrameLinkByName: boolean;
disableDoubleClickTextEditing: boolean;
folder: string;
cropFolder: string;
@@ -86,6 +90,9 @@ export interface ExcalidrawSettings {
overrideObsidianFontSize: boolean;
dynamicStyling: DynamicStyle;
isLeftHanded: boolean;
desktopUIMode: UIMode;
tabletUIMode: UIMode;
phoneUIMode: UIMode;
iframeMatchExcalidrawTheme: boolean;
matchTheme: boolean;
matchThemeAlways: boolean;
@@ -95,6 +102,7 @@ export interface ExcalidrawSettings {
penModeDoubleTapEraser: boolean;
penModeSingleFingerPanning: boolean;
penModeCrosshairVisible: boolean;
panWithRightMouseButton: boolean; //mfuria #329
renderImageInMarkdownReadingMode: boolean,
renderImageInHoverPreviewForMDNotes: boolean,
renderImageInMarkdownToPDF: boolean,
@@ -103,11 +111,15 @@ export interface ExcalidrawSettings {
zoomToFitOnOpen: boolean;
zoomToFitOnResize: boolean;
zoomToFitMaxLevel: number;
zoomStep: number; // % increment per zoom action (e.g. mouse wheel)
zoomMin: number; // minimum zoom percentage
zoomMax: number; // maximum zoom percentage
openInAdjacentPane: boolean;
showSecondOrderLinks: boolean;
focusOnFileTab: boolean;
openInMainWorkspace: boolean;
showLinkBrackets: boolean;
syncElementLinkWithText: boolean;
linkPrefix: string;
urlPrefix: string;
parseTODO: boolean;
@@ -162,18 +174,12 @@ export interface ExcalidrawSettings {
mdCSS: string;
scriptEngineSettings: {
[key:string]: {
[key:string]: {
value?:string,
hidden?: boolean,
description?: string,
valueset?: string[],
height?: number,
}
[key:string]: ScriptSettingValue;
}
};
defaultTrayMode: boolean;
previousRelease: string;
showReleaseNotes: boolean;
compareManifestToPluginVersion: boolean;
showNewVersionNotification: boolean;
//mathjaxSourceURL: string;
latexBoilerplate: string;
@@ -181,6 +187,7 @@ export interface ExcalidrawSettings {
taskboneEnabled: boolean;
taskboneAPIkey: string;
pinnedScripts: string[];
sidepanelTabs: string[];
customPens: PenStyle[];
numberOfCustomPens: number;
pdfScale: number;
@@ -206,6 +213,7 @@ export interface ExcalidrawSettings {
aiEnabled: boolean,
openAIAPIToken: string,
openAIDefaultTextModel: string,
openAIDefaultTextModelMaxTokens: number,
openAIDefaultVisionModel: string,
openAIDefaultImageGenerationModel: string,
openAIURL: string,
@@ -226,11 +234,14 @@ export interface ExcalidrawSettings {
modifierKeyOverrides: {modifiers: Modifier[], key: string}[];
showSplashscreen: boolean;
pdfSettings: PDFExportSettings;
disableContextMenu: boolean;
}
declare const PLUGIN_VERSION:string;
export const DEFAULT_SETTINGS: ExcalidrawSettings = {
copyLinkToElemenetAnchorTo100: false,
copyFrameLinkByName: false,
disableDoubleClickTextEditing: false,
folder: "Excalidraw",
cropFolder: "",
@@ -271,6 +282,9 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
overrideObsidianFontSize: false,
dynamicStyling: "colorful",
isLeftHanded: false,
desktopUIMode: "tray",
tabletUIMode: "compact",
phoneUIMode: "mobile",
iframeMatchExcalidrawTheme: true,
matchTheme: false,
matchThemeAlways: false,
@@ -280,14 +294,18 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
penModeDoubleTapEraser: true,
penModeSingleFingerPanning: true,
penModeCrosshairVisible: true,
panWithRightMouseButton: false, //mfuria #329
renderImageInMarkdownReadingMode: false,
renderImageInHoverPreviewForMDNotes: false,
renderImageInMarkdownToPDF: false,
allowPinchZoom: false,
allowWheelZoom: false,
zoomToFitOnOpen: true,
zoomToFitOnResize: true,
zoomToFitOnResize: false,
zoomToFitMaxLevel: 2,
zoomStep: 0.05,
zoomMin: 0.1,
zoomMax: 30,
linkPrefix: "📍",
urlPrefix: "🌐",
parseTODO: false,
@@ -299,7 +317,8 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
showSecondOrderLinks: true,
focusOnFileTab: true,
openInMainWorkspace: true,
showLinkBrackets: true,
showLinkBrackets: false,
syncElementLinkWithText: false,
allowCtrlClick: true,
forceWrap: false,
pageTransclusionCharLimit: 200,
@@ -351,9 +370,9 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
mdBorderColor: "Black",
mdCSS: "",
scriptEngineSettings: {},
defaultTrayMode: true,
previousRelease: "0.0.0",
showReleaseNotes: true,
compareManifestToPluginVersion: true,
showNewVersionNotification: true,
//mathjaxSourceURL: "https://cdn.jsdelivr.net/npm/mathjax@3.2.1/es5/tex-svg.js",
latexBoilerplate: "\\color{blue}",
@@ -361,6 +380,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
taskboneEnabled: false,
taskboneAPIkey: "",
pinnedScripts: [],
sidepanelTabs: [],
customPens: [
{...PENS["default"]},
{...PENS["highlighter"]},
@@ -411,9 +431,10 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
startupScriptPath: "",
aiEnabled: true,
openAIAPIToken: "",
openAIDefaultTextModel: "gpt-3.5-turbo-1106",
openAIDefaultVisionModel: "gpt-4o",
openAIDefaultImageGenerationModel: "dall-e-3",
openAIDefaultTextModel: "gpt-5-mini",
openAIDefaultTextModelMaxTokens: 4096,
openAIDefaultVisionModel: "gpt-5-mini",
openAIDefaultImageGenerationModel: "gpt-image-1",
openAIURL: "https://api.openai.com/v1/chat/completions",
openAIImageGenerationURL: "https://api.openai.com/v1/images/generations",
openAIImageEditsURL: "https://api.openai.com/v1/images/edits",
@@ -520,6 +541,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
alignment: "center",
margin: "normal",
},
disableContextMenu: false,
};
export class ExcalidrawSettingTab extends PluginSettingTab {
@@ -604,6 +626,31 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
containerEl.addClass("excalidraw-settings");
this.containerEl.empty();
// ------------------------------------------------
// Search and Settings to Clipboard
// ------------------------------------------------
const notebookLMLinkContainer = createDiv("setting-item-description excalidraw-settings-links-container");
new ContentSearcher(containerEl, notebookLMLinkContainer);
notebookLMLinkContainer.createEl("a",{
href: "https://notebooklm.google.com/notebook/42d76a2f-c11d-4002-9286-1683c43d0ab0",
attr: {
"aria-label": t("NOTEBOOKLM_LINK_ARIA"),
"style": "margin: auto;"
}},
(a)=> {
//Lucide: message-circle-question-mark
a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-circle-question-mark-icon lucide-message-circle-question-mark"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/></svg>${
t("NOTEBOOKLM_LINK_TEXT")
}`;
}
);
// ------------------------------------------------
// Promo links
// ------------------------------------------------
const coffeeDiv = containerEl.createDiv("coffee");
coffeeDiv.addClass("ex-coffee-div");
const coffeeLink = coffeeDiv.createEl("a", {
@@ -618,41 +665,53 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
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>`,
icon: getIcon("bug").outerHTML,
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",
aria: t("LINKS_BUGS_ARIA"),
text: t("LINKS_BUGS"),
},
{
icon: getIcon("globe").outerHTML,
href: "https://excalidraw-obsidian.online/",
aria: t("LINKS_WIKI_ARIA"),
text: t("LINKS_WIKI"),
},
{
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>`,
icon: getIcon("youtube").outerHTML,
href: "https://www.youtube.com/@VisualPKM",
aria: "Check out my YouTube channel to learn about Visual Thinking and Excalidraw",
text: "Visual PKM on YouTube",
aria: t("LINKS_YT_ARIA"),
text: t("LINKS_YT"),
},
{
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",
aria: t("LINKS_DISCORD_ARIA"),
text: t("LINKS_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>`,
icon: getIcon("twitter").outerHTML,
href: "https://twitter.com/zsviczian",
aria: "Follow me on Twitter",
text: "Follow me on Twitter",
aria: t("LINKS_TWITTER"),
text: t("LINKS_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",
}
aria: t("LINKS_VTW_ARIA"),
text: t("LINKS_VTW"),
},
{
icon: getIcon("book").outerHTML,
href: "https://sketch-your-mind.com",
aria: t("LINKS_BOOK_ARIA"),
text: t("LINKS_BOOK"),
},
];
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;
a.innerHTML = icon + text;
});
});
@@ -678,6 +737,18 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
.setName(t("WARN_ON_MANIFEST_MISMATCH_NAME"))
.setDesc(fragWithHTML(t("WARN_ON_MANIFEST_MISMATCH_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.compareManifestToPluginVersion)
.onChange(async (value) => {
this.plugin.settings.compareManifestToPluginVersion = value;
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("NEWVERSION_NOTIFICATION_NAME"))
.setDesc(fragWithHTML(t("NEWVERSION_NOTIFICATION_DESC")))
@@ -764,7 +835,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
addIframe(detailsEl, "jgUpYznHP9A",216);
addYouTubeThumbnail(detailsEl, "jgUpYznHP9A",216);
new Setting(detailsEl)
.setName(t("SCRIPT_FOLDER_NAME"))
@@ -1094,6 +1165,35 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
.setName(t("AI_OPENAI_DEFAULT_MAX_TOKENS_NAME"))
.setDesc(fragWithHTML(t("AI_OPENAI_DEFAULT_MAX_TOKENS_DESC")))
.addText((text) =>
text
.setPlaceholder("e.g.: 4096")
.setValue(this.plugin.settings.openAIDefaultTextModelMaxTokens.toString())
.onChange(async (value) => {
const intVal = parseInt(value);
if (isNaN(intVal) && value !== "") {
text.setValue(this.plugin.settings.openAIDefaultTextModelMaxTokens.toString());
return;
}
if (value === "") {
this.plugin.settings.openAIDefaultTextModelMaxTokens = 4096;
text.setValue("4096");
this.applySettingsUpdate();
return;
}
if (intVal < 0) {
text.setValue(this.plugin.settings.openAIDefaultTextModelMaxTokens.toString());
return;
}
this.plugin.settings.openAIDefaultTextModelMaxTokens = intVal;
text.setValue(intVal.toString());
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("AI_OPENAI_DEFAULT_VISION_MODEL_NAME"))
.setDesc(fragWithHTML(t("AI_OPENAI_DEFAULT_VISION_MODEL_DESC")))
@@ -1155,6 +1255,18 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("DISABLE_CONTEXT_MENU_NAME"))
.setDesc(t("DISABLE_CONTEXT_MENU_DESC"))
.addToggle((toggle) =>
toggle
.setValue(!this.plugin.settings.disableContextMenu)
.onChange(async (value) => {
this.plugin.settings.disableContextMenu = !value;
this.applySettingsUpdate();
}),
);
const readingModeEl = new Setting(detailsEl)
.setName(t("SHOW_DRAWING_OR_MD_IN_READING_MODE_NAME"))
@@ -1181,22 +1293,19 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
.setName(t("LEFTHANDED_MODE_NAME"))
.setDesc(fragWithHTML(t("LEFTHANDED_MODE_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.isLeftHanded)
.onChange(async (value) => {
this.plugin.settings.isLeftHanded = value;
//not clear why I need to do this. If I don't double apply the stylesheet changes
//then the style won't be applied in the popout windows
setLeftHandedMode(value);
setTimeout(()=>setLeftHandedMode(value));
this.applySettingsUpdate();
}),
);
addIframe(detailsEl, "H8Njp7ZXYag",999);
detailsEl = displayDetailsEl.createEl("details");
detailsEl.createEl("summary", {
text: t("MODES_HEAD"),
cls: "excalidraw-setting-h3",
});
new UIModeSettingsComponent(
detailsEl,
this.plugin.settings,
this.app,
()=>this.applySettingsUpdate(),
).render();
addYouTubeThumbnail(detailsEl, "H8Njp7ZXYag",999);
detailsEl = displayDetailsEl.createEl("details");
detailsEl.createEl("summary", {
@@ -1243,7 +1352,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
addIframe(detailsEl, "fypDth_-8q0");
addYouTubeThumbnail(detailsEl, "fypDth_-8q0");
new Setting(detailsEl)
.setName(t("IFRAME_MATCH_THEME_NAME"))
@@ -1256,7 +1365,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate(true);
}),
);
addIframe(detailsEl, "ICpoyMv6KSs");
addYouTubeThumbnail(detailsEl, "ICpoyMv6KSs");
new Setting(detailsEl)
.setName(t("MATCH_THEME_NAME"))
@@ -1317,9 +1426,24 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
detailsEl = displayDetailsEl.createEl("details");
detailsEl.createEl("summary", {
text: t("ZOOM_HEAD"),
text: t("ZOOM_AND_PAN_HEAD"), //mfuria #329
cls: "excalidraw-setting-h3",
});
//mfuria #329. Added setting for right-click panning
new Setting(detailsEl)
.setName(t("PAN_WITH_RIGHT_MOUSE_BUTTON_NAME"))
.setDesc(fragWithHTML(t("PAN_WITH_RIGHT_MOUSE_BUTTON_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.panWithRightMouseButton)
.onChange(async (value) => {
this.plugin.settings.panWithRightMouseButton = value;
this.applySettingsUpdate(true);
}),
);
new Setting(detailsEl)
.setName(t("DEFAULT_PINCHZOOM_NAME"))
.setDesc(fragWithHTML(t("DEFAULT_PINCHZOOM_DESC")))
@@ -1332,7 +1456,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
addIframe(detailsEl, "rBarRfcSxNo",107);
addYouTubeThumbnail(detailsEl, "rBarRfcSxNo",107);
new Setting(detailsEl)
.setName(t("DEFAULT_WHEELZOOM_NAME"))
@@ -1385,6 +1509,45 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}
})
createSliderWithText(detailsEl, {
name: t("ZOOM_STEP_NAME"),
desc: t("ZOOM_STEP_DESC"),
value: this.plugin.settings.zoomStep*100,
min: 1,
max: 25,
step: 1,
onChange: (value) => {
this.plugin.settings.zoomStep = value/100;
this.applySettingsUpdate();
}
})
createSliderWithText(detailsEl, {
name: t("ZOOM_MIN_NAME"),
desc: t("ZOOM_MIN_DESC"),
value: this.plugin.settings.zoomMin*100,
min: 1,
max: 50,
step: 1,
onChange: (value) => {
this.plugin.settings.zoomMin = value/100;
this.applySettingsUpdate();
}
})
createSliderWithText(detailsEl, {
name: t("ZOOM_MAX_NAME"),
desc: t("ZOOM_MAX_DESC"),
value: this.plugin.settings.zoomMax*100,
min: 500,
max: 6000,
step: 100,
onChange: (value) => {
this.plugin.settings.zoomMax = value/100;
this.applySettingsUpdate();
}
})
// ------------------------------------------------
// Pen
// ------------------------------------------------
@@ -1656,6 +1819,18 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
(el) => (el.innerHTML = t("LINKS_DESC")),
);
new Setting(detailsEl)
.setName(t("ELEMENT_LINK_SYNC_NAME"))
.setDesc(fragWithHTML(t("ELEMENT_LINK_SYNC_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.syncElementLinkWithText)
.onChange(async (value) => {
this.plugin.settings.syncElementLinkWithText = value;
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("SECOND_ORDER_LINKS_NAME"))
.setDesc(fragWithHTML(t("SECOND_ORDER_LINKS_DESC")))
@@ -1716,6 +1891,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
.setName(t("LINK_PREFIX_NAME"))
.setDesc(fragWithHTML(t("LINK_PREFIX_DESC")))
@@ -1953,8 +2129,8 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
})
);
addIframe(detailsEl, "yZQoJg2RCKI");
addIframe(detailsEl, "opLd1SqaH_I",8);
addYouTubeThumbnail(detailsEl, "yZQoJg2RCKI");
addYouTubeThumbnail(detailsEl, "opLd1SqaH_I",8);
let dropdown: DropdownComponent;
let embedComment: Setting;
@@ -2113,7 +2289,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
text: t("EXPORT_SUBHEAD"),
cls: "excalidraw-setting-h3",
});
addIframe(detailsEl, "wTtaXmRJ7wg",171);
addYouTubeThumbnail(detailsEl, "wTtaXmRJ7wg",171);
const pdfExportEl = new Setting(detailsEl)
.setName(t("SHOW_DRAWING_OR_MD_IN_EXPORTPDF_NAME"))
@@ -2358,7 +2534,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
cls: "excalidraw-setting-h3",
});
addIframe(detailsEl, "nB4cOfn0xAs");
addYouTubeThumbnail(detailsEl, "nB4cOfn0xAs");
new Setting(detailsEl)
.setName(t("PDF_TO_IMAGE_SCALE_NAME"))
.setDesc(fragWithHTML(t("PDF_TO_IMAGE_SCALE_DESC")))
@@ -2404,7 +2580,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
new EmbeddalbeMDFileCustomDataSettingsComponent(
detailsEl,
this.plugin.settings.embeddableMarkdownDefaults,
this.applySettingsUpdate,
(val?:boolean) => this.applySettingsUpdate(val),
).render();
detailsEl = embedFilesDetailsEl.createEl("details");
@@ -2535,7 +2711,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
// Non-excalidraw.com supported features
// ------------------------------------------------
containerEl.createEl("hr", { cls: "excalidraw-setting-hr" });
containerEl.createDiv({ text: t("NONSTANDARD_DESC"), cls: "setting-item-description" });
containerEl.createDiv( { text: t("NONSTANDARD_DESC"), cls: "setting-item-description" });
detailsEl = this.containerEl.createEl("details");
const nonstandardDetailsEl = detailsEl;
detailsEl.createEl("summary", {
@@ -2569,7 +2745,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
text: t("CUSTOM_PEN_HEAD"),
cls: "excalidraw-setting-h3",
});
addIframe(detailsEl, "OjNhjaH2KjI",69);
addYouTubeThumbnail(detailsEl, "OjNhjaH2KjI",69);
new Setting(detailsEl)
.setName(t("CUSTOM_PEN_NAME"))
.setDesc(t("CUSTOM_PEN_DESC"))
@@ -2611,7 +2787,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
text: t("CUSTOM_FONT_HEAD"),
cls: "excalidraw-setting-h3",
});
addIframe(detailsEl, "eKFmrSQhFA4");
addYouTubeThumbnail(detailsEl, "eKFmrSQhFA4");
new Setting(detailsEl)
.setName(t("ENABLE_FOURTH_FONT_NAME"))
.setDesc(fragWithHTML(t("ENABLE_FOURTH_FONT_DESC")))
@@ -2717,7 +2893,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
cls: "excalidraw-setting-h1",
});
addIframe(detailsEl, "r08wk-58DPk");
addYouTubeThumbnail(detailsEl, "r08wk-58DPk");
new Setting(detailsEl)
.setName(t("LATEX_DEFAULT_NAME"))
.setDesc(fragWithHTML(t("LATEX_DEFAULT_DESC")))
@@ -2815,7 +2991,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
detailsEl.createDiv( { text: t("TASKBONE_DESC"), cls: "setting-item-description" });
let taskboneAPIKeyText: TextComponent;
addIframe(detailsEl, "7gu4ETx7zro");
addYouTubeThumbnail(detailsEl, "7gu4ETx7zro");
new Setting(detailsEl)
.setName(t("TASKBONE_ENABLE_NAME"))
.setDesc(fragWithHTML(t("TASKBONE_ENABLE_DESC")))
@@ -3194,7 +3370,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
cls: "excalidraw-setting-h1",
});
addIframe(detailsEl, "H8Njp7ZXYag",52);
addYouTubeThumbnail(detailsEl, "H8Njp7ZXYag",52);
Object.keys(this.plugin.settings.scriptEngineSettings)
.filter((s) => scripts.contains(s))
.forEach((scriptName: string) => {
+149
View File
@@ -0,0 +1,149 @@
/**
* Language Pack Diff Checker Script
*
* Purpose:
* Compare src/lang/locale/en.ts and a target language file (e.g. zh-cn.ts), output missing and extra keys.
* Output is color-coded:
* - Green: Key exists in en.ts but missing in the target language file
* - Red: Key exists in the target language file but not in en.ts
* - Yellow: The same key exists in both files but the line numbers are different
*
* Dependencies:
* Node.js environment, no extra dependencies required.
*
* Usage:
* 1. Open a terminal in this file's directory (or project root).
* 2. Run:
* node src/lang/langDiffWithEn.js zh-cn
* # or node src/lang/langDiffWithEn.js ja
* # The argument is the language file name (without extension), default is zh-cn
*
* Output:
* + (green): Key exists in en.ts but missing in the target language file
* - (red): Key exists in the target language file but not in en.ts
* ! (yellow): The same key exists in both files but the line numbers are different
* If there is no output, the two files have identical keys.
*/
/**
* 语言包差异检测脚本
*
* 用途:
* 比较 src/lang/locale/en.ts 与指定语言文件(如 zh-cn.ts)中的 key,输出缺失和多余的 key。
* 输出内容会用不同颜色区分:
* - 绿色:en.ts 有但目标语言缺失的 key
* - 红色:目标语言有但 en.ts 没有的 key
* - 黄色:相同的 key 所在的行号不相同
*
* 依赖:
* Node.js 环境,无需额外依赖。
*
* 用法:
* 1. 在命令行进入本文件所在目录(或项目根目录)。
* 2. 运行:
* node src/lang/langDiffWithEn.js zh-cn
* # 或 node src/lang/langDiffWithEn.js ja
* # 参数为语言文件名(不带扩展名),默认为 zh-cn
*
* 输出说明:
* + 开头(绿色):en.ts 有但目标语言缺失的 key
* - 开头(红色):目标语言有但 en.ts 没有的 key
* ! 开头(黄色):相同的 key 所在的行号不相同
* 若无输出则表示两个文件 key 完全一致。
*/
const fs = require("fs");
const path = require("path");
/**
* 读取 locale 文件夹下指定语言和 en.ts 文件,逐行解析键值和行号
* @param lang 语言文件名(不含扩展名),如 zh-cn
* @returns { en: Record<string, {value: string, line: number}>, lang: Record<string, {value: string, line: number}> }
*/
function readLocaleFiles(lang = "zh-cn") {
// 构造 locale 目录路径
const localeDir = path.join(__dirname, "./locale");
// 获取 en.ts 文件路径
const enFile = path.join(localeDir, "en.ts");
// 获取指定语言文件路径
const langFile = path.join(localeDir, `${lang}.ts`);
/**
* 解析指定的语言文件,提取每个 key 的值和所在行号
* @param file 文件路径
* @returns {Record<string, {value: string, line: number}>}
*/
const parse = (file) => {
// 读取文件内容并按行分割
const lines = fs.readFileSync(file, "utf8").split(/\r?\n/);
const result = {};
let inExport = false;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
// 检查是否进入 export default 块
if (!inExport && line.includes("export default")) {
inExport = true;
continue;
}
if (!inExport) continue;
// 匹配 key: "value", 格式的行
const m = line.match(/^\s*([A-Z0-9_]+)\s*:\s*.*?,?$/);
if (m) {
let key = m[1];
// 保存 key 及其所在行号
result[key] = i + 1;
}
}
return result;
};
// 返回 en 和指定语言的解析结果
return {
en: parse(enFile),
lang: parse(langFile),
};
}
/**
* 比较 en 和 lang 的 key/value,输出差异
*/
function diffLang(lang = "zh-cn") {
const { en, lang: l } = readLocaleFiles(lang);
const allKeys = new Set([...Object.keys(en), ...Object.keys(l)]);
const diffs = [];
for (const key of allKeys) {
if (!(key in en)) {
diffs.push(`- ${key}: ${l[key]}`);
} else if (!(key in l)) {
diffs.push(`+ ${key}: ${en[key]}`);
} else {
if (en[key] !== l[key]) {
diffs.push(`! ${key}: en: ${en[key]} <--> lang: ${l[key]}`);
}
}
}
return diffs;
}
// CLI
if (require.main === module) {
const lang = process.argv[2] || "zh-cn";
const diffs = diffLang(lang);
if (diffs.length === 0) {
console.log(`语言文件 ${lang} 与 en.ts 无差异`);
} else {
diffs.forEach((line) => {
if (line.startsWith("+")) {
// 绿色
console.log("\x1b[32m%s\x1b[0m", line);
} else if (line.startsWith("-")) {
// 红色
console.log("\x1b[31m%s\x1b[0m", line);
} else if (line.startsWith("!")) {
// 黄色
console.log("\x1b[33m%s\x1b[0m", line);
} else {
// 默认
console.log(line);
}
});
}
}
+169 -27
View File
@@ -37,6 +37,7 @@ export default {
CONVERT_FILE_KEEP_EXT: "*.excalidraw => *.excalidraw.md",
CONVERT_FILE_REPLACE_EXT: "*.excalidraw => *.md (Logseq compatibility)",
DOWNLOAD_LIBRARY: "Export stencil library as an *.excalidrawlib file",
OPEN_SIDEPANEL: "Open Excalidraw Sidepanel",
OPEN_EXISTING_NEW_PANE: "Open existing drawing - IN A NEW PANE",
OPEN_EXISTING_ACTIVE_PANE:
"Open existing drawing - IN THE CURRENT ACTIVE PANE",
@@ -44,7 +45,7 @@ export default {
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 for the selected image in a popout window",
FLIP_IMAGE: "Open the back-of-the-note for the selected image in a popout window (flip the card)",
NEW_IN_NEW_PANE: "Create new drawing - IN AN ADJACENT WINDOW",
NEW_IN_NEW_TAB: "Create new drawing - IN A NEW TAB",
NEW_IN_ACTIVE_PANE: "Create new drawing - IN THE CURRENT ACTIVE WINDOW",
@@ -58,7 +59,12 @@ export default {
NEW_IN_POPOUT_WINDOW_EMBED: "Create new drawing - IN A POPOUT WINDOW - and embed into active document",
TOGGLE_LOCK: "Toggle Text Element between edit RAW and PREVIEW",
DELETE_FILE: "Delete selected image or Markdown file from Obsidian Vault",
MARKER_FRAME_SHOW: "Show Marker Frames",
MARKER_FRAME_HIDE: "Hide Marker Frames",
MARKER_FRAME_TITLE_SHOW: "Show Marker Frame Titles",
MARKER_FRAME_TITLE_HIDE: "Hide Marker Frame Titles",
COPY_ELEMENT_LINK: "Copy [[link]] for selected element(s)",
FRAME_WITH_NAME: "Copy frame link by name",
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.`,
@@ -87,6 +93,8 @@ export default {
CONVERT_CARD_TO_FILE: "Move back-of-note card to File",
ERROR_TRY_AGAIN: "Please try again.",
PASTE_CODEBLOCK: "Paste code block",
INVERT_IMAGES_IN_DARK_MODE: "Invert image(s) in dark mode",
DO_NOT_INVERT_IMAGES_IN_DARK_MODE: "Do not invert image(s) in dark mode",
INSERT_LATEX:
`Insert LaTeX formula (e.g. \\binom{n}{k} = \\frac{n!}{k!(n-k)!}).`,
ENTER_LATEX: "Enter a valid LaTeX expression",
@@ -94,7 +102,7 @@ export default {
RUN_OCR: "OCR full drawing: Grab text from freedraw + images to clipboard and doc.props",
RERUN_OCR: "OCR full drawing re-run: Grab text from freedraw + images to clipboard and doc.props",
RUN_OCR_ELEMENTS: "OCR selected elements: Grab text from freedraw + images to clipboard",
TRAY_MODE: "Toggle property-panel tray-mode",
UI_MODE: "Toggle UI-mode",
SEARCH: "Search for text in drawing",
CROP_PAGE: "Crop and mask selected page",
CROP_IMAGE: "Crop and mask image",
@@ -106,11 +114,13 @@ export default {
TEMPORARY_ENABLE_AUTOSAVE: "Enable autosave",
FONTS_LOADED: "Excalidraw: CJK Fonts loaded",
FONTS_LOAD_ERROR: "Excalidraw: Could not find CJK Fonts in the assets folder\n",
TOGGLE_ENABLE_CONTEXT_MENU: "Toggle enable context menu (helpful on Mobile devices)",
//Prompt.ts
SELECT_LINK_TO_OPEN: "Select a link to open",
//ExcalidrawView.ts
ABOUT_LIBRARIES: "How to load libraries",
ERROR_CANT_READ_FILEPATH: "Error, can't read file path. Importing file instead",
NO_SEARCH_RESULT: "Didn't find a matching element in the drawing",
FORCE_SAVE_ABORTED: "Force Save aborted because saving is in progress",
@@ -133,12 +143,21 @@ export default {
"1) Please select your drawing using CTRL/CMD+A and make a copy with CTRL/CMD+C.\n" +
"2) Then create an empty drawing in a new pane by CTRL/CMD+clicking the Excalidraw ribbon button,\n" +
"3) and paste your work to the new document with CTRL/CMD+V.",
ARIA_LABEL_TRAY_MODE: "Tray-mode offers an alternative, more spacious canvas",
ARIA_LABEL_TRAY_MODE: "You can choose from 3 different desktop and tablet UI modes: Full, Compact, and Tray. On Phones only the Phone mode is available.",
TRAY_TRAY_MODE: "Toggle UI-mode",
TRAY_SCRIPT_LIBRARY: "Script Library",
TRAY_SCRIPT_LIBRARY_ARIA: "Explore the Excalidraw Script Library",
TRAY_EXPORT: "Export Image...",
TRAY_EXPORT_ARIA: "Export image as PNG, SVG, or Excalidraw file",
TRAY_SAVE: "Save",
TRAY_SWITCH_TO_MD: "Open as Markdown",
TRAY_SWITCH_TO_MD_ARIA: "Switch to markdown view",
MASK_FILE_NOTICE: "This is a mask file. It is used to crop images and mask out parts of the image. Press and hold notice to open the help video.",
INSTALL_SCRIPT_BUTTON: "Install or update Excalidraw Scripts",
OPEN_AS_MD: "Open as Markdown",
EXPORT_IMAGE: `Export Image`,
OPEN_LINK: "Open selected text as link\n(SHIFT+CLICK to open in a new pane)",
EXCALIDRAW_SIDEPANEL: "Excalidraw Sidepanel",
EXPORT_EXCALIDRAW: "Export to an .Excalidraw file",
LINK_BUTTON_CLICK_NO_TEXT:
"Select an element that contains an internal or external link.\n",
@@ -158,10 +177,11 @@ export default {
CONVERT_FILE: "Convert to new format",
BACKUP_AVAILABLE: "We encountered an error while loading your drawing. This might have occurred if Obsidian unexpectedly closed during a save operation. For example, if you accidentally closed Obsidian on your mobile device while saving.<br><br><b>GOOD NEWS:</b> Fortunately, a local backup is available. However, please note that if you last modified this drawing on a different device (e.g., tablet) and you are now on your desktop, that other device likely has a more recent backup.<br><br>I recommend trying to open the drawing on your other device first and restore the backup from its local storage.<br><br>Would you like to load the backup?",
BACKUP_RESTORED: "Backup restored",
BACKUP_SAVE_AS_FILE: "This drawing is empty. A non-empty backup is avalable. Would you like to resture it as a new file and open it in a new tab?",
BACKUP_SAVE_AS_FILE: "This drawing is empty. A non-empty backup is available. Would you like to restore it as a new file and open it in a new tab?",
BACKUP_SAVE: "Restore",
BACKUP_DELETE: "Delete Backup",
BACKUP_CANCEL: "Cancel", CACHE_NOT_READY: "I apologize for the inconvenience, but an error occurred while loading your file.<br><br><mark>Having a little patience can save you a lot of time...</mark><br><br>The plugin has a backup cache, but it appears that you have just started Obsidian. Initializing the Backup Cache may take some time, usually up to a minute or more depending on your device's performance. You will receive a notification in the top right corner when the cache initialization is complete.<br><br>Please press OK to attempt loading the file again and check if the cache has finished initializing. If you see a completely empty file behind this message, I recommend waiting until the backup cache is ready before proceeding. Alternatively, you can choose Cancel to manually correct your file.<br>",
BACKUP_CANCEL: "Cancel",
CACHE_NOT_READY: "I apologize for the inconvenience, but an error occurred while loading your file.<br><br><mark>Having a little patience can save you a lot of time...</mark><br><br>The plugin has a backup cache, but it appears that you have just started Obsidian. Initializing the Backup Cache may take some time, usually up to a minute or more depending on your device's performance. You will receive a notification in the top right corner when the cache initialization is complete.<br><br>Please press OK to attempt loading the file again and check if the cache has finished initializing. If you see a completely empty file behind this message, I recommend waiting until the backup cache is ready before proceeding. Alternatively, you can choose Cancel to manually correct your file.<br>",
OBSIDIAN_TOOLS_PANEL: "Obsidian Tools Panel",
ERROR_SAVING_IMAGE: "Unknown error occurred while fetching the image. It could be that for some reason the image is not available or rejected the fetch request from Obsidian",
WARNING_PASTING_ELEMENT_AS_TEXT: "PASTING EXCALIDRAW ELEMENTS AS A TEXT ELEMENT IS NOT ALLOWED",
@@ -191,11 +211,40 @@ export default {
SAVE_IS_TAKING_LONG: "Saving your previous file is taking a long time. Please wait...",
SAVE_IS_TAKING_VERY_LONG: "For better performance, consider splitting large drawings into several smaller files.",
//ContentSearcher.ts
SEARCH_COPIED_TO_CLIPBOARD: "Markdown ready on clipboard",
SEARCH_COPY_TO_CLIPBOARD_ARIA: "Copy the entire dialog to the clipboard as Markdown. Ideal for use with tools like ChatGPT to search and understand.",
SEARCH_SHOWHIDE_ARIA: "Show/Hide search bar",
SEARCH_NEXT: "Next",
SEARCH_PREVIOUS: "Previous",
//settings.ts
DISABLE_CONTEXT_MENU_NAME: "Disable Excalidraw context menu",
DISABLE_CONTEXT_MENU_DESC: "Disables the Excalidraw context menu. This can be useful on Mobile devices where the context menu pops up in unwanted moments.",
NOTEBOOKLM_LINK_ARIA: "Ask NotebookLM for help about the plugin. This model is pre-loaded with all my video transcripts, release notes and other helpful content. Chat with NotebookLM to explore my 250+ videos and the Excalidraw documentation.",
NOTEBOOKLM_LINK_TEXT: "Learn the Plugin. Access the NotebookLM knowledgebase.",
LINKS_BUGS_ARIA: "Report bugs and raise feature requsts on the plugin's GitHub page",
LINKS_BUGS: "Report Bugs",
LINKS_YT_ARIA: "Check out my YouTube channel to learn about Visual Thinking and Excalidraw",
LINKS_YT: "Learn on YouTube",
LINKS_DISCORD_ARIA: "Join the Visual Thinking Workshop Discord Server",
LINKS_DISCORD: "Join the Community",
LINKS_TWITTER: "Follow me",
LINKS_VTW_ARIA: "Learn about Visual PKM, Excalidraw, Obsidian, ExcaliBrain and more",
LINKS_VTW: "Join a Workshop",
LINKS_BOOK_ARIA: "Read Sketch Your Mind, my book on Visual Thinking",
LINKS_BOOK: "Read the Book",
LINKS_WIKI: "Plugin Wiki",
LINKS_WIKI_ARIA: "Explore the Excalidraw Plugin Wiki",
RELEASE_NOTES_NAME: "Display Release Notes after update",
RELEASE_NOTES_DESC:
"<b><u>Toggle ON:</u></b> Display release notes each time you update Excalidraw to a newer version.<br>" +
"<b><u>Toggle OFF:</u></b> Silent mode. You can still read release notes on <a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/releases'>GitHub</a>.",
WARN_ON_MANIFEST_MISMATCH_NAME: "Warn about incomplete plugin updates",
WARN_ON_MANIFEST_MISMATCH_DESC: "Checks that the installed Excalidraw executable matches the version shown in Obsidian's plugin list. If they don't match (often after partial sync), you'll see a warning and can update. Disable to stop checking.",
NEWVERSION_NOTIFICATION_NAME: "Plugin update notification",
NEWVERSION_NOTIFICATION_DESC:
"<b><u>Toggle ON:</u></b> Show a notification when a new version of the plugin is available.<br>" +
@@ -209,7 +258,7 @@ export default {
CROP_SUFFIX_NAME: "Crop file suffix",
CROP_SUFFIX_DESC:
"The last part of the filename for new drawings created when cropping an image. " +
"Leave empty if you don't need a sufix.",
"Leave empty if you don't need a suffix.",
CROP_PREFIX_NAME: "Crop file prefix",
CROP_PREFIX_DESC:
"The first part of the filename for new drawings created when cropping an image. " +
@@ -224,7 +273,7 @@ export default {
"Leave empty if you don't need a prefix.",
ANNOTATE_PRESERVE_SIZE_NAME: "Preserve image size when annotating",
ANNOTATE_PRESERVE_SIZE_DESC:
"When annotating an image in markdown the replacment image link will include the width of the original image.",
"When annotating an image in markdown the replacement image link will include the width of the original image.",
CROP_FOLDER_NAME: "Crop file folder (CaSE senSItive!)",
CROP_FOLDER_DESC:
"Default location for new drawings created when cropping an image. If empty, drawings will be created following the Vault attachments settings.",
@@ -244,7 +293,7 @@ export default {
"Template.md, the setting would be: Excalidraw/Template.md (or just Excalidraw/Template - you may omit the .md file extension). " +
"If you are using Excalidraw in compatibility mode, then your template must be a legacy Excalidraw file as well " +
"such as Excalidraw/Template.excalidraw. <br><b>Template Folder:</b> You can also set a folder as your template. " +
"In this case you will be prompted which tempalte to use when creating a new drawing.<br>" +
"In this case you will be prompted which template to use when creating a new drawing.<br>" +
"<b>Pro Tip:</b> If you are using the Obsidian Templater plugin, you can add Templater code to your different Excalidraw " +
"templates to automate configuration of your drawings.",
SCRIPT_FOLDER_NAME: "Excalidraw Automate script folder (CASE SeNSitiVE!)",
@@ -268,14 +317,16 @@ export default {
AI_OPENAI_DEFAULT_MODEL_DESC:
"The default AI model to use when generating text. This is a freetext field, so you can enter any valid OpenAI model name. " +
"Find out more about the available models on the <a href='https://platform.openai.com/docs/models'>OpenAI website</a>.",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "Enter your default AI model here. e.g.: gpt-3.5-turbo-1106",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "Enter your default AI model here. e.g.: gpt-5-mini",
AI_OPENAI_DEFAULT_MAX_TOKENS_NAME: "Max tokens",
AI_OPENAI_DEFAULT_MAX_TOKENS_DESC:
"Maximum number of tokens to generate in the API response. Set to 0 to omit the max_tokens field (useful for models that don't support this parameter, such as GPT-5).",
AI_OPENAI_DEFAULT_IMAGE_MODEL_NAME: "Default Image Generation AI model",
AI_OPENAI_DEFAULT_IMAGE_MODEL_DESC:
"The default AI model to use when generating images. Image editing and variations are only supported by dall-e-2 at this time by OpenAI, " +
"for this reason dall-e-2 will automatically be used in such cases regardless of this setting.<br>" +
"The default AI model to use when generating images. Image editing and variations are only supported by dall-e-2 and gpt-image-1 at this time by OpenAI.<br>" +
"This is a freetext field, so you can enter any valid OpenAI model name. " +
"Find out more about the available models on the <a href='https://platform.openai.com/docs/models'>OpenAI website</a>.",
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "Enter your default Image Generation AI model here e.g.: dall-e-3",
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "Enter your default Image Generation AI model here e.g.: gpt-image-1",
AI_OPENAI_DEFAULT_VISION_MODEL_NAME: "Default AI vision model",
AI_OPENAI_DEFAULT_VISION_MODEL_DESC:
"The default AI vision model to use when generating text from images. This is a freetext field, so you can enter any valid OpenAI model name. " +
@@ -285,7 +336,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-4o",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "Enter your default AI vision model here. e.g.: gpt-5-mini",
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",
@@ -318,7 +369,7 @@ export default {
"Excalidraw will also save the file when closing a workspace tab or navigating within Obsidian, but away from the active Excalidraw tab (i.e. tapping on the Obsidian ribbon or checking backlinks, etc.). " +
"Excalidraw will not be able to save your work when terminating Obsidian directly (i.e. swiping it away). Also note, that when you switch apps on a Mobile device, sometimes Android and iOS closes " +
"Obsidian in the background to save system resources. In such a case Excalidraw will not be able to save the latest changes.",
FILENAME_HEAD: "Filename",
FILENAME_HEAD: "Filename",
FILENAME_DESC:
"<p>Click this link for the <a href='https://momentjs.com/docs/#/displaying/format/'>" +
"date and time format reference</a>.</p>",
@@ -356,7 +407,7 @@ FILENAME_HEAD: "Filename",
LEFTHANDED_MODE_NAME: "Left-handed mode",
LEFTHANDED_MODE_DESC:
"Currently only has effect in tray-mode. If turned on, the tray will be on the right side." +
"<br><b><u>Toggle ON:</u></b> Left-handed mode.<br><b><u>Toggle OFF:</u></b> Right-handed moded",
"<br><b><u>Toggle ON:</u></b> Left-handed mode.<br><b><u>Toggle OFF:</u></b> Right-handed mode.",
IFRAME_MATCH_THEME_NAME: "Markdown embeds to match Excalidraw theme",
IFRAME_MATCH_THEME_DESC:
"<b><u>Toggle ON:</u></b> Set this to true if for example you are using Obsidian in dark-mode but use excalidraw with a light background. " +
@@ -393,7 +444,8 @@ FILENAME_HEAD: "Filename",
SHOW_DRAWING_OR_MD_IN_HOVER_PREVIEW_DESC:
"...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.",
"markdown side of the document.<br>" +
"Note: <b>excalidraw-open-md</b> is different from <b>excalidraw-embed-md</b>. If <b>excalidraw-embed-md</b> is set to true, the hover preview will always show the markdown side, regardless of this setting. To force image rendering when embedding, use <code>![[drawing#^as-image]]</code> in your markdown file.",
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:
"When you are in markdown reading mode (aka. reading the back side of the drawing) should the Excalidraw drawing be rendered as an image? " +
@@ -408,12 +460,32 @@ FILENAME_HEAD: "Filename",
"Note: This setting does not affect the PDF export feature within Excalidraw itself.<br>" +
"See the other related setting for <a href='#"+TAG_MDREADINGMODE+"'>Markdown Reading Mode</a> under 'Appearance and Behavior' further above.<br>" +
"⚠️ You must close and reopen the Excalidraw/markdown file for changes to take effect. ⚠️",
MODES_HEAD: "UI Modes",
DESKTOP_UI_MODE_NAME: "Preferred Desktop Mode",
DESKTOP_UI_MODE_DESC: "Select the default UI mode for desktop devices.",
TABLET_UI_MODE_NAME: "Preferred Tablet Mode",
TABLET_UI_MODE_DESC: "Select the default UI mode for tablet devices.",
PHONE_UI_MODE_NAME: "Preferred Phone Mode",
PHONE_UI_MODE_DESC: "Select the default UI mode for phone devices.",
MODE_FULL: "Desktop-mode",
MODE_COMPACT: "Compact-mode",
MODE_TRAY: "Tray-mode",
MODE_PHONE: "Phone-mode",
REAPPLY_UI_MODE_BUTTON: "Reapply UI mode now",
TRAY_MODE_NAME: "Enable tray-mode",
PREFER_COMPACT_MODE_DESKTOP_NAME: "Prefer compact-mode on Desktop",
PREFER_COMPACT_MODE_DESKTOP_DESC: "When toggling tray-mode on a desktop, if this option is enabled, Excalidraw will toggle between compact-mode and tray-mode. " +
"If this setting is off, it will toggle betweeen full-mode and tray-mode.",
COMPACT_MODE_NAME: "Prefer compact-mode on Tablets",
COMPACT_MODE_DESC: "This setting allows you to have a different default mode on tablets, then on desktops. You can default to compact mode on tablets, and to tray-mode on desktops with the help of this setting.",
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 " +
"conflict with Obsidian hotkey settings. The hotkey combinations you add below will override Obsidian's hotkey settings while using 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",
ZOOM_AND_PAN_HEAD: "Zoom and Pan",
PAN_WITH_RIGHT_MOUSE_BUTTON_NAME: "Right-click drag to pan",
PAN_WITH_RIGHT_MOUSE_BUTTON_DESC: "Right-click and drag to pan the canvas (Miro-style). Press 'm' to open the context menu.",
DEFAULT_PINCHZOOM_NAME: "Allow pinch zoom in pen mode",
DEFAULT_PINCHZOOM_DESC:
"Pinch zoom in pen mode when using the freedraw tool is disabled by default to prevent unwanted accidental zooming with your palm.<br>" +
@@ -432,6 +504,12 @@ FILENAME_HEAD: "Filename",
ZOOM_TO_FIT_MAX_LEVEL_NAME: "Zoom to fit max ZOOM level",
ZOOM_TO_FIT_MAX_LEVEL_DESC:
"Set the maximum level to which zoom to fit will enlarge the drawing. Minimum is 0.5 (50%) and maximum is 10 (1000%).",
ZOOM_STEP_NAME: "Zoom increment",
ZOOM_STEP_DESC: "Zoom increment (in percentage points) for actions like mouse wheel zoom. Smaller values give finer control but may require excessive scrolling. Default: 5%.",
ZOOM_MIN_NAME: "Minimum zoom",
ZOOM_MIN_DESC: "How far you can zoom out (fit more of the drawing on screen). Default: 10%. Values below 10% were historically unstable—lower with caution and reset to 10% if issues occur.",
ZOOM_MAX_NAME: "Maximum zoom",
ZOOM_MAX_DESC: "Upper zoom limit. Default: 3000%. Usually no need to change; included for completeness.",
PEN_HEAD: "Pen",
GRID_HEAD: "Grid",
GRID_DYNAMIC_COLOR_NAME: "Dynamic grid color",
@@ -439,8 +517,7 @@ FILENAME_HEAD: "Filename",
"<b><u>Toggle ON:</u></b>Change grid color to match the canvas color<br><b><u>Toggle OFF:</u></b>Use the color below as the grid color",
GRID_COLOR_NAME: "Grid color",
GRID_OPACITY_NAME: "Grid opacity",
GRID_OPACITY_DESC: "Grid opacity will also control the opacity of the binding box when binding an arrow to an element.<br>" +
"Set the opacity of the grid. 0 is transparent, 100 is opaque.",
GRID_OPACITY_DESC: "Sets the opacity of the grid. 0 is transparent, 100 is opaque.",
GRID_DIRECTION_NAME: "Grid direction",
GRID_DIRECTION_DESC: "The first toggle shows/hides the horizontal grid, the second toggle shows/hides the vertical grid.",
GRID_HORIZONTAL: "Render horizontal grid",
@@ -471,7 +548,8 @@ FILENAME_HEAD: "Filename",
LONG_PRESS_MOBILE_NAME: "Long press to open mobile",
LONG_PRESS_MOBILE_DESC: "Long press delay in milliseconds to open an Excalidraw Drawing embedded in a Markdown file. ",
DOUBLE_CLICK_LINK_OPEN_VIEW_MODE: "Allow double-click to open links in view mode",
ELEMENT_LINK_SYNC_NAME: "Sync text-element link with text",
ELEMENT_LINK_SYNC_DESC: "When enabled, Excalidraw matches pre-2.19.0 behavior: the first link in the text body is always copied to the element link field. SVG/PNG exports only keep links when the element link field holds a single link (not links inside the text body). Turn this ON if you rely on text-body links and want the element link to always mirror the first one. Turn it OFF if you manage the element link separately: for metadata like tags, inline link ontologies, or multiple links, e.g., dataview-style notes like '(reminds me of:: [[link]]) #noteToSelf'.",
FOCUS_ON_EXISTING_TAB_NAME: "Focus on Existing Tab",
FOCUS_ON_EXISTING_TAB_DESC: "When opening a link, Excalidraw will focus on the existing tab if the file is already open. " +
"Enabling this setting overrides 'Reuse Adjacent Pane' when the file is already open except for the 'Open the back-of-the-note of the selected excalidraw image' command palette action.",
@@ -494,6 +572,12 @@ FILENAME_HEAD: "Filename",
"In PREVIEW mode, when parsing Text Elements, place brackets around links. " +
"You can override this setting for a specific drawing by adding <code>"
}${FRONTMATTER_KEYS["link-brackets"].name}: true/false</code> to the file's frontmatter.`,
/*LINK_DETECTION_NAME: "Do not auto-create element link from text",
LINK_DETECTION_DESC: "By default, Excalidraw will automatically create an element link when you type or paste a valid " +
"[[Obsidian link]] or a (web link) into a Text Element. This link overrides whatever element link you may have set previously. " +
"Even if you delete the element link, if the text element contains a valid link, Excalidraw will recreate the element link. " +
"If you turn this setting on, Excalidraw will not auto-create element links from text. You can still manually set element links " +
`Links in the text will still be navigable when you ${labelCTRL()} + CLICK the element.`,*/
LINK_PREFIX_NAME: "Link prefix",
LINK_PREFIX_DESC: `${
"In PREVIEW mode, if the Text Element contains a link, precede the text with these characters. " +
@@ -545,7 +629,7 @@ FILENAME_HEAD: "Filename",
"Use the <code>http://iframely.server.crestify.com/iframely?url=</code> to get title of page when dropping a link into Excalidraw",
PDF_TO_IMAGE: "PDF to Image",
PDF_TO_IMAGE_SCALE_NAME: "PDF to Image conversion scale",
PDF_TO_IMAGE_SCALE_DESC: "Sets the resolution of the image that is generated from the PDF page. Higher resolution will result in bigger images in memory and consequently a higher load on your system (slower performance), but sharper imagee. " +
PDF_TO_IMAGE_SCALE_DESC: "Sets the resolution of the image that is generated from the PDF page. Higher resolution will result in bigger images in memory and consequently a higher load on your system (slower performance), but sharper image. " +
"Additionally, if you want to copy PDF pages (as images) to Excalidraw.com, the bigger image size may result in exceeding the 2MB limit on Excalidraw.com.",
EMBED_TOEXCALIDRAW_HEAD: "Embed files into Excalidraw",
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.",
@@ -705,7 +789,7 @@ FILENAME_HEAD: "Filename",
DUMMY_TEXT_ELEMENT_LINT_SUPPORT_NAME: "Linter compatibility",
DUMMY_TEXT_ELEMENT_LINT_SUPPORT_DESC: "Excalidraw is sensitive to the file structure below <code># Excalidraw Data</code>. Automatic linting of documents can create errors in Excalidraw Data. " +
"While I've made some effort to make the data loading resilient to " +
"lint changes, this solution is not foolproof.<br><mark>The best is to avoid liniting or otherwise automatically changing Excalidraw documents using different plugins.</mark><br>" +
"lint changes, this solution is not foolproof.<br><mark>The best is to avoid linting or otherwise automatically changing Excalidraw documents using different plugins.</mark><br>" +
"Use this setting if for good reasons you have decided to ignore my recommendation and configured linting of Excalidraw files.<br> " +
"The <code>## Text Elements</code> section is sensitive to empty lines. A common linting approach is to add an empty line after section headings. In case of Excalidraw this will break/change the first text element in your drawing. " +
"To overcome this, you can enable this setting. When enabled, Excalidraw will add a dummy element to the beginning of <code>## Text Elements</code> that the linter can safely modify." ,
@@ -822,10 +906,10 @@ FILENAME_HEAD: "Filename",
<strong>Note:</strong> If you're using Obsidian Sync and want to synchronize these font files across your devices, ensure that Obsidian Sync is set to synchronize "All other file types".`,
LOAD_CHINESE_FONTS_NAME: "Load Chinese fonts from file at startup",
LOAD_JAPANESE_FONTS_NAME: "Load Japanese fonts from file at startup",
LOAD_KOREAN_FONTS_NAME: "Load Korean fonts frome file at startup",
LOAD_KOREAN_FONTS_NAME: "Load Korean fonts from file at startup",
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.",
TASKBONE_HEAD: "Taskbone Optical Character Recogntion",
TASKBONE_HEAD: "Taskbone Optical Character Recognition",
TASKBONE_DESC: "This is an experimental integration of optical character recognition into Excalidraw. Please note, that taskbone is an independent external service not provided by Excalidraw, nor the Excalidraw-Obsidian plugin project. " +
"The OCR service will grab legible text from freedraw lines and embedded pictures on your canvas and place the recognized text in the frontmatter of your drawing as well as onto clipboard. " +
"Having the text in the frontmatter will enable you to search in Obsidian for the text contents of these. " +
@@ -834,7 +918,7 @@ FILENAME_HEAD: "Filename",
TASKBONE_ENABLE_DESC: "By enabling this service your agree to the Taskbone <a href='https://www.taskbone.com/legal/terms/' target='_blank'>Terms and Conditions</a> and the " +
"<a href='https://www.taskbone.com/legal/privacy/' target='_blank'>Privacy Policy</a>.",
TASKBONE_APIKEY_NAME: "Taskbone API Key",
TASKBONE_APIKEY_DESC: "Taskbone offers a free service with a reasonable number of scans per month. If you want to use this feature more frequently, or you want to supoprt " +
TASKBONE_APIKEY_DESC: "Taskbone offers a free service with a reasonable number of scans per month. If you want to use this feature more frequently, or you want to support " +
"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.",
@@ -877,9 +961,13 @@ FILENAME_HEAD: "Filename",
SCRIPT_EXECUTION_ERROR:
"Script execution error. Please find error message on the developer console.",
//ExcalidrawViewUtils.ts
MARKER_FRAME_RENDERING_DISABLED_NOTICE: "There are hidden marker-frames in the scene.",
//DRAWING_HAS_BACK_OF_THE_CARD: "There are notes on the back of this drawing.",
//ExcalidrawData.ts
LOAD_FROM_BACKUP: "Excalidraw file was corrupted. Loading from backup file.",
FONT_LOAD_SLOW: "Loading Fonts...\n\n This is taking longer than expected. If this delay occurs regulary then you may download the fonts locally to your Vault. \n\n" +
FONT_LOAD_SLOW: "Loading Fonts...\n\n This is taking longer than expected. If this delay occurs regularly then you may download the fonts locally to your Vault. \n\n" +
"(click=dismiss, right-click=Info)",
FONT_INFO_TITLE: "Starting v2.5.3 fonts load from the Internet",
FONT_INFO_DETAILED: `
@@ -921,8 +1009,12 @@ FILENAME_HEAD: "Filename",
//IFrameActionsMenu.tsx
NARROW_TO_HEADING: "Narrow to heading...",
PIN_VIEW: "Pin view",
DO_NOT_PIN_VIEW: "Do not pin view",
NARROW_TO_BLOCK: "Narrow to block...",
SHOW_ENTIRE_FILE: "Show entire file",
SELECT_SECTION: "Select section from document",
SELECT_VIEW: "Select view from base",
ZOOM_TO_FIT: "Zoom to fit",
RELOAD: "Reload original link",
OPEN_IN_BROWSER: "Open current link in browser",
@@ -1056,6 +1148,7 @@ FILENAME_HEAD: "Filename",
EXPORTDIALOG_BACKGROUND: "Background",
EXPORTDIALOG_BACKGROUND_TRANSPARENT: "Transparent",
EXPORTDIALOG_BACKGROUND_USE_COLOR: "Use scene color",
EXPORTDIALOG_INCLUDE_INTERNAL_LINKS: "Export internal links to SVG/PDF?",
// Selection
EXPORTDIALOG_SELECTED_ELEMENTS: "Export",
EXPORTDIALOG_SELECTED_ALL: "Entire scene",
@@ -1125,4 +1218,53 @@ FILENAME_HEAD: "Filename",
//exportUtils.ts
PDF_EXPORT_DESKTOP_ONLY: "PDF export is only available on desktop",
//UniversalInsertFileModal.ts
UIFM_TITLE: "Insert File From Vault",
UIFM_SECTION_HEAD: "Select section heading",
UIFM_ANCHOR: "Anchor to 100% of original size",
UIFM_ANCHOR_DESC: "This is a pro feature, use it only if you understand how it works. If enabled even if you change the size of the imported image in Excalidraw, the next time you open the drawing this image will pop back to 100% size. This is useful when embedding an atomic Excalidraw idea into another note and preserving relative sizing of text and icons.",
UIFM_BTN_EMBEDDABLE: "as Embeddable",
UIFM_BTN_PDF: "PDF as Image",
UIFM_BTN_IMAGE: "as Image",
//ReleaseNotes.ts
RN_WELCOME: "Welcome to Excalidraw",
//Excalidraw component
COMP_IMG: "Image & Files",
COMP_IMG_FROM_SYSTEM: "Import from system",
COMP_IMG_ANY_FILE: "ANY file from Vault",
COMP_IMG_LaTeX: "LaTeX formula",
COMP_FRAME: "Frame Actions",
COMP_FRAME_HINT: "Toggle Marker Frame. Guide-only frames to define slides/print areas/image references. " +
"Hidden in image exports; doesn't contain elements. Hide/show frames via canvas context menu.",
//CustomEmbeddable.tsx
NOTICE_PDF_THEME: "PDF theme overridden.\n" +
"Control via this file's 'excalidraw-embeddable-theme' document property (overrides plugin).\n\n" +
"Values: dark, light, auto=Excalidraw, default=Obsidian.",
//EmbeddableActionsMenu.tsx
BOOKMARK_PAGE: "Save current position in document",
CAPTURE_PAGE: "Capture current page as image",
//VersionMismatch.ts
//WARNING: Do not change the {VAL_RECORDED} and {VAL_ACTUAL} strings, they are replaced by the actual version values at runtime!
VERSION_MISMATCH_NOTICE: `The version recorded by Obsidian is <b>{VAL_RECORDED}</b>, but the installed Excalidraw code is <b>{VAL_ACTUAL}</b>.`,
VERSION_MISMATCH_HEADING: "Excalidraw version mismatch",
VERSION_MISMATCH_CAUSE: "This usually happens after a partial sync (e.g. Obsidian Sync Standard) where large files (main.js > 5MB) did not sync, so only <code>manifest.json</code> updated.",
VERSION_MISMATCH_OPTIONS: "Options:<br><b>1.</b> Re-download the plugin (recommended).<br><b>2.</b> Ignore for now.",
VERSION_MISMATCH_NOTE: "Note: Updating version info manually may affect tools that read manifest.json directly (e.g. Plugin Update Tracker, BRAT) until a full reinstall.",
VERSION_MISMATCH_DISABLE_NAME: "Disable future mismatch warnings",
VERSION_MISMATCH_DISABLE_DESC: "You can re-enable this under: Settings → Excalidraw → Basic → Warn about incomplete plugin updates.",
VERSION_MISMATCH_REDOWNLOAD: "Re-download plugin",
VERSION_MISMATCH_IGNORE: "Ignore",
//InlineLinkSuggester.ts
INLINE_HINT: "Type [[ to search and insert a link",
//SuggestionModal.ts
SUGGESTION_NOMATCH: "No matches found",
};
+1235 -2
View File
File diff suppressed because it is too large. Load diff
+6 -1
View File
@@ -215,6 +215,9 @@ export default {
"Модель ИИ по умолчанию, используемая при генерации текста. Это поле свободного текста, поэтому вы можете ввести любое действительное имя модели OpenAI. " +
"Узнайте больше о доступных моделях на <a href='https://platform.openai.com/docs/models'>OpenAI сайте</a>.",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "Введите здесь модель искусственного интеллекта по умолчанию, например: gpt-3.5-turbo-1106.",
AI_OPENAI_DEFAULT_MAX_TOKENS_NAME: "Максимальное количество токенов",
AI_OPENAI_DEFAULT_MAX_TOKENS_DESC:
"Максимальное количество токенов для генерации в ответе API. Установите значение 0, чтобы пропустить поле max_tokens (полезно для моделей, которые не поддерживают этот параметр, таких как GPT-5).",
AI_OPENAI_DEFAULT_IMAGE_MODEL_NAME: "Модель ИИ для генерации изображений по умолчанию",
AI_OPENAI_DEFAULT_IMAGE_MODEL_DESC:
"Модель ИИ по умолчанию, используемая при генерации изображений. Редактирование и изменение изображений поддерживается OpenAI только в dall-e-2, " +
@@ -345,7 +348,9 @@ FILENAME_HEAD: "Имя файла",
"конфликтуют с настройками горячих клавиш Obsidian. Комбинации горячих клавиш, которые вы добавите ниже, отменят настройки горячих клавиш Obsidian при использовании Excalidraw, таким образом " +
`Вы можете добавить <code>${labelCTRL()}+G</code>, если хотите по умолчанию перейти к Группе Объектов в Excalidraw вместо открытия Режима просмотра Графиков.`,
THEME_HEAD: "Тема и стиль",
ZOOM_HEAD: "Масштабирование",
ZOOM_AND_PAN_HEAD: "Масштаб и панорамирование",
PAN_WITH_RIGHT_MOUSE_BUTTON_NAME: "Перемещение холста правой кнопкой мыши (открыть меню с 'm')",
PAN_WITH_RIGHT_MOUSE_BUTTON_DESC: "Когда этот параметр включен, вы можете перемещать холст, нажимая правую кнопку мыши и перетаскивая. Контекстное меню откроется с помощью клавиши 'm', если только вы не редактируете текст.",
DEFAULT_PINCHZOOM_NAME: "Разрешить масштабирование в режиме пера",
DEFAULT_PINCHZOOM_DESC:
"По умолчанию зуммирование в режиме пера при использовании инструмента «Свободное рисование» отключено, чтобы предотвратить нежелательное случайное масштабирование с помощью ладони.<br>" +
+664 -521
View File
File diff suppressed because it is too large. Load diff
+1265 -2
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -6,9 +6,9 @@ import { Notice } from "obsidian";
import { getEA } from "src/core";
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { cloneElement } from "src/utils/excalidrawAutomateUtils";
import { ExportSettings } from "src/view/ExcalidrawView";
import { nanoid } from "src/constants/constants";
import { svgToBase64 } from "../utils/utils";
import { ExportSettings } from "src/types/exportUtilTypes";
/**
* Creates a masked image from an Excalidraw scene.
+127
View File
@@ -0,0 +1,127 @@
import ExcalidrawView from "src/view/ExcalidrawView";
import { getViewColorPalette } from "src/utils/excalidrawViewUtils";
type PaletteName = "canvasBackground"|"elementBackground"|"elementStroke";
const GRID_COLUMNS = 5;
const CELL_SIZE = 32;
const CELL_GAP = 8;
const POPUP_PADDING = 12;
const MAX_HEIGHT = 260;
const getColors = (palette: PaletteName, view?: ExcalidrawView, includeSceneColors: boolean = false): string[] => {
const raw = getViewColorPalette(palette, view, includeSceneColors) ?? [];
const flattened: string[] = [];
raw.forEach((entry: any) => {
if (Array.isArray(entry)) {
entry.forEach((color) => {
if (typeof color === "string" && color) {
flattened.push(color);
}
});
} else if (typeof entry === "string" && entry) {
flattened.push(entry);
}
});
return flattened;
};
const positionPopup = (popup: HTMLElement, anchor: HTMLElement) => {
const rect = anchor.getBoundingClientRect();
const { innerWidth, innerHeight } = window;
const popupWidth = popup.offsetWidth || (GRID_COLUMNS * (CELL_SIZE + CELL_GAP)) + POPUP_PADDING * 2;
const popupHeight = popup.offsetHeight || MAX_HEIGHT + POPUP_PADDING * 2;
let left = rect.left;
let top = rect.bottom + 8;
if (left + popupWidth > innerWidth - 8) {
left = Math.max(8, innerWidth - popupWidth - 8);
}
if (top + popupHeight > innerHeight - 8) {
top = Math.max(8, rect.top - popupHeight - 8);
}
popup.style.left = `${left}px`;
popup.style.top = `${top}px`;
};
const attachOutsideHandlers = (
overlay: HTMLElement,
popup: HTMLElement,
resolve: (color: string | null) => void,
) => {
const stopPropagation = (evt: Event) => evt.stopPropagation();
let cleanup: (color: string | null) => void;
const onKeyDown = (evt: KeyboardEvent) => {
if (evt.key === "Escape") {
evt.stopPropagation();
cleanup(null);
}
};
const onOverlayClick = () => cleanup(null);
cleanup = (color: string | null) => {
document.removeEventListener("keydown", onKeyDown, true);
overlay.removeEventListener("click", onOverlayClick);
popup.removeEventListener("click", stopPropagation);
overlay.remove();
resolve(color);
};
document.addEventListener("keydown", onKeyDown, true);
overlay.addEventListener("click", onOverlayClick);
popup.addEventListener("click", stopPropagation);
return cleanup;
};
export const showColorPicker = async (
palette: PaletteName,
anchorElement: HTMLElement,
view?: ExcalidrawView,
includeSceneColors: boolean = false,
): Promise<string | null> => {
const colors = getColors(palette, view, includeSceneColors);
if (!colors.length) {
return null;
}
return new Promise((resolve) => {
const overlay = document.createElement("div");
overlay.classList.add("excalidraw-colorpicker-overlay");
const popup = document.createElement("div");
popup.classList.add("excalidraw-colorpicker-popup");
const grid = document.createElement("div");
grid.classList.add("excalidraw-colorpicker-grid");
grid.style.gridTemplateColumns = `repeat(${GRID_COLUMNS}, ${CELL_SIZE}px)`;
grid.style.gap = `${CELL_GAP}px`;
grid.style.maxHeight = `${MAX_HEIGHT}px`;
colors.forEach((color) => {
const swatch = document.createElement("button");
swatch.type = "button";
swatch.ariaLabel = color;
swatch.classList.add("excalidraw-colorpicker-swatch");
swatch.style.backgroundColor = color;
swatch.addEventListener("click", () => cleanup(color));
grid.appendChild(swatch);
});
popup.appendChild(grid);
overlay.appendChild(popup);
document.body.appendChild(overlay);
positionPopup(popup, anchorElement);
const cleanup = attachOutsideHandlers(overlay, popup, resolve);
});
};
+11 -3
View File
@@ -37,6 +37,7 @@ export class EmbeddableSettings extends Modal {
private isLocalURI: boolean;
private mdCustomData: EmbeddableMDCustomProps;
private onKeyDown: (ev: KeyboardEvent) => void;
private listenerHost: Document | null = null;
constructor(
private plugin: ExcalidrawPlugin,
@@ -50,7 +51,7 @@ export class EmbeddableSettings extends Modal {
this.zoomValue = element.scale[0];
this.isYouTube = isYouTube(this.element.link);
this.notExcalidrawIsInternal = this.file && !this.view.plugin.isExcalidrawFile(this.file)
this.isMDFile = this.file && this.file.extension === "md"; // && !this.view.plugin.isExcalidrawFile(this.file);
this.isMDFile = this.file && this.file.extension.toLowerCase() === "md"; // && !this.view.plugin.isExcalidrawFile(this.file);
this.isLocalURI = this.element.link.startsWith("file://");
if(isYouTube) this.youtubeStart = getYouTubeStartAt(this.element.link);
@@ -72,7 +73,10 @@ export class EmbeddableSettings extends Modal {
}
onClose() {
this.containerEl.removeEventListener("keydown",this.onKeyDown);
if(this.listenerHost && this.onKeyDown) {
this.listenerHost.removeEventListener("keydown",this.onKeyDown);
this.listenerHost = null;
}
this.plugin = null;
this.view = null;
this.file = null;
@@ -166,7 +170,11 @@ export class EmbeddableSettings extends Modal {
}
this.onKeyDown = onKeyDown;
this.containerEl.ownerDocument.addEventListener("keydown",onKeyDown);
const ownerDoc = this.containerEl.ownerDocument;
if(ownerDoc) {
this.listenerHost = ownerDoc;
ownerDoc.addEventListener("keydown",onKeyDown);
}
}
private async applySettings() {
+16 -3
View File
@@ -5,8 +5,9 @@ import { DEVICE } from "src/constants/constants";
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import ExcalidrawView from "src/view/ExcalidrawView";
import ExcalidrawPlugin from "src/core/main";
import { fragWithHTML, getExportPadding, getExportTheme, getPNGScale, getWithBackground, shouldEmbedScene } from "src/utils/utils";
import { PageOrientation, PageSize, PDFPageAlignment, PDFPageMarginString, exportSVGToClipboard, exportPNG, exportPNGToClipboard } from "src/utils/exportUtils";
import { fragWithHTML, getExportInternalLinks, getExportPadding, getExportTheme, getPNGScale, getWithBackground, shouldEmbedScene } from "src/utils/utils";
import { exportSVGToClipboard, exportPNG, exportPNGToClipboard } from "src/utils/exportUtils";
import { PageOrientation, PageSize, PDFPageAlignment, PDFPageMarginString } from "src/types/exportUtilTypes";
import { t } from "src/lang/helpers";
import { PDFExportSettings, PDFExportSettingsComponent } from "./PDFExportSettingsComponent";
import { captureScreenshot } from "src/utils/screenshot";
@@ -21,6 +22,7 @@ export class ExportDialog extends Modal {
public scale: number;
public theme: string;
public transparent: boolean;
public exportInternalLinks: boolean = true;
public saveSettings: boolean;
public dirty: boolean = false;
private selectedOnlySetting: Setting;
@@ -63,6 +65,7 @@ export class ExportDialog extends Modal {
this.exportSelectedOnly = false;
this.saveToVault = true;
this.transparent = !getWithBackground(this.plugin, this.file);
this.exportInternalLinks = getExportInternalLinks(this.plugin, this.file);
this.pageSize = plugin.settings.pdfSettings.pageSize;
this.pageOrientation = plugin.settings.pdfSettings.pageOrientation;
@@ -301,7 +304,17 @@ export class ExportDialog extends Modal {
.onChange(value => {
this.transparent = value === "transparent";
})
)
);
new Setting(this.contentContainer)
.setName(t("EXPORTDIALOG_INCLUDE_INTERNAL_LINKS"))
.addToggle(toggle =>
toggle
.setValue(this.exportInternalLinks)
.onChange(value => {
this.exportInternalLinks = value;
})
);
}
this.selectedOnlySetting = new Setting(this.contentContainer)
+282
View File
@@ -0,0 +1,282 @@
import { App, Modal } from "obsidian";
function getClientPoint(e: PointerEvent | TouchEvent) {
if (e.type.startsWith("touch")) {
const t = (e as TouchEvent).touches[0] ?? (e as TouchEvent).changedTouches[0];
return t ? { x: t.clientX, y: t.clientY } : null;
}
const p = e as PointerEvent;
return { x: p.clientX, y: p.clientY };
}
function pointInRect(pt: { x: number; y: number }, r: DOMRect, padding = 1): boolean {
return (
pt.x >= r.left - padding &&
pt.x <= r.right + padding &&
pt.y >= r.top - padding &&
pt.y <= r.bottom + padding
);
}
function isPointOnText(e: PointerEvent | TouchEvent, doc: Document): boolean {
const pt = getClientPoint(e);
if (!pt) return false;
let offsetNode: Node | null = null;
let offset: number | null = null;
// Chromium/Firefox-ish
const caretPos = (doc as any).caretPositionFromPoint?.(pt.x, pt.y);
if (caretPos?.offsetNode) {
offsetNode = caretPos.offsetNode;
offset = typeof caretPos.offset === "number" ? caretPos.offset : null;
} else {
// Safari/WebKit
const caretRange = (doc as any).caretRangeFromPoint?.(pt.x, pt.y);
if (caretRange?.startContainer) {
offsetNode = caretRange.startContainer;
offset = typeof caretRange.startOffset === "number" ? caretRange.startOffset : null;
}
}
if (!offsetNode || offsetNode.nodeType !== Node.TEXT_NODE || offset == null) return false;
if (!offsetNode.textContent?.trim()) return false;
const textNode = offsetNode as Text;
const len = textNode.data.length;
const at = Math.max(0, Math.min(offset, len));
const range = doc.createRange();
if (at < len) {
range.setStart(textNode, at);
range.setEnd(textNode, at + 1);
} else if (at > 0) {
range.setStart(textNode, at - 1);
range.setEnd(textNode, at);
} else {
return false;
}
const rects = Array.from(range.getClientRects());
if (rects.length === 0) return false;
return rects.some((r) => pointInRect(pt, r, 1));
}
export class FloatingModal extends Modal {
private dragging = false;
private offsetX = 0;
private offsetY = 0;
private pointerDownHandler: (e: PointerEvent | TouchEvent) => void;
private pointerMoveHandler: (e: PointerEvent | TouchEvent) => void;
private pointerUpHandler: () => void;
private disableKeyCapture = true; // new flag: when true, let keystrokes pass through to workspace
private previousActive: HTMLElement | null = null; // stores element focused before opening
private escListener: (e: KeyboardEvent) => void;
private modalKeydownStopHandler: (e: KeyboardEvent) => void; // store handler so we can remove it
private ownerWindow: Window = window;
private ownerDocument: Document = document;
constructor(app: App) {
super(app);
// Initialize event handlers with proper binding
this.pointerDownHandler = this.handlePointerDown.bind(this);
this.pointerMoveHandler = this.handlePointerMove.bind(this);
this.pointerUpHandler = this.handlePointerUp.bind(this);
this.escListener = this.handleEscKey.bind(this);
this.modalKeydownStopHandler = (ev: KeyboardEvent) => ev.stopPropagation();
}
private handlePointerDown(e: PointerEvent | TouchEvent): void {
// Get the target element
const target = e.target as HTMLElement;
// Ignore if clicking on interactive elements
if (
target instanceof HTMLInputElement ||
target instanceof HTMLTextAreaElement ||
target instanceof HTMLSelectElement ||
target instanceof HTMLButtonElement ||
isPointOnText(e, this.ownerDocument) ||
target.closest(".clickable-icon") ||
target.closest(".modal-close-button") // ensure close button never starts drag
) {
return;
}
// For touch events, prevent default behavior to avoid Obsidian's handling
if (e.type === "touchstart") {
e.preventDefault();
e.stopPropagation();
if ((e as TouchEvent).touches.length !== 1) return;
const touch = (e as TouchEvent).touches[0];
this.dragging = true;
const { modalEl } = this;
this.offsetX = touch.clientX - modalEl.getBoundingClientRect().left;
this.offsetY = touch.clientY - modalEl.getBoundingClientRect().top;
modalEl.style.height = "fit-content";
// Add touch-specific event listeners
this.ownerDocument.addEventListener("touchmove", this.pointerMoveHandler as (e: TouchEvent) => void, {
passive: false,
});
this.ownerDocument.addEventListener("touchend", this.pointerUpHandler);
this.ownerDocument.addEventListener("touchcancel", this.pointerUpHandler);
} else {
// Handle pointer events
this.dragging = true;
const { modalEl } = this;
const pointerEvent = e as PointerEvent;
this.offsetX = pointerEvent.clientX - modalEl.getBoundingClientRect().left;
this.offsetY = pointerEvent.clientY - modalEl.getBoundingClientRect().top;
// Add pointer-specific event listeners
this.ownerDocument.addEventListener("pointermove", this.pointerMoveHandler as (e: PointerEvent) => void);
this.ownerDocument.addEventListener("pointerup", this.pointerUpHandler);
// Capture the pointer to ensure we get events even when outside the target
target.setPointerCapture(pointerEvent.pointerId);
}
}
private handlePointerMove(e: PointerEvent | TouchEvent): void {
if (!this.dragging) return;
const { modalEl } = this;
// Prevent default behavior
e.preventDefault();
if (e.type === "touchmove") e.stopPropagation();
let clientX, clientY;
if (e.type === "touchmove") {
const touch = (e as TouchEvent).touches[0];
clientX = touch.clientX;
clientY = touch.clientY;
} else {
const pointerEvent = e as PointerEvent;
clientX = pointerEvent.clientX;
clientY = pointerEvent.clientY;
}
const x = clientX - this.offsetX;
const y = clientY - this.offsetY;
// Position the modal element
modalEl.style.left = `${x}px`;
modalEl.style.top = `${y}px`;
modalEl.style.transform = "none"; // Remove centering transform
}
private handlePointerUp(): void {
this.dragging = false;
// Remove all event listeners
this.ownerDocument.removeEventListener("pointermove", this.pointerMoveHandler as (e: PointerEvent) => void);
this.ownerDocument.removeEventListener("pointerup", this.pointerUpHandler);
this.ownerDocument.removeEventListener("touchmove", this.pointerMoveHandler as (e: TouchEvent) => void);
this.ownerDocument.removeEventListener("touchend", this.pointerUpHandler);
this.ownerDocument.removeEventListener("touchcancel", this.pointerUpHandler);
}
private handleEscKey(e: KeyboardEvent) {
if (e.key === "Escape") {
e.stopPropagation();
this.close();
}
}
open(): void {
super.open();
this.ownerDocument = this.modalEl.ownerDocument ?? document;
this.ownerWindow = this.ownerDocument.defaultView ?? window;
// NEW: capture previously focused element & release Obsidian modal key trapping
if (this.disableKeyCapture) {
this.previousActive = this.ownerDocument.activeElement as HTMLElement | null;
try {
// @ts-ignore pop modal's key scope so keys are not intercepted
this.app.keymap.popScope(this.scope);
} catch {}
try {
// @ts-ignore prevent automatic selection / focus restoration
this.shouldRestoreSelection = false;
} catch {}
}
setTimeout(() => {
//@ts-ignore
const { containerEl, modalEl, bgEl, headerEl } = this;
containerEl.style.pointerEvents = "none";
if (bgEl) bgEl.style.display = "none";
if (headerEl) headerEl.style.pointerEvents = "none";
// Set initial position and make modal draggable
if (modalEl) {
modalEl.style.pointerEvents = "auto";
// Position absolute is needed for custom positioning
modalEl.style.position = "absolute";
// Center the modal initially
const rect = modalEl.getBoundingClientRect();
const centerX = this.ownerWindow.innerWidth / 2 - rect.width / 2;
const centerY = this.ownerWindow.innerHeight / 2 - rect.height / 2;
modalEl.style.left = `${centerX}px`;
modalEl.style.top = `${centerY}px`;
modalEl.style.transform = "none";
const modalStyle = this.ownerWindow.getComputedStyle(modalEl);
modalEl.style.borderBottomLeftRadius = modalStyle.borderTopLeftRadius;
modalEl.style.borderBottomRightRadius = modalStyle.borderTopRightRadius;
// Add event listeners for both pointer and touch events
modalEl.addEventListener("pointerdown", this.pointerDownHandler as (e: PointerEvent) => void);
modalEl.addEventListener("touchstart", this.pointerDownHandler as (e: TouchEvent) => void, {
passive: false,
});
if (this.disableKeyCapture) {
// Prevent the modal from stealing focus
modalEl.setAttr("tabindex", "-1");
// Refocus previous element (if still in DOM)
if (this.previousActive?.isConnected) {
this.previousActive.focus({ preventScroll: true });
}
// Stop key events originating inside the modal from bubbling back
modalEl.addEventListener("keydown", this.modalKeydownStopHandler, { capture: true });
}
// Add ESC listener (capture to run before underlying workspace)
this.ownerDocument.addEventListener("keydown", this.escListener, { capture: true });
// NEW: re-enable pointer events on the close button so it is tappable on mobile
const closeBtn = containerEl.querySelector(".modal-close-button");
if (closeBtn) {
(closeBtn as HTMLElement).style.pointerEvents = "auto";
}
}
});
}
close(): void {
// Optional: restore previous focus if body ended up focused
if (this.disableKeyCapture && this.previousActive?.isConnected && this.ownerDocument.activeElement === this.ownerDocument.body) {
try { this.previousActive.focus({ preventScroll: true }); } catch {}
}
const { modalEl } = this;
// Clean up event listeners
if (modalEl) {
modalEl.removeEventListener("pointerdown", this.pointerDownHandler as (e: PointerEvent) => void);
modalEl.removeEventListener("touchstart", this.pointerDownHandler as (e: TouchEvent) => void);
// Remove the capturing keydown stopper if it was added
modalEl.removeEventListener("keydown", this.modalKeydownStopHandler, { capture: true });
}
// Remove any remaining document event listeners
this.handlePointerUp();
this.ownerDocument.removeEventListener("keydown", this.escListener, { capture: true });
super.close();
}
// (Optional helper if you want to toggle later)
enableKeyCapture() { this.disableKeyCapture = false; }
disableKeyCaptureFn() { this.disableKeyCapture = true; }
}
+13 -13
View File
@@ -1,22 +1,25 @@
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { t } from "src/lang/helpers";
import { CaptureUpdateAction } from "src/constants/constants";
import { FloatingModal } from "./FloatingModal";
import ExcalidrawView from "src/view/ExcalidrawView";
import { Setting } from "obsidian";
export const showFrameSettings = (ea: ExcalidrawAutomate) => {
const {enabled, clip, name, outline} = ea.getExcalidrawAPI().getAppState().frameRendering;
export const showFrameSettings = (view: ExcalidrawView) => {
const {enabled, clip, name, outline, markerName, markerEnabled} = view.excalidrawAPI.getAppState().frameRendering;
// Create modal dialog
const frameSettingsModal = new ea.obsidian.Modal(ea.plugin.app);
const frameSettingsModal = new FloatingModal(view.app);
frameSettingsModal.onOpen = () => {
const {contentEl} = frameSettingsModal;
contentEl.createEl("h1", {text: t("FRAME_SETTINGS_TITLE")});
const settings = { enabled, clip, name, outline };
const settings = { enabled, clip, name, outline, markerName, markerEnabled };
// Add toggles
const enableFramesSetting = new ea.obsidian.Setting(contentEl)
new Setting(contentEl)
.setName(t("FRAME_SETTINGS_ENABLE"))
.addToggle(toggle => toggle
.setValue(settings.enabled)
@@ -28,21 +31,21 @@ export const showFrameSettings = (ea: ExcalidrawAutomate) => {
})
);
const displayFrameNameSetting = new ea.obsidian.Setting(contentEl)
const displayFrameNameSetting = new Setting(contentEl)
.setName(t("FRAME_SETTIGNS_NAME"))
.addToggle(toggle => toggle
.setValue(settings.name)
.onChange(value => settings.name = value)
);
const displayFrameOutlineSetting = new ea.obsidian.Setting(contentEl)
const displayFrameOutlineSetting = new Setting(contentEl)
.setName(t("FRAME_SETTINGS_OUTLINE"))
.addToggle(toggle => toggle
.setValue(settings.outline)
.onChange(value => settings.outline = value)
);
const enableFrameClippingSetting = new ea.obsidian.Setting(contentEl)
const enableFrameClippingSetting = new Setting(contentEl)
.setName(t("FRAME_SETTINGS_CLIP"))
.addToggle(toggle => toggle
.setValue(settings.clip)
@@ -55,12 +58,12 @@ export const showFrameSettings = (ea: ExcalidrawAutomate) => {
hideComponent(enableFrameClippingSetting, !settings.enabled);
// Add OK button
new ea.obsidian.Setting(contentEl)
new Setting(contentEl)
.addButton(button => button
.setButtonText("OK")
.onClick(() => {
// Update appState with new settings
ea.viewUpdateScene({
view.updateScene({
// @ts-ignore
appState: {
frameRendering: settings
@@ -72,9 +75,6 @@ export const showFrameSettings = (ea: ExcalidrawAutomate) => {
);
};
frameSettingsModal.onClose = () => {
ea.destroy();
}
frameSettingsModal.open();
};
@@ -1,5 +1,4 @@
import { App, FuzzySuggestModal, TFile } from "obsidian";
import { REG_LINKINDEX_INVALIDCHARS } from "../../constants/constants";
import { t } from "../../lang/helpers";
export class InsertCommandDialog extends FuzzySuggestModal<TFile> {
+7 -64
View File
@@ -1,9 +1,9 @@
import { FuzzyMatch, FuzzySuggestModal, setIcon } from "obsidian";
import { AUDIO_TYPES, CODE_TYPES, ICON_NAME, IMAGE_TYPES, REG_LINKINDEX_INVALIDCHARS, VIDEO_TYPES } from "../../constants/constants";
import { FuzzyMatch, FuzzySuggestModal } from "obsidian";
import { t } from "../../lang/helpers";
import ExcalidrawPlugin from "src/core/main";
import { getLink } from "src/utils/fileUtils";
import { LinkSuggestion } from "src/types/types";
import { getLinkSuggestionsFiltered, getSortedLinkMatches, renderLinkSuggestion } from "src/shared/Suggesters/LinkSuggesterUtils";
export class InsertLinkDialog extends FuzzySuggestModal<LinkSuggestion> {
@@ -32,13 +32,7 @@ export class InsertLinkDialog extends FuzzySuggestModal<LinkSuggestion> {
getItems(): LinkSuggestion[] {
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/422
return (
this.app.metadataCache
//@ts-ignore
.getLinkSuggestions()
//@ts-ignore
.filter((x) => !x.path.match(REG_LINKINDEX_INVALIDCHARS))
);
return getLinkSuggestionsFiltered(this.app);
}
getItemText(item: LinkSuggestion): string {
@@ -59,62 +53,11 @@ export class InsertLinkDialog extends FuzzySuggestModal<LinkSuggestion> {
}
renderSuggestion(result: FuzzyMatch<LinkSuggestion>, itemEl: HTMLElement) {
const { item, match: matches } = result || {};
itemEl.addClass("mod-complex");
const contentEl = itemEl.createDiv("suggestion-content");
const auxEl = itemEl.createDiv("suggestion-aux");
const titleEl = contentEl.createDiv("suggestion-title");
const noteEl = contentEl.createDiv("suggestion-note");
renderLinkSuggestion(this.plugin, result, itemEl, this.emptyStateText);
}
if (!item) {
titleEl.setText(this.emptyStateText);
itemEl.addClass("is-selected");
return;
}
const path = item.file?.path ?? item.path;
const pathLength = path.length - (item.file?.name.length ?? 0);
const matchElements = matches.matches.map((m) => {
return createSpan("suggestion-highlight");
});
const itemText = this.getItemText(item);
for (let i = pathLength; i < itemText.length; i++) {
const match = matches.matches.find((m) => m[0] === i);
if (match) {
const element = matchElements[matches.matches.indexOf(match)];
titleEl.appendChild(element);
element.appendText(itemText.substring(match[0], match[1]));
i += match[1] - match[0] - 1;
continue;
}
titleEl.appendText(itemText[i]);
}
noteEl.setText(path);
if(!item.file) {
setIcon(auxEl, "ghost");
} else if(this.plugin.isExcalidrawFile(item.file)) {
setIcon(auxEl, ICON_NAME);
} else if (item.file.extension === "md") {
setIcon(auxEl, "square-pen");
} else if (IMAGE_TYPES.includes(item.file.extension)) {
setIcon(auxEl, "image");
} else if (VIDEO_TYPES.includes(item.file.extension)) {
setIcon(auxEl, "monitor-play");
} else if (AUDIO_TYPES.includes(item.file.extension)) {
setIcon(auxEl, "file-audio");
} else if (CODE_TYPES.includes(item.file.extension)) {
setIcon(auxEl, "file-code");
} else if (item.file.extension === "canvas") {
setIcon(auxEl, "layout-dashboard");
} else if (item.file.extension === "pdf") {
setIcon(auxEl, "book-open-text");
} else {
auxEl.setText(item.file.extension);
}
getSuggestions(query: string): FuzzyMatch<LinkSuggestion>[] {
return getSortedLinkMatches(query, this.getItems());
}
onClose(): void {
+83 -29
View File
@@ -20,6 +20,7 @@ export class InsertPDFModal extends Modal {
private lockAfterImport: boolean = true;
private pagesToImport:number[] = [];
private pageDimensions: {width: number, height: number} = {width: 0, height: 0};
private pageDimensionsByPage: Map<number, {width: number; height: number}> = new Map();
private importScale = 0.3;
private imageSizeMessage: HTMLElement;
private pdfDoc: any;
@@ -63,6 +64,7 @@ export class InsertPDFModal extends Modal {
this.pdfDoc.destroy();
this.pdfDoc = null;
}
this.pageDimensionsByPage.clear();
this.plugin = null;
this.view = null;
this.app = null;
@@ -70,23 +72,44 @@ export class InsertPDFModal extends Modal {
this.setImageSizeMessage = null;
}
private async getPDFPageDimensions (pdfDoc: any) {
try {
const scale = this.plugin.settings.pdfScale;
const canvas = createEl("canvas");
const page = await pdfDoc.getPage(1);
// Set scale
const viewport = page.getViewport({ scale });
this.pageDimensions.height = viewport.height;
this.pageDimensions.width = viewport.width;
//https://github.com/excalidraw/excalidraw/issues/4036
canvas.width = 0;
canvas.height = 0;
this.setImageSizeMessage();
} catch(e) {
console.log(e);
private async loadPageDimensions(pages?: number[]) {
if(!this.pdfDoc) return;
const scale = this.plugin.settings.pdfScale;
const pagesToLoad = pages && pages.length > 0 ? [...new Set(pages)] : [1];
for (const pageNum of pagesToLoad) {
if(this.pageDimensionsByPage.has(pageNum)) continue;
try {
const page = await this.pdfDoc.getPage(pageNum);
const viewport = page.getViewport({ scale });
this.pageDimensionsByPage.set(pageNum, { width: viewport.width, height: viewport.height });
} catch(e) {
console.log(e);
}
}
this.pageDimensions = this.getMaxSelectedPageDimensions();
this.setImageSizeMessage();
}
private getMaxSelectedPageDimensions() {
let width = 0;
let height = 0;
const pages = this.pagesToImport.length > 0
? this.pagesToImport
: Array.from(this.pageDimensionsByPage.keys());
pages.forEach((p) => {
const dims = this.pageDimensionsByPage.get(p);
if(!dims) return;
width = Math.max(width, dims.width);
height = Math.max(height, dims.height);
});
if(width === 0 || height === 0) {
const first = this.pageDimensionsByPage.values().next().value;
if(first) {
width = first.width;
height = first.height;
}
}
return { width, height };
}
@@ -118,7 +141,11 @@ export class InsertPDFModal extends Modal {
return this.pagesToImport;
}
private setImageSizeMessage = () => this.imageSizeMessage.innerText = `${Math.round(this.pageDimensions.width*this.importScale)} x ${Math.round(this.pageDimensions.height*this.importScale)}`;
private setImageSizeMessage = () => {
if(!this.imageSizeMessage) return;
const dims = this.getMaxSelectedPageDimensions();
this.imageSizeMessage.innerText = `${Math.round(dims.width*this.importScale)} x ${Math.round(dims.height*this.importScale)}`;
};
async createForm() {
await this.plugin.loadSettings();
@@ -136,7 +163,7 @@ export class InsertPDFModal extends Modal {
let numPagesMessage: HTMLParagraphElement;
let numPages: number;
let numPages: number = 0;
let importButton: ButtonComponent;
let importMessage: HTMLElement;
@@ -174,8 +201,15 @@ export class InsertPDFModal extends Modal {
let pageRangesTextComponent: TextComponent
let importPagesMessage: HTMLParagraphElement;
const rangeOnChange = (value:string) => {
const rangeOnChange = async (value:string) => {
const pages = this.createPageListFromString(value);
if(this.pdfDoc && pages.length > 0) {
await this.loadPageDimensions(pages);
} else {
this.pageDimensionsByPage.clear();
this.pageDimensions = {width: 0, height: 0};
this.setImageSizeMessage();
}
if(pages.length > 15) {
importPagesMessage.innerHTML = `You are importing <b>${pages.length}</b> pages. ⚠️ This may take a while. ⚠️`;
} else {
@@ -187,6 +221,10 @@ export class InsertPDFModal extends Modal {
const setFile = async (file: TFile) => {
if(this.pdfDoc) await this.pdfDoc.destroy();
this.pdfDoc = null;
this.pageDimensionsByPage.clear();
this.pageDimensions = {width: 0, height: 0};
numPages = 0;
this.setImageSizeMessage();
if(file) {
this.pdfDoc = await getPDFDoc(file);
@@ -194,14 +232,16 @@ export class InsertPDFModal extends Modal {
if(this.pdfDoc) {
numPages = this.pdfDoc.numPages;
pageRangesTextComponent.setValue(`1-${numPages}`);
rangeOnChange(`1-${numPages}`);
await rangeOnChange(`1-${numPages}`);
importButtonMessages();
numPagesMessages();
this.getPDFPageDimensions(this.pdfDoc);
} else {
importButton.setDisabled(true);
}
}
} else {
importButtonMessages();
numPagesMessages();
}
}
const search = new TextComponent(ce);
@@ -225,7 +265,7 @@ export class InsertPDFModal extends Modal {
pageRangesTextComponent = text;
text
.setValue("")
.onChange((value) => rangeOnChange(value))
.onChange(async (value) => { await rangeOnChange(value); })
text.inputEl.style.width = "100%";
})
importPagesMessage = ce.createEl("p", {text: ""});
@@ -382,9 +422,10 @@ export class InsertPDFModal extends Modal {
el.innerText = ` ${this.gapSize.toString()}`;
});
const initialDims = this.getMaxSelectedPageDimensions();
const importSizeSetting = new Setting(ce)
.setName("Imported page size")
.setDesc(`${this.pageDimensions.width*this.importScale} x ${this.pageDimensions.height*this.importScale}`)
.setDesc(`${Math.round(initialDims.width*this.importScale)} x ${Math.round(initialDims.height*this.importScale)}`)
.addSlider(slider => slider
.setLimits(0.1, 1.5, 0.1)
.setValue(this.importScale)
@@ -395,6 +436,7 @@ export class InsertPDFModal extends Modal {
}))
this.imageSizeMessage = importSizeSetting.descEl;
this.setImageSizeMessage();
const actionButton = new Setting(ce)
.setDesc("Select a document first")
@@ -406,13 +448,22 @@ export class InsertPDFModal extends Modal {
const ea = getEA(this.view) as ExcalidrawAutomate;
let column = 0;
let row = 0;
const imgWidth = Math.round(this.pageDimensions.width*this.importScale);
const imgHeight = Math.round(this.pageDimensions.height*this.importScale);
await this.loadPageDimensions(this.pagesToImport);
const maxPageDimensions = this.getMaxSelectedPageDimensions();
const cellWidth = Math.round(maxPageDimensions.width*this.importScale);
const cellHeight = Math.round(maxPageDimensions.height*this.importScale);
if(cellWidth === 0 || cellHeight === 0) {
importMessage.innerText = t("IPM_SELECT_PAGES_TO_IMPORT");
return;
}
for(let i = 0; i < this.pagesToImport.length; i++) {
const page = this.pagesToImport[i];
importMessage.innerText = `Importing page ${page} (${i+1} of ${this.pagesToImport.length})`;
const topX = Math.round(this.pageDimensions.width*this.importScale*column + this.gapSize*column);
const topY = Math.round(this.pageDimensions.height*this.importScale*row + this.gapSize*row);
const dims = this.pageDimensionsByPage.get(page) ?? maxPageDimensions;
const imgWidth = Math.round(dims.width*this.importScale);
const imgHeight = Math.round(dims.height*this.importScale);
const topX = Math.round(cellWidth*column + this.gapSize*column);
const topY = Math.round(cellHeight*row + this.gapSize*row);
ea.style.strokeColor = this.borderBox ? "#000000" : "transparent";
const boxID = ea.addRect(
@@ -439,7 +490,10 @@ export class InsertPDFModal extends Modal {
if(this.frame) {
const frameID = ea.addFrame(topX, topY,imgWidth,imgHeight,`${page}`);
ea.addElementsToFrame(frameID, [boxID,imageID]);
const frameEl = ea.getElement(frameID) as any;
frameEl.frameRole = "marker";
ea.addToGroup([frameID,boxID,imageID]);
//ea.addElementsToFrame(frameID, [boxID,imageID]);
ea.getElement(frameID).link = this.pdfFile.path + `#page=${page}`;
}
+444 -273
View File
@@ -5,301 +5,472 @@ If you'd like to learn more, please subscribe to my YouTube channel: [Visual PKM
Thank you & Enjoy!
<div class="excalidraw-videoWrapper"><div>
<iframe src="https://www.youtube.com/embed/P_Q6avJGoWI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></div>
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=P_Q6avJGoWI" target="_blank"><img src ="https://i.ytimg.com/vi/P_Q6avJGoWI/maxresdefault.jpg" style="width:100%;"></a>
</div>
`;
export const RELEASE_NOTES: { [k: string]: string } = {
Intro: `After each update, you’ll see these release notes (you can turn this off in the plugin settings).
Intro: `After each update, you'll see these release notes (you can turn this off in the plugin settings).
I build this plugin in my free time, as a labor of love. Curious about the philosophy behind it? Check out [📕 Sketch Your Mind](https://sketch-your-mind.com). If you find it valuable, say THANK YOU or…
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://storage.ko-fi.com/cdn/kofi6.png?v=6" border="0" alt="Buy Me a Coffee at ko-fi.com" height=45></a></div>
`,
"2.13.0":`
<div class="excalidraw-videoWrapper"><div>
<iframe src="https://www.youtube.com/embed/QzhyQb4JF3Q" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></div>
"2.20.5":`
## Fixed
- Obsidian Mobile: The floating navigation bar got stuck at the bottom after closing Excalidraw or switching to a markdown note. [#2673](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2673)
- "Toggle UI Mode" now includes a preference setting for Obsidian Phone as well. You can now set different default layouts for phone, tablet, and desktop. [#2670](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2670)
## New
- **Flexible Auto-Export Location:** Take control of where your auto-exported .png, .svg, and .excalidraw files are saved. Addressing a long-standing request, you can now define custom output paths using the new **Excalidraw Hooks**.
- Implement the \`onImageExportPathHook\` callback in your ExcalidrawAutomate startup script to control the *destination path*.
- Get the skeleton script via plugin settings or download it [here](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/refs/heads/master/src/constants/assets/startupScript.md).
- Added "Toggle Full Screen" button to toolbar right next to the "Obsidian menu", and the "Insert Any File" button.
`,
"2.20.4":`
## Fixed
- Fix NativeSVG embed mode into Markdown documents, ahead of the Obsidian 1.12.1 release. [#2665](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2665)
- Color picker once again supports 8-digit hex codes (Hex color string with an opacity). [#10772](https://github.com/excalidraw/excalidraw/issues/10772)
- Fixed regression that removed LaTeX scaling. [#2668](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2668) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
- Corrected malformed frame embeds when using marker frames.
- Context menu options **“Do not invert image(s) in dark mode”** and **“Invert image(s) in dark mode”** now properly cascade when drawings are nested as images inside other drawings.
- Improved performance of the [MindMap Builder script](https://visual-thinking-workshop.com/mindmap).
- **Control Auto-Export Trigger:** Use the \`onTriggerAutoexportHook\` in your startup script to decide *if* and *how* auto-export runs for a file, based on its properties or frontmatter, *before* the export path is determined.
## New
- [Deconstruct Selected Elements script](https://youtu.be/HRtaaD34Zzg) now includes a folder selection option, allowing you to choose the destination folder for the generated image.
- Arrow binding midpoints. When the projected point is close to center, snap it to the exact center. This way it's easier to create neat(er) simple arrow connections. [#10611](https://github.com/excalidraw/excalidraw/pull/10611)
- **Improved "Open Excalidraw drawing":** The Command Palette command now searches the *entire Vault* for the matching Excalidraw file when used on an embedded .svg or .png, useful when exports are in different folders.
`,
"2.20.3":`
## Fixed
- Hover preview when hovering an element with a link in the scene was unreliable
- If a text element had a link in the text body, in some situations, the link became unresponsive to clicks. [#2660](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2660)
- **Placeholder Files for New Embeds:** When embedding a new drawing as PNG/SVG via the Command Palette, empty placeholder files are now created immediately based on your auto-export setting. This ensures Obsidian correctly updates links if you rename the file soon after creation (when "Keep filenames in sync" is on).
## New
- Added default keymap to latex editor [#2655](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2655) 🙏[superle3](https://github.com/superle3)
`,
"2.20.2":`
## New from Excalidraw.com
- Arrow focus indicator [#10613](https://github.com/excalidraw/excalidraw/pull/10613)
- **Paste Obsidian URLs into Excalidraw:** Pasting an Obsidian URL for an image or file into Excalidraw now inserts the associated image directly into the drawing.
## Fixed
- Experimental file type display now also works in Obsidian Mobile. (Reported on Discord)
- Text to Mermaid stores chat history locally (i.e. not synchronized between devices).
- Image positioning in crop editor [#2589](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2589), [#10726](https://github.com/excalidraw/excalidraw/pull/10726)
- **\`onImageFilePathHook\` Drag & Drop Support:** The \`onImageFilePathHook\` (for controlling location/filename of *embedded* files) is now triggered when dragging and dropping files into Excalidraw from outside Obsidian, matching the existing behavior for pasting.
## MindMap Builder
- Implemented better undo support (effective only for the very last MindMap Builder action). Additionally, CMD/CTRL+Z and CTRL+Y, CMD+SHIFT+Z now work when the MindMap input window is focused.
- Fixed: Double character input issue (IME Composition Error) when creating nodes [#2647](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2647)
- Fixed: More robust error handling when the MindMap is corrupted or invalid.
- Updated Excalidraw Writing Machine to support document generation from MindMaps. Writing Machine will honor the branch order. Requires update of the Writing Machine Script.
## New in ExcalidrawAutomate
- \`getBoundTextElement()\` now also accepts an \`ExcalidrawElement[]\` (2-element selection: container + text) in addition to a single element.
- \`addElementsToView()\` extended with \`captureUpdate\` parameter (default: "IMMEDIATELY"). When set to false, the addition of elements will not be recorded in the view's history.
\`\`\`ts
async addElementsToView(
repositionToCursor: boolean = false,
save: boolean = true,
newElementsOnTop: boolean = false,
shouldRestoreElements: boolean = false,
captureUpdate: CaptureUpdateActionType = CaptureUpdateAction.IMMEDIATELY,
): Promise<boolean>
\`\`\`
`,
"2.20.1":`
## Fixed
- Fixed Experimental file type display, available under miscellaneous settings. (Reported on Discord)
- Fixed image inversion in dark mode on iOS devices. [#2636](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2636)
- Fixed UI Mode switching on tablets was unreliable.
## New/Fixed in MindMap Builder
- **Connector Ontology**: Added support for labeling connection lines. A secondary input field (accessible via Shift+Tab) is now available in both docked and floating modes. Labels are preserved during copy/paste operations using inline Dataview syntax (e.g., link ontology:: node content).
- **Connector Styling**: Introduced configuration settings for branch thickness and scaling strategies, allowing a choice between Hierarchical (tapering width by depth) or Uniform connector widths.
- **Smart Resume**: The Focus and Zoom actions now target the most recently active node if no current selection is made. This automatically focuses the input field, allowing you to quickly resume mapping from where you left off.
- **Radial Fill Sweep**: Added a "Fill Sweep Angle" option for Radial layouts. When enabled, nodes are distributed evenly across the full configured arc range, even when there are only a few nodes. (Visible only when Growth Strategy is set to "Radial").
- **Radial Navigation**: Updated Level 1 node navigation in Radial maps to follow visual vertical alignment instead of rotational order. Up/Down keys now consistently move the selection visually up or down on both sides of the circle, matching the behavior of Right-Left layouts.
- **Fixed**:
- Sidepanel opens on activation of MindMap Builder even in floating mode. Requires update of both Excalidraw and the MindMap Builder script.
- **Node Reordering**: Overhauled the logic for moving nodes via CMD/CTRL+Arrow to resolve unpredictability; nodes now move consistently to the intended locations.
- **iOS Navigation**: Resolved an issue where using the Tab key to cycle focus between components in the floating input window did not work reliably on iOS.
- **Boundary Layering**: Fixed an issue where sub-branch boundaries were placed above text elements when pasting a map; they now correctly render on the layer below the text.
- **Layout Stability**: Fixed an issue where the viewport would shift unexpectedly when pasting multiple elements onto an existing node in large scenes.
> [!Tip]- Learn MindMap Builder
> Learn it fast with the low-cost [MindMap Builder course](https://visual-thinking-workshop.com/mindmap). Register before **31 Jan** to join a live Q&A:
> - Sat Jan 31 @ 18:00 CET ([local time](https://www.timeanddate.com/worldclock/fixedtime.html?msg=MindMap+Builder+Launch+Party&iso=20260131T17&p1=%3A&ah=1))
> - Sun Feb 1 @ 09:00 CET ([local time](https://www.timeanddate.com/worldclock/fixedtime.html?msg=MindMap+Builder+Launch+Party&iso=20260201T08&p1=%3A&ah=1))
`,
"2.20.0":`
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=5G9QF-u9w0Q" target="_blank"><img src ="https://i.ytimg.com/vi/5G9QF-u9w0Q/maxresdefault.jpg" style="width:100%;"></a>
</div>
> [!Tip]- Learn MindMap Builder
> Learn it fast with the low-cost [MindMap Builder course](https://visual-thinking-workshop.com/mindmap). Register before **31 Jan** to join a live Q&A:
> - Sat Jan 31 @ 18:00 CET ([local time](https://www.timeanddate.com/worldclock/fixedtime.html?msg=MindMap+Builder+Launch+Party&iso=20260131T17&p1=%3A&ah=1))
> - Sun Feb 1 @ 09:00 CET ([local time](https://www.timeanddate.com/worldclock/fixedtime.html?msg=MindMap+Builder+Launch+Party&iso=20260201T08&p1=%3A&ah=1))
## Scripts
- Moved [Shade Master](https://youtu.be/ISuORbVKyhQ) to use the new Excalidraw Sidepanel API (just like MindMap Builder).
## New
- Dark theme from Excalidraw.com [#10578](https://github.com/excalidraw/excalidraw/pull/10578) (including correct emoji rendering in dark mode 😍).
- New image context-menu option (right-click an image) to control whether that image inverts in dark mode
- Default behavior: SVG-based images (including LaTeX, Mermaid, and nested Excalidraw images) invert in dark mode; bitmap images (PNG/JPG) do not.
- New from Excalidraw.com: chat-style interface for Mermaid TextToDiagrams (requires an OpenAI API key configured in Excalidraw plugin settings). [#10530](https://github.com/excalidraw/excalidraw/pull/10530)
- Breaking change: the legacy “force SVG” option for Mermaid diagrams is no longer supported. If a diagram can be rendered as Excalidraw, it will be; otherwise, an SVG will be used.
- Moved the Shade Master script to use the new Sidepanel (just like MindMap Builder).
## Fixed
- In full-screen mode on phones, a large area at the top of the screen was left unused. Also fixed an issue where the Obsidian Mobile navigation bar could overlap the Excalidraw toolbar.
- The link indicator in the top-right corner would remain visible even when an element was set to transparent [#2625](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2625)
- Importing PDFs with mixed page sizes could produce distorted pages [#2578](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2578)
- Some PDFs failed to load when importing PDFs as images (notably documents using JPEG2000-compressed images). Also improved handling of certain color profiles and cases where text rendered with missing/incorrect glyphs.
- A long-standing export issue: when exporting in a theme different from the current view (e.g., viewing in dark mode but exporting in light mode), nested Excalidraw images containing bitmap images could export with inverted colors.
`,
"2.19.2":`
## Fixed
- Minor fixes to the link autocomplete functionality:
- Link suggester "eats up text" [#2603](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2603)
- "!" triggers the link suggester prematurely
- "\[\[" will now be auto-completed to "\[\[]]". Note, this is not available in MindMap Builder currently.
## New
- When a persistent Excalidraw script is updated via the script store, it will now automatically reload so the new script takes effect immediately.
`,
"2.19.1":`
## Fixed
- Excalidraw pointer offset issue on Obsidian Mobile 1.11.4 [#2607](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2607)
## New
- Inline autocomplete link suggester now supports Heading sections and block references.
- Escaped "\\\\[" will now be rendered as "[" in text elements.
- Scaling the LaTeX element when the formula is updated. [#2604](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2604) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
## New in ExcalidrawAutomate
- Added PDF++ image link support to the \`addImage()\` function.
`,
"2.19.0":`
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=qY66yoobaX4" target="_blank"><img src ="https://i.ytimg.com/vi/qY66yoobaX4/maxresdefault.jpg" style="width:100%;"></a>
</div>
## New
- 🚀🎉🍾 Added **inline link autocomplete** to text element editing and element link editing. Simply start typing "[[" as you would in a normal markdown document.
- ‼️ removed add link button element-link editor on desktop
- ‼️ removed add link from context menu on desktop
- ‼️ added new setting under "Links, transclusion and TODOs" **Sync text-element link with text**
- The default behavior is OFF, because it feels more natural to manage the element link separately.
- When enabled (ON), Excalidraw matches pre-2.19.0 behavior: the first link in the text body is always copied to the element link field. SVG/PNG exports only keep links when the element link field holds a single link (not links inside the text body). Turn this ON if you rely on text-body links and want the element link to always mirror the first one. Turn it OFF if you manage the element link separately: for metadata like tags, inline link ontologies, or multiple links, e.g., dataview-style notes like '(reminds me of:: [[link]]) #noteToSelf'.
- LaTeX formula is saved to \`element.customData.latex\`. This can be helpful for various automation use cases.
- Implemented Color Picker in Custom Pen Settings to pick from the current view's color palette.
- Updated the **Scribble Helper** script with the new Color Picker to select the text color.
- Updated the **Shade Maser** script with the new Color Picker to select the shading color.
- **Mindmap Builder**
- Uses new sidepanel, persistent across different drawings and autostarts with Obsidian.
- You can now configure hotkeys
- Allows editing node text in place
- You can define your own color palette for branches
- Improved auto-layout algorithm to work better with larger subtrees
- Includes inline link suggester
- Image and Embeddable nodes
## Fixed
- Floating modal used by Excalidraw scripts did not work correctly in Obisidian popout windows.
- In onPaste if \`imageElement.customData.latex\` is present, it will treat the pasted images as a LaTeX formula, even if copied from Excalidraw.com or another Obsidian Vault.
## New & fixed in ExcalidrawAutomate
- \`ea.toClipboard()\` will now include the DataURL for included images from \`ea.imagesDict\`
- Implemented Excalidraw Sidepanel API for ExcalidrawAutomate. Scripts can now create custom Obsidian sidepanel tabs in the Excalidraw Sidepanel.
- New Command Palette action: "Open Excalidraw Sidepanel" will toggle the sidepanel visibility.
- The demo script making full use of the new sidepanel API is [Mindmap Builder](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.md).
- [ExcalidrawAutomate full library for LLM training.md](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/refs/heads/master/docs/AITrainingData/ExcalidrawAutomate%20full%20library%20for%20LLM%20training.md) includes all necessary training information to use sidepanels.
- Added palette popover helper \`showColorPicker()\` (also used in Pen Settings and Mindmap Builder) to pick from the current view's canvas/element palettes.
- Added inline link suggester helper \`attachInlineLinkSuggester()\` returning a KeyBlocker interface so host scripts can suppress their own keydown handlers while the suggester is active.
New functions in ExcalidrawAutomate. See also [SidepanelTab](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/src/types/sidepanelTabTypes.ts) type definition.
\`\`\`ts
sidepanelTab: ExcalidrawSidepanelTab | null;
checkForActiveSidepanelTabForScript(scriptName?: string): ExcalidrawSidepanelTab | null;
createSidepanelTab(title: string, persist?: boolean, reveal?: boolean): Promise<ExcalidrawSidepanelTab | null>;
getSidepanelLeaf(): WorkspaceLeaf | null;
toggleSidepanelView(): void;
persistSidepanelTab(): ExcalidrawSidepanelTab | null;
attachInlineLinkSuggester(inputEl: HTMLInputElement, widthWrapper?: HTMLElement): KeyBlocker;
getViewColorPalette(palette: "canvasBackground"|"elementBackground"|"elementStroke"): (string[] | string)[];
showColorPicker(anchorElement: HTMLElement, palette: "canvasBackground"|"elementBackground"|"elementStroke", includeSceneColors: boolean = true): Promise<string | null>;
\`\`\`
- **setView() improvements**
- Calling \`setView()\` now picks a sensible target automatically:
- It prefers the **currently active Excalidraw view**.
- If no active Excalidraw view is found (e.g., the user is focused on a different tab like the File Explorer/sidebar), it will fall back to the **last active Excalidraw view (as long as it is still available)** — typically the drawing the user came from.
- **New selector**: \`"auto"\` (equivalent to calling \`setView()\`).
- Useful when you also want to reveal/focus the view: \`setView("auto", true)\`.
- **Deprecated selectors**: \`"active"\` and \`"first"\` are deprecated and kept only for backward compatibility.
- Recommended usage is either \`setView()\`, \`setView("auto")\`, or \`setView(excalidrawView)\` (explicitly target a specific view).
\`\`\`ts
setView(view?: ExcalidrawView | "auto" | "first" | "active" | null, show: boolean = false)
\`\`\`
`,
"2.18.3":`
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=dZguonMP2KU" target="_blank"><img src ="https://i.ytimg.com/vi/dZguonMP2KU/maxresdefault.jpg" style="width:100%;"></a>
</div>
## New
- Added Mindmap Builder script to the store.
- LaTeX Suit Integration by [@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
- Added Linear Calendar Generator script to the store. 🙏 [@iwanhoogendoorn](https://github.com/iwanhoogendoorn)
## Fixed
- YouTube video embeds working on iOS [#2569](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2569)
- Stroke color setting for Embeddedables (markdown notes, websites) is missing after 2.17.0 update [#2580](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2580)
- Context menu paste pastes in image twice [#10542](https://github.com/excalidraw/excalidraw/issues/10542)
## New in ExcalidrawAutomate
- Added 3 new helper functions for working with Script Engine settings (safe during initialization when \`scriptEngineSettings[activeScript]\` is \`undefined\` / \`null\`):
- \`setScriptSettingValue(key: string, value: ScriptSettingValue): void\`
- \`getScriptSettingValue(key: string, defaultValue: ScriptSettingValue): ScriptSettingValue\`
- \`saveScriptSettings(): Promise<void>\`
- Updated \`addArrow()\` to support the new Excalidraw binding options:
- \`startBindMode?: "inside" | "orbit"\`
- \`endBindMode?: "inside" | "orbit"\`
- \`startFixedPoint?: [number, number]\`
- \`endFixedPoint?: [number, number]\`
- \`elbowed?: boolean\`
\`\`\`ts
/**
* Returns an object describing the bound text element.
* If a text element is provided:
* - returns { eaElement } if the element is in ea.elementsDict
* - else (if searchInView is true) returns { sceneElement } if found in the targetView scene
* If a container element is provided, searches for the bound text element:
* - returns { eaElement } if found in ea.elementsDict
* - else (if searchInView is true) returns { sceneElement } if found in the targetView scene
* If not found, returns {}.
* Does not add the text element to elementsDict.
* @param element
* @param searchInView - If true, searches in the targetView elements if not found in elementsDict.
* @returns Object containing either eaElement or sceneElement or empty if not found.
*/
getBoundTextElement(element: ExcalidrawElement, searchInView: boolean = false): {
eaElement?: Mutable<ExcalidrawTextElement>,
sceneElement?: ExcalidrawTextElement
};
\`\`\`
`,
"2.18.2":`
## Fixed
- Stroke palette menu for embedded notes is gone after 2.17 update [#2580](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2580)
- Cannot link to group [#2579](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2579)
`,
"2.18.1":`
## New
- Improved the **Copy [[link]] for selected elements** context-menu action:
- Added an optional checkbox to append the \`|100%\` anchor to the copied link.
- Added an option to copy by **frame name** (instead of frame ID) when the frame is named.
## Fixed
- Prevented unnecessary \`data.json\` saves each time a drawing is opened. [#2562](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2562)
- Fixed angle snapping when a line passes over an object.
- Fixed hover preview when referencing a frame by name in an image reference.
- Fixed “Back of note” card insertion breaking LaTeX equations in existing cards. [#2296](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2296) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
- Adjusted hover-preview sizing to more closely match embeds. [#2525](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2575) 🙏[parkero](https://github.com/parkero)
`,
"2.18.0":`
## New from Excalidraw.com
- 🔥🔥🔥 New arrow behavior allows binding arrows to the inside of shapes and image! 🙏[mtolmacs](https://github.com/mtolmacs), [dwelle](https://github.com/dwelle) [#9670](https://github.com/excalidraw/excalidraw/pull/9670)
## New
- New option in the Export Dialog to **include/exclude internal links** when exporting to SVG or PDF.
- Useful when sharing an SVG or PDF with others.
- Internal links are links that point to files in your Obsidian vault.
- By default, internal links are included in exports.
- Use the new document property: \`export-internal-links: false\` to disable exporting internal links on a per-drawing basis.
## Fixed
- Memory leak issues
- Potential fix to Backspace and CTRL+V stopping working in text elements after extended use of Excalidraw.
- Improved detection of on-screen keyboard on mobile devices. (issue reported on [Discord](https://discord.com/channels/1026825302900494357/1444652800360316959))
- Insert any file, insert LaTeX and some other dialogs got hidden behind the on-screen keyboard on mobile devices. Dialogs appear at the top of the screen now on mobile devices.
## New in ExcalidrawAutomate
- **createSVG()** now exposes convertMarkdownLinksToObsidianURLs and includeInternalLinks parameters.
\`\`\`ts
async createSVG(
templatePath?: string,
embedFont: boolean = false,
exportSettings?: ExportSettings,
loader?: EmbeddedFilesLoader,
theme?: string,
padding?: number,
convertMarkdownLinksToObsidianURLs: boolean = false,
includeInternalLinks: boolean = true,
): Promise<SVGSVGElement>
\`\`\`
`,
"2.17.2":`
## Fixed
- Lasso selection tool is back in the more tools menu in tray-mode and desktop mode.
- "Toggle enable context menu" command palette action is available on mobile devices.
- FloatingModal window top-right close button did not work on mobile devices.
- Hover preview flashed for larger PDF hover previews, in some cases would not even show.
- Fixed: opanAI API URL in settings will be honored when creating code from diagram [#2540](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2540) 🙏[@threeq](https://github.com/threeq)
- Fixed export to PDF. Rounded images cropped from the left and the top were transformed incorrectly. [#2544](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2544)
## New
- Added configurable max tokens setting for OpenAI API [#2543](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2543) 🙏[@dddrop](https://github.com/dddrop)
`,
"2.17.1":`
## Fixed
- Excalibrain stopped working after the 2.17.0 update. Fixed. [#2532](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2532)
- Pinned scripts are not hidden in view mode when in phone UI mode.
`,
"2.17.0":`
## New
- Phone UI from Excalidraw.com [#9996](https://github.com/excalidraw/excalidraw/pull/9996)
- Custom pen settings now allow pen width to be set at 0.1 increments from 0.1 to 8.0
- Updated the "Palm Guard" script to support the change UI configurations.
- Restructured UI-Mode settings in plugin settings. You can now set the preference for UI mode for desktop and tablets.
The old "prefer tray-mode" toggle has been removed. "Toggle Tray-Mode" changes to "Toggle UI-Mode".
- New command palette action: "Toggle enable context menu". This setting is helpful on Mobile devices, where the context menu may interfere with touch interactions. The setting is saved with the drawing, thus you can add it to your templates (then press CTRL+S to force save) if you want the context menu to be disabled by default.
## Fixed
- side panel does not attach correctly when library is pinned [#2510](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2510)
- Fixed print area when using marker frames and printing Slideshow to PDF
- The "Invert Colors" script and ExcalidrawAutomate bugs that resulted in broken colors and Excalidraw crashes in some cases after color inversion.
- Fixed duplicated PDF elements after copy-pasting from scene to scene.
- Resolved the large gap at the top on iOS devices. As it turns out, Apple adds additional padding automatically to avoid collision with the notch.
- Fixed the positioning of the "Canvas and Shape Properties" window.
- Attempt to fix the mobile keyboard pop-up, distorting the view.
- Added finalize multipoint-line button to compact layout
`,
"2.16.1":`
## Fixed
- Based on a request from [Kevin](https://github.com/Kovah) referencing GDPR, I removed YouTube iframes from settings, scripts, etc., and replaced them with thumbnail images + links to YouTube. [#2234](https://github.com/zsviczian/obsidian-excalidraw-plugin/discussions/2234)`,
"2.16.0":`
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=51EgDgtiZgQ" target="_blank"><img src ="https://i.ytimg.com/vi/51EgDgtiZgQ/maxresdefault.jpg" style="width:100%;"></a>
</div>
## New from Excalidraw.com
- New library search feature [#9903](https://github.com/excalidraw/excalidraw/pull/9903)
- You can rename library items by selecting them, then choosing "Rename or publish" from the ... menu.
- New compact mode for tablets [#9910](https://github.com/excalidraw/excalidraw/pull/9910)
- New setting in plugin setting \`Compact-mode on Tablets\` to override tray-mode on tablets in favor of the new compact mode.
## New
- Embedding PDF as images, frames are now marker frames instead of regular frames. You can reference pages, including their markup in markdown notes, using this syntax: \`![[drawing#^frame=12]]\` (page 12)
- Pinned scripts toolbar is now on the right side in all modes: tray-, normal-, and compact. The toolbar moves into view when the side panel is opened for the stencil library or for search.
- Better RTL support, pinned scripts are rendered on the left side in RTL mode.
## Fixed
- Critical fix: When clicking to follow a link in a markdown embeddable in preview mode to open an Excalidraw drawing in the same tab, the back of the newly opened drawing was overwritten with the content of the source drawing.
- PDF++ Links from document to Excalidraw select everything in the scene instead of the linked element. [#2503](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2503)
`,
"2.15.3":`
## Fixed
- New back of the note cards are not visible until the drawing is saved. When adding a back-of-the-note card using the context menu, the card got placed at the absolute 0,0 position in the scene instead of the current pointer position. [#9949](https://github.com/excalidraw/excalidraw/issues/9949)
- Drawings created 4 years ago don't open [#2479](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2479)
- On Obsidian Mobile, when an element has multiple links, clicking the link icon, the link selector pops up and immediately closes
- Improved handling of importing external images and drag and drop of images from inside Obsidian. Features like (Convert SVG to Strokes) and (Flip the card) now work immediately, you don't need to force save, or wait for autosave to kick in.
## New
- Added startup check that detects when Obsidian's recorded plugin version differs from the installed Excalidraw code (e.g. after partial sync of large files) and offers to update or ignore, with a setting to disable the check.
- When Excalidraw is open in two or more tabs—either as Markdown or Excalidraw—auto-zoom is disabled. This allows you to work in multiple tabs on the same drawing at once: focusing on different areas of the same drawing, or editing the Markdown and Excalidraw views in parallel.
`,
"2.15.2":`
## Fixed:
- Pressing enter on a text element erroneously activated all markdown embeddables in the scene. [discord](https://discord.com/channels/1026825302900494357/1412683408424833045)
- After updating to PDF++ 0.40.31, touch scrolling of embedded PDF documents stopped working on mobile devices, and the PDF document appeared with the wrong themes in some cases.
- Issue with the Kanban board as an active embeddable on mobile phones is fixed.
## Fixed in ExcalidrawAutomate
- \`getActiveEmbeddableViewOrEditor (view?:ExcalidrawView): {view:any}|{file:TFile, editor:Editor}|{node: ObsidianCanvasNode}|null;\` no returns the node, instead of the empty view from the leaf.
`,
"2.15.1":`
## Fixed
- PDF improvements
- It was not possible to scroll the embedded PDF. [#9891](https://github.com/excalidraw/excalidraw/pull/9891)
- Embedded PDF pages were blurred (pixelated).
- Embedded PDF now accurately follows \`excalidraw-embeddable-theme\` document property.
- auto: follows Excalidraw theme (regardless of Obsidian theme)
- default: follows Obsidian theme (regardless of Excalidraw theme)
- dark: always displays the PDF in dark mode (regardless of Excalidraw and Obsidian themes)
- light: always displays the PDF in light mode (regardless of Excalidraw and Obsidian themes)
- New embeddable-menu buttons:
- Snapshot: inserts an image of the current active page to the scene
- Bookmark: updates the embed link to the current page
- Pasting an oversized image triggered an error and caused Excalidraw to discard the scene. [#2453](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2453), [#9878](https://github.com/excalidraw/excalidraw/issues/9878)
- Video with local URI will no longer autoplay when the scene loads
- Error creating link to element when element is a sticky note
- Area link embeds hide the content of the objects within the area [#2461](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2461)
- On Obsidian Mobile 1.9.10, embeddables could cause a black/white screen (no active view) until reselecting the Excalidraw page; [#2460](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2460)
- Scrolling of embedded web pages on mobile devices is working again.
## New
- Insert Any File now supports adding Audio files.
- New option in settings under "Zoom and Pan". Pan with right mouse button (Miro-style): right-click and drag to pan the canvas. Press 'm' for the context menu (disabled while editing text). 🙏 [@mfuria](https://github.com/mfuria) for making this happen! [#2450](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2450), [#329](https://github.com/zsviczian/excalidraw/pull/329)
- Insert image in the main toolbar now opens a dropdown menu of options: Insert from system, insert from Vault, insert Card, and insert LaTeX. [#2448](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2448)
## Deprecated
- Removed "Toggle RAW mode" from the Command Palette and the Obsidian Tools menu due to low usage. RAW mode remains available by adding \`excalidraw-plugin: raw\` to the note's YAML frontmatter/document properties.
## New in ExcalidrawAutomate
\`\`\`ts
splitFolderAndFilename(filepath: string) : {
folderpath: string;
filename: string;
basename: string;
extension: string;
}
/**
* Returns the center position of the current view in Excalidraw coordinates.
* @returns {{x:number, y:number}} The center position of the view.
*/
public getViewCenterPosition(): {x:number, y:number};
\`\`\`
`,
"2.12.4":`
## Fixed
- ExaliBrain did not render after the 2.12.3 update. [#2384](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2384)
`,
"2.12.3":`
## Minor fixes
- Includes all recent updates and fixes from excalidraw.com
- Fixed issue with line editor snapping out of edit mode
- Fixed long-standing issue with wireframe to code calling a deprecated OpenAI endpoint
- "Load Excalidraw Properties into Obsidian Suggester" setting now defaults to false for new installations. [#2380](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2380)
- Taskbone OCR result does not get saved to frontmatter in some cases [#1123](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1123)
"2.15.0":`
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=DqDnzCOoYMc" target="_blank"><img src ="https://i.ytimg.com/vi/DqDnzCOoYMc/maxresdefault.jpg" style="width:100%;"></a>
</div>
## New
- If the cropped file or annotated file prefix is set to empty, there will now be no prefix added to the file name. Additionally, now you can also set a suffix to the file name. [#2370](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2370)
`,
"2.12.2": `
## Fixed
- BUG: Excalidraw theme changes to Light from Dark when clicking line element node [#2360](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2360)
`,
"2.12.1": `
## New
- "Text to Path" text input window is now draggable.
- Introducing **Marker Frames**. These are special frames that can be used to mark slides, pages areas for PDF printouts, image references, etc.
To create a marker frame, create a frame and toggle the marker frame in the elements properties panel.
- Markers are not included in exports such as images or PDFs.
- Markers do not contain elements
- Markers can be hidden/shown from the canvas context menu
- Updated the "Printable Layout Wizard" script
- Now works with marker frames
- Supports different page sizes and orientations within a single PDF document
- The printout may include non-marker frames (e.g., PDF image embeds in frames)
- Pro-tip: You can also use marker frames...
- with the Slideshow plugin
- to create image-area references such that the frames do not get rendered in exported images, and you can reference areas by frame name
- Performance improvement of Image-area references
## Fixed
- Minor fixes to the Polygon line feature introduced in 2.12.0. [#9580](https://github.com/excalidraw/excalidraw/pull/9580)
- Fix new Improved Unlock UI, where if a lock element was over an unlocked element, the unlocked element was not selectable. [#9582](https://github.com/excalidraw/excalidraw/pull/9582)
- Fixed ghost point issue when moving a shape after dragging a point in the line editor [#9530](https://github.com/excalidraw/excalidraw/pull/9530)
## New in ExcalidrawAutomate
${String.fromCharCode(96,96,96)}js
untils.inputPrompt({
header: string,
placeholder?: string,
value?: string,
buttons?: { caption: string; tooltip?:string; action: Function }[],
lines?: number,
displayEditorButtons?: boolean,
customComponents?: (container: HTMLElement) => void,
blockPointerInputOutsideModal?: boolean,
controlsOnTop?: boolean,
draggable?: boolean,
});
${String.fromCharCode(96,96,96)}
`,
"2.12.0": `
<div class="excalidraw-videoWrapper"><div>
<iframe src="https://www.youtube.com/embed/-fldh3cE2gs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></div>
## Fixed
- Dynamic styling was not working when frames were present in the scene.
- Minor fix to the screenshot feature. This also resolves the long-standing issue where window control buttons (close, minimize, maximize) appeared in full-screen mode.
- Fixed an issue where ALT/OPT + dragging an embeddable object sometimes failed, resulting in an empty object instead of dragging the element.
## New
- **Line Polygons**: Draw a closed line shape, and it will automatically snap into a polygon. [#9477](https://github.com/excalidraw/excalidraw/pull/9477)
- Updated the Split Ellipse and Boolean Operations scripts to support this feature.
- When entering line editor mode (CTRL/CMD + click), the lock point is now marked for easier editing. You can break the polygon using the polygon action in the elements panel.
- **Popout Override**: The "Open the back-of-the-note for the selected image in a popout window" action now overrides the "Focus on Existing Tab" setting and always opens a new popout.
- **Text Arch Enhancements**: The Text Arch script now supports fitting text to a wider range of paths and shapes. Text can also be edited and refitted to different paths.
- **Improved Unlock UI**: Single-clicking a locked element now shows an unlock button. [#9546](https://github.com/excalidraw/excalidraw/pull/9546)
- **Script Update Alerts**: On startup, Excalidraw will notify you if any installed scripts have available updates.
`,
"2.11.1": `
## Fixed:
- The new "Screenshot" option in the Export Image dialog was not working properly. [#2339](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2339)
## New from Excalidraw.com
- Quarter snap points for diamonds [#9387](https://github.com/excalidraw/excalidraw/pull/9387)
- Precise highlights for bindings [#9472](https://github.com/excalidraw/excalidraw/pull/9472)
`,
"2.11.0": `
## New
- New "Screenshot" option in the Export Image dialog. This allows you to take a screenshot of the current view, including embedded web pages, youtube videos, and markdown documents. Screenshot is only possible in PNG.
- Expose parameter in plugin settings to disable AI functionality [#2325](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2325)
- Enable (disable) double-click text editing option in Excalidraw appearance and behavior (based on request on Discord)
- Added two new PDF export sizes: "Match image", "HD Screen".
- Switch between basic shapes. Quickly change the shape of the selected element by pressing TAB [#9270](https://github.com/excalidraw/excalidraw/pull/9270)
- Updated the Scribble Helper Script. Now controls are at the top so your palm does accidently trigger them. I added a new button to insert special characters. Scribble helper now makes use of the new text element wrapping in Excalidraw.
## Fixed in the plugin
- Scaling multiple embeddables at once did not work. [#2276](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2276)
- When creating multiple back-of-the-note the second card is not created correctly if autosave has not yet happened.
- Drawing reloads while editing the back-of-the-note card in certain cases causes editing to be interrupted.
- Moved Excalidraw filetype indicator ✏️ to after filename where other filetype tags are displayed. You can turn the filetype indicator on/off in plugin settings under Miscellaneous.
## Fixed by Excalidraw.com
- Alt-duplicate now preserves the original element. Previously, using Alt to duplicate would swap the original with the new element, leading to unexpected behavior and several downstream issues. [#9403](https://github.com/excalidraw/excalidraw/pull/9403)
- When dragging the arrow endpoint, update the binding only on the dragged side [#9367](https://github.com/excalidraw/excalidraw/pull/9367)
- Laser pointer trail disappearing on pointerup [#9413](https://github.com/excalidraw/excalidraw/pull/9413) [#9427](https://github.com/excalidraw/excalidraw/pull/9427)
`,
"2.10.1": `
## Fixed by Excalidraw.com
- Eraser performance improvement regression. Erasing locked elements. [#9400](https://github.com/excalidraw/excalidraw/pull/9400)
## New
- Grid Customization Options in plugin settings (appearance and behavior/grid): You can now selectively show or hide vertical and horizontal grid lines independently. This allows you to create alternative grid styles, such as horizontal-only lined grids instead of the traditional checkered pattern.
## Fixed in ExcalidrawAutomate
- ${String.fromCharCode(96)}ea.createSVG${String.fromCharCode(96)} throws error [#2321](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2321)
---
## ❤️ Enjoying the plugin?
Support my work by checking out my new book, now available for pre-order:
[Sketch Your Mind: Nurture a Playful and Creative Brain](https://sketch-your-mind.com) is about visual Personal Knowledge Management. It explores the thinking behind Excalidraw and how it helps you structure and evolve ideas visually. It’s the book I wish I had when I began my own PKM journey.
<div class="ex-coffee-div"><a href="https://sketch-your-mind.com"><img src="https://raw.githubusercontent.com/zsviczian/sketch-your-mind/refs/heads/main/images/cover-mini.jpg" border="0" alt="Pre-order Sketch Your Mind" height="100%"></a></div>
`,
"2.10.0": `
## New from Excalidraw.com
- Lasso select [#9169](https://github.com/excalidraw/excalidraw/pull/9169)
- Add container to multiple text elements [#9348](https://github.com/excalidraw/excalidraw/pull/9348)
## Fixed from Excalidraw.com
- Rounded diamond edge elbow arrow U route [#9349](https://github.com/excalidraw/excalidraw/pull/9349)
- Improved eraser performance [#9352](https://github.com/excalidraw/excalidraw/pull/9352)
- Keep arrow label horizontal [#9364](https://github.com/excalidraw/excalidraw/pull/9364)
## Fixed in ExcalidrawAutomate
- ${String.fromCharCode(96)}ea.addText${String.fromCharCode(96)} did not honor the width parameter.
`,
"2.9.2":`
- More minor fix. Toolbars are not responsive when dynamic styling is turned off. [#2287](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2287)
`,
"2.9.1":`
- Minor emergency fix. Reverting: [#9203](https://github.com/excalidraw/excalidraw/pull/9203)
`,
"2.9.0":`
## New
- QoL improvement: The context menu requires a longer press and hold for it to be displayed on mobile devices. When you want to precision adjust an element it happens that you linger on the point for just a little longer and the context menu appears unwantedly.
- Elbow arrow improvements [#9236](https://github.com/excalidraw/excalidraw/pull/9236), [#8593](https://github.com/excalidraw/excalidraw/pull/8593), [#9197](https://github.com/excalidraw/excalidraw/pull/9197), [#9191](https://github.com/excalidraw/excalidraw/pull/9191), [#9236](https://github.com/excalidraw/excalidraw/pull/9236)
## Fixed Obsidian 1.8.9 regressions
- Custom references (like #^group) broken in Live Preview in Obsidian 1.8.9 due to translation update [#2279](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2279)
- Excalidraw tabs only show on a second click on Obsidian Mobile
## Refactoring
- The Excalidraw component moved to React 19. Obsidian for now remains on React 18. This refactoring ensures that Excalidraw continues to work in Obsidian and Obsidian will receive future Excalidraw updates. [#9182](https://github.com/excalidraw/excalidraw/pull/9182)
`,
"2.8.3":`
## Fixed
- Chinese translation not available since 2.8.0. [#2247](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2247)
- Since the most recent Samsung Android update, adding images from the gallery returns an Unsupported Image Type error. [#2245](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2245)
- Duplicating/removing frame while children selected [#9079](https://github.com/excalidraw/excalidraw/pull/9079)
`,
"2.8.2":`
## New
- Moved "Create new drawing" option up in the context menu [#2243](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2243)
## Fixed
- In rare cases drawing content gets overwritten with another drawing [#2152](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2152)
- "Wrap selection in frame" sets dark mode to light mode [#2240](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2240)
- Multiple bug fixes from Excalidraw.com
- Elbow arrows within boxes [#9077](https://github.com/excalidraw/excalidraw/issues/9077)
- Elbow arrow orthogonality [#9073](https://github.com/excalidraw/excalidraw/pull/9073)
- Improve library sidebar performance [#9060](https://github.com/excalidraw/excalidraw/pull/9060)
- Opacity slider now displays numerical value [#9009](https://github.com/excalidraw/excalidraw/pull/9009)
- Resize a frame and its children together when box selecting the frame and its children together [#9031](https://github.com/excalidraw/excalidraw/pull/9031)
- Excalidraw screen flickering in dark mode [#9057](https://github.com/excalidraw/excalidraw/pull/9057)
`,
"2.8.1":`
## Fixed
- Unable to open Excalidraw files after the 2.8.0 update. [#2235](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2235)
`,
"2.8.0":`
<div class="excalidraw-videoWrapper"><div>
<iframe src="https://www.youtube.com/embed/tWi5xTUTz7E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></div>
## New
- Updated "Export Image" dialog
- 🚀 PDF Export option including tiling of images over multiple pages. Only available on desktop :(
- SVG to clipboard
- More granular setting for padding and scale
- Slideshow script can now print slides to PDF (update script from script store)
- Set local graph to show the links in the embeddable when it is activated/deactivated [#2200](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2200)
## Fixed
- Fixed several LaTeX issues. 🙏 @Sintuz [#1631](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1631), [#2195](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2195), [#1842](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1842)
- Fixed support for *.jfif and *.avif images [#2212](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2212)
- PDF++ selection is not correctly showing after embedded into a drawing (for some specific files) [#2213](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2213)
- iOS 18 can't upload image and library [#2182](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2182)
- Image block references are broken in hover previews [#2218](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2218)
- ⚠️ Note there is a known issue in Obsidian 1.8.2 ⚠️ affecting preview windows in Excalidraw. I received confirmation that this will be fixed in 1.8.3. For now, if hover previews are important to you, you can downgrade to Obsidian 1.8.1 [#2228](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2225)
- Mobile elements panel and context menu are not scrollable [#2216](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2216)
- "Local Font" menu disappears when opening a drawing in an Obsidian popout-window [#2205](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2205)
## Updates from Excalidraw.com
- Pressing delete on a frame will only delete the children [#9011](https://github.com/excalidraw/excalidraw/pull/9011)
- New crowfoot arrowheads and a new arrowhead picker [#8942](https://github.com/excalidraw/excalidraw/pull/8942)
- Fixed some of the arrow binding issues [#9010](https://github.com/excalidraw/excalidraw/pull/9010), [#2209](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2209)
- New context menu action: "Wrap selection in frame" [#9005](https://github.com/excalidraw/excalidraw/pull/9005)
- Elbow arrow segment fixing and positioning [#8952](https://github.com/excalidraw/excalidraw/pull/8952)
- When drag creating a new frame, do not add a partial group to it. When wrapping a selected partial group in a frame however, do add it to the wrapping frame. But such that it should be separated from the previous containing group. [#9014](https://github.com/excalidraw/excalidraw/pull/9014)
## New in ExcalidrawAutomate
- New hook: ${String.fromCharCode(96)}onImageFileNameHook${String.fromCharCode(96)}. When set, this callback is triggered when a image is being saved in Excalidraw.
- PDF export functions, paving the way for slideshow to export slides to PDF
${String.fromCharCode(96,96,96)}ts
/**
* Returns the dimensions of a standard page size in pixels.
*/
function getPagePDFDimensions(
pageSize: PageSize,
orientation: PageOrientation
): PageDimensions;
/**
* Creates a PDF from the provided SVG elements with specified scaling and page properties.
*/
function createPDF(props: {
SVG: SVGSVGElement[];
scale?: PDFExportScale;
pageProps?: PDFPageProperties;
filename: string;
}): Promise<void>;
/**
* Creates an SVG representation of the current view.
*/
function createViewSVG(props : {
withBackground?: boolean;
theme?: "light" | "dark";
frameRendering?: FrameRenderingOptions;
padding?: number;
selectedOnly?: boolean;
skipInliningFonts?: boolean;
embedScene?: boolean;
}): Promise<SVGSVGElement>;
/**
* If set, this callback is triggered when a image is being saved in Excalidraw.
* You can use this callback to customize the naming and path of pasted images to avoid
* default names like "Pasted image 123147170.png" being saved in the attachments folder,
* and instead use more meaningful names based on the Excalidraw file or other criteria,
* plus save the image in a different folder.
*
* If the function returns null or undefined, the normal Excalidraw operation will continue
* with the excalidraw generated name and default path.
* If a filepath is returned, that will be used. Include the full Vault filepath and filename
* with the file extension.
* The currentImageName is the name of the image generated by excalidraw or provided during paste.
*/
function onImageFilePathHook: (data: {
currentImageName: string;
drawingFilePath: string;
}) => string = null;
${String.fromCharCode(96,96,96)}
# New in ExcalidrawAutomate
- \`createPDF()\` now supports \`SVG[]\` array of SVGs with different sizes.
- New function:
\`\`\`ts
/**
* Gets the elements within a specific area.
* @param elements - The elements to check.
* @param param1 - The area to check against.
* @returns The elements within the area.
*/
elementsInArea(
elements: NonDeletedExcalidrawElement[],
{x, y, width, height}:{
x:number; y:number; width:number; height:number;
}
):ExcalidrawElement[]
\`\`\`
`,
};
@@ -1,5 +1,5 @@
import { Setting } from "obsidian";
import { PageOrientation, PageSize, PDFPageAlignment, PDFPageMarginString, STANDARD_PAGE_SIZES } from "src/utils/exportUtils";
import { PageOrientation, PageSize, PDFPageAlignment, PDFPageMarginString, STANDARD_PAGE_SIZES } from "src/types/exportUtilTypes";
import { t } from "src/lang/helpers";
export interface PDFExportSettings {
+44 -11
View File
@@ -9,6 +9,7 @@ import { getExcalidrawViews } from "src/utils/obsidianUtils";
import { PENS } from "src/utils/pens";
import { fragWithHTML } from "src/utils/utils";
import { __values } from "tslib";
import { showColorPicker } from "./ColorPicker";
const EASINGFUNCTIONS: Record<string,string> = {
linear: "linear",
@@ -55,7 +56,6 @@ export class PenSettingsModal extends Modal {
) {
super(plugin.app);
this.api = view.excalidrawAPI;
}
onOpen(): void {
@@ -66,8 +66,8 @@ export class PenSettingsModal extends Modal {
async onClose() {
if(this.dirty) {
await this.plugin.saveSettings();
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.updatePinnedCustomPens());
this.plugin.saveSettings();
const pen = this.plugin.settings.customPens[this.pen]
const api = this.view.excalidrawAPI;
setPen(pen,api);
@@ -157,6 +157,7 @@ export class PenSettingsModal extends Modal {
let scSetting: Setting;
let sccpComponent: ColorComponent;
let sctComponent: TextComponent;
let strokeUseCurrentToggle: ToggleComponent;
let strokeSetting: Setting;
let [sHex, sOpacity] = hexColor(ps.strokeColor);
let sChangeBounce:boolean = false;
@@ -164,7 +165,8 @@ export class PenSettingsModal extends Modal {
strokeSetting = new Setting(ce)
.setName(fragWithHTML(!Boolean(ps.strokeColor) ? "Stroke color: <b>Current</b>" : "Stroke color: <b>Preset color</b>"))
.setDesc(fragWithHTML("Use <b>current</b> stroke color of the canvas, or set a specific <b>preset color</b> for the pen"))
.addToggle(toggle =>
.addToggle(toggle => {
strokeUseCurrentToggle = toggle;
toggle
.setValue(!Boolean(ps.strokeColor))
.onChange(value=> {
@@ -181,8 +183,8 @@ export class PenSettingsModal extends Modal {
}
ps.strokeColor = sctComponent.getValue();
}
})
)
});
})
scSetting = new Setting(ce)
.setName("Select stroke color")
@@ -225,8 +227,22 @@ export class PenSettingsModal extends Modal {
ps.strokeColor = value + sOpacity;
sctComponent.setValue(value + sOpacity);
})
}
}
)
.addButton(button => {
button
.setIcon("swatch-book")
.onClick(async () => {
const selected = await showColorPicker("elementStroke", button.buttonEl, this.view, true);
if(!selected) {return;}
strokeUseCurrentToggle?.setValue(false);
sChangeBounce = true;
[sHex, sOpacity] = hexColor(selected);
ps.strokeColor = selected;
sctComponent.setValue(selected);
if(sHex) {sccpComponent.setValue(sHex);}
});
})
scSetting.settingEl.style.display = !Boolean(ps.strokeColor) ? "none" : "";
@@ -236,13 +252,15 @@ export class PenSettingsModal extends Modal {
let bgcpComponent: ColorComponent;
let bgctComponent: TextComponent;
let bgtComponent: ToggleComponent;
let bgUseCurrentToggle: ToggleComponent;
let fsSetting: Setting;
let [bgHex, bgOpacity] = hexColor(ps.backgroundColor);
bgSetting = new Setting(ce)
.setName(fragWithHTML(!Boolean(ps.backgroundColor) ? "Background color: <b>Current</b>" : "Background color: <b>Preset color</b>"))
.setDesc(fragWithHTML("Toggle to use the <b>current background color</b> of the canvas; or a <b>preset color</b>"))
.addToggle(toggle =>
.addToggle(toggle => {
bgUseCurrentToggle = toggle;
toggle
.setValue(!Boolean(ps.backgroundColor))
.onChange(value=> {
@@ -260,8 +278,8 @@ export class PenSettingsModal extends Modal {
}
bgtComponent.setValue(false);
}
})
)
});
})
bgctSetting = new Setting(ce)
@@ -325,6 +343,21 @@ export class PenSettingsModal extends Modal {
bgctComponent.setValue(value+bgOpacity)
})
})
.addButton(button => {
button
.setIcon("swatch-book")
.onClick(async () => {
const selected = await showColorPicker("elementBackground", button.buttonEl, this.view, true);
if(!selected) {return;}
bgUseCurrentToggle?.setValue(false);
bgtComponent?.setValue(false);
bgChangeBounce = true;
[bgHex, bgOpacity] = hexColor(selected);
ps.backgroundColor = selected;
bgctComponent.setValue(selected);
if(bgHex) {bgcpComponent.setValue(bgHex);}
});
})
bgcSetting.settingEl.style.display = (!Boolean(ps.backgroundColor) || ps.backgroundColor==="transparent") ? "none" : "";
@@ -369,7 +402,7 @@ export class PenSettingsModal extends Modal {
.setName(fragWithHTML(`Stroke Width <b>${ps.strokeWidth === 0 ? "Not Set" : ps.strokeWidth}</b>`))
.addSlider(slider =>
slider
.setLimits(0,5,0.5)
.setLimits(0.1,8,0.1)
.setValue(ps.strokeWidth)
.onChange(value => {
this.dirty = true;
@@ -421,7 +454,7 @@ export class PenSettingsModal extends Modal {
.setDesc("If the stroke has an outline, this will mean the stroke color is the outline color, and the background color is the pen stroke's fill color. If the pen does not have an outline then the pen color is the stroke color. The Fill Style setting applies to the fill style of the enclosed shape, not of the line itself. The line can only have solid fill.")
.addSlider(slider =>
slider
.setLimits(0,8,0.5)
.setLimits(0,8,0.1)
.setValue(ps.penOptions.outlineWidth)
.onChange(value => {
this.dirty = true;
+234 -52
View File
@@ -8,6 +8,7 @@ import {
TFile,
Notice,
TextAreaComponent,
getIcon,
} from "obsidian";
import ExcalidrawView from "../../view/ExcalidrawView";
import ExcalidrawPlugin from "../../core/main";
@@ -23,6 +24,12 @@ import { REGEX_LINK, REGEX_TAGS } from "../ExcalidrawData";
import { ScriptEngine } from "../Scripts";
import { openExternalLink, openTagSearch, parseObsidianLink } from "src/utils/excalidrawViewUtils";
import { ButtonDefinition } from "src/types/promptTypes";
import { EditorView, keymap } from "@codemirror/view";
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
import { parser } from "./math-only";
import { LRLanguage } from "@codemirror/language";
import { editorLivePreviewField } from "obsidian";
import { Extension } from "@codemirror/state";
export class Prompt extends Modal {
private promptEl: HTMLInputElement;
@@ -79,6 +86,147 @@ export class Prompt extends Modal {
}
}
export class LaTexPrompt extends Modal {
public waitForClose : Promise<string>;
private promptEl: HTMLInputElement;
private resolvePromise: (input: string) => void;
private rejectPromise: (reason?: any) => void;
private editorView : EditorView;
private latexsSuitePlugin : any;
protected constructor(
app: App,
private prompt_text: string,
private default_value?: string,
) {
super(app);
this.titleEl.setText(this.prompt_text);
this.contentEl.addClass("excalidraw-LatexPrompt");
this.latexsSuitePlugin = app.plugins.plugins["obsidian-latex-suite"];
const mainContentContainer: HTMLDivElement = this.contentEl.createDiv();
this.display(default_value, mainContentContainer);
this.waitForClose = new Promise<string>((resolve, reject) => {
this.resolvePromise = resolve;
this.rejectPromise = reject;
});
this.editorView.focus();
}
public static Prompt(app: App,
prompt_text?: string,
default_value?: string,
): Promise<string>{
const latexprompt = new LaTexPrompt(app, prompt_text, default_value);
return latexprompt.waitForClose;
}
private display(value : string, container : HTMLDivElement) {
const minimalSetup = [
history(),
keymap.of([
...defaultKeymap,
...historyKeymap,
])
]
const extensions: Extension[] = [
// overriding default "Mod-Enter" from defaultKeymap (so first in array)
keymap.of([{
key:"Mod-Enter",
run : () => {this.submitCallback(); return true;}
}]),
minimalSetup
]
if (this.latexsSuitePlugin) {
// the language put eveything in a "math" node
// surrounded by "math-begin" and "math-end"
// so that latex-suite always thinks we are in mathmode
const language = LRLanguage.define({parser:parser});
extensions.push([
language,
editorLivePreviewField.init(() => false),
this.latexsSuitePlugin.editorExtensions
]);
}
this.editorView = new EditorView({
doc: value,
extensions : extensions,
parent : container,
});
const buttonBarContainer: HTMLDivElement = container.createDiv();
buttonBarContainer.addClass(`excalidraw-prompt-buttonbar-bottom`);
const actionButtonContainer: HTMLDivElement = buttonBarContainer.createDiv();
this.createButton(
actionButtonContainer,
"",
this.submitCallback.bind(this),
t("PROMPT_BUTTON_OK") ?? "",
undefined,
"check"
).setCta().buttonEl.style.marginRight = "0";
this.createButton(
actionButtonContainer,
"",
this.cancelCallback.bind(this),
t("PROMPT_BUTTON_CANCEL"),
undefined,
"x"
);
this.open();
}
private createButton(container: HTMLElement,
text: string,
callback: (evt: MouseEvent) => any,
tooltip: string = "",
margin: string = "5px",
iconId?:string,
){
const btn = new ButtonComponent(container);
btn.buttonEl.style.padding = "0.5em";
btn.buttonEl.style.marginLeft = margin;
btn.setTooltip(tooltip);
if (iconId) {
btn.setIcon(iconId);
} else {
btn.setButtonText(text);
}
btn.onClick(callback);
return btn;
}
private submitCallback(){
const res = this.editorView.state.doc.toString();
if (res.trim().length == 0) {
this.rejectPromise("empty latex");
} else {
this.resolvePromise(res);
}
this.close();
}
private cancelCallback(){
this.rejectPromise("Canceled input");
this.close();
}
onOpen(): void {
super.onOpen();
this.editorView.focus();
}
onClose(): void {
this.contentEl.empty();
this.editorView.destroy();
}
}
export class GenericInputPrompt extends Modal {
public waitForClose: Promise<string>;
private view: ExcalidrawView;
@@ -101,6 +249,26 @@ export class GenericInputPrompt extends Modal {
private draggable: boolean = false;
private cleanupDragListeners: (() => void) | null = null;
// Add event handler instance properties
private handleKeyDown = (evt: KeyboardEvent) => {
if ((evt.key === "Enter" && this.lines === 1) || (isWinCTRLorMacCMD(evt) && evt.key === "Enter")) {
evt.preventDefault();
this.submit();
}
if (this.displayEditorButtons && evt.key === "k" && isWinCTRLorMacCMD(evt)) {
evt.preventDefault();
this.linkBtnClickCallback();
}
};
private handleCheckCaret = () => {
//timer is implemented because on iPad with pencil the button click generates an event on the textarea
this.selectionUpdateTimer = this.view.ownerWindow.setTimeout(() => {
this.selectionStart = this.inputComponent.inputEl.selectionStart;
this.selectionEnd = this.inputComponent.inputEl.selectionEnd;
}, 30);
};
public static Prompt(
view: ExcalidrawView,
plugin: ExcalidrawPlugin,
@@ -141,7 +309,7 @@ export class GenericInputPrompt extends Modal {
private header: string,
placeholder?: string,
value?: string,
buttons?: { caption: string; action: Function }[],
buttons?: ButtonDefinition[],
lines?: number,
displayEditorButtons?: boolean,
customComponents?: (container: HTMLElement) => void,
@@ -226,25 +394,15 @@ export class GenericInputPrompt extends Modal {
.setValue(value ?? "")
.onChange((value) => (this.input = value));
let i = 0;
const checkcaret = () => {
//timer is implemented because on iPad with pencil the button click generates an event on the textarea
this.selectionUpdateTimer = this.view.ownerWindow.setTimeout(() => {
this.selectionStart = this.inputComponent.inputEl.selectionStart;
this.selectionEnd = this.inputComponent.inputEl.selectionEnd;
}, 30);
}
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
textComponent.inputEl.addEventListener("keydown", this.handleKeyDown);
textComponent.inputEl.addEventListener('keyup', this.handleCheckCaret);
textComponent.inputEl.addEventListener('pointerup', this.handleCheckCaret);
textComponent.inputEl.addEventListener('touchend', this.handleCheckCaret);
textComponent.inputEl.addEventListener('input', this.handleCheckCaret);
textComponent.inputEl.addEventListener('paste', this.handleCheckCaret);
textComponent.inputEl.addEventListener('cut', this.handleCheckCaret);
textComponent.inputEl.addEventListener('select', this.handleCheckCaret);
textComponent.inputEl.addEventListener('selectionchange', this.handleCheckCaret);
return textComponent;
}
@@ -255,12 +413,20 @@ export class GenericInputPrompt extends Modal {
callback: (evt: MouseEvent) => any,
tooltip: string = "",
margin: string = "5px",
iconId?:string,
) {
const btn = new ButtonComponent(container);
btn.buttonEl.style.padding = "0.5em";
btn.buttonEl.style.marginLeft = margin;
btn.setTooltip(tooltip);
btn.setButtonText(text).onClick(callback);
if (iconId) {
btn.setIcon(iconId);
} else {
btn.setButtonText(text);
}
btn.onClick(callback);
return btn;
}
@@ -276,13 +442,17 @@ export class GenericInputPrompt extends Modal {
const btn = new ButtonComponent(actionButtonContainer);
btn.buttonEl.style.marginLeft="5px";
if(button.tooltip) btn.setTooltip(button.tooltip);
btn.setButtonText(button.caption).onClick((evt: MouseEvent) => {
const res = button.action(this.input);
if (res) {
this.input = res;
}
this.submit();
});
button.iconId
? btn.setIcon(button.iconId)
: btn.setButtonText(button.caption);
button.tooltip && btn.setTooltip(button.tooltip);
btn.onClick((evt: MouseEvent) => {
const res = button.action(this.input);
if (res) {
this.input = res;
}
this.submit();
});
b = b ?? btn;
}
if (b) {
@@ -292,20 +462,32 @@ export class GenericInputPrompt extends Modal {
} else {
this.createButton(
actionButtonContainer,
"✅",
"",
this.submitClickCallback.bind(this),
t("PROMPT_BUTTON_OK") ?? "",
"5px",
"check",
).setCta().buttonEl.style.marginRight = "0";
}
this.createButton(actionButtonContainer, "❌", this.cancelClickCallback.bind(this), t("PROMPT_BUTTON_CANCEL"));
this.createButton(
actionButtonContainer,
"",
this.cancelClickCallback.bind(this),
t("PROMPT_BUTTON_CANCEL"),
"5px",
"x",
);
if(this.displayEditorButtons) {
this.createButton(editorButtonContainer, "⏎", ()=>this.insertStringBtnClickCallback("\n"), t("PROMPT_BUTTON_INSERT_LINE"), "0");
this.createButton(editorButtonContainer, "⌫", this.delBtnClickCallback.bind(this), "Delete");
this.createButton(editorButtonContainer, "⎵", ()=>this.insertStringBtnClickCallback(" "), t("PROMPT_BUTTON_INSERT_SPACE"));
this.createButton(editorButtonContainer, "§", this.specialCharsBtnClickCallback.bind(this), t("PROMPT_BUTTON_SPECIAL_CHARS"));
this.createButton(editorButtonContainer, "", ()=>this.insertStringBtnClickCallback("\n"), t("PROMPT_BUTTON_INSERT_LINE"), "0", "corner-down-left");
this.createButton(editorButtonContainer, "", this.delBtnClickCallback.bind(this), "Delete", "5px", "delete");
this.createButton(editorButtonContainer, "", ()=>this.insertStringBtnClickCallback(" "), t("PROMPT_BUTTON_INSERT_SPACE"), "5px", "space");
this.createButton(editorButtonContainer, "", this.specialCharsBtnClickCallback.bind(this), t("PROMPT_BUTTON_SPECIAL_CHARS"), "5px", "at-sign");
if(this.view) {
this.createButton(editorButtonContainer, "🔗", this.linkBtnClickCallback.bind(this), t("PROMPT_BUTTON_INSERT_LINK"));
this.createButton(editorButtonContainer, "", this.linkBtnClickCallback.bind(this), t("PROMPT_BUTTON_INSERT_LINK"), "5px", "link");
}
this.createButton(editorButtonContainer, "🔠", this.uppercaseBtnClickCallback.bind(this), t("PROMPT_BUTTON_UPPERCASE"));
this.createButton(editorButtonContainer, "", this.uppercaseBtnClickCallback.bind(this), t("PROMPT_BUTTON_UPPERCASE"), "5px", "arrow-big-up");
}
}
@@ -372,17 +554,6 @@ export class GenericInputPrompt extends Modal {
this.cancel();
}
private keyDownCallback = (evt: KeyboardEvent) => {
if ((evt.key === "Enter" && this.lines === 1) || (isWinCTRLorMacCMD(evt) && evt.key === "Enter")) {
evt.preventDefault();
this.submit();
}
if (this.displayEditorButtons && evt.key === "k" && isWinCTRLorMacCMD(evt)) {
evt.preventDefault();
this.linkBtnClickCallback();
}
};
private submit() {
this.didSubmit = true;
this.close();
@@ -401,10 +572,18 @@ export class GenericInputPrompt extends Modal {
}
private removeInputListener() {
this.inputComponent?.inputEl?.removeEventListener(
"keydown",
this.keyDownCallback,
);
if (!this.inputComponent?.inputEl) return;
const inputEl = this.inputComponent.inputEl;
inputEl.removeEventListener("keydown", this.handleKeyDown);
inputEl.removeEventListener('keyup', this.handleCheckCaret);
inputEl.removeEventListener('pointerup', this.handleCheckCaret);
inputEl.removeEventListener('touchend', this.handleCheckCaret);
inputEl.removeEventListener('input', this.handleCheckCaret);
inputEl.removeEventListener('paste', this.handleCheckCaret);
inputEl.removeEventListener('cut', this.handleCheckCaret);
inputEl.removeEventListener('select', this.handleCheckCaret);
inputEl.removeEventListener('selectionchange', this.handleCheckCaret);
}
private specialCharsBtnClickCallback = (evt: MouseEvent) => {
@@ -477,6 +656,8 @@ export class GenericInputPrompt extends Modal {
onOpen() {
super.onOpen();
this.modalEl.classList.add("excalidraw-modal");
this.containerEl.classList.add("excalidraw-modal");
this.inputComponent.inputEl.focus();
this.inputComponent.inputEl.select();
@@ -1011,6 +1192,7 @@ export async function linkPrompt(
...tagsArray,
];
await sleep(10); //obsidian modal link click immediately refocuses the editor, so we need to wait a bit
if (items.length>1) {
parts = await ScriptEngine.suggester(
app,
@@ -1060,4 +1242,4 @@ export const templatePromt = async (files: TFile[], app: App): Promise<TFile> =>
undefined,
t("PROMPT_SELECT_TEMPLATE")
))??[null, null, null])[0];
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
import { Modal, Setting, TFile } from "obsidian";
import ExcalidrawPlugin from "src/core/main";
import { getIMGFilename } from "src/utils/fileUtils";
import { addIframe } from "src/utils/utils";
import { addYouTubeThumbnail } from "src/utils/utils";
const haveLinkedFilesChanged = (depth: number, mtime: number, path: string, sourceList: Set<string>, plugin: ExcalidrawPlugin):boolean => {
if(depth++ > 5) return false;
@@ -67,7 +67,7 @@ export class PublishOutOfDateFilesDialog extends Modal {
text: "Video about Obsidian Publish support",
});
detailsEl.createEl("br");
addIframe(detailsEl, "JC1E-jeiWhI");
addYouTubeThumbnail(detailsEl, "JC1E-jeiWhI");
const p = this.contentEl.createEl("p",{text: "Collecting data..."});
const statusEl = this.contentEl.createEl("p", {text: "Status: "});
const files = await listOfOutOfSyncImgExports(this.plugin, recursive, statusEl);
+13 -5
View File
@@ -2,6 +2,7 @@ import { App, MarkdownRenderer, Modal } from "obsidian";
import { isVersionNewerThanOther } from "src/utils/utils";
import ExcalidrawPlugin from "../../core/main";
import { FIRST_RUN, RELEASE_NOTES } from "./Messages";
import { t } from "src/lang/helpers";
declare const PLUGIN_VERSION:string;
@@ -16,17 +17,23 @@ export class ReleaseNotes extends Modal {
}
onOpen(): void {
//@ts-ignore
const { containerEl, contentEl, titleEl, headerEl } = this;
//this.contentEl.classList.add("excalidraw-release");
this.containerEl.classList.add("excalidraw-release");
this.titleEl.setText(`Welcome to Excalidraw ${this.version ?? ""}`);
containerEl.classList.add("excalidraw-release");
titleEl.setText(`${t("RN_WELCOME")} ${this.version ?? ""}`);
this.createForm();
if(headerEl) headerEl.style.pointerEvents = "none"; // Disable pointer events on header to allow clicks through
}
async onClose() {
this.contentEl.empty();
await this.plugin.loadSettings();
this.plugin.settings.previousRelease = PLUGIN_VERSION
await this.plugin.saveSettings();
if(this.plugin.settings.previousRelease !== PLUGIN_VERSION) {
this.plugin.settings.previousRelease = PLUGIN_VERSION;
await this.plugin.saveSettings();
}
}
async createForm() {
@@ -39,7 +46,8 @@ export class ReleaseNotes extends Modal {
.slice(0, 10)
.join("\n\n---\n")
: FIRST_RUN;
await MarkdownRenderer.renderMarkdown(
await MarkdownRenderer.render(
this.app,
message,
this.contentEl,
"",
+5 -151
View File
@@ -1,80 +1,27 @@
import { MarkdownRenderer, Modal, Notice, request } from "obsidian";
import ExcalidrawPlugin from "../../core/main";
import { errorlog, escapeRegExp } from "../../utils/utils";
import { errorlog } from "../../utils/utils";
import { log } from "src/utils/debugHelper";
import { ContentSearcher } from "../components/ContentSearcher";
const URL =
"https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/index-new.md";
export class ScriptInstallPrompt extends Modal {
private contentDiv: HTMLDivElement;
constructor(private plugin: ExcalidrawPlugin) {
super(plugin.app);
// this.titleEl.setText(t("INSTAL_MODAL_TITLE"));
}
async onOpen(): Promise<void> {
const searchBarWrapper = document.createElement("div");
searchBarWrapper.classList.add('search-bar-wrapper');
const searchBar = document.createElement("input");
searchBar.type = "text";
searchBar.id = "search-bar";
searchBar.placeholder = "Search...";
//searchBar.style.width = "calc(100% - 120px)"; // space for the buttons and hit count
const nextButton = document.createElement("button");
nextButton.textContent = "→";
nextButton.onclick = () => this.navigateSearchResults("next");
const prevButton = document.createElement("button");
prevButton.textContent = "←";
prevButton.onclick = () => this.navigateSearchResults("previous");
const hitCount = document.createElement("span");
hitCount.id = "hit-count";
hitCount.classList.add('hit-count');
searchBarWrapper.appendChild(prevButton);
searchBarWrapper.appendChild(nextButton);
searchBarWrapper.appendChild(searchBar);
searchBarWrapper.appendChild(hitCount);
this.contentEl.prepend(searchBarWrapper);
searchBar.addEventListener("input", (e) => {
this.clearHighlights();
const searchTerm = (e.target as HTMLInputElement).value;
if (searchTerm && searchTerm.length > 0) {
this.highlightSearchTerm(searchTerm);
const totalHits = this.contentDiv.querySelectorAll("mark.search-highlight").length;
hitCount.textContent = totalHits > 0 ? `1/${totalHits}` : "";
setTimeout(()=>this.navigateSearchResults("next"));
} else {
hitCount.textContent = "";
}
});
searchBar.addEventListener("keydown", (e) => {
// If Ctrl/Cmd + F is pressed, focus on search bar
if ((e.ctrlKey || e.metaKey) && e.key === "f") {
e.preventDefault();
searchBar.focus();
}
// If Enter is pressed, navigate to next result
else if (e.key === "Enter") {
e.preventDefault();
this.navigateSearchResults(e.shiftKey ? "previous" : "next");
}
});
this.contentEl.classList.add("excalidraw-scriptengine-install");
this.contentDiv = document.createElement("div");
this.contentEl.appendChild(this.contentDiv);
new ContentSearcher(this.contentDiv);
this.containerEl.classList.add("excalidraw-scriptengine-install");
try {
const source = await request({ url: URL });
@@ -111,99 +58,6 @@ export class ScriptInstallPrompt extends Modal {
}
}
highlightSearchTerm(searchTerm: string): void {
// Create a walker to traverse text nodes
const walker = document.createTreeWalker(
this.contentDiv,
NodeFilter.SHOW_TEXT,
{
acceptNode: (node: Text) => {
return node.nodeValue!.toLowerCase().includes(searchTerm.toLowerCase()) ?
NodeFilter.FILTER_ACCEPT :
NodeFilter.FILTER_REJECT;
}
}
);
const nodesToReplace: Text[] = [];
while (walker.nextNode()) {
nodesToReplace.push(walker.currentNode as Text);
}
nodesToReplace.forEach(node => {
const nodeContent = node.nodeValue!;
const newNode = document.createDocumentFragment();
let lastIndex = 0;
let match;
const regex = new RegExp(escapeRegExp(searchTerm), 'gi');
// Iterate over all matches in the text node
while ((match = regex.exec(nodeContent)) !== null) {
const before = document.createTextNode(nodeContent.slice(lastIndex, match.index));
const highlighted = document.createElement('mark');
highlighted.className = 'search-highlight';
highlighted.textContent = match[0];
highlighted.classList.add('search-result');
newNode.appendChild(before);
newNode.appendChild(highlighted);
lastIndex = regex.lastIndex;
}
newNode.appendChild(document.createTextNode(nodeContent.slice(lastIndex)));
node.replaceWith(newNode);
});
}
clearHighlights(): void {
this.contentDiv.querySelectorAll("mark.search-highlight").forEach((el) => {
el.outerHTML = el.innerHTML;
});
}
navigateSearchResults(direction: "next" | "previous"): void {
const highlights: HTMLElement[] = Array.from(
this.contentDiv.querySelectorAll("mark.search-highlight")
);
if (highlights.length === 0) return;
const currentActiveIndex = highlights.findIndex((highlight) =>
highlight.classList.contains("active-highlight")
);
if (currentActiveIndex !== -1) {
highlights[currentActiveIndex].classList.remove("active-highlight");
highlights[currentActiveIndex].style.border = "none";
}
let nextActiveIndex = 0;
if (direction === "next") {
nextActiveIndex =
currentActiveIndex === highlights.length - 1
? 0
: currentActiveIndex + 1;
} else if (direction === "previous") {
nextActiveIndex =
currentActiveIndex === 0
? highlights.length - 1
: currentActiveIndex - 1;
}
const nextActiveHighlight = highlights[nextActiveIndex];
nextActiveHighlight.classList.add("active-highlight");
nextActiveHighlight.scrollIntoView({
behavior: "smooth",
block: "nearest",
});
// Update the hit count
const hitCount = document.getElementById("hit-count");
hitCount.textContent = `${nextActiveIndex + 1}/${highlights.length}`;
}
onClose(): void {
this.contentEl.empty();
}
+19 -5
View File
@@ -3,10 +3,13 @@ import { t } from "../../lang/helpers";
import ExcalidrawView from "src/view/ExcalidrawView";
import { getEA } from "src/core";
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { MD_EX_SECTIONS } from "src/constants/constants";
import { CARD_HEIGHT, CARD_WIDTH, MD_EX_SECTIONS } from "src/constants/constants";
import { addBackOfTheNoteCard } from "src/utils/excalidrawViewUtils";
export class SelectCard extends FuzzySuggestModal<string> {
private center: boolean = false;
private x: number = 0;
private y: number = 0;
constructor(
public app: App,
@@ -31,7 +34,7 @@ export class SelectCard extends FuzzySuggestModal<string> {
this.close();
return;
}
addBackOfTheNoteCard(this.view, item);
addBackOfTheNoteCard(this.view, item, true, undefined, undefined, this.center, {x: this.x, y: this.y});
this.close();
}
}
@@ -48,18 +51,29 @@ export class SelectCard extends FuzzySuggestModal<string> {
onChooseItem(item: string): void {
const ea = getEA(this.view) as ExcalidrawAutomate;
if(this.center) {
const centerPos = ea.getViewCenterPosition();
if(centerPos) {
this.x = centerPos.x - (CARD_WIDTH / 2);
this.y = centerPos.y - (CARD_HEIGHT / 2);
}
}
const id = ea.addEmbeddable(
0,0,400,500,
this.x,this.y,CARD_WIDTH,CARD_HEIGHT,
`[[${this.view.file.path}#${item}]]`
);
(async () => {
await ea.addElementsToView(true, false, true);
await ea.addElementsToView(!this.center, false, true);
ea.selectElementsInView([id]);
ea.destroy();
})();
}
public start(): void {
public start(center: boolean = false): void {
this.x = this.view.currentPosition.x;
this.y = this.view.currentPosition.y;
this.center = !!center;
this.emptyStateText = t("EMPTY_SECTION_MESSAGE");
this.setPlaceholder(t("SELECT_SECTION_OR_TYPE_NEW"));
this.open();
+189 -22
View File
@@ -31,6 +31,12 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: "The ExcalidrawPlugin object",
after: "",
},
{
field: "FloatingModal",
code: null,
desc: "A modified version of the Obsidian.Modal class that allows the modal to be dragged around the screen and that does not dim the background.",
after: "",
},
{
field: "elementsDict",
code: null,
@@ -196,6 +202,23 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: "Get single element from ExcalidrawAutomate elementsDict",
after: "",
},
{
field: "getBoundTextElement",
code:
"getBoundTextElement(element: ExcalidrawElement, searchInView?: boolean): { eaElement?: Mutable<ExcalidrawTextElement>; sceneElement?: ExcalidrawTextElement; };",
desc:
"Returns an object describing the bound text element.\n" +
"@param element: ExcalidrawElement | ExcalidrawElement[] - The selected container with text (an array of 2 elements) to check.\n" +
"If a text element is provided:\n" +
" - returns { eaElement } if the element is in ea.elementsDict\n" +
" - else (if searchInView is true) returns { sceneElement } if found in the targetView scene\n" +
"If a container element is provided, searches for the bound text element:\n" +
" - returns { eaElement } if found in ea.elementsDict\n" +
" - else (if searchInView is true) returns { sceneElement } if found in the targetView scene\n" +
"If not found, returns {}.\n" +
"Does not add the text element to elementsDict.",
after: "",
},
{
field: "create",
code: 'async create(params?: {filename?: string, foldername?: string, templatePath?: string, onNewPane?: boolean, silent?: boolean, frontmatterKeys?: {},}): Promise<string>;',
@@ -215,12 +238,13 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
' "excalidraw-linkbutton-opacity"?: number;\n' +
' "excalidraw-autoexport"?: boolean;\n' +
' "excalidraw-mask"?: boolean;\n' +
' "excalidraw-export-internal-links"?: boolean;\n' +
' "cssclasses"?: string;\n}',
after: "",
},
{
field: "createSVG",
code: "async createSVG(templatePath?: string, embedFont?: boolean, exportSettings?: ExportSettings, loader?: EmbeddedFilesLoader, theme?: string,): Promise<SVGSVGElement>;",
code: "async createSVG(templatePath?: string, embedFont?: boolean, exportSettings?: ExportSettings, loader?: EmbeddedFilesLoader, theme?: string, padding?: number, convertMarkdownLinksToObsidianURLs: boolean = false, includeInternalLinks: boolean = true,): Promise<SVGSVGElement>;",
desc: "Use ExcalidrawAutomate.getExportSettings(boolean,boolean) to create an ExportSettings object.\nUse ExcalidrawAutomate.getEmbeddedFilesLoader(boolean?) to create an EmbeddedFilesLoader object.",
after: "",
},
@@ -381,26 +405,39 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "addArrow",
code: "addArrow(points: [[x: number, y: number]], formatting?: { startArrowHead?: string; endArrowHead?: string; startObjectId?: string; endObjectId?: string;}, id?:string): string;",
desc: `valid values for startArrowHead and endArrowHead are: "arrow"|"bar"|"circle"|"circle_outline"|"triangle"|"triangle_outline"|"diamond"|"diamond_outline"|null`,
code:
'addArrow(points: [x: number, y: number][], formatting?: { startArrowHead?: string; endArrowHead?: string; startObjectId?: string; endObjectId?: string; startBindMode?: string; endBindMode?: string; startFixedPoint?: [number, number]; endFixedPoint?: [number, number]; elbowed?: boolean}, id?: string): string;',
desc:
"Adds an arrow element.\n" +
'Arrowheads: "arrow"|"bar"|"circle"|"circle_outline"|"triangle"|"triangle_outline"|"diamond"|"diamond_outline"|null.\n' +
'Bindings: "inside" | "outside" Sets startObjectId/endObjectId to bind the arrow ends to shapes. Bind mode: "orbit" (default) or "inside".\n' +
"Fixed point: [xRatio,yRatio] in 0..1 (percentage of bound element width/height) to bind to a specific point on the element. In case of orbit mode, the orbit will happen around this immaginary point.\n" +
"Elbowed: true will create an elbowed arrow.",
after: "",
},
{
field: "addImage",
code: "async addImage(opts: {topX: number, topY: number, imageFile: TFile|string, scale?: boolean, anchor?: boolean, colorMap?: ColorMap}): Promise<string>;",
desc: "imageFile may be a TFile or a string that contains a hyperlink.\n"+
"imageFile may also be an obsidian filepath including a reference eg.: 'path/my.pdf#page=3'\n"+
"Set scale to false if you want to embed the image at 100% of its original size. Default is true which will insert a scaled image.\n"+
"anchor will only be evaluated if scale is false. anchor true will add |100% to the end of the filename, resulting in an image that will always pop back to 100% when the source file is updated or when the Excalidraw file is reopened.\n"+
"colorMap is only used for SVG images and nested Excalidraw images. See the Shade Master script and the Deconstruct Selected Elements script for examples using colorMap.\n"+
desc: "imageFile may be a TFile or a string that contains a hyperlink.\n" +
"imageFile may also be an obsidian filepath including a reference eg.: 'path/my.pdf#page=3'\n" +
"Set scale to false if you want to embed the image at 100% of its original size. Default is true which will insert a scaled image.\n" +
"anchor will only be evaluated if scale is false. anchor true will add |100% to the end of the filename, resulting in an image that will always pop back to 100% when the source file is updated or when the Excalidraw file is reopened.\n" +
"colorMap is only used for SVG images and nested Excalidraw images. See the Shade Master script and the Deconstruct Selected Elements script for examples using colorMap.\n" +
"type ColorMap = { [color: string]: string; }",
after: "",
},
{
field: "addEmbeddable",
code: "addEmbeddable(topX: number, topY: number, width: number, height: number, url?: string, file?: TFile, embeddableCustomData?: EmbeddableMDCustomProps): string;",
desc: "Adds an iframe/webview (depending on content and platform) to the drawing. If url is not null then the iframe/webview will be loaded from the url. The url maybe a markdown link to an note in the Vault or a weblink. " +
"If url is null then the iframe/webview will be loaded from the file. Both the url and the file may not be null.<br>" + EMBEDDABLE_MDCUSTOMPROPS,
desc: "Adds an embeddable component (technically an iframe or webview depending on content and platform) to the drawing. If url is not null then the embeddable will be loaded from the url. The url maybe a markdown link to an note in the Vault or a weblink. " +
"If url is null then the embeddable will be loaded from the file. Both the url and the file may not be null.<br>" + EMBEDDABLE_MDCUSTOMPROPS,
after: "",
},
{
field: "addIFrame",
code: "addIFrame(topX: number, topY: number, width: number, height: number, url?: string, file?: TFile, html?: string): string;",
desc: "If the url or file attribute is provided then the iframe will insert an embeddable component (technically calling ea.addEmbeddable() in the background with the same parameters). The function is depricated in that case use addEmbeddable instead. \n" +
"If the html attribute is provided, then the function will create an 'iframe' element with the provided html content.",
after: "",
},
{
@@ -462,9 +499,18 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "setView",
code: 'setView(view: ExcalidrawView | "first" | "active"): ExcalidrawView;',
desc: null,
after: "",
code: 'setView(view?: ExcalidrawView | "auto" | "first" | "active" | null, show: boolean = false): ExcalidrawView;',
desc: "Sets the target view for EA. All the view operations and the access to Excalidraw API will be performed on this view. " +
"Typically you will use setView() (to pick a sensible default) or setView(excalidrawView) (to explicitly target a specific view).\n" +
'"auto" is equivalent to calling setView() and can read nicer when you want to show the view (e.g. setView("auto", true)).\n' +
'"active" and "first" are deprecated and are kept for backward compatibility.\n' +
'If view is null or undefined (or "auto"), EA will pick a sensible default: first the currently active Excalidraw view (if any), otherwise the last active Excalidraw view (if it is still available), otherwise the "first" Excalidraw view in the workspace.\n' +
"If show is true, the view will be brought to front and focused.\n" +
'If "first" is provided, the target will be the first Excalidraw view returned by Obsidian\'s workspace leaf collection (i.e., the first item in getExcalidrawViews()). ' +
"This ordering is managed by Obsidian and does not necessarily match what a user would consider the “first” view; from a user's perspective it may appear random.\n" +
'If "active" is provided, the currently active Excalidraw view in the workspace will be used. If that is not available, then the last active Excalidraw view will be used.\n' +
"The function returns the ExcalidrawView that was set as targetView.",
after: '("auto",true);',
},
{
field: "getExcalidrawAPI",
@@ -516,7 +562,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: 'Updates the color map of an SVG image element in the view. If a ColorMap is provided, it will be used directly. If an SVGColorInfo is provided, it will be converted to a ColorMap. The view will be marked as dirty (i.e. will be saved at next scheduled time) and the image will be reset using the color map.\n'+
'See "Shade Master" scritp in Script Library for an example of using this function.\n\n' +
'type SVGColorInfo = Map<string, { mappedTo: string; fill: boolean; stroke: boolean; }>\n' +
'type ColorMap = { [color: string]: string; }',
'type ColorMap = { [color: string]: string; invertInDarkMode?: boolean; }',
after: "",
},
{
@@ -524,7 +570,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
code: "getColorMapForImageElement(el: ExcalidrawElement): ColorMap",
desc: 'Retrieves the color map for an image element. The color map contains information about the mapping of colors used in the image. If the element already has a color map, it will be returned. The colorMap does not include all colors in the image, only those that have been mapped.\n' +
'See "Shade Master" scritp in Script Library for an example of using this function.\n\n' +
'type ColorMap = { [color: string]: string; }',
'type ColorMap = { [color: string]: string; invertInDarkMode?: boolean; }',
after: "",
},
{
@@ -571,8 +617,12 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "addElementsToView",
code: "async addElementsToView(repositionToCursor?: boolean, save?: boolean, newElementsOnTop?: boolean,shouldRestoreElements?: boolean,): Promise<boolean>;",
desc: "Adds elements from elementsDict to the current view\nrepositionToCursor: default is false\nsave: default is true\nnewElementsOnTop: default is false, i.e. the new elements get to the bottom of the stack\nnewElementsOnTop controls whether elements created with ExcalidrawAutomate are added at the bottom of the stack or the top of the stack of elements already in the view\nNote that elements copied to the view with copyViewElementsToEAforEditing retain their position in the stack of elements in the view even if modified using EA",
code: "async addElementsToView(repositionToCursor?: boolean, save?: boolean, newElementsOnTop?: boolean,shouldRestoreElements?: boolean,captureUpdate?: CaptureUpdateActionType): Promise<boolean>;",
desc: "Adds elements from elementsDict to the current view\nrepositionToCursor: default is false\n" +
"save: default is true\n" +
"newElementsOnTop: default is false, i.e. the new elements get to the bottom of the stack\n" +
"newElementsOnTop controls whether elements created with ExcalidrawAutomate are added at the bottom of the stack or the top of the stack of elements already in the view\nNote that elements copied to the view with copyViewElementsToEAforEditing retain their position in the stack of elements in the view even if modified using EA\n" +
"captureUpdate controls undo/redo capture: 'IMMEDIATELY' records immediately (use for local updates), 'NEVER' skips undo tracking (remote/init changes), and 'EVENTUALLY' defers capture as part of multi-step async flows.",
after: "",
},
{
@@ -605,6 +655,12 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
"}",
after: "",
},
{
field: "getElementsInArea",
code: "getElementsInArea(elements: ExcalidrawElement[], area: {x: number, y: number, width: number, height: number}): ExcalidrawElement[];",
desc: "Filter the elements and returns only those within the specific area.",
after: "",
},
{
field: "getBoundingBox",
code: "getBoundingBox(elements: ExcalidrawElement[]): {topX: number, topY: number, width: number, height: number,};",
@@ -666,6 +722,37 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: `Sets script settings.\nSee for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}`,
after: "",
},
{
field: "setScriptSettingValue",
code: "setScriptSettingValue(key: string, value: ScriptSettingValue): void;",
desc:
`Sets a single Script Engine setting value for the active script (in-memory).\n` +
`Use saveScriptSettings() to persist changes.\n` +
`Handles initialization when scriptEngineSettings[activeScript] is undefined/null.\n` +
`See for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}\n\n` +
`type ScriptSettingValue = { value?: string; hidden?: boolean; description?: string; valueset?: string[]; height?: number; };`,
after: `("myKey", { value: "" });`,
},
{
field: "getScriptSettingValue",
code: "getScriptSettingValue(key: string, defaultValue: ScriptSettingValue): ScriptSettingValue;",
desc:
`Gets a single Script Engine setting value for the active script.\n` +
`Returns defaultValue if the key does not exist (or if activeScript is not set).\n` +
`Handles initialization when scriptEngineSettings[activeScript] is undefined/null.\n` +
`See for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}\n\n` +
`type ScriptSettingValue = { value?: string; hidden?: boolean; description?: string; valueset?: string[]; height?: number; };`,
after: `("myKey", { value: "" });`,
},
{
field: "saveScriptSettings",
code: "async saveScriptSettings(): Promise<void>;",
desc:
`Persists Script Engine settings to disk (plugin settings).\n` +
`Useful after calling setScriptSettingValue().\n` +
`See for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}`,
after: "()",
},
{
field: "openFileInNewOrAdjacentLeaf",
code: "openFileInNewOrAdjacentLeaf(file: TFile): WorkspaceLeaf;",
@@ -763,6 +850,25 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
"colorNameToHex to convert the color name to a HEX color.",
after: "",
},
{
field: "getViewColorPalette",
code: "getViewColorPalette(palette: \"canvasBackground\"|\"elementBackground\"|\"elementStroke\"): (string[] | string)[];",
desc: "Returns the current view's palette for canvas background, element background, or element stroke colors. Falls back to the default palette when no view is loaded or the palette is unavailable.",
after: "(\"elementStroke\");",
},
{
field: "showColorPicker",
code: "async showColorPicker(anchorElement: HTMLElement, palette: \"canvasBackground\"|\"elementBackground\"|\"elementStroke\", includeSceneColors: boolean = true): Promise<string | null>;",
desc: "Opens a palette popover anchored to the provided element and resolves with the selected color; returns null when dismissed.\n\n" +
"Example Usage:\n" +
'const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");\n' +
"if(selected) {" +
'console.log("User selected color: " + selected);' +
"} else {" +
'console.log("User cancelled color selection");' +
"}",
after: "(buttonEl, \"elementStroke\");",
},
{
field: "obsidian",
code: "obsidian",
@@ -807,11 +913,11 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "getActiveEmbeddableViewOrEditor",
code: "getActiveEmbeddableViewOrEditor(view?: ExcalidrawView);",
code: "getActiveEmbeddableViewOrEditor (view?:ExcalidrawView): {view:any}|{file:TFile, editor:Editor}|{node: ObsidianCanvasNode}|null;",
desc: "Returns the editor or leaf.view of the currently active embedded obsidian file.<br>" +
"If view is not provided, ea.targetView is used.<br>" +
"If the embedded file is a markdown document the function will return<br>" +
"<code>{file:TFile, editor:Editor}</code> otherwise it will return {view:any}. You can check view type with view.getViewType();",
"If the embedded file is an eligible Obsidian canvas node document the function will return<br>" +
"<code>{file:TFile, editor:Editor}</code> of {node: ObsidianCanvasNode}, otherwise it will return {view:any}. You can check view type with view.getViewType();",
after: "",
},
{
@@ -820,6 +926,53 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: "@returns the last recorded pointer position on the Excalidraw canvas",
after: "",
},
{
field: "getViewCenterPosition",
code: "getViewCenterPosition(): {x: number, y: number};",
desc: "@returns the center position of the current view in Excalidraw coordinates",
after: "",
},
{
field: "checkForActiveSidepanelTabForScript",
code: "checkForActiveSidepanelTabForScript(scriptName?: string): ExcalidrawSidepanelTab | null;",
desc: "Returns the active sidepanel tab for the given script, or null if none exists. " +
"If scriptName is omitted the function checks ea.activeScript. " +
"At most one sidepanel tab may be open per script. " +
"The returned ExcalidrawSidepanelTab may be hosted by a different ExcalidrawAutomate instance — compare sidepanelTab.getHostEA() === ea to determine ownership. " +
"Useful to detect or reuse an existing tab instead of creating a new one.",
after: '("MyScript");'
},
{
field: "createSidepanelTab",
code: "async createSidepanelTab(title: string, persist: boolean = false, reveal: boolean = true,): Promise<ExcalidrawSidepanelTab | null>;",
desc: "Creates this EA instance's sidepanel tab; use the returned ExcalidrawSidepanelTab (setContent/setTitle, onOpen/onClose/onFocus, contentEl) to build the UI and lifecycle hooks.\n"+
"In case the script wants to replace the sidepanel tab it created earlier, call closeSidepanelTab() first, then createSidepanelTab() again.",
after: "",
},
{
field: "getSidepanelLeaf",
code: "getSidepanelLeaf(): WorkspaceLeaf | null;",
desc: "Returns the WorkspaceLeaf hosting the Excalidraw sidepanel view, or null if the sidepanel is not present.",
after: "();"
},
{
field: "toggleSidepanelView",
code: "toggleSidepanelView(): void;",
desc: "Toggles the Excalidraw sidepanel visibility when the sidepanel is hosted in the left or right workspace split. If the sidepanel is not attached to a left/right sidebar, no action is taken.",
after: "();"
},
{
field: "persistSidepanelTab",
code: "persistSidepanelTab(): ExcalidrawSidepanelTab | null;",
desc: "Pins the active script's sidepanel tab so it persists across Obsidian restarts and returns it.",
after: "",
},
{
field: "attachInlineLinkSuggester",
code: "attachInlineLinkSuggester(inputEl: HTMLInputElement, widthWrapper?: HTMLElement): KeyBlocker;",
desc: "Attaches an inline [[link]] suggester to an input. Optionally align width to a wrapper element. Returns a KeyBlocker so host scripts can skip their own keydown handlers while the suggester is active via isBlockingKeys(); call close() on the returned suggester to detach.",
after: "",
},
{
field: "getleaf",
code: "getLeaf(origo: WorkspaceLeaf, targetPane?: PaneTarget): WorkspaceLeaf;",
@@ -932,7 +1085,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
export const EXCALIDRAW_SCRIPTENGINE_INFO: SuggesterInfo[] = [
{
field: "inputPrompt",
code: "inputPrompt: (opts: {header: string, placeholder?: string, value?: string, buttons?: {caption:string, tooltip?:string, action:Function}[], lines?: number, displayEditorButtons?: boolean, customComponents?: (container: HTMLElement) => void, blockPointerInputOutsideModal?: boolean, controlsOnTop?: boolean});",
code: "inputPrompt: (opts: {header: string, placeholder?: string, value?: string, buttons?: {caption:string, tooltip?:string, iconId?: string, action:Function}[], lines?: number, displayEditorButtons?: boolean, customComponents?: (container: HTMLElement) => void, blockPointerInputOutsideModal?: boolean, controlsOnTop?: boolean});",
desc:
"Opens a prompt that asks for an input.\nReturns a string with the input.\nYou need to await the result of inputPrompt.\n" +
"Editor buttons are text editing buttons like delete, enter, allcaps - these are only displayed if lines is greater than 1 \n" +
@@ -940,6 +1093,7 @@ export const EXCALIDRAW_SCRIPTENGINE_INFO: SuggesterInfo[] = [
"blockPointerInputOutsideModal will block pointer input outside the modal. This is useful if you want to prevent the user accidently closing the modal or interacting with the excalidraw canvas while the prompt is open.\n" +
"controlsOnTop when set to true will move all the buttons to the top of the modal, leaving the text area at the bottom. This feature was developed for Scribble Helper script to avoid your palm pressing buttons while scribbling.\n"+
"buttons.action(input: string) => string\nThe button action function will receive the actual input string. If action returns null, input will be unchanged. If action returns a string, input will receive that value when the promise is resolved. " +
"iconId is the lucide.dev icon name. If iconId is provided caption will be ignored, simply submit \"\" as caption in that case. \n" +
"example:\n<code>let fileType = '';\nconst filename = await utils.inputPrompt (\n 'Filename',\n '',\n '',\n, [\n {\n caption: 'Markdown',\n action: ()=>{fileType='md';return;}\n },\n {\n caption: 'Excalidraw',\n action: ()=>{fileType='ex';return;}\n }\n ]\n);</code>",
after: `({\n header: "",\n placeholder: undefined, //string\n value: undefined, //string\n buttons: [{ //optional, may leave undefined\n caption: "", //string\n tooltip: undefined, //string\n action: (input)=>{} //Function\n }],\n lines: undefined, //number\n displayEditorButtons: undefined, //boolean\n customComponents: undefined, //(container: HTMLElement) => void\n blockPointerInputOutsideModal: undefined, //boolean\n controlsOnTop: undefined, //boolean\n draggable: undefined, //boolean\n});`,
},
@@ -961,7 +1115,7 @@ export const FRONTMATTER_KEYS_INFO: SuggesterInfo[] = [
{
field: "plugin",
code: null,
desc: "Denotes an excalidraw file. If key is not present, the file will not be recognized as an Excalidarw file. Valid values are 'parsed' and 'raw'",
desc: "Denotes an excalidraw file. If key is not present, the file will not be recognized as an Excalidraw file. Valid values are 'parsed' and 'raw'",
after: ": parsed",
},
{
@@ -1055,12 +1209,25 @@ export const FRONTMATTER_KEYS_INFO: SuggesterInfo[] = [
desc: "If this key is present it will override the default excalidraw embed and export setting.",
after: ": false",
},
{
field: "export-internal-links",
code: null,
desc: "Default value (if not set) is true, if set to false internal links will not be exported to SVG images and PDFs.",
after: ": false",
},
{
field: "open-md",
code: null,
desc: "If this key is present the file will be opened as a markdown file in the editor",
after: ": true",
},
{
field: "embed-md",
code: null,
desc: "If this key is present, when embedding the ![[image]] into a markdown document, it will be embedded as markdown, not as an image.\n" +
"If however you embed ![[image#^as-image]], i.e. you reference the 'as-image' block, then the image will be embedded as an image.",
after: ": true",
},
{
field: "autoexport",
code: null,
@@ -0,0 +1,121 @@
import { Setting, DropdownComponent, App } from "obsidian";
import { t } from "src/lang/helpers";
import { ExcalidrawSettings } from "src/core/settings";
import { fragWithHTML, setLeftHandedMode, setUIMode } from "src/utils/utils";
import { DEVICE } from "src/constants/constants";
export type UIMode = "full" | "compact" | "tray" | "mobile";
//setDesktopUIMode(this.app, this.plugin.settings);
export class UIModeSettingsComponent {
private containerEl: HTMLElement;
private settings: ExcalidrawSettings;
private app: App;
private onChange: () => void;
private reapplyButtonAction: ()=>void = null;
constructor(
containerEl: HTMLElement,
settings: ExcalidrawSettings,
app: App,
onChange: () => void,
reapplyButtonAction: ()=>void = null,
) {
this.containerEl = containerEl;
this.settings = settings;
this.app = app;
this.onChange = onChange;
this.reapplyButtonAction = reapplyButtonAction;
}
render(): void {
const { containerEl } = this;
new Setting(containerEl)
.setName(t("DESKTOP_UI_MODE_NAME"))
.setDesc(t("DESKTOP_UI_MODE_DESC"))
.addDropdown((dropdown: DropdownComponent) =>
dropdown
.addOption("full", t("MODE_FULL"))
.addOption("compact", t("MODE_COMPACT"))
.addOption("tray", t("MODE_TRAY"))
.setValue(this.settings.desktopUIMode)
.onChange((value: UIMode) => {
this.settings.desktopUIMode = value;
if (DEVICE.isDesktop) {
setUIMode(this.app, this.settings);
}
this.onChange();
}),
);
new Setting(containerEl)
.setName(t("TABLET_UI_MODE_NAME"))
.setDesc(t("TABLET_UI_MODE_DESC"))
.addDropdown((dropdown: DropdownComponent) =>
dropdown
.addOption("full", t("MODE_FULL"))
.addOption("compact", t("MODE_COMPACT"))
.addOption("tray", t("MODE_TRAY"))
.setValue(this.settings.tabletUIMode)
.onChange((value: UIMode) => {
this.settings.tabletUIMode = value;
if (DEVICE.isTablet) {
setUIMode(this.app, this.settings);
}
this.onChange();
}),
);
new Setting(containerEl)
.setName(t("PHONE_UI_MODE_NAME"))
.setDesc(t("PHONE_UI_MODE_DESC"))
.addDropdown((dropdown: DropdownComponent) =>
dropdown
.addOption("full", t("MODE_FULL"))
.addOption("compact", t("MODE_COMPACT"))
.addOption("tray", t("MODE_TRAY"))
.addOption("mobile", t("MODE_PHONE"))
.setValue(this.settings.phoneUIMode ?? "mobile")
.onChange((value: UIMode) => {
this.settings.phoneUIMode = value;
if (DEVICE.isPhone) {
setUIMode(this.app, this.settings);
}
this.onChange();
}),
);
new Setting(containerEl)
.setName(t("LEFTHANDED_MODE_NAME"))
.setDesc(fragWithHTML(t("LEFTHANDED_MODE_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.settings.isLeftHanded)
.onChange(async (value) => {
this.settings.isLeftHanded = value;
//not clear why I need to do this. If I don't double apply the stylesheet changes
//then the style won't be applied in the popout windows
setLeftHandedMode(value);
setTimeout(()=>setLeftHandedMode(value));
this.onChange();
}),
);
if (this.reapplyButtonAction) {
new Setting(containerEl)
.addButton((button) =>
button
.setButtonText(t("REAPPLY_UI_MODE_BUTTON"))
.setCta()
.onClick(() => {
setUIMode(this.app, this.settings);
this.reapplyButtonAction();
}),
);
}
}
}
+41
View File
@@ -0,0 +1,41 @@
import ExcalidrawPlugin from "src/core/main";
import { t } from "src/lang/helpers";
import { UIModeSettingsComponent } from "./UIModeSettingComponent";
import { Modal } from "obsidian";
export class UIModeSettings extends Modal {
private isDirty = false;
constructor(
private plugin: ExcalidrawPlugin,
) {
super(plugin.app);
}
onOpen(): void {
this.containerEl.classList.add("excalidraw-release");
this.createForm();
}
async onClose() {
if (this.isDirty) {
await this.plugin.saveSettings();
}
this.plugin = null;
}
async createForm() {
this.contentEl.createEl("h1",{text: t("MODES_HEAD")});
new UIModeSettingsComponent(
this.contentEl,
this.plugin.settings,
this.app,
()=>this.applySettingsUpdate(),
()=>this.close(),
).render();
}
private async applySettingsUpdate() {
this.isDirty = true;
};
}
+12 -8
View File
@@ -1,4 +1,4 @@
import { ButtonComponent, DropdownComponent, TFile, ToggleComponent } from "obsidian";
import { ButtonComponent, DropdownComponent, TFile } from "obsidian";
import ExcalidrawView from "../../view/ExcalidrawView";
import ExcalidrawPlugin from "../../core/main";
import { Modal, Setting, TextComponent } from "obsidian";
@@ -10,6 +10,7 @@ import { InsertPDFModal } from "./InsertPDFModal";
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { cleanSectionHeading } from "src/utils/obsidianUtils";
import { t } from "src/lang/helpers";
export class UniversalInsertFileModal extends Modal {
private center: { x: number, y: number } = { x: 0, y: 0 };
@@ -60,8 +61,11 @@ export class UniversalInsertFileModal extends Modal {
}
onOpen(): void {
const modalEl = this.modalEl;
modalEl.classList.add("excalidraw-modal");
this.containerEl.classList.add("excalidraw-release");
this.titleEl.setText(`Insert File From Vault`);
this.containerEl.classList.add("excalidraw-modal");
this.titleEl.setText(t("UIFM_TITLE"));
this.createForm();
}
@@ -155,15 +159,15 @@ export class UniversalInsertFileModal extends Modal {
});
sectionPickerSetting = new Setting(ce)
.setName("Select section heading")
.setName(t("UIFM_SECTION_HEAD"))
.addDropdown(dropdown => {
sectionPicker = dropdown;
sectionPicker.selectEl.style.width = "100%";
})
sizeToggleSetting = new Setting(ce)
.setName("Anchor to 100% of original size")
.setDesc("This is a pro feature, use it only if you understand how it works. If enabled even if you change the size of the imported image in Excalidraw, the next time you open the drawing this image will pop back to 100% size. This is useful when embedding an atomic Excalidraw idea into another note and preserving relative sizing of text and icons.")
.setName(t("UIFM_ANCHOR"))
.setDesc(t("UIFM_ANCHOR_DESC"))
.addToggle(toggle => {
toggle.setValue(anchorTo100)
.onChange((value) => {
@@ -174,7 +178,7 @@ export class UniversalInsertFileModal extends Modal {
new Setting(ce)
.addButton(button => {
button
.setButtonText("as Embeddable")
.setButtonText(t("UIFM_BTN_EMBEDDABLE"))
.onClick(async () => {
const path = this.app.metadataCache.fileToLinktext(
file,
@@ -198,7 +202,7 @@ export class UniversalInsertFileModal extends Modal {
})
.addButton(button => {
button
.setButtonText("as Pdf")
.setButtonText(t("UIFM_BTN_PDF"))
.onClick(() => {
const insertPDFModal = new InsertPDFModal(this.plugin, this.view);
insertPDFModal.open(file);
@@ -208,7 +212,7 @@ export class UniversalInsertFileModal extends Modal {
})
.addButton(button => {
button
.setButtonText("as Image")
.setButtonText(t("UIFM_BTN_IMAGE"))
.onClick(async () => {
const ea:ExcalidrawAutomate = getEA(this.view);
const isMarkdown = file && file.extension === "md" && !ea.isExcalidrawFile(file);
+102
View File
@@ -0,0 +1,102 @@
import { Modal, Setting } from "obsidian";
import ExcalidrawPlugin from "src/core/main";
import { t } from "src/lang/helpers";
declare const PLUGIN_VERSION: string;
/**
* A modal dialog that informs the user about a version mismatch between the version recorded by Obsidian and the actual version of the plugin executable.
* Explain that this can be the result of a partial sync, such as an Obsidian Sync Standard plan, which does not syncronize files larger than 5MB, and the plugin executable is larger.
* Explain that changing the plugin version information in Obsidian can lead to unexpected behavior in plugins suchs as the Plugin Update Tracker plugin or the BRAT plugin.
* The user has a toggle button to disable this check in the future. There is additional information that this can be reenabled in plugin settings.
* The user can click update obsidian version info to match the plugin version, and open Obsidian settings to redownload the plugin.
* The user can click ignore to dismiss the dialog.
*/
export class VersionMismatchPrompt extends Modal {
private resolvePromise: (value: any) => void;
public promise: Promise<any>;
private resolved: boolean;
private isDirty: boolean = false;
public constructor(
private plugin: ExcalidrawPlugin,
) {
super(plugin.app);
}
async start(): Promise<any> {
this.promise = new Promise((resolve) => {
this.resolvePromise = resolve;
});
await this.plugin.loadSettings();
this.buildUI();
this.open();
return this.promise;
}
private buildUI() {
const { contentEl } = this;
contentEl.empty();
const recorded = this.plugin.manifest.version;
const actual = PLUGIN_VERSION;
contentEl.createEl("h2", { text: t("VERSION_MISMATCH_HEADING") });
const p1 = contentEl.createEl("p");
p1.innerHTML = t("VERSION_MISMATCH_NOTICE")
.replace("{VAL_RECORDED}", recorded)
.replace("{VAL_ACTUAL}", actual);
const p2 = contentEl.createEl("p");
p2.innerHTML = t("VERSION_MISMATCH_CAUSE");
const p3 = contentEl.createEl("p");
p3.innerHTML = t("VERSION_MISMATCH_OPTIONS");
const p4 = contentEl.createEl("p");
p4.innerHTML = t("VERSION_MISMATCH_NOTE");
new Setting(contentEl)
.setName(t("VERSION_MISMATCH_DISABLE_NAME"))
.setDesc(t("VERSION_MISMATCH_DISABLE_DESC"))
.addToggle(tg =>
tg.setValue(!this.plugin.settings.compareManifestToPluginVersion ? true : false)
.onChange(async (value) => {
this.plugin.settings.compareManifestToPluginVersion = !value; // invert because label is Disable ...
this.isDirty = true;
}),
);
// Buttons row
const buttonBar = contentEl.createDiv({ cls: "ex-version-mismatch-buttons" });
const redownloadBtn = buttonBar.createEl("button", { text: t("VERSION_MISMATCH_REDOWNLOAD") });
redownloadBtn.addEventListener("click", () => {
this.resolved = true; // triggers opening settings in caller
this.close();
});
const ignoreBtn = buttonBar.createEl("button", { text: t("VERSION_MISMATCH_IGNORE") });
ignoreBtn.addEventListener("click", () => {
this.resolved = false;
this.close();
});
buttonBar.style.display = "flex";
buttonBar.style.gap = "0.5rem";
buttonBar.style.marginTop = "1rem";
redownloadBtn.style.backgroundColor = "var(--interactive-accent)";
redownloadBtn.style.color = "var(--text-on-accent)";
}
async onClose() {
super.onClose();
if(this.isDirty) {
await this.plugin.saveSettings();
}
if (!this.resolved) {
this.resolvePromise && this.resolvePromise(false);
} else {
this.resolvePromise && this.resolvePromise(true);
}
}
}
@@ -0,0 +1,240 @@
import { ExcalidrawTextElement } from "@zsviczian/excalidraw/types/element/src/types";
import { Notice } from "obsidian";
import { t } from "src/lang/helpers";
import { ScriptEngine } from "../Scripts";
import ExcalidrawView from "src/view/ExcalidrawView";
/**
*
* @param view - ExcalidrawView instance
* @param prefix - defines the default button.
* @returns
*/
export async function copyLinkToSelectedElementToClipboard(view: ExcalidrawView, prefix: string) {
const elements = view.getViewSelectedElements();
if (elements.length < 1) {
new Notice(t("INSERT_LINK_TO_ELEMENT_ERROR"));
return;
}
let elementId: string = undefined;
if (elements.length === 2) {
const textEl = elements.filter((el) => el.type === "text");
if (textEl.length === 1 && (textEl[0] as ExcalidrawTextElement).containerId) {
const container = elements.filter(
(el) => el.boundElements && el.boundElements.some((be) => be.type === "text"),
);
if (container.length === 1) {
elementId = textEl[0].id;
}
}
}
if (!elementId) {
elementId =
elements.length === 1
? elements[0].id
: view.plugin.ea.getLargestElement(elements).id;
}
const frames = elements.filter((el) => el.type === "frame");
const hasFrame = frames.length === 1;
const hasMarkerFrame = hasFrame && (frames[0] as any).frameRole === "marker";
const hasGroup = elements.some((el) => el.groupIds && el.groupIds.length > 0);
// Feature 1: UIFM_ANCHOR checkbox (persisted)
let anchorTo100 = Boolean(view.plugin.settings.copyLinkToElemenetAnchorTo100);
// Feature 2: frame link by name (persisted)
let copyFrameLinkByName = Boolean(view.plugin.settings.copyFrameLinkByName);
const frameNameRaw = hasFrame ? (frames[0] as any)?.name : undefined;
const frameName = typeof frameNameRaw === "string" ? frameNameRaw.trim() : "";
const frameNameIsValid =
hasFrame && frameName.length > 0 && /[\p{L}\p{N}_ -]+/u.test(frameName);
const getFrameTarget = () =>
frameNameIsValid && copyFrameLinkByName ? frameName : frames[0].id;
let cancelled = true;
const button = {
area: {
caption: "Area",
action: () => {
cancelled = false;
prefix = "area=";
return;
}
},
link: {
caption: "Link",
action: () => {
cancelled = false;
prefix = "";
return;
} },
group: {
caption: "Group",
action: () => {
cancelled = false;
prefix = "group=";
return;
}
},
frame: {
caption: "Frame",
action: () => {
cancelled = false;
prefix = "frame=";
elementId = getFrameTarget();
return;
},
},
clippedframe: {
caption: "Clipped Frame",
action: () => {
cancelled = false;
prefix = "clippedframe=";
elementId = getFrameTarget();
return;
},
},
};
let buttons = [];
switch (prefix) {
case "area=":
buttons = [
button.area,
button.link,
...(hasGroup ? [button.group] : []),
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
...(hasFrame ? [button.frame] : []),
];
break;
case "group=":
buttons = [
...(hasGroup ? [button.group] : []),
button.link,
button.area,
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
...(hasFrame ? [button.frame] : []),
];
break;
case "frame=":
buttons = [
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
...(hasFrame ? [button.frame] : []),
...(hasGroup ? [button.group] : []),
button.link,
button.area,
];
break;
case "clippedframe=":
buttons = [
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
...(hasFrame ? [button.frame] : []),
...(hasGroup ? [button.group] : []),
button.link,
button.area,
];
break;
default:
buttons = [
button.link,
button.area,
button.group,
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
...(hasFrame ? [button.frame] : []),
];
}
let alias: string;
try {
alias = await ScriptEngine.inputPrompt(
view,
view.plugin,
view.app,
"Set link alias",
"Leave empty if you do not want to set an alias",
"",
buttons,
undefined,
undefined,
(container: HTMLElement) => {
const wrapper = container.createDiv?.("excalidraw-prompt-checkboxes") ?? container;
const ownerDoc = wrapper.ownerDocument ?? document;
const anchorRow = ownerDoc.createElement("label");
anchorRow.style.display = "flex";
anchorRow.style.alignItems = "center";
anchorRow.style.gap = "8px";
anchorRow.style.marginTop = "8px";
const anchorCb = ownerDoc.createElement("input");
anchorCb.type = "checkbox";
anchorCb.checked = anchorTo100;
anchorCb.setAttribute("aria-label", t("UIFM_ANCHOR_DESC"));
anchorCb.addEventListener("change", () => {
anchorTo100 = anchorCb.checked;
});
const anchorText = ownerDoc.createElement("span");
anchorText.textContent = t("UIFM_ANCHOR");
anchorRow.appendChild(anchorCb);
anchorRow.appendChild(anchorText);
wrapper.appendChild(anchorRow);
if (frameNameIsValid) {
const frameRow = ownerDoc.createElement("label");
frameRow.style.display = "flex";
frameRow.style.alignItems = "center";
frameRow.style.gap = "8px";
frameRow.style.marginTop = "8px";
const frameCb = ownerDoc.createElement("input");
frameCb.type = "checkbox";
frameCb.checked = copyFrameLinkByName;
frameCb.setAttribute("aria-label", t("FRAME_WITH_NAME"));
frameCb.addEventListener("change", () => {
copyFrameLinkByName = frameCb.checked;
});
const frameText = ownerDoc.createElement("span");
frameText.textContent = t("FRAME_WITH_NAME");
frameRow.appendChild(frameCb);
frameRow.appendChild(frameText);
wrapper.appendChild(frameRow);
}
},
);
} finally {
const changed =
view.plugin.settings.copyLinkToElemenetAnchorTo100 !== anchorTo100 ||
view.plugin.settings.copyFrameLinkByName !== copyFrameLinkByName;
if (changed) {
await view.plugin.loadSettings();
view.plugin.settings.copyLinkToElemenetAnchorTo100 = anchorTo100;
view.plugin.settings.copyFrameLinkByName = copyFrameLinkByName;
await view.plugin.saveSettings();
}
}
if (cancelled) {
return;
}
if ((alias === "" || alias == null) && anchorTo100) {
alias = "100%";
}
navigator.clipboard.writeText(
`${prefix.length > 0 ? "!" : ""}[[${view.file.path}#^${prefix}${elementId}${alias ? `|${alias}` : ``}]]`,
);
new Notice(t("INSERT_LINK_TO_ELEMENT_READY"));
}
+31
View File
@@ -0,0 +1,31 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
/*
Obsidian uses a slightly modified version of the hypermd parser for math blocks
found at https://github.com/laobubu/HyperMD/blob/071ce236605bb7693efa6d4b829c39413a3d37fb/src/mode/hypermd.ts#L329-L336
where spaces are replaced with `_` and the mathlevel of 1|2 is replaced with `math-block` for display math and nothing for inline math
create from the following grammar (where we remove the upper-cases):
@top Document { Formatting_formatting-math_formatting-math-begin_keyword_math_math-block Math Formatting_formatting-math_formatting-math-end_keyword_math_math- }
Formatting_formatting-math_formatting-math-begin_keyword_math_math-block { "" }
Math { any* }
Formatting_formatting-math_formatting-math-end_keyword_math_math- { "" }
@tokens {
any { _ }
}
*/
import {LRParser} from "@lezer/lr"
export const parser = LRParser.deserialize({
version: 14,
states: "zOOOO?MrOOQOPOOOOOO'#Ca'#CaOYOPO'#C_OOOO?MtOOOOO-E6_-E6_QOOOOO",
stateData: "b~OVQOURP~OVQOURX~O",
goto: "fUPPVY]`RPORSPRUSQRPRTR",
nodeNames: "⚠ Document formatting_formatting-math_formatting-math-begin_keyword_math_math-block math formatting_formatting-math_formatting-math-end_keyword_math_math-",
maxTerm: 7,
skippedNodes: [0],
repeatNodeCount: 1,
tokenData: "i~RRO;'S[;'S;=`a;=`O[~aOV~~fPV~;=`<%l[",
tokenizers: [0],
topRules: {"Document":[0,1]},
tokenPrec: 0
})
+46 -64
View File
@@ -2,7 +2,7 @@
//https://img.youtube.com/vi/uZz5MgzWXiM/maxresdefault.jpg
import { ExcalidrawElement, FileId } from "@zsviczian/excalidraw/types/element/src/types";
import { BinaryFileData, DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
import { DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
import { App, MarkdownRenderer, Notice, TFile } from "obsidian";
import {
DEFAULT_MD_EMBED_CSS,
@@ -15,7 +15,6 @@ import {
} from "../constants/constants";
import { createSVG } from "src/utils/excalidrawAutomateUtils";
import { ExcalidrawData, getTransclusion } from "./ExcalidrawData";
import { ExportSettings } from "../view/ExcalidrawView";
import { t } from "../lang/helpers";
import { tex2dataURL } from "./LaTeX";
import ExcalidrawPlugin from "../core/main";
@@ -39,11 +38,12 @@ import {
promiseTry,
PromisePool,
} from "../utils/utils";
import { ValueOf } from "../types/types";
import { getMermaidImageElements, getMermaidText, shouldRenderMermaid } from "../utils/mermaidUtils";
import { mermaidToExcalidraw } from "src/constants/constants";
import { ImageKey, imageCache } from "./ImageCache";
import { FILENAMEPARTS, PreviewImageType } from "../types/utilTypes";
import { ColorMap, ImgData, PDFPageViewProps, Size, MimeType, FileData } from "src/types/embeddedFileLoaderTypes";
import { ExportSettings } from "src/types/exportUtilTypes";
//An ugly workaround for the following situation.
//File A is a markdown file that has an embedded Excalidraw file B
@@ -54,54 +54,7 @@ import { FILENAMEPARTS, PreviewImageType } from "../types/utilTypes";
//and getObsidianImage is aborted if the file is already in the Watchdog stack
const markdownRendererRecursionWatcthdog = new Set<TFile>();
export const IMAGE_MIME_TYPES = {
svg: "image/svg+xml",
png: "image/png",
jpg: "image/jpeg",
jpeg: "image/jpeg",
gif: "image/gif",
webp: "image/webp",
bmp: "image/bmp",
ico: "image/x-icon",
avif: "image/avif",
jfif: "image/jfif",
} as const;
type ImgData = {
mimeType: MimeType;
fileId: FileId;
dataURL: DataURL;
created: number;
hasSVGwithBitmap: boolean;
size: Size;
pdfPageViewProps?: PDFPageViewProps;
};
export declare type MimeType = ValueOf<typeof IMAGE_MIME_TYPES> | "application/octet-stream";
export type FileData = BinaryFileData & {
size: Size;
hasSVGwithBitmap: boolean;
shouldScale: boolean; //true if image should maintain its area, false if image should display at 100% its size
pdfPageViewProps?: PDFPageViewProps;
};
export type PDFPageViewProps = {
left: number;
bottom: number;
right: number;
top: number;
rotate?: number; //may be undefined in legacy files
}
export type Size = {
height: number;
width: number;
};
export interface ColorMap {
[color: string]: string;
};
/**
* Function takes an SVG and replaces all fill and stroke colors with the ones in the colorMap
@@ -201,6 +154,10 @@ export class EmbeddedFile {
}
}
get hasSeparateDarkAndLightVersion(): boolean {
return this.isSVGwithBitmap;
}
public resetImage(hostPath: string, imgPath: string) {
this.imgInverted = this.img = "";
this.mtime = 0;
@@ -278,11 +235,12 @@ export class EmbeddedFile {
if (this.fileChanged()) {
this.imgInverted = this.img = "";
}
this.isSVGwithBitmap = isSVGwithBitmap;
this.mtime = this.isHyperLink || this.isLocalLink ? 0 : this.file.stat.mtime;
this.pdfPageViewProps = pdfPageViewProps;
this.size = size;
this.mimeType = mimeType;
switch (isDark && isSVGwithBitmap) {
switch (isDark && this.hasSeparateDarkAndLightVersion) {
case true:
this.imgInverted = imgBase64;
break;
@@ -290,7 +248,6 @@ export class EmbeddedFile {
this.img = imgBase64;
break; //bitmaps and SVGs without an embedded bitmap do not need a negative image
}
this.isSVGwithBitmap = isSVGwithBitmap;
}
public isLoaded(isDark: boolean): boolean {
@@ -309,7 +266,7 @@ export class EmbeddedFile {
return false;
}
}
if (this.isSVGwithBitmap && isDark) {
if (this.hasSeparateDarkAndLightVersion && isDark) {
return this.imgInverted !== "";
}
return this.img !== "";
@@ -319,7 +276,7 @@ export class EmbeddedFile {
if (!this.file && !this.isHyperLink && !this.isLocalLink) {
return "";
}
if (isDark && this.isSVGwithBitmap) {
if (this.hasSeparateDarkAndLightVersion && isDark) {
return this.imgInverted;
}
return this.img; //images that are not SVGwithBitmap, only the light string is stored, since inverted and non-inverted are ===
@@ -461,16 +418,33 @@ export class EmbeddedFilesLoader {
);
if (imageList.length > 0) {
hasSVGwithBitmap = true;
}
}
if (hasSVGwithBitmap && isDark && !Boolean(maybeSVG)) {
imageList.forEach((i) => {
const id = i.parentElement?.id;
if (id.endsWith("-invert-bitmap")) return;
svg.querySelectorAll(`use[href='#${id}']`).forEach((u) => {
u.setAttribute("filter", THEME_FILTER);
});
});
}
const svgsToInvert = svg.querySelectorAll("symbol[id$='-no-invert-svg']");
if (svgsToInvert.length > 0) {
hasSVGwithBitmap = true;
}
if (svgsToInvert.length > 0 && isDark && !Boolean(maybeSVG)) {
svgsToInvert.forEach((i) => {
const id = i.id;
svg.querySelectorAll(`use[href='#${id}']`).forEach((u) => {
u.setAttribute("filter", THEME_FILTER);
});
});
}
if (!hasSVGwithBitmap && svg.getAttribute("hasbitmap")) {
hasSVGwithBitmap = true;
}
@@ -608,7 +582,7 @@ export class EmbeddedFilesLoader {
return {
mimeType,
fileId: await generateIdFromFile(
isHyperLink || isPDF || isExcalidrawFile ? (new TextEncoder()).encode(dataURL as string) : ab,
isHyperLink || isPDF || isExcalidrawFile ? (new TextEncoder()).encode(dataURL as string).buffer : ab,
inFile instanceof EmbeddedFile ? inFile.filenameparts?.linkpartReference : undefined
),
dataURL,
@@ -675,7 +649,7 @@ export class EmbeddedFilesLoader {
};
files[batch].push(fileData);
}
} else if (embeddedFile.isSVGwithBitmap && (depth !== 0 || isThemeChange)) {
} else if (embeddedFile.hasSeparateDarkAndLightVersion && (depth !== 0 || isThemeChange)) {
//this will reload the image in light/dark mode when switching themes
const fileData: FileData = {
mimeType: embeddedFile.mimeType,
@@ -713,7 +687,7 @@ export class EmbeddedFilesLoader {
created: data.created,
size: data.size,
hasSVGwithBitmap: false,
shouldScale: true
shouldScale: true,
};
files[batch].push(fileData);
}
@@ -731,8 +705,7 @@ export class EmbeddedFilesLoader {
const data = getMermaidText(element);
const result = await mermaidToExcalidraw(
data,
{ themeVariables: { fontSize: "20" } },
true
{ themeVariables: { fontSize: "20" } }
);
if(!result) {
return;
@@ -785,6 +758,10 @@ export class EmbeddedFilesLoader {
}
const addFilesTimer = setInterval(() => {
if (this.terminate) {
clearInterval(addFilesTimer);
return;
}
if(files[batch].length === 0) {
return;
}
@@ -800,7 +777,9 @@ export class EmbeddedFilesLoader {
const iterator = loadIterator.bind(this)();
const concurency = this.plugin.settings.renderingConcurrency;
await new PromisePool(iterator, concurency).all();
if (!this.terminate) {
await new PromisePool(iterator, concurency).all();
}
clearInterval(addFilesTimer);
@@ -1215,11 +1194,14 @@ export const generateIdFromFile = async (file: ArrayBuffer, key?: string): Promi
}
// Hash the combined data (file and key, if provided)
const hashBuffer = await window.crypto.subtle.digest("SHA-1", dataToHash);
// Ensure we pass an ArrayBuffer (not ArrayBufferLike) to subtle.digest
const buffer: ArrayBuffer = dataToHash.buffer.slice(
dataToHash.byteOffset,
dataToHash.byteOffset + dataToHash.byteLength
) as ArrayBuffer;
const hashBuffer = await window.crypto.subtle.digest("SHA-1", buffer);
id =
// Convert buffer to byte array
Array.from(new Uint8Array(hashBuffer))
// Convert to hex string
.map((byte) => byte.toString(16).padStart(2, "0"))
.join("") as FileId;
} catch (error) {
File diff suppressed because it is too large. Load diff
+81 -39
View File
@@ -46,7 +46,8 @@ import {
FileId,
} from "@zsviczian/excalidraw/types/element/src/types";
import { BinaryFiles, DataURL, SceneData } from "@zsviczian/excalidraw/types/excalidraw/types";
import { EmbeddedFile, MimeType } from "./EmbeddedFileLoader";
import { EmbeddedFile } from "./EmbeddedFileLoader";
import { MimeType } from "src/types/embeddedFileLoaderTypes";
import { MultiOptionConfirmationPrompt } from "./Dialogs/Prompt";
import { getMermaidImageElements, getMermaidText, shouldRenderMermaid } from "../utils/mermaidUtils";
import { DEBUGGING, debug } from "../utils/debugHelper";
@@ -304,7 +305,11 @@ const RE_TEXTELEMENTS_FALLBACK_2 = /(.*)##? Text Elements(?:\n|$)/m;
const RE_DRAWING = /^(%%\n+)?##? Drawing\n/m;
export const getExcalidrawMarkdownHeaderSection = (data:string, keys?:[string,string][]):string => {
export function getExcalidrawMarkdownHeader (data: string): {
header: string,
shouldFixTrailingHashtag: boolean,
processingOk: boolean,
} {
//The base case scenario is at the top, continued with fallbacks in order of likelihood and file structure
//change history for sake of backward compatibility
@@ -439,10 +444,18 @@ export const getExcalidrawMarkdownHeaderSection = (data:string, keys?:[string,st
}
}
if (trimLocation === -1) {
return data.endsWith("\n") ? data : (data + "\n");
return {header:data.endsWith("\n") ? data : (data + "\n"), shouldFixTrailingHashtag, processingOk: false};
}
let header = updateFrontmatterInString(data.substring(0, trimLocation),keys);
return {header: data.substring(0, trimLocation), shouldFixTrailingHashtag, processingOk: true};
}
export const getExcalidrawMarkdownHeaderSection = (data:string, keys?:[string,string][]):string => {
const {header, shouldFixTrailingHashtag, processingOk} = getExcalidrawMarkdownHeader(data);
if(!processingOk) return header;
const updatedHeader = updateFrontmatterInString(header, keys);
//this should be removed at a later time. Left it here to remediate 1.4.9 mistake
/*const REG_IMG = /(^---[\w\W]*?---\n)(!\[\[.*?]]\n(%%\n)?)/m; //(%%\n)? because of 1.4.8-beta... to be backward compatible with anyone who installed that version
if (header.match(REG_IMG)) {
@@ -450,15 +463,15 @@ export const getExcalidrawMarkdownHeaderSection = (data:string, keys?:[string,st
}*/
//end of remove
return shouldFixTrailingHashtag
? header + "\n#\n"
: header.endsWith("\n") ? header : (header + "\n");
? updatedHeader + "\n#\n"
: updatedHeader.endsWith("\n") ? header : (header + "\n");
}
export class ExcalidrawData {
public textElements: Map<
string,
{ raw: string; parsed: string}
{ raw: string; parsed: string; hasTextLink: boolean; }
> = null;
public scene: any = null;
public deletedElements: ExcalidrawElement[] = [];
@@ -569,6 +582,10 @@ export class ExcalidrawData {
el.containerId = null;
}
if (el.type === "text" && !el.originalText) {
el.originalText = el.rawText ?? el.text ?? "";
}
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/494
if (el.x === null) {
el.x = 0;
@@ -692,7 +709,7 @@ export class ExcalidrawData {
this.selectedElementIds = {};
this.textElements = new Map<
string,
{ raw: string; parsed: string}
{ raw: string; parsed: string, hasTextLink: boolean }
>();
this.elementLinks = new Map<string, string>();
if (this.file !== file) {
@@ -748,6 +765,27 @@ export class ExcalidrawData {
this.deletedElements = this.scene.elements.filter((el:ExcalidrawElement)=>el.isDeleted);
this.scene.elements = this.scene.elements.filter((el:ExcalidrawElement)=>!el.isDeleted);
//once off migration of legacy scenes
if(this.scene?.elements?.some((el:any)=>el.type==="iframe" && !el.customData)) {
const prompt = new MultiOptionConfirmationPrompt(
this.plugin,
"This file contains embedded frames " +
"which will be migrated to a newer version for compatibility with " +
"<a href='https://excalidraw.com'>excalidraw.com</a>.<br>🔄 If you're using Obsidian on " +
"multiple devices, you may proceed now, but please, before opening this " +
"file on your other devices, update Excalidraw on those as well.<br>🔍 More info is available "+
"<a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.9.9'>here</a>.<br>🌐 " +
"<a href='https://translate.google.com/?sl=en&tl=zh-CN&text=This%20file%20contains%20embedded%20frames%20which%20will%20be%20migrated%20to%20a%20newer%20version%20for%20compatibility%20with%20excalidraw.com.%0A%0AIf%20you%27re%20using%20Obsidian%20on%20multiple%20devices%2C%20you%20may%20proceed%20now%2C%20but%20please%2C%20before%20opening%20this%20file%20on%20your%20other%20devices%2C%20update%20Excalidraw%20on%20those%20as%20well.%0A%0AMore%20info%20is%20available%20here%3A%20https%3A%2F%2Fgithub.com%2Fzsviczian%2Fobsidian-excalidraw-plugin%2Freleases%2Ftag%2F1.9.9%27%3Ehere%3C%2Fa%3E.&op=translate'>" +
"Translate</a>.",
);
prompt.contentEl.focus();
const confirmation = await prompt.waitForClose
if(!confirmation) {
throw new Error(ERROR_IFRAME_CONVERSION_CANCELED);
}
}
this.initializeNonInitializedFields();
const timer = window.setTimeout(()=>{
const notice = new Notice(t("FONT_LOAD_SLOW"),15000);
@@ -790,27 +828,6 @@ export class ExcalidrawData {
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 MultiOptionConfirmationPrompt(
this.plugin,
"This file contains embedded frames " +
"which will be migrated to a newer version for compatibility with " +
"<a href='https://excalidraw.com'>excalidraw.com</a>.<br>🔄 If you're using Obsidian on " +
"multiple devices, you may proceed now, but please, before opening this " +
"file on your other devices, update Excalidraw on those as well.<br>🔍 More info is available "+
"<a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.9.9'>here</a>.<br>🌐 " +
"<a href='https://translate.google.com/?sl=en&tl=zh-CN&text=This%20file%20contains%20embedded%20frames%20which%20will%20be%20migrated%20to%20a%20newer%20version%20for%20compatibility%20with%20excalidraw.com.%0A%0AIf%20you%27re%20using%20Obsidian%20on%20multiple%20devices%2C%20you%20may%20proceed%20now%2C%20but%20please%2C%20before%20opening%20this%20file%20on%20your%20other%20devices%2C%20update%20Excalidraw%20on%20those%20as%20well.%0A%0AMore%20info%20is%20available%20here%3A%20https%3A%2F%2Fgithub.com%2Fzsviczian%2Fobsidian-excalidraw-plugin%2Freleases%2Ftag%2F1.9.9%27%3Ehere%3C%2Fa%3E.&op=translate'>" +
"Translate</a>.",
);
prompt.contentEl.focus();
const confirmation = await prompt.waitForClose
if(!confirmation) {
throw new Error(ERROR_IFRAME_CONVERSION_CANCELED);
}
}
this.initializeNonInitializedFields();
data = data.substring(0, sceneJSONandPOS.pos);
//The Markdown # Text Elements take priority over the JSON text elements. Assuming the scenario in which the
@@ -922,10 +939,12 @@ export class ExcalidrawData {
this.textElements.set(id, {
raw: text,
parsed: parseRes.parsed,
hasTextLink: !!parseRes.link,
});
if (parseRes.link) {
if (parseRes.link && this.plugin.settings.syncElementLinkWithText) {
textEl.link = parseRes.link;
}
textEl.hasTextLink = !!parseRes.link;
//this will set the rawText field of text elements imported from files before 1.3.14, and from other instances of Excalidraw
if (textEl && (!textEl.rawText || textEl.rawText === "")) {
textEl.rawText = text;
@@ -1020,7 +1039,7 @@ export class ExcalidrawData {
this.file = file;
this.textElements = new Map<
string,
{ raw: string; parsed: string}
{ raw: string; parsed: string; hasTextLink: boolean }
>();
this.elementLinks = new Map<string, string>();
this.setShowLinkBrackets();
@@ -1095,9 +1114,11 @@ export class ExcalidrawData {
}
if (this.textMode === TextMode.parsed) {
if (!text.parsed) {
const parseRes = await this.parse(text.raw);
this.textElements.set(id, {
raw: text.raw,
parsed: (await this.parse(text.raw)).parsed,
parsed: parseRes.parsed,
hasTextLink: !!parseRes.link,
});
}
//console.log("parsed",this.textElements.get(id).parsed);
@@ -1113,7 +1134,6 @@ export class ExcalidrawData {
return (
el.type !== "text" &&
el.link &&
//el.link.startsWith("[[") &&
!this.elementLinks.has(el.id)
);
});
@@ -1169,17 +1189,18 @@ export class ExcalidrawData {
this.textElements.set(id, {
raw: text.raw,
parsed: text.parsed,
hasTextLink: text.hasTextLink,
});
this.textElements.delete(te.id); //delete the old ID from the Map
}
if (!this.textElements.has(id)) {
const raw = te.rawText && te.rawText !== "" ? te.rawText : te.text; //this is for compatibility with drawings created before the rawText change on ExcalidrawTextElement
this.textElements.set(id, { raw, parsed: null});
this.textElements.set(id, { raw, parsed: null, hasTextLink: false});
this.parseasync(id, raw);
}
} else if (!this.textElements.has(te.id)) {
const raw = te.rawText && te.rawText !== "" ? te.rawText : te.text; //this is for compatibility with drawings created before the rawText change on ExcalidrawTextElement
this.textElements.set(id, { raw, parsed: null});
this.textElements.set(id, { raw, parsed: null, hasTextLink: false});
this.parseasync(id, raw);
}
@@ -1195,7 +1216,6 @@ export class ExcalidrawData {
el.type !== "text" &&
el.id === key &&
el.link, //&&
//el.link.startsWith("[["),
);
if (el.length === 0) {
this.elementLinks.delete(key); //if no longer in the scene, delete the text element
@@ -1223,9 +1243,11 @@ export class ExcalidrawData {
? el[0].rawText
: (el[0].originalText ?? el[0].text);
if (text !== (el[0].originalText ?? el[0].text)) {
const parseRes = await this.parse(text);
this.textElements.set(key, {
raw,
parsed: (await this.parse(raw)).parsed,
parsed: parseRes.parsed,
hasTextLink: !!parseRes.link,
});
}
}
@@ -1233,9 +1255,11 @@ export class ExcalidrawData {
}
private async parseasync(key: string, raw: string) {
const parseRes = await this.parse(raw);
this.textElements.set(key, {
raw,
parsed: (await this.parse(raw)).parsed,
parsed: parseRes.parsed,
hasTextLink: !!parseRes.link,
});
}
@@ -1333,6 +1357,7 @@ export class ExcalidrawData {
position = parts.value.index + parts.value[0].length;
}
outString += text.substring(position, text.length);
outString = this.unescapeSquareBrackets(outString);
if (linkIcon) {
outString = this.linkPrefix + outString;
}
@@ -1353,6 +1378,10 @@ export class ExcalidrawData {
: text;
}
private unescapeSquareBrackets(text: string): string {
return text?.replaceAll(/\\\[/g, "[") ?? text;
}
/**
* Does a quick parse of the raw text. Returns the parsed string if raw text does not include a transclusion.
* Return null if raw text includes a transclusion.
@@ -1410,6 +1439,7 @@ export class ExcalidrawData {
position = parts.value.index + parts.value[0].length;
}
outString += text.substring(position, text.length);
outString = this.unescapeSquareBrackets(outString);
if (linkIcon) {
outString = this.linkPrefix + outString;
}
@@ -1425,6 +1455,7 @@ export class ExcalidrawData {
*/
disableCompression: boolean = false;
generateMDBase(deletedElements: ExcalidrawElement[] = []) {
const syncTextLinks = this.plugin.settings.syncElementLinkWithText;
let outString = this.textElementCommentedOut ? "%%\n" : "";
outString += `# Excalidraw Data\n\n## Text Elements\n`;
if (this.plugin.settings.addDummyTextElement) {
@@ -1435,7 +1466,7 @@ export class ExcalidrawData {
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/566
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 && element.length===1 && element[0].link && (!syncTextLinks || element[0].rawText === element[0].originalText)) {
//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;
@@ -1754,6 +1785,14 @@ export class ExcalidrawData {
return t.parsed;
}
public getParsedResult(id: string) {
const t = this.textElements.get(id);
if (!t) {
return null;
}
return t;
}
/**
* Attempts to quickparse (sycnhronously) the raw text.
*
@@ -1783,6 +1822,7 @@ export class ExcalidrawData {
this.textElements.set(elementID, {
raw: rawOriginalText,
parsed: parseResult,
hasTextLink: !!link,
});
return [parseResult, link];
}
@@ -1792,6 +1832,7 @@ export class ExcalidrawData {
this.textElements.set(elementID, {
raw: rawOriginalText,
parsed: parsedText,
hasTextLink: !!parseRes.link,
});
if (parsedText) {
updateSceneCallback(parsedText);
@@ -1809,6 +1850,7 @@ export class ExcalidrawData {
this.textElements.set(elementID, {
raw: rawOriginalText,
parsed: parseResult.parsed,
hasTextLink: !!parseResult.link,
});
return {
parseResult: parseResult.parsed,
+11
View File
@@ -55,6 +55,7 @@ class ImageCache {
this.db = null;
this.plugin = null;
this.app = null;
this.obsidanURLCache.forEach((url) => URL.revokeObjectURL(url));
this.obsidanURLCache.clear();
this.obsidanURLCache = null;
}
@@ -179,6 +180,10 @@ class ImageCache {
const fileExists = files.some((f: TFile) => f.path === filepath);
const file = fileExists ? files.find((f: TFile) => f.path === filepath) : null;
if (isLegacyKey || !file || (file && (file.stat.mtime > cursor.value.mtime)) || (!cursor.value.blob && !cursor.value.svg)) {
if(this.obsidanURLCache.has(key)) {
URL.revokeObjectURL(this.obsidanURLCache.get(key));
this.obsidanURLCache.delete(key);
}
deletePromises.push(
new Promise<void>((innerResolve, innerReject) => {
const deleteRequest = store.delete(cursor.primaryKey);
@@ -368,6 +373,9 @@ class ImageCache {
const key = getKey(key_);
store.put(data, key);
if(!Boolean(svg)) {
if(this.obsidanURLCache.has(key) && this.obsidanURLCache.get(key) !== obsidianURL) {
URL.revokeObjectURL(this.obsidanURLCache.get(key));
}
this.obsidanURLCache.set(key, obsidianURL);
}
}
@@ -406,6 +414,9 @@ class ImageCache {
return; // Database not initialized yet
}
this.obsidanURLCache.forEach((url) => URL.revokeObjectURL(url));
this.obsidanURLCache.clear();
return this.clear(this.cacheStoreName, "Image cache was cleared");
}
+1 -1
View File
@@ -1,7 +1,7 @@
// LaTeX.ts
import { DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
import ExcalidrawView from "../view/ExcalidrawView";
import { FileData, MimeType } from "./EmbeddedFileLoader";
import { FileData, MimeType } from "src/types/embeddedFileLoaderTypes";
import { FileId } from "@zsviczian/excalidraw/types/element/src/types";
import ExcalidrawPlugin from "src/core/main";
+2 -1
View File
@@ -1,13 +1,14 @@
import { ExcalidrawAutomate } from "../ExcalidrawAutomate";
import {Notice, requestUrl} from "obsidian"
import ExcalidrawPlugin from "../../core/main"
import ExcalidrawView, { ExportSettings } from "../../view/ExcalidrawView"
import FrontmatterEditor from "src/shared/Frontmatter";
import { ExcalidrawElement } from "@zsviczian/excalidraw/types/element/src/types";
import { EmbeddedFilesLoader } from "../EmbeddedFileLoader";
import { blobToBase64 } from "src/utils/fileUtils";
import { getEA } from "src/core";
import { log } from "src/utils/debugHelper";
import { ExportSettings } from "src/types/exportUtilTypes";
import ExcalidrawView from "src/view/ExcalidrawView";
const TASKBONE_URL = "https://api.taskbone.com/"; //"https://excalidraw-preview.onrender.com/";
const TASKBONE_OCR_FN = "execute?id=60f394af-85f6-40bc-9613-5d26dc283cbb";
Loaded 100 of 142 files, more files were not shown because too many files have changed in this diff. Show more