Compare commits

..
Author SHA1 Message Date
zsviczian 3a1c9c50d5 removed messages 2026-01-21 08:04:55 +01:00
zsviczian 66c119a9e8 invertInDarkMode 2026-01-20 23:20:23 +01:00
zsviczian 2195c9bb98 AddPDF and Image dark mode 2026-01-20 20:47:35 +01:00
zsviczian 03d4965976 bitmap inversion 2026-01-20 17:52:56 +01:00
zsviczian 3077d88e57 invert image setting initial implementation 2026-01-19 20:45:35 +01:00
147 changed files with 17818 additions and 47128 deletions

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ tmp
deploy.ps1
#VSCode
.vscode
yarn.lock
.DS_Store
.lock
-30
View File
@@ -1,30 +0,0 @@
{
"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
}
}
+4 -5
View File
@@ -20,7 +20,7 @@
"rollup": "^2.70.1",
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.8.1",
"typescript": "5.9.3"
"typescript": "^5.7.3"
}
},
"node_modules/@babel/code-frame": {
@@ -1180,11 +1180,10 @@
"license": "0BSD"
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"version": "5.7.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
+1 -1
View File
@@ -19,6 +19,6 @@
"rollup": "^2.70.1",
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.8.1",
"typescript": "5.9.3"
"typescript": "^5.7.3"
}
}
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
+1 -3
View File
@@ -577,11 +577,9 @@ 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, scaleX?: number, scaleY?: number): Promise<string>;
addLaTex(topX: number, topY: number, tex: string): Promise<string>;
/**
* Returns the base64 dataURL of the LaTeX equation rendered as an SVG.
* @param {string} tex - The LaTeX equation string.
-482
View File
@@ -1,482 +0,0 @@
# MindMap Builder API
This page documents how **Mind Map Builder** works internally and how to automate it through `window.MindMapBuilderAPI`.
## Why this API exists
Mind Map Builder is optimized for interactive keyboard-first use in Excalidraw. The public API adds a stable automation layer so scripts and AI agents can:
- discover available methods and actions,
- validate arguments before execution,
- execute high-level operations without re-implementing layout logic,
- retrieve map structure and role-based element groups.
## Runtime model (how Mind Map Builder works)
At runtime, Mind Map Builder treats a map as a graph composed of:
- **Node elements**: text-containing Excalidraw elements representing ideas.
- **Branch arrows**: arrows with `customData.isBranch === true`, defining parent/child relationships.
- **Map roots**: top-level nodes without incoming branch arrows.
- **Additional roots (submaps)**: nodes flagged as `customData.isAdditionalRoot === true`.
- **Map config root**: settings are resolved from the node returned by internal root/settings-root logic.
- **Project elements**: branch content plus related decorations, boundaries, and crosslinks.
Most operations run through existing Mind Map Builder internals (action dispatcher + layout engine), and the API wraps those internals with structured success/error return objects.
## API entry point
```js
const mmb = window.MindMapBuilderAPI;
```
The API is available while Mind Map Builder is active.
## Result envelope
All public methods (except `ready()` and `getCapabilities()`) return:
```ts
type MMResult<T> =
| { ok: true; data: T }
| { ok: false; error: { code: string; message: string; details?: any } };
```
## Discoverability and minification-safe introspection
Because Mind Map Builder is minified in distribution, rely on runtime introspection (not source signatures):
- `spec()` for machine-readable contract,
- `help()` for human-readable docs,
- `listMethods()` for method discovery,
- `validate()` for argument validation,
- `getErrorCodes()` for stable error semantics.
## Quick start
```js
const mmb = window.MindMapBuilderAPI;
if (!mmb?.ready()) throw new Error("MindMapBuilderAPI not ready");
const methods = mmb.listMethods();
console.log(methods);
const view = mmb.getView();
console.log(view);
```
---
## Public API reference
### Metadata and introspection
#### `ready(): boolean`
Returns whether the API runtime is initialized.
#### `getCapabilities(): { actions: string[]; methods: string[] }`
Returns action constants and currently enumerable API method names.
#### `listMethods(): MMResult<{ methods: string[] }>`
Returns all documented public method names.
#### `getErrorCodes(): MMResult<{ errors: Record<string,string> }>`
Returns error code → explanation map.
#### `spec(): MMResult<{ version; actions; errors; methods }>`
Returns the full machine-readable API contract, including method parameter metadata.
#### `help(method?: string, format?: "object" | "text"): MMResult<object | string>`
Returns docs for one method or the full API.
#### `validate(method: string, args?: any): MMResult<{ valid: boolean; errors: string[]; normalizedArgs: object }>`
Validates arguments against documented method contract before execution.
### View and selection
#### `setView(view: ExcalidrawView): MMResult<{ view; filePath }>`
Sets the active Excalidraw view context used by Mind Map Builder.
#### `getView(): MMResult<{ view; filePath }>`
Returns the current Excalidraw view and backing file path.
#### `getSelection(): MMResult<{ nodeId: string | null; elementIds: string[] }>`
Returns current selected mindmap node (if resolvable) and selected element IDs.
#### `selectNode(nodeId?: string): MMResult<{ nodeId: string }>`
Selects node by ID. If omitted, resolves from current selection context.
#### `setInputFieldDockStatus({ isDocked }): Promise<MMResult<{ isDocked: boolean; isUndocked: boolean; sidepanelVisible: boolean }>>`
Forces input UI mode to docked/undocked. When docking, it docks if needed and reveals sidepanel if hidden. When undocking, it undocks if needed and hides sidepanel if currently visible.
### Map structure and node content
#### `getMindMapRoots(): MMResult<{ rootIds: string[] }>`
Returns top-level master root IDs.
#### `getMapInfo(nodeId?: string): MMResult<{ nodeId; rootId; settingsRootId; depth }>`
Returns hierarchy info for a node.
#### `getNodeText(nodeId?: string): MMResult<{ nodeId; text; ontology }>`
Returns node text and ontology (derived from incoming branch metadata text).
### Actions and layout
#### `performAction(action: string, event?: object): Promise<MMResult<void>>`
Executes one built-in action from `MindMapBuilderAPI.Actions`.
#### `refreshMapLayout(nodeId?: string): Promise<MMResult<{ rootId: string }>>`
Re-runs map layout for a selected or provided node.
### Create / import / export
#### `addNode({ text, parentId?, ontology?, follow?, position? }): Promise<MMResult<{ nodeId; arrowId; rootId }>>`
Adds a node using existing mindmap insertion logic.
#### `importMarkdown({ markdown, parentId? }): Promise<MMResult<{ addedNodeIds: string[]; rootId: string | null }>>`
Imports markdown bullet hierarchy into the map.
#### `exportMarkdown({ nodeId?, cut? }): Promise<MMResult<{ markdown: string }>>`
Copies selected branch as markdown to clipboard and returns the markdown text.
### Submaps and config
#### `toggleSubmapRoot({ nodeId?, enabled? }): Promise<MMResult<{ nodeId; enabled }>>`
Toggles additional-root status (or forces it when `enabled` is provided).
#### `getMapConfig(nodeId?): MMResult<{ rootId; settingsRootId; config }>`
Returns effective map configuration.
#### `setMapConfig({ patch, nodeId?, relayout? }): Promise<MMResult<{ rootId; settingsRootId }>>`
Patches map config and optionally relayouts.
### Element extraction for automation
#### `getBranchElementIds({ nodeId, includeDecorations?, includeCrosslinks? }): MMResult<{ ids: string[] }>`
Returns branch element IDs for targeted operations.
#### `getProjectElementIds(rootId: string): MMResult<{ ids: string[] }>`
Returns all project element IDs under a root.
#### `getElementIdsByRole(rootId: string): MMResult<{ nodes; branchArrows; crossLinks; boundaries; decorations; boundTexts }>`
Returns categorized element IDs for selective styling or export workflows.
---
## Actions enum
Use `MindMapBuilderAPI.Actions` constants with `performAction()`.
Key values include:
- `ADD`, `ADD_SIBLING_AFTER`, `ADD_SIBLING_BEFORE`,
- `ADD_FOLLOW`, `ADD_FOLLOW_FOCUS`, `ADD_FOLLOW_ZOOM`,
- `EDIT`, `PIN`, `BOX`, `TOGGLE_EMBED`, `TOGGLE_BOUNDARY`, `TOGGLE_SUBMAP_ROOT`, `TOGGLE_GROUP`,
- `FOLD`, `FOLD_L1`, `FOLD_ALL`,
- `COPY`, `CUT`, `PASTE`,
- `ZOOM`, `FOCUS`,
- `NAVIGATE`, `NAVIGATE_ZOOM`, `NAVIGATE_FOCUS`,
- `SORT_ORDER`, `REARRANGE`,
- `DOCK_UNDOCK`, `HIDE`,
- `UNDO`, `REDO_Z`, `REDO_Y`.
## Error codes
Retrieve full list dynamically via:
```js
window.MindMapBuilderAPI.getErrorCodes();
```
Common codes:
- `NO_VIEW`, `INVALID_VIEW`
- `INVALID_NODE`, `NO_SELECTION`, `NO_ROOT`
- `INVALID_ACTION`, `INVALID_ARGUMENT`
- `OPERATION_FAILED`
---
## Examples
### 1) Agent-safe execution flow
```js
const ea = window.ExcalidrawAutomate;
if (!ea) {
console.log("Excalidraw not running");
return;
}
ea.setView();
if (!ea.targetView) {
console.log("No Excaliidraw document open");
return;
}
let mmb = window.MindMapBuilderAPI;
if (!mmb) {
const cmd = Object.keys(app.commands.commands).find(k=>k.match(/.*Mindmap Builder$/));
if(!cmd) {
console.log("MindMap Builder not installed");
return;
}
const leaf = ea.targetView.leaf;
app.workspace.setActiveLeaf(leaf);
if (app.commands.commands[cmd].checkCallback(false)) {
console.log("Failed to initialize MindMap Builder");
return;
}
await sleep(100);
mmb = window.MindMapBuilderAPI;
if (!mmb) {
console.log("MindMap Builder API not available");
return;
}
}
const check = mmb.validate("addNode", { text: "New idea" });
if (!check.ok || !check.data.valid) {
console.log(check);
return;
}
const res = await mmb.addNode(check.data.normalizedArgs);
console.log(res);
```
### 2) Discover API at runtime
```js
const spec = window.MindMapBuilderAPI.spec();
if (spec.ok) {
console.log(spec.data.version);
console.log(Object.keys(spec.data.methods));
}
```
### 3) Add nodes then relayout
```js
await window.MindMapBuilderAPI.addNode({ text: "Topic A" });
await window.MindMapBuilderAPI.addNode({ text: "Topic B", follow: true });
await window.MindMapBuilderAPI.refreshMapLayout();
```
### 4) Execute built-in action
```js
const { Actions } = window.MindMapBuilderAPI;
await window.MindMapBuilderAPI.performAction(Actions.FOLD_ALL);
```
### 5) Read node text + ontology
```js
const res = window.MindMapBuilderAPI.getNodeText();
if (res.ok) {
console.log(res.data.text, res.data.ontology);
}
```
### 6) Force input dock/undock state
```js
await window.MindMapBuilderAPI.setInputFieldDockStatus({ isDocked: true }); // force docked input
await window.MindMapBuilderAPI.setInputFieldDockStatus({ isDocked: false }); // force floating input
```
### 7) Import markdown under selected node
```js
const md = `
# Product Strategy
- Vision
- Problem
- Outcome
- Execution
- Milestones
`;
await window.MindMapBuilderAPI.importMarkdown({ markdown: md });
```
### 8) Export a branch to markdown
```js
const out = await window.MindMapBuilderAPI.exportMarkdown({ cut: false });
if (out.ok) console.log(out.data.markdown);
```
### 9) Get role-based IDs and style with ExcalidrawAutomate
```js
const roots = window.MindMapBuilderAPI.getMindMapRoots();
if (!roots.ok || roots.data.rootIds.length === 0) return;
const roles = window.MindMapBuilderAPI.getElementIdsByRole(roots.data.rootIds[0]);
if (!roles.ok) return;
// Example: pass roles.data.nodes into your EA styling pipeline
```
### 10) Build a feature showcase mindmap (Right-Left + boundaries)
```js
(async () => {
const ensureMindMapBuilder = async () => {
const ea = window.ExcalidrawAutomate;
if (!ea) throw new Error("ExcalidrawAutomate is not available");
ea.setView();
if (!ea.targetView) {
//if no excalidraw document is avaialble create one and open it
await ea.create({onNewPane: true,silent: false});
await sleep(100);
ea.setView();
if(!ea.targetView) {
throw new Error("No Excalidraw view is open");
}
}
let mmb = window.MindMapBuilderAPI;
if (!mmb) {
const cmd = Object.keys(app.commands.commands).find((k) => /.*Mindmap Builder$/.test(k));
if (!cmd) throw new Error("MindMap Builder command not found");
app.workspace.setActiveLeaf(ea.targetView.leaf);
// checkCallback(false) returns false when the command can run.
if (app.commands.commands[cmd].checkCallback(false)) {
throw new Error("MindMap Builder could not be initialized");
}
await sleep(120);
mmb = window.MindMapBuilderAPI;
if (!mmb) throw new Error("MindMap Builder API not available after command execution");
}
const setView = mmb.setView(ea.targetView);
if (!setView.ok) throw new Error(`setView failed: ${setView.error.message}`);
return { ea, mmb };
}
const assertOk = (result, label) => {
if (!result?.ok) {
const message = result?.error?.message || "Unknown error";
const code = result?.error?.code || "UNKNOWN";
throw new Error(`${label} failed (${code}): ${message}`);
}
return result.data;
}
const { mmb } = await ensureMindMapBuilder();
// 1) Create / select root
const rootData = assertOk(await mmb.addNode({ text: "MindMapBuilder API", ontology: "Root" }), "add root");
assertOk(mmb.selectNode(rootData.nodeId), "select root");
// 2) Explicitly set growth strategy to Right-Left
assertOk(
await mmb.setMapConfig({
nodeId: rootData.nodeId,
patch: {
growthMode: "Right-Left",
multicolor: true,
boxChildren: false,
},
relayout: true,
}),
"setMapConfig",
);
// 3) Build feature branches
const features = [
{
title: "Discoverability",
ontology: "spec/help/listMethods/getErrorCodes",
items: ["spec()", "help('addNode')", "listMethods()", "getErrorCodes()"],
},
{
title: "Validation",
ontology: "validate-first automation",
items: ["validate(method,args)", "normalizedArgs", "contract checks"],
},
{
title: "Core Ops",
ontology: "create+layout",
items: ["addNode()", "refreshMapLayout()", "performAction()"],
},
{
title: "Map Data",
ontology: "query graph",
items: ["getMapInfo()", "getNodeText()", "getMindMapRoots()"],
},
{
title: "Import/Export",
ontology: "markdown bridge",
items: ["importMarkdown()", "exportMarkdown()"],
},
{
title: "Extraction",
ontology: "element grouping",
items: ["getBranchElementIds()", "getProjectElementIds()", "getElementIdsByRole()"],
},
];
const branchNodeIds = [];
for (const group of features) {
assertOk(mmb.selectNode(rootData.nodeId), `select root for ${group.title}`);
const branch = assertOk(
await mmb.addNode({ text: group.title, ontology: group.ontology, parentId: rootData.nodeId }),
`add branch ${group.title}`,
);
branchNodeIds.push(branch.nodeId);
for (const item of group.items) {
assertOk(
await mmb.addNode({ text: item, parentId: branch.nodeId }),
`add item ${group.title} -> ${item}`,
);
}
}
// 4) Add boundaries around selected branch groups
const withBoundaries = ["Discoverability", "Core Ops", "Extraction"];
for (let i = 0; i < features.length; i++) {
const group = features[i];
if (!withBoundaries.includes(group.title)) continue;
assertOk(mmb.selectNode(branchNodeIds[i]), `select for boundary ${group.title}`);
assertOk(await mmb.performAction(mmb.Actions.TOGGLE_BOUNDARY), `toggle boundary ${group.title}`);
}
// 5) Final layout + quick verification calls
assertOk(mmb.selectNode(rootData.nodeId), "reselect root");
assertOk(await mmb.refreshMapLayout(rootData.nodeId), "final relayout");
const rootInfo = assertOk(mmb.getMapInfo(rootData.nodeId), "getMapInfo root");
const rootText = assertOk(mmb.getNodeText(rootData.nodeId), "getNodeText root");
mmb.performAction(mmb.Actions.ZOOM);
console.log("Map created", { rootInfo, rootText, branchNodeIds });
})();
```
---
## ExcalidrawAutomate integration note
MindMapBuilder API focuses on mindmap-specific orchestration. For advanced canvas operations (fine-grained styling, geometry transforms, scene-level utilities, file operations), use **ExcalidrawAutomate** together with this API.
Reference:
- [ExcalidrawAutomate full library for LLM training.md](../AITrainingData/ExcalidrawAutomate%20full%20library%20for%20LLM%20training.md)
You can use MindMapBuilderAPI to identify target nodes/branches, then use ExcalidrawAutomate to apply detailed transformations.
## Compatibility
- Designed for the current MindMapBuilder public API exposed at runtime.
- Prefer `spec()` and `validate()` in automation code to remain robust against future changes.
+1 -3
View File
@@ -577,11 +577,9 @@ 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, scaleX?: number, scaleY?: number): Promise<string>;
addLaTex(topX: number, topY: number, tex: string): Promise<string>;
/**
* Returns the base64 dataURL of the LaTeX equation rendered as an SVG.
* @param {string} tex - The LaTeX equation string.
+1 -1
View File
@@ -1 +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="svg-icon lucide-workflow"><rect width="8" height="8" x="3" y="3" rx="2"/><path d="M7 11v4a2 2 0 0 0 2 2h4"/><rect width="8" height="8" x="13" y="13" rx="2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="100 100 500 400"><path fill-rule="evenodd" d="M414.57 183.49a11.194 11.194 0 0 0-10.344 6.914 11.21 11.21 0 0 0-.851 4.285v74.086h-110.09c-5.57-47.172-45.852-83.945-94.48-83.945-52.418 0-95.2 42.715-95.2 95.145 0 52.43 42.782 95.141 95.2 95.141 48.629 0 88.91-36.773 94.48-83.945h110.09v74.145c0 1.465.293 2.93.851 4.285a11.184 11.184 0 0 0 10.344 6.91H585.2c1.465 0 2.93-.292 4.285-.85a11.184 11.184 0 0 0 6.91-10.344v-170.63c0-1.466-.293-2.93-.851-4.286a11.246 11.246 0 0 0-2.426-3.633c-1.035-1.035-2.277-1.867-3.633-2.43s-2.82-.851-4.285-.851z"/></svg>

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 604 B

+1 -1
View File
@@ -1 +1 @@
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><path d="M947.2 0H76.8C33.6 0 0 33.6 0 76.8v870.4C0 990.4 33.6 1024 76.8 1024h870.4c38.4 0 72-30.4 76.8-68.8V76.8C1024 33.6 990.4 0 947.2 0zM84.8 84.8h852.8V256H84.8V84.8z m256 256h596.8v256H340.8v-256z m-256 598.4V340.8H256v596.8H84.8z m256 0v-256h596.8v256H340.8z"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1670131481615" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3504" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M947.2 0H76.8C33.6 0 0 33.6 0 76.8v870.4C0 990.4 33.6 1024 76.8 1024h870.4c38.4 0 72-30.4 76.8-68.8V76.8C1024 33.6 990.4 0 947.2 0zM84.8 84.8h852.8V256H84.8V84.8z m256 256h596.8v256H340.8v-256z m-256 598.4V340.8H256v596.8H84.8z m256 0v-256h596.8v256H340.8z" p-id="3505"></path></svg>

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 616 B

+5 -1
View File
@@ -1 +1,5 @@
<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="svg-icon lucide-squares-subtract"><path d="M10 22a2 2 0 0 1-2-2"/><path d="M16 22h-2"/><path d="M16 4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h3a1 1 0 0 0 1-1v-5a2 2 0 0 1 2-2h5a1 1 0 0 0 1-1z"/><path d="M20 8a2 2 0 0 1 2 2"/><path d="M22 14v2"/><path d="M22 20a2 2 0 0 1-2 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<path
d="m 24.000085,1.5001668 c -0.386664,0 -0.771381,0.00992 -1.153418,0.029456 -0.382035,0.019538 -0.761505,0.048738 -1.138431,0.087333 -0.376928,0.038595 -0.751077,0.086489 -1.122412,0.1436604 -0.371337,0.057172 -0.740095,0.1231708 -1.105359,0.1984375 -0.365266,0.075267 -0.72701,0.1598168 -1.085722,0.2526978 -0.358713,0.092881 -0.714405,0.1943596 -1.066085,0.304374 C 16.976978,2.6261398 16.62896,2.7444758 16.284794,2.8711426 15.940628,2.9978093 15.600354,3.132931 15.264185,3.275769 14.928014,3.4186072 14.596073,3.5694093 14.26838,3.7279378 13.940685,3.8864665 13.617667,4.0523606 13.29893,4.2260986 12.980192,4.3998368 12.66565,4.5812681 12.356352,4.7697347 12.047052,4.9582013 11.74261,5.1540648 11.443229,5.356779 11.143849,5.5594932 10.849575,5.7692003 10.560596,5.9856812 10.271615,6.2021619 9.9881012,6.4251244 9.7100016,6.654891 9.4319021,6.8846574 9.1592182,7.1213204 8.8924805,7.3638916 8.6257427,7.6064628 8.3649942,7.8552043 8.1100993,8.1100993 7.8552043,8.3649942 7.6064628,8.6257427 7.3638916,8.8924805 7.1213204,9.1592182 6.8846574,9.4319021 6.654891,9.7100016 6.4251244,9.9881012 6.2021619,10.271615 5.9856812,10.560596 5.7692003,10.849575 5.5594932,11.143849 5.356779,11.443229 5.1540648,11.74261 4.9582013,12.047052 4.7697347,12.356352 4.5812681,12.66565 4.3998368,12.980192 4.2260986,13.29893 4.0523606,13.617667 3.8864665,13.940685 3.7279378,14.26838 3.5694093,14.596073 3.4186072,14.928014 3.275769,15.264185 3.132931,15.600354 2.9978093,15.940628 2.8711426,16.284794 2.7444758,16.62896 2.6261398,16.976978 2.5161255,17.328658 c -0.1100144,0.35168 -0.2114932,0.707372 -0.3043742,1.066085 -0.092881,0.358712 -0.177431,0.720456 -0.2526978,1.085722 -0.075267,0.365264 -0.1412659,0.734022 -0.1984375,1.105359 -0.057171,0.371335 -0.1050652,0.745484 -0.1436604,1.122412 -0.038595,0.376926 -0.067795,0.756396 -0.087333,1.138431 -0.019538,0.382037 -0.029456,0.766754 -0.029456,1.153418 0,0.386665 0.00992,0.770865 0.029456,1.152902 0.019538,0.382035 0.048738,0.762022 0.087333,1.138948 0.038595,0.376927 0.086489,0.751076 0.1436604,1.122412 0.057172,0.371337 0.1231708,0.739578 0.1984375,1.104842 0.075267,0.365266 0.1598168,0.727526 0.2526978,1.086239 0.092881,0.358713 0.1943598,0.713888 0.3043742,1.065568 0.1100143,0.35168 0.2283503,0.699698 0.3550171,1.043864 0.1266667,0.344166 0.2617884,0.684439 0.4046264,1.02061 0.1428382,0.336169 0.2936403,0.668627 0.4521688,0.996321 0.1585287,0.327695 0.3244228,0.650712 0.4981608,0.96945 0.1737382,0.318738 0.3551695,0.632763 0.5436361,0.942061 0.1884666,0.3093 0.3843301,0.613742 0.5870443,0.913123 0.2027142,0.299381 0.4124213,0.593654 0.6289022,0.882633 0.2164807,0.288981 0.4394432,0.573012 0.6692098,0.851111 0.2297664,0.2781 0.4664294,0.550267 0.7090006,0.817005 0.2425712,0.266737 0.4913127,0.528002 0.7462077,0.782898 0.2548949,0.254894 0.5156434,0.503637 0.7823812,0.746207 0.2667377,0.242572 0.5394216,0.478717 0.8175211,0.708484 0.2780996,0.229767 0.5616134,0.453246 0.8505944,0.669727 0.288979,0.216481 0.583253,0.426188 0.882633,0.628902 0.299381,0.202714 0.603823,0.398577 0.913123,0.587044 0.309298,0.188467 0.62384,0.369381 0.942578,0.54312 0.318737,0.173737 0.641755,0.340148 0.96945,0.498677 0.327693,0.158529 0.659634,0.309331 0.995805,0.452169 0.336169,0.142838 0.676443,0.277443 1.020609,0.40411 0.344166,0.126665 0.692184,0.24552 1.043864,0.355533 0.304779,0.09534 0.613889,0.181052 0.923975,0.26355 0.08249,0.310063 0.168215,0.618701 0.263549,0.923458 0.110015,0.351679 0.228351,0.699699 0.355018,1.043864 0.126665,0.344165 0.261788,0.684439 0.404626,1.02061 0.142838,0.336169 0.29364,0.668111 0.452169,0.995804 0.158528,0.327694 0.324423,0.65123 0.498161,0.969967 0.173736,0.318737 0.355169,0.632763 0.543636,0.942061 0.188465,0.309299 0.38433,0.613743 0.587044,0.913123 0.202714,0.29938 0.412422,0.593654 0.628902,0.882633 0.216481,0.288981 0.439444,0.573013 0.66921,0.851111 0.229766,0.2781 0.465913,0.550267 0.708484,0.817005 0.242571,0.266736 0.491831,0.528003 0.746724,0.782898 0.254895,0.254893 0.515645,0.503637 0.782381,0.746207 0.266738,0.242571 0.539422,0.478718 0.817522,0.708484 0.278098,0.229766 0.561614,0.453246 0.850594,0.669727 0.288979,0.216479 0.583253,0.426188 0.882633,0.628902 0.29938,0.202714 0.603824,0.398578 0.913123,0.587044 0.309298,0.188467 0.623324,0.369383 0.942061,0.543119 0.318737,0.173738 0.642273,0.34015 0.969967,0.498678 0.327693,0.158528 0.659634,0.309331 0.995805,0.452169 0.336169,0.142838 0.676444,0.277443 1.020609,0.40411 0.344165,0.126665 0.692185,0.245519 1.043864,0.355533 0.351679,0.110015 0.707372,0.211494 1.066085,0.304375 0.358711,0.09288 0.720457,0.176914 1.085722,0.252181 0.365263,0.07527 0.734022,0.141782 1.105359,0.198954 0.371335,0.05717 0.745485,0.105065 1.122412,0.14366 0.376925,0.0386 0.756397,0.0678 1.138431,0.08733 0.382036,0.01954 0.766755,0.02946 1.153418,0.02946 0.386665,0 0.770866,-0.0099 1.152902,-0.02946 0.382034,-0.01954 0.762023,-0.04874 1.138948,-0.08733 0.376927,-0.0386 0.751077,-0.08649 1.122412,-0.14366 0.371336,-0.05717 0.73Line truncated
/>
</svg>

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 17 KiB

@@ -1 +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="svg-icon lucide-shapes"><path d="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z"/><rect x="3" y="14" width="7" height="7" rx="1"/><circle cx="17.5" cy="17.5" r="3.5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="5 5 170 70" stroke="#000"><path fill="none" stroke-linecap="round" stroke-width="4" d="M10 10h60m-60 0h60m0 0v60m0-60v60m0 0H10m60 0H10m0 0V10m0 60V10M141 10c6.47 6.91 12.94 13.83 29 31m-29-31c9.29 9.93 18.57 19.86 29 31m0 0-29 29m29-29-29 29m0 0c-10.49-9.82-20.99-19.64-31-29m31 29c-7.35-6.88-14.71-13.76-31-29m0 0 31-31m-31 31 31-31"/><g stroke-linecap="round"><path fill="none" stroke-width="4" d="M80 40h20m-20 0h20"/><path fill-rule="evenodd" stroke-width="0" d="m100 40-9.06 4.23v-8.46L100 40"/><path fill="none" stroke-width="4" d="M100 40c-3.14 1.47-6.29 2.93-9.06 4.23M100 40c-3.13 1.46-6.27 2.92-9.06 4.23m0 0v-8.46m0 8.46v-8.46m0 0c3.38 1.58 6.76 3.16 9.06 4.23m-9.06-4.23c2.17 1.02 4.34 2.03 9.06 4.23m0 0s0 0 0 0m0 0s0 0 0 0"/></g></svg>

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 802 B

+15
View File
@@ -1,2 +1,17 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72.75819749055177 80.03703336574608" width="72.75819749055177" height="80.03703336574608">
<!-- svg-source:excalidraw -->
<defs>
<style class="style-fonts">
@font-face {
font-family: "Virgil";
src: url("https://excalidraw.com/Virgil.woff2");
}
@font-face {
font-family: "Cascadia";
src: url("https://excalidraw.com/Cascadia.woff2");
}
</style>
</defs>
<g stroke-linecap="round"><g transform="translate(4 4) rotate(0 12.71901889991409 17.183109917454658)"><path d="M0 0 C0 7.02, 0 14.05, 0 34.37 M0 34.37 C7.62 34.37, 15.24 34.37, 25.44 34.37" stroke="black" stroke-width="4.5" fill="none" stroke-dasharray="1.5 10"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(51.379765518092086 61.93633577499986) rotate(0 5.684341886080802e-14 7.050348795373111)"><path d="M0 0 C0 4.06, 0 8.11, 0 14.1" stroke="black" stroke-width="4.5" fill="none" stroke-dasharray="1.5 10"></path></g></g><mask></mask><g stroke-linecap="round" transform="translate(34.0013341989918 20.987787610339183) rotate(0 17.378431645779926 17.378431645779983)"><path d="M34.76 17.38 C34.76 18.38, 34.67 19.41, 34.49 20.4 C34.32 21.39, 34.05 22.38, 33.71 23.32 C33.36 24.27, 32.93 25.2, 32.43 26.07 C31.93 26.94, 31.34 27.78, 30.69 28.55 C30.04 29.32, 29.32 30.04, 28.55 30.69 C27.78 31.34, 26.94 31.93, 26.07 32.43 C25.2 32.93, 24.27 33.36, 23.32 33.71 C22.38 34.05, 21.39 34.32, 20.4 34.49 C19.41 34.67, 18.38 34.76, 17.38 34.76 C16.37 34.76, 15.35 34.67, 14.36 34.49 C13.37 34.32, 12.38 34.05, 11.43 33.71 C10.49 33.36, 9.56 32.93, 8.69 32.43 C7.82 31.93, 6.98 31.34, 6.21 30.69 C5.44 30.04, 4.71 29.32, 4.07 28.55 C3.42 27.78, 2.83 26.94, 2.33 26.07 C1.83 25.2, 1.39 24.27, 1.05 23.32 C0.7 22.38, 0.44 21.39, 0.26 20.4 C0.09 19.41, 0 18.38, 0 17.38 C0 16.37, 0.09 15.35, 0.26 14.36 C0.44 13.37, 0.7 12.38, 1.05 11.43 C1.39 10.49, 1.83 9.56, 2.33 8.69 C2.83 7.82, 3.42 6.98, 4.07 6.21 C4.71 5.44, 5.44 4.71, 6.21 4.07 C6.98 3.42, 7.82 2.83, 8.69 2.33 C9.56 1.83, 10.49 1.39, 11.43 1.05 C12.38 0.7, 13.37 0.44, 14.36 0.26 C15.35 0.09, 16.37 0, 17.38 0 C18.38 0, 19.41 0.09, 20.4 0.26 C21.39 0.44, 22.38 0.7, 23.32 1.05 C24.27 1.39, 25.2 1.83, 26.07 2.33 C26.94 2.83, 27.78 3.42, 28.55 4.07 C29.32 4.71, 30.04 5.44, 30.69 6.21 C31.34 6.98, 31.93 7.82, 32.43 8.69 C32.93 9.56, 33.36 10.49, 33.71 11.43 C34.05 12.38, 34.32 13.37, 34.49 14.36 C34.67 15.35, 34.71 16.88, 34.76 17.38 C34.8 17.88, 34.8 16.88, 34.76 17.38" stroke="black" stroke-width="4" fill="none"></path></g><g stroke-linecap="round"><g transform="translate(41.72257566145686 38.36621939788711) rotate(0 9.65718949485347 0)"><path d="M0 0 C4.11 0, 8.22 0, 19.31 0 M0 0 C6.95 0, 13.9 0, 19.31 0" stroke="black" stroke-width="4" fill="none"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(41.72257587602678 38.36622004108449) rotate(89.99999999999994 9.65718949485347 0)"><path d="M0 0 C5.31 0, 10.62 0, 19.31 0 M0 0 C4.56 0, 9.13 0, 19.31 0" stroke="black" stroke-width="4" fill="none"></path></g></g><mask></mask></svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

+1 -1
View File
@@ -1 +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="svg-icon lucide-repeat"><path d="m17 2 4 4-4 4"/><path d="M3 11v-1a4 4 0 0 1 4-4h14"/><path d="m7 22-4-4 4-4"/><path d="M21 13v1a4 4 0 0 1-4 4H3"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M480 256c-17.67 0-32 14.31-32 32c0 52.94-43.06 96-96 96H192L192 344c0-9.469-5.578-18.06-14.23-21.94C169.1 318.3 159 319.8 151.9 326.2l-80 72C66.89 402.7 64 409.2 64 416s2.891 13.28 7.938 17.84l80 72C156.4 509.9 162.2 512 168 512c3.312 0 6.615-.6875 9.756-2.062C186.4 506.1 192 497.5 192 488L192 448h160c88.22 0 160-71.78 160-160C512 270.3 497.7 256 480 256zM160 128h159.1L320 168c0 9.469 5.578 18.06 14.23 21.94C337.4 191.3 340.7 192 343.1 192c5.812 0 11.57-2.125 16.07-6.156l80-72C445.1 109.3 448 102.8 448 95.1s-2.891-13.28-7.938-17.84l-80-72c-7.047-6.312-17.19-7.875-25.83-4.094C325.6 5.938 319.1 14.53 319.1 24L320 64H160C71.78 64 0 135.8 0 224c0 17.69 14.33 32 32 32s32-14.31 32-32C64 171.1 107.1 128 160 128z"/></svg>

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 794 B

@@ -1 +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="svg-icon lucide-paintbrush-vertical"><path d="M10 2v2"/><path d="M14 2v4"/><path d="M17 2a1 1 0 0 1 1 1v9H6V3a1 1 0 0 1 1-1z"/><path d="M6 12a1 1 0 0 0-1 1v1a2 2 0 0 0 2 2h2a1 1 0 0 1 1 1v2.9a2 2 0 1 0 4 0V17a1 1 0 0 1 1-1h2a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M224 0H336C362.5 0 384 21.49 384 48V256H0V48C0 21.49 21.49 0 48 0H64L96 64L128 0H160L192 64L224 0zM384 288V320C384 355.3 355.3 384 320 384H256V448C256 483.3 227.3 512 192 512C156.7 512 128 483.3 128 448V384H64C28.65 384 0 355.3 0 320V288H384zM192 464C200.8 464 208 456.8 208 448C208 439.2 200.8 432 192 432C183.2 432 176 439.2 176 448C176 456.8 183.2 464 192 464z"/></svg>

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 443 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-squircle"><path fill="none" d="M12 3c7.2 0 9 1.8 9 9s-1.8 9-9 9-9-1.8-9-9 1.8-9 9-9"/></svg>
<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-squircle"><path fill="none" d="M12 3c7.2 0 9 1.8 9 9s-1.8 9-9 9-9-1.8-9-9 1.8-9 9-9"/></svg>

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 294 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-scan-search"><g stroke-width="2"><path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><circle cx="12" cy="12" r="3"/><path d="m16 16-1.9-1.9"/></g></svg>
<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-scan-search"><g stroke-width="2"><path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><circle cx="12" cy="12" r="3"/><path d="m16 16-1.9-1.9"/></g></svg>

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 444 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-moon"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="120 30 500 500" stroke="#000"><path d="M365.4 56a224.009 224.009 0 0 0-158.39 65.609 223.994 223.994 0 0 0 0 316.78 224.001 224.001 0 0 0 158.39 65.609c59.41 0 116.39-23.602 158.39-65.609a223.99 223.99 0 0 0 65.605-158.39c0-39.32-10.348-77.949-30.008-112s-47.938-62.328-81.992-81.988a224 224 0 0 0-112-30.012zm92.398 243.6h-72.801v72.801l.004-.004a19.602 19.602 0 0 1-39.2 0v-72.8h-72.8v.003a19.6 19.6 0 0 1-16.974-9.8 19.59 19.59 0 0 1 0-19.603c3.5-6.062 9.97-9.8 16.973-9.8h72.801v-72.802.004a19.602 19.602 0 0 1 39.2 0V260.4h72.8v-.004a19.604 19.604 0 0 1 16.974 29.403 19.604 19.604 0 0 1-16.973 9.801z"/></svg>

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 664 B

@@ -7,9 +7,8 @@ Select some elements in the scene. The script will take these elements and move
<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>
```js
```javascript
*/
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.7.3")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
return;
@@ -22,57 +21,16 @@ const excalidrawTemplates = ea.getListOfTemplateFiles();
if(typeof window.ExcalidrawDeconstructElements === "undefined") {
window.ExcalidrawDeconstructElements = {
openDeconstructedImage: true,
reuseTab: true,
templatePath: excalidrawTemplates?.[0]?.path??""
templatePath: excalidrawTemplates?.[0].path??""
};
} else if (typeof window.ExcalidrawDeconstructElements.reuseTab === "undefined") {
window.ExcalidrawDeconstructElements.reuseTab = true;
}
// 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();
}
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"
};
}
let settings = ea.getScriptSettings();
@@ -118,13 +76,12 @@ 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,
@@ -139,7 +96,7 @@ ea.getElements().filter(el=>el.type==="image").forEach(el=>{
return;
}
const equation = ea.targetView.excalidrawData.getEquation(el.fileId);
const eqImg = ea.targetView.getScene()?.files[el.fileId]
eqImg = ea.targetView.getScene()?.files[el.fileId]
if(equation && eqImg) {
ea.imagesDict[el.fileId] = {
mimeType: eqImg.mimeType,
@@ -155,107 +112,28 @@ ea.getElements().filter(el=>el.type==="image").forEach(el=>{
});
// ----------------------
// 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("/");
// 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);
// ------------
// Input prompt
// ------------
let shouldAnchor = false;
const actionButtons = [
{
caption: "Insert @100%",
tooltip: "Anchor to 100% size",
action: () => {
shouldAnchor = true;
}
} else {
new Notice("Deconstruction ready");
}
};
},
{
caption: "Insert",
tooltip: "Insert without anchoring",
action: () => {
shouldAnchor = false;
}
}];
// ----------------------
// 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)
const customControls = (container) => {
new ea.obsidian.Setting(container)
.setName(`Select template`)
.addDropdown(dropdown => {
templates.forEach(file => dropdown.addOption(file.path, file.basename));
@@ -265,67 +143,64 @@ modal.onOpen = () => {
.onChange(value => {
window.ExcalidrawDeconstructElements.templatePath = value;
})
});
})
// -- Open Toggle --
new ea.obsidian.Setting(content)
new ea.obsidian.Setting(container)
.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";
})
);
)
}
// -- 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);
});
const path = await utils.inputPrompt(
"Filename for new file",
"Filename",
await ea.getAttachmentFilepath(DEFAULT_FILENAME),
actionButtons,
2,
false,
customControls
);
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);
});
};
if(!path) return;
modal.open();
// ----------------------
// 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");
}
+14 -64
View File
@@ -6,23 +6,12 @@ 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*/
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") {
const selectedElements = ea.getViewSelectedElements();
if (selectedElements.length !== 1 || selectedElements[0].type === "arrow") {
new Notice("Select a single element that is not an arrow and not a frame");
return;
}
// 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;
@@ -122,8 +111,9 @@ function getImageLink(f) {
}
function getBoundText(el) {
const text = ea.getBoundTextElement(el,true)?.sceneElement?.rawText;
return text ? text + "\n" : "";
const textId = el.boundElements?.find(x => x.type === "text")?.id;
const text = ea.getViewElements().find(x => x.id === textId)?.originalText;
return text ? text + "\n" : "";
}
async function getSectionText(file, section) {
@@ -184,9 +174,8 @@ async function getBlockText(file, blockref) {
}
async function getElementText(el) {
const maybeTextEl = ea.getBoundTextElement(el,true)?.sceneElement;
if (maybeTextEl) {
return maybeTextEl.rawText;
if (el.type === "text") {
return el.originalText;
}
if (el.type === "image") {
const f = ea.getViewFileForImageElement(el);
@@ -224,55 +213,16 @@ async function crawl(el, level, isFirst = false) {
visited.add(el.id);
let result = await getElementText(el) + "\n";
let itemsToTraverse = [];
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);
// Process all arrows connected to this element
const boundElementsData = el.boundElements.filter(x => x.type === "arrow");
const isFork = boundElementsData.length > (isFirst ? 1 : 2);
if(isFork) level++;
// Recursive Traversal
for(const {arrow, nextEl} of itemsToTraverse) {
if (!visited.has(nextEl.id)) {
for(const bindingData of boundElementsData) {
const arrow = ea.getViewElements().find(x=> x.id === bindingData.id);
const nextEl = getNextElementFollowingArrow(el, arrow);
if (nextEl && !visited.has(nextEl.id)) {
if(isFork) result += `\n${"#".repeat(level)} `;
const arrowLabel = getBoundText(arrow);
if (arrowLabel) {
+2 -1
View File
@@ -1 +1,2 @@
<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="svg-icon lucide-layout-grid"><rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/></svg>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 376.3492303436433 256.64929991179815" stroke="#000">
<g stroke-linecap="round" transform="translate(10 10) rotate(0 58.5858154296875 58.5858154296875)"><path d="M-1.64 1.57 C38.67 2.87, 77.63 0.2, 117.31 1.14 M-0.05 -0.5 C40.75 0.3, 82.48 0.12, 118.09 0.99 M116.67 0.11 C118.02 47.69, 116.43 92.18, 118.63 118.15 M117.41 0.39 C116.57 38.93, 117.51 79.53, 116.57 116.49 M118.65 117.22 C92.96 119.01, 66.56 117.46, -0.42 117.17 M117.21 116.56 C91.43 117.53, 63.4 117.03, -0.23 117.71 M1.5 116.9 C-2.3 91.83, 1.37 68.12, -0.05 -0.85 M-0.84 116.86 C-1.03 87.92, -0.86 61.1, 0.54 0.72" stroke-width="2" fill="none"></path></g><g stroke-linecap="round" transform="translate(128.96603337932902 10.2586194164669) rotate(0 58.5858154296875 58.5858154296875)"><path d="M0.05 1.78 C24.68 -1.8, 48.73 0.22, 118.17 0.33 M-0.27 0.22 C34.72 0.61, 69.52 1.58, 118.12 0.36 M117.6 1.43 C115.71 34.53, 118.33 70.74, 117.89 116.98 M116.68 -0.46 C117.9 41.7, 116.85 81.21, 116.34 117.29 M118.4 119.11 C83.22 117.59, 48.31 117.2, -1.44 117.99 M118.15 116.77 C74.14 115.56, 31.55 116.99, -0.96 117.69 M-1.69 115.77 C1.1 78.33, -0.93 41, -1.14 1.03 M-0.43 116.37 C0.72 90.14, 1.52 62.17, 0.55 -0.66" stroke-width="2" fill="none"></path></g><g stroke-linecap="round" transform="translate(248.3020093440573 10.465294492851172) rotate(0 58.5858154296875 58.5858154296875)"><path d="M0.39 -0.88 C44.51 0.1, 89.74 -0.71, 117.03 -0.11 M0.42 0.03 C30.22 0.74, 59.56 0.11, 117.15 -0.25 M116 -0.35 C118.88 36.78, 118.14 71.41, 118.16 117.65 M117.62 0.75 C115.99 39.07, 115.76 79.63, 117.09 117.91 M117.44 117.56 C81.29 118.3, 44.81 119.12, 1.29 117.25 M116.84 116.27 C88.98 117.24, 60.29 117.22, 0.21 117.92 M1.97 115.99 C0.94 82.75, -0.15 51.05, -1.24 -1.67 M-0.26 118 C1.05 86.36, 1.06 53.45, 0.95 0.65" stroke-width="2" fill="none"></path></g><g stroke-linecap="round" transform="translate(10.875590140210988 129.01237455957016) rotate(0 58.5858154296875 58.5858154296875)"><path d="M0.24 -0.16 C29.59 1.02, 57.45 2.91, 117.44 0.38 M0.41 0.64 C32.74 0.23, 66.39 0.45, 116.84 -0.9 M118.21 0.43 C119.3 32.21, 116.11 63.55, 119.15 115.99 M117.68 -0.62 C115.84 34.54, 116.24 68.9, 116.91 118 M115.86 119.08 C76.96 118.61, 32.48 117.59, -1.75 116.45 M117.39 116.77 C85.7 116.42, 54.91 116.16, 0.1 118.13 M-0.18 118.45 C-0.52 71.18, -0.96 24.41, 1.23 0.16 M0.3 117.66 C0.57 92.18, 0.07 65.33, -0.4 0.17" stroke-width="2" fill="none"></path></g><g stroke-linecap="round" transform="translate(129.84162351954 129.27099397603888) rotate(0 58.5858154296875 58.5858154296875)"><path d="M-0.16 1.48 C27.24 1.09, 56.31 0.13, 117.56 -0.42 M0.64 0.04 C34.52 0.5, 69.88 -0.81, 116.27 -0.23 M117.6 1.5 C115.78 39.75, 114.64 84.85, 115.99 117.12 M116.55 -0.84 C116.19 29.74, 115.7 60.09, 118 117.71 M119.08 118.46 C74.37 114.72, 29.76 114.66, -0.72 116.45 M116.77 116.64 C81.73 117.03, 46.47 117.52, 0.96 118.05 M1.28 117.07 C0.37 77.34, -0.95 39.83, 0.16 -1.64 M0.49 117.63 C0.17 83.07, -1.11 48.64, 0.17 0.23" stroke-width="2" fill="none"></path></g><g stroke-linecap="round" transform="translate(249.17759948426828 129.47766905242315) rotate(0 58.5858154296875 58.5858154296875)"><path d="M1.48 0.05 C26.67 2.03, 51.16 0.48, 116.75 0 M0.04 -0.61 C27.7 -1.15, 53.12 -1.65, 116.94 0.54 M118.67 -0.27 C116.09 22.53, 119.75 46.69, 117.12 116.32 M116.34 -0.31 C117.34 27.65, 117.51 57.73, 117.71 117.89 M118.46 117.96 C73.87 118.06, 32.19 117.57, -0.72 117.14 M116.64 116.71 C84.55 115.98, 52.82 117.66, 0.88 117.52 M-0.11 116.63 C-0.44 89.26, 1.33 65.24, -1.64 -0.19 M0.46 117.75 C-0.38 77.25, -0.75 38.91, 0.23 0.69" stroke-width="2" fill="none"></path></g></svg>

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 3.6 KiB

+13 -1
View File
@@ -1 +1,13 @@
<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="svg-icon lucide-sun-moon"><path d="M12 2v2"/><path d="M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715"/><path d="M16 12a4 4 0 0 0-4-4"/><path d="m19 5-1.256 1.256"/><path d="M20 12h2"/></svg>
<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">
<path stroke-width="2" fill="none" d="M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8z"></path>
<path stroke-width="2" fill="none" d="M12 8a2.828 2.828 0 1 0 4 4"></path>
<path stroke-width="2" fill="none" d="M12 2v2"></path>
<path stroke-width="2" fill="none" d="M12 20v2"></path>
<path stroke-width="2" fill="none" d="m4.93 4.93 1.41 1.41"></path>
<path stroke-width="2" fill="none" d="m17.66 17.66 1.41 1.41"></path>
<path stroke-width="2" fill="none" d="M2 12h2"></path>
<path stroke-width="2" fill="none" d="M20 12h2"></path>
<path stroke-width="2" fill="none" d="m6.34 17.66-1.41 1.41"></path>
<path stroke-width="2" fill="none" d="m19.07 4.93-1.41 1.41"></path>
</svg>

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 865 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-sun"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="50 -20 600 600"><path d="M350 0c-74.262 0-145.48 29.5-197.99 82.012a279.995 279.995 0 0 0 0 395.98 279.995 279.995 0 0 0 395.98 0 279.995 279.995 0 0 0 0-395.98A279.992 279.992 0 0 0 350 0zm140 324.8H210v-89.602h280z"/></svg>

Before

Width:  |  Height:  |  Size: 456 B

After

Width:  |  Height:  |  Size: 274 B

+24 -1
View File
@@ -1 +1,24 @@
<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="svg-icon lucide-calendar-days"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><path d="M8 14h.01"/><path d="M12 14h.01"/><path d="M16 14h.01"/><path d="M8 18h.01"/><path d="M12 18h.01"/><path d="M16 18h.01"/></svg>
<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>

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 929 B

-45
View File
@@ -1,45 +0,0 @@
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
+3051 -1052
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1 +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="svg-icon lucide-map-plus"><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>
<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>

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 485 B

+17 -2
View File
@@ -1,2 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 297.0049715909092 210.33238636363632" width="297.0049715909092" height="210.33238636363632">
<g transform="translate(120.73437500000006 90.6171875) rotate(0 -55.24325284090909 -43.80859375)" stroke="none"><path d="M -14.07,7.96 Q -14.07,7.96 -15.48,4.09 -16.89,0.22 -18.99,-3.55 -21.09,-7.33 -24.13,-12.89 -27.17,-18.45 -30.14,-24.36 -33.10,-30.28 -35.37,-34.93 -37.64,-39.59 -40.51,-44.80 -43.37,-50.02 -46.11,-53.71 -48.86,-57.40 -52.16,-60.58 -55.46,-63.76 -60.35,-67.14 -65.24,-70.53 -69.99,-72.77 -74.74,-75.00 -80.08,-76.54 -85.41,-78.08 -91.27,-78.91 -97.12,-79.74 -103.29,-80.06 -109.47,-80.38 -110.38,-80.46 -111.29,-80.55 -112.12,-80.91 -112.96,-81.28 -113.64,-81.90 -114.31,-82.52 -114.76,-83.32 -115.20,-84.12 -115.36,-85.02 -115.53,-85.92 -115.40,-86.82 -115.27,-87.73 -114.85,-88.54 -114.44,-89.36 -113.79,-90.00 -113.13,-90.64 -112.31,-91.04 -111.49,-91.44 -110.58,-91.55 -109.67,-91.67 -108.78,-91.49 -107.88,-91.31 -107.09,-90.85 -106.30,-90.39 -105.69,-89.71 -105.09,-89.02 -104.73,-88.18 -104.38,-87.34 -104.31,-86.42 -104.25,-85.51 -104.47,-84.63 -104.70,-83.74 -105.20,-82.97 -105.70,-82.21 -106.42,-81.64 -107.14,-81.07 -108.00,-80.77 -108.86,-80.46 -109.77,-80.44 -110.69,-80.43 -111.56,-80.70 -112.43,-80.98 -113.17,-81.52 -113.91,-82.06 -114.44,-82.81 -114.96,-83.55 -115.22,-84.43 -115.48,-85.31 -115.45,-86.22 -115.42,-87.13 -115.09,-87.99 -114.77,-88.84 -114.19,-89.55 -113.61,-90.26 -112.84,-90.75 -112.06,-91.23 -111.17,-91.44 -110.28,-91.66 -110.29,-91.66 -110.29,-91.66 -104.12,-93.28 -97.96,-94.90 -91.98,-95.45 -85.99,-96.00 -81.46,-95.64 -76.92,-95.29 -68.61,-93.08 -60.30,-90.88 -54.63,-88.23 -48.96,-85.58 -45.26,-83.31 -41.56,-81.05 -36.47,-77.03 -31.37,-73.00 -27.42,-68.77 -23.47,-64.54 -19.02,-58.37 -14.56,-52.20 -11.80,-47.74 -9.05,-43.29 -5.96,-38.13 -2.87,-32.97 0.60,-27.54 4.09,-22.12 6.49,-18.24 8.89,-14.36 11.48,-11.16 14.07,-7.96 14.81,-6.16 15.56,-4.36 15.86,-2.43 16.15,-0.51 15.98,1.43 15.81,3.37 15.17,5.21 14.54,7.05 13.48,8.69 12.43,10.33 11.01,11.67 9.59,13.00 7.90,13.96 6.20,14.92 4.33,15.45 2.45,15.98 0.50,16.04 -1.44,16.10 -3.34,15.69 -5.25,15.29 -7.00,14.43 -8.76,13.58 -10.25,12.34 -11.75,11.09 -12.91,9.52 -14.07,7.96 -14.07,7.96 L -14.07,7.96 Z"></path></g><g transform="translate(164.26775568181824 144.2109375) rotate(0 61.39737215909091 31.56072443181816)" stroke="none"><path d="M 15.66,-4.01 Q 15.66,-4.01 16.13,-0.20 16.61,3.60 17.59,8.51 18.58,13.41 19.95,17.45 21.33,21.49 24.37,24.74 27.42,27.99 31.19,30.37 34.96,32.74 39.20,35.13 43.45,37.52 48.43,39.69 53.42,41.86 58.89,43.75 64.36,45.65 70.65,46.93 76.94,48.20 82.07,49.37 87.20,50.54 94.31,51.57 101.42,52.61 105.80,53.22 110.19,53.84 116.30,55.50 122.42,57.17 123.33,57.43 124.24,57.70 125.02,58.24 125.80,58.78 126.36,59.54 126.93,60.30 127.22,61.20 127.51,62.11 127.50,63.05 127.49,64.00 127.18,64.90 126.86,65.79 126.28,66.54 125.70,67.29 124.91,67.81 124.12,68.33 123.20,68.58 122.29,68.82 121.34,68.76 120.39,68.69 119.52,68.33 118.64,67.97 117.93,67.35 117.21,66.73 116.73,65.91 116.25,65.09 116.06,64.16 115.87,63.24 115.98,62.30 116.09,61.35 116.50,60.50 116.91,59.64 117.57,58.96 118.23,58.28 119.07,57.85 119.91,57.41 120.85,57.27 121.79,57.13 122.72,57.29 123.66,57.46 124.49,57.91 125.32,58.37 125.96,59.06 126.61,59.76 127.00,60.62 127.38,61.49 127.47,62.43 127.57,63.37 127.35,64.30 127.14,65.22 126.64,66.03 126.14,66.83 125.41,67.44 124.68,68.04 123.80,68.38 122.91,68.72 121.96,68.76 121.02,68.80 121.02,68.80 121.02,68.80 115.03,68.92 109.04,69.04 104.35,68.97 99.66,68.90 91.93,68.33 84.21,67.77 79.05,67.15 73.88,66.53 66.31,65.49 58.74,64.46 52.36,62.80 45.98,61.14 39.86,59.02 33.75,56.90 28.77,54.67 23.78,52.44 16.02,48.05 8.26,43.66 4.11,40.01 -0.02,36.37 -2.76,32.84 -5.49,29.32 -7.53,25.15 -9.57,20.98 -11.19,16.07 -12.82,11.16 -14.24,7.58 -15.66,4.01 -15.91,2.08 -16.16,0.15 -15.95,-1.78 -15.73,-3.72 -15.05,-5.54 -14.38,-7.37 -13.29,-8.99 -12.20,-10.60 -10.75,-11.91 -9.30,-13.21 -7.59,-14.14 -5.87,-15.06 -3.98,-15.54 -2.09,-16.03 -0.15,-16.04 1.79,-16.06 3.69,-15.61 5.59,-15.17 7.32,-14.28 9.05,-13.39 10.53,-12.11 12.00,-10.83 13.12,-9.24 14.24,-7.64 14.95,-5.83 15.66,-4.01 15.66,-4.01 L 15.66,-4.01 Z"></path></g><g transform="translate(162.112215909091 97.65198863636371) rotate(0 65.9463778409091 -9.367897727272734)" stroke="none"><path d="M -11.89,-13.03 Q -11.89,-13.03 -9.71,-14.43 -7.53,-15.83 -3.76,-18.75 0.00,-21.67 4.98,-23.33 9.95,-24.99 15.49,-25.40 21.03,-25.81 25.86,-26.38 30.69,-26.94 36.72,-27.29 42.74,-27.64 50.18,-27.53 57.63,-27.43 63.68,-27.17 69.73,-26.92 76.87,-26.79 84.00,-26.67 89.62,-26.12 95.24,-25.57 100.83,-24.77 106.42,-23.98 111.10,-23.39 115.77,-22.79 120.60,-22.26 125.43,-21.72 128.49,-20.87 131.56,-20.02 132.45,-19.88 133.35,-19.73 134.15,-19.31 134.95,-18.88 135.57,-18.22 136.19,-17.56 136.57,-16.74 136.95,-15.92 137.05,-15.02 137.15,-14.12 136.95,-13.24 136.76,-12.35 136.29,-11.57 135.82,-10.80 135.13,-10.21 134.44,-9.63 133.60,-9.29 132.76,-8.96 131.85,-8.91 130.95,-8.86 130.08,-9.10 129.20,-9.35 128.46,-9.85 127.71,-10.36 127.16,-11.08 126.61,-11.81 126.32,-12.66 126.03,-13Line truncated
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 297.0049715909092 210.33238636363632" width="297.0049715909092" height="210.33238636363632">
<!-- svg-source:excalidraw -->
<defs>
<style class="style-fonts">
@font-face {
font-family: "Virgil";
src: url("https://excalidraw.com/Virgil.woff2");
}
@font-face {
font-family: "Cascadia";
src: url("https://excalidraw.com/Cascadia.woff2");
}
</style>
</defs>
<rect x="0" y="0" width="297.0049715909092" height="210.33238636363632" fill="#ffffff"></rect><g transform="translate(120.73437500000006 90.6171875) rotate(0 -55.24325284090909 -43.80859375)" stroke="none"><path d="M -14.07,7.96 Q -14.07,7.96 -15.48,4.09 -16.89,0.22 -18.99,-3.55 -21.09,-7.33 -24.13,-12.89 -27.17,-18.45 -30.14,-24.36 -33.10,-30.28 -35.37,-34.93 -37.64,-39.59 -40.51,-44.80 -43.37,-50.02 -46.11,-53.71 -48.86,-57.40 -52.16,-60.58 -55.46,-63.76 -60.35,-67.14 -65.24,-70.53 -69.99,-72.77 -74.74,-75.00 -80.08,-76.54 -85.41,-78.08 -91.27,-78.91 -97.12,-79.74 -103.29,-80.06 -109.47,-80.38 -110.38,-80.46 -111.29,-80.55 -112.12,-80.91 -112.96,-81.28 -113.64,-81.90 -114.31,-82.52 -114.76,-83.32 -115.20,-84.12 -115.36,-85.02 -115.53,-85.92 -115.40,-86.82 -115.27,-87.73 -114.85,-88.54 -114.44,-89.36 -113.79,-90.00 -113.13,-90.64 -112.31,-91.04 -111.49,-91.44 -110.58,-91.55 -109.67,-91.67 -108.78,-91.49 -107.88,-91.31 -107.09,-90.85 -106.30,-90.39 -105.69,-89.71 -105.09,-89.02 -104.73,-88.18 -104.38,-87.34 -104.31,-86.42 -104.25,-85.51 -104.47,-84.63 -104.70,-83.74 -105.20,-82.97 -105.70,-82.21 -106.42,-81.64 -107.14,-81.07 -108.00,-80.77 -108.86,-80.46 -109.77,-80.44 -110.69,-80.43 -111.56,-80.70 -112.43,-80.98 -113.17,-81.52 -113.91,-82.06 -114.44,-82.81 -114.96,-83.55 -115.22,-84.43 -115.48,-85.31 -115.45,-86.22 -115.42,-87.13 -115.09,-87.99 -114.77,-88.84 -114.19,-89.55 -113.61,-90.26 -112.84,-90.75 -112.06,-91.23 -111.17,-91.44 -110.28,-91.66 -110.29,-91.66 -110.29,-91.66 -104.12,-93.28 -97.96,-94.90 -91.98,-95.45 -85.99,-96.00 -81.46,-95.64 -76.92,-95.29 -68.61,-93.08 -60.30,-90.88 -54.63,-88.23 -48.96,-85.58 -45.26,-83.31 -41.56,-81.05 -36.47,-77.03 -31.37,-73.00 -27.42,-68.77 -23.47,-64.54 -19.02,-58.37 -14.56,-52.20 -11.80,-47.74 -9.05,-43.29 -5.96,-38.13 -2.87,-32.97 0.60,-27.54 4.09,-22.12 6.49,-18.24 8.89,-14.36 11.48,-11.16 14.07,-7.96 14.81,-6.16 15.56,-4.36 15.86,-2.43 16.15,-0.51 15.98,1.43 15.81,3.37 15.17,5.21 14.54,7.05 13.48,8.69 12.43,10.33 11.01,11.67 9.59,13.00 7.90,13.96 6.20,14.92 4.33,15.45 2.45,15.98 0.50,16.04 -1.44,16.10 -3.34,15.69 -5.25,15.29 -7.00,14.43 -8.76,13.58 -10.25,12.34 -11.75,11.09 -12.91,9.52 -14.07,7.96 -14.07,7.96 L -14.07,7.96 Z"></path></g><g transform="translate(164.26775568181824 144.2109375) rotate(0 61.39737215909091 31.56072443181816)" stroke="none"><path d="M 15.66,-4.01 Q 15.66,-4.01 16.13,-0.20 16.61,3.60 17.59,8.51 18.58,13.41 19.95,17.45 21.33,21.49 24.37,24.74 27.42,27.99 31.19,30.37 34.96,32.74 39.20,35.13 43.45,37.52 48.43,39.69 53.42,41.86 58.89,43.75 64.36,45.65 70.65,46.93 76.94,48.20 82.07,49.37 87.20,50.54 94.31,51.57 101.42,52.61 105.80,53.22 110.19,53.84 116.30,55.50 122.42,57.17 123.33,57.43 124.24,57.70 125.02,58.24 125.80,58.78 126.36,59.54 126.93,60.30 127.22,61.20 127.51,62.11 127.50,63.05 127.49,64.00 127.18,64.90 126.86,65.79 126.28,66.54 125.70,67.29 124.91,67.81 124.12,68.33 123.20,68.58 122.29,68.82 121.34,68.76 120.39,68.69 119.52,68.33 118.64,67.97 117.93,67.35 117.21,66.73 116.73,65.91 116.25,65.09 116.06,64.16 115.87,63.24 115.98,62.30 116.09,61.35 116.50,60.50 116.91,59.64 117.57,58.96 118.23,58.28 119.07,57.85 119.91,57.41 120.85,57.27 121.79,57.13 122.72,57.29 123.66,57.46 124.49,57.91 125.32,58.37 125.96,59.06 126.61,59.76 127.00,60.62 127.38,61.49 127.47,62.43 127.57,63.37 127.35,64.30 127.14,65.22 126.64,66.03 126.14,66.83 125.41,67.44 124.68,68.04 123.80,68.38 122.91,68.72 121.96,68.76 121.02,68.80 121.02,68.80 121.02,68.80 115.03,68.92 109.04,69.04 104.35,68.97 99.66,68.90 91.93,68.33 84.21,67.77 79.05,67.15 73.88,66.53 66.31,65.49 58.74,64.46 52.36,62.80 45.98,61.14 39.86,59.02 33.75,56.90 28.77,54.67 23.78,52.44 16.02,48.05 8.26,43.66 4.11,40.01 -0.02,36.37 -2.76,32.84 -5.49,29.32 -7.53,25.15 -9.57,20.98 -11.19,16.07 -12.82,11.16 -14.24,7.58 -15.66,4.01 -15.91,2.08 -16.16,0.15 -15.95,-1.78 -15.73,-3.72 -15.05,-5.54 -14.38,-7.37 -13.29,-8.99 -12.20,-10.60 -10.75,-11.91 -9.30,-13.21 -7.59,-14.14 -5.87,-15.06 -3.98,-15.54 -2.09,-16.03 -0.15,-16.04 1.79,-16.06 3.69,-15.61 5.59,-15.17 7.32,-14.28 9.05,-13.39 10.53,-12.11 12.00,-10.83 13.12,-9.24 14.24,-7.64 14.95,-5.83 15.66,-4.01 15.66,-4.01 L 15.66,-4.01 Z"></path></g><g transform="translate(162.112215909091 97.65198863636371) rotate(0 65.9463778409091 -9.367897727272734)" stroke="none"><path d="M -11.89,-13.03 Q -11.89,-13.03 -9.71,-14.43 -7.53,-15.83 -3.76,-18.75 0.00,-21.67 4.98,-23.33 9.95,-24.99 15.49,-25.40 21.03,-25.81 25.86,-26.38 30.69,-26.94 36.72,-27.29 42.74,-27.64 50.18,-27.53 57.63,-27.43 63.68,-27.17 69.73,-26.92 76.87,-26.79 84.00,-26.67 89.62,-26.12 95.24,-25.57 100.83,-24.77 106.42,-23.98 111.10,-23.39 115.77,-22.79 120.60,-22.26 125.43,-21.72 128.49,-20.87 131.56,-20.02 132.45,-19.88 133.35,-19.73 134.15,-19.31 134.95,-18.88 135.57,-18.22 136.19,-17.56 136.57,-16.74 136.95,-15.92 137.05,-15.02 137.15,-14.12 136.95,-13.24 136.76,-12.35 136.29,-11.57 135.82,-10.80 135.13,-10.21 134.44,-9.63 133.60,-9.29 132.76,-8.96 131.85,-8.91 130.95,-8.86 130.08,-9Line truncated

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

+1 -1
View File
@@ -1 +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="svg-icon lucide-file-text"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM112 256H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"/></svg>

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 622 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-palette"><path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"/><circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/><circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/><circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/><circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M512 255.1C512 256.9 511.1 257.8 511.1 258.7C511.6 295.2 478.4 319.1 441.9 319.1H344C317.5 319.1 296 341.5 296 368C296 371.4 296.4 374.7 297 377.9C299.2 388.1 303.5 397.1 307.9 407.8C313.9 421.6 320 435.3 320 449.8C320 481.7 298.4 510.5 266.6 511.8C263.1 511.9 259.5 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256V255.1zM96 255.1C78.33 255.1 64 270.3 64 287.1C64 305.7 78.33 319.1 96 319.1C113.7 319.1 128 305.7 128 287.1C128 270.3 113.7 255.1 96 255.1zM128 191.1C145.7 191.1 160 177.7 160 159.1C160 142.3 145.7 127.1 128 127.1C110.3 127.1 96 142.3 96 159.1C96 177.7 110.3 191.1 128 191.1zM256 63.1C238.3 63.1 224 78.33 224 95.1C224 113.7 238.3 127.1 256 127.1C273.7 127.1 288 113.7 288 95.1C288 78.33 273.7 63.1 256 63.1zM384 191.1C401.7 191.1 416 177.7 416 159.1C416 142.3 401.7 127.1 384 127.1C366.3 127.1 352 142.3 352 159.1C352 177.7 366.3 191.1 384 191.1z"/></svg>

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 1.1 KiB

+3 -32
View File
@@ -20,37 +20,12 @@ if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.14.2")) {
return;
}
function requestFullscreen() {
const el = ea.targetView.ownerDocument.body;
if (el.requestFullscreen) {
el.requestFullscreen();
} else if (el.webkitRequestFullscreen) {
el.webkitRequestFullscreen();
}
ea.targetView.gotoFullscreen();
}
function exitFullscreen() {
const doc = ea.targetView.ownerDocument;
if (doc.exitFullscreen) {
doc.exitFullscreen();
} else if (doc.webkitExitFullscreen) {
doc.webkitExitFullscreen();
}
ea.targetView.exitFullscreen();
}
async function run() {
if(window.excalidrawPalmGuard) {
window.excalidrawPalmGuard()
return;
}
const modal = new ea.FloatingModal(ea.plugin.app);
if (modal.bgEl) {
modal.containerEl.removeChild(modal.bgEl);
}
modal.modalEl.style.borderRadius = "6px";
modal.contentEl.style.padding = "4px";
const FULLSCREEN = "Goto fullscreen?";
let settings = ea.getScriptSettings() || {};
if(!settings[FULLSCREEN]) {
@@ -119,9 +94,7 @@ async function run() {
};
// Enter fullscreen view mode
if(enableFullscreen) {
requestFullscreen ();
}
if(enableFullscreen) ea.targetView.gotoFullscreen();
setTimeout(()=>toggleUIVisibility(true),100);
// Create floating toolbar modal
@@ -220,9 +193,7 @@ async function run() {
toggleUIVisibility(false);
// Exit fullscreen
if(ea.targetView && enableFullscreen) {
exitFullscreen();
}
if(ea.targetView && enableFullscreen) ea.targetView.exitFullscreen();
clearInterval(autocloseTimer);
delete window.excalidrawPalmGuard;
};
@@ -241,4 +212,4 @@ async function run() {
}, 100);
}
run();
run();
+1 -1
View File
@@ -1 +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="svg-icon lucide-hand"><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>
<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>

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 459 B

+1 -1
View File
@@ -1 +1 @@
<svg class="svg-icon lucide-printer" 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>
<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>

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 386 B

+4 -1
View File
@@ -1 +1,4 @@
<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="svg-icon lucide-a-large-small"><path d="m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"/><path d="M15.697 14h5.606"/><path d="m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"/><path d="M3.304 13h6.392"/></svg>
<svg viewBox="0 0 50 30" xmlns="http://www.w3.org/2000/svg">
<text fill="currentColor" x="10" y="30" font-size="16px" font-weight="light">A</text>
<text fill="currentColor" x="22" y="30" font-size="36px" font-weight="light">A</text>
</svg>

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 243 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-file-pen"><path d="M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z"/></svg>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" stroke="#000" viewBox="0 0 122.88 102.06"><path stroke-linecap="round" stroke-width="4" d="M8.18,23.12h67.09v5.39H8.18c-0.77,0-1.47,0.31-1.98,0.82c-0.5,0.51-0.82,1.21-0.82,1.98v39.46c0,0.77,0.31,1.47,0.82,1.98 c0.51,0.5,1.21,0.82,1.98,0.82h67.09v5.39H8.18c-2.24,0-4.29-0.92-5.77-2.4L2.4,76.53C0.92,75.05,0,73.01,0,70.76V31.3 c0-2.24,0.92-4.29,2.4-5.77l0.01-0.01C3.89,24.04,5.94,23.12,8.18,23.12L8.18,23.12z M71.77,53.85c-1.52,0-2.75-1.23-2.75-2.75 c0-1.52,1.23-2.75,2.75-2.75h12.78V18.04c-0.39-3.8-1.56-6.62-3.34-8.6c-1.93-2.16-4.67-3.43-7.99-3.98 c-1.49-0.24-2.51-1.65-2.26-3.15c0.24-1.49,1.65-2.51,3.15-2.26c4.54,0.75,8.37,2.57,11.19,5.74c0.72,0.8,1.37,1.69,1.94,2.66 c0.72-1.25,1.58-2.35,2.56-3.32c2.94-2.92,6.88-4.51,11.59-5.1c1.51-0.18,2.88,0.89,3.06,2.4c0.18,1.51-0.89,2.88-2.4,3.06 c-3.52,0.44-6.38,1.54-8.39,3.53c-1.99,1.97-3.25,4.91-3.61,9.04v5.07h24.65c2.24,0,4.29,0.92,5.77,2.4l0.01,0.01 c1.48,1.48,2.4,3.53,2.4,5.77v39.46c0,2.24-0.92,4.29-2.4,5.77l-0.01,0.01c-1.48,1.48-3.53,2.4-5.77,2.4H90.05v5.07 c0.36,4.13,1.62,7.08,3.61,9.04c2,1.98,4.86,3.09,8.39,3.53c1.51,0.18,2.58,1.56,2.4,3.06c-0.18,1.51-1.55,2.58-3.06,2.4 c-4.7-0.59-8.65-2.18-11.59-5.1c-0.98-0.97-1.84-2.07-2.56-3.32c-0.57,0.97-1.22,1.85-1.94,2.66c-2.83,3.16-6.66,4.99-11.19,5.74 c-1.49,0.24-2.9-0.77-3.15-2.26c-0.24-1.49,0.77-2.9,2.26-3.15c3.32-0.55,6.06-1.81,7.99-3.98c1.78-1.99,2.94-4.81,3.34-8.6 l0-30.17H71.77L71.77,53.85L71.77,53.85z M90.05,28.5v19.84h12.98c1.52,0,2.75,1.23,2.75,2.75c0,1.52-1.23,2.75-2.75,2.75H90.05 v19.71h24.65c0.77,0,1.47-0.31,1.98-0.82c0.5-0.51,0.82-1.21,0.82-1.98V31.3c0-0.77-0.31-1.47-0.82-1.98 c-0.51-0.5-1.21-0.82-1.98-0.82H90.05L90.05,28.5z"/></svg>

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 1.7 KiB

+1 -1
View File
@@ -1 +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="svg-icon lucide-square-stack"><path d="M4 10c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h4c1.1 0 2 .9 2 2"/><path d="M10 16c-1.1 0-2-.9-2-2v-4c0-1.1.9-2 2-2h4c1.1 0 2 .9 2 2"/><rect width="8" height="8" x="14" y="14" rx="2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 120" stroke="#000"><defs/><path fill="none" stroke-linecap="round" stroke-width="4" d="M10 110h200m-200 0h200M30 90h160M30 90h160M50 70h120M50 70h120M70 50h80m-80 0h80M90 30h40m-40 0h40M110 10s0 0 0 0m0 0s0 0 0 0"/></svg>

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 279 B

+7 -1
View File
@@ -1 +1,7 @@
<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="svg-icon lucide-repeat-1"><path d="m17 2 4 4-4 4"/><path d="M3 11v-1a4 4 0 0 1 4-4h14"/><path d="m7 22-4-4 4-4"/><path d="M21 13v1a4 4 0 0 1-4 4H3"/><path d="M11 10h1v4"/></svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><g><g><path fill="#000000" d="M101.2,18.7c-2,0.9-38,36.6-39.2,39c-1,1.9-1.1,4.2-0.4,6.2c0.6,1.5,37.3,38.6,39.3,39.6c1.7,0.9,5.2,0.8,7.1-0.1c1.9-0.9,3.7-3.5,4.1-5.8c0.6-3.5-0.2-4.5-12.5-16.8L88.2,69.2h44.3c38.7,0,44.8,0.1,48.6,0.7c24.2,4.2,43.2,22.6,48.1,46.8c3.3,16.4-1,34.2-11.5,47.6c-3.5,4.6-4.1,6.9-2.4,10.4c1.8,3.7,6.6,5.3,10.4,3.5c2.8-1.3,8.7-9.4,12.5-17.2c10.5-20.8,10.5-45.2,0-66.2c-10.3-20.6-28.6-34.8-51.8-40c-4.6-1.1-4.8-1.1-51.3-1.2c-25.7-0.1-46.7-0.3-46.7-0.5s5.2-5.5,11.5-11.9c9.4-9.4,11.6-11.9,12-13.3C113.6,21.6,107.3,16.1,101.2,18.7z"/><path fill="#000000" d="M34.9,73.4c-1.8,0.5-5.8,4.4-9.7,9.6c-7.9,10.4-12.8,22.4-14.5,35.4c-5.3,40.1,22.9,77.3,63.1,83.3c4,0.6,11.3,0.7,45.4,0.7c24,0,40.6,0.2,40.6,0.4c0,0.2-5,5.3-11.1,11.1c-11.3,11-12.9,13-12.9,16c0,4.1,3.8,7.9,7.9,7.9c0.7,0,2.1-0.3,3.1-0.7c2.3-1,38.1-36.6,39.3-39.2c1-2.1,1.1-4.2,0.4-6.1c-0.6-1.5-37.3-38.6-39.3-39.7c-1.9-1-6.1-0.6-8.1,0.8c-2.9,2-4,6.4-2.5,9.4c0.4,0.8,5.9,6.6,12.1,12.9l11.4,11.4h-40.4c-35,0-40.9-0.1-44.7-0.7c-24.2-4.1-43.4-22.9-48.2-47.1c-1.1-5.5-1.1-16.4,0-21.9c2.1-10.7,7-20.2,14.6-28.7c2.1-2.3,3.5-4.3,3.8-5.4c1-3.6-0.7-7.3-4.2-9C38.7,72.8,37.4,72.7,34.9,73.4z"/></g></g></g>
</svg>

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 1.6 KiB

+1 -1
View File
@@ -1 +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="svg-icon lucide-arrow-left-right"><path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M32 176h370.8l-57.38 57.38c-12.5 12.5-12.5 32.75 0 45.25C351.6 284.9 359.8 288 368 288s16.38-3.125 22.62-9.375l112-112c12.5-12.5 12.5-32.75 0-45.25l-112-112c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25L402.8 112H32c-17.69 0-32 14.31-32 32S14.31 176 32 176zM480 336H109.3l57.38-57.38c12.5-12.5 12.5-32.75 0-45.25s-32.75-12.5-45.25 0l-112 112c-12.5 12.5-12.5 32.75 0 45.25l112 112C127.6 508.9 135.8 512 144 512s16.38-3.125 22.62-9.375c12.5-12.5 12.5-32.75 0-45.25L109.3 400H480c17.69 0 32-14.31 32-32S497.7 336 480 336z"/></svg>

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 602 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-line-squiggle"><path d="M7 3.5c5-2 7 2.5 3 4C1.5 10 2 15 5 16c5 2 9-10 14-7s.5 13.5-4 12c-5-2.5.5-11 6-2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="100 80 500 400"><path d="M307.18 443.33a193.376 193.376 0 0 1-41.418-4.664 107.213 107.213 0 0 1-65.613-41.641 107.22 107.22 0 0 1-20.254-75.027c6.3-43.398 45.266-87.5 135.92-81.082a358.117 358.117 0 0 1 97.883 20.297 218.57 218.57 0 0 0-26.832-60.664c-22.285-35-49.934-55.066-81.668-59.5-66.617-9.102-133 49.582-133.58 50.168v-.004a11.664 11.664 0 0 1-19.957-9.09 11.655 11.655 0 0 1 4.324-8.176c3.035-2.8 75.016-66.617 152.25-56 39.316 5.368 72.566 28.934 98.7 70a233.33 233.33 0 0 1 33.831 84.47 245.007 245.007 0 0 1 106.52 91.116c3.219 5.606 1.29 12.762-4.32 15.98-5.606 3.223-12.762 1.29-15.98-4.316a223.277 223.277 0 0 0-83.652-75.016 148.281 148.281 0 0 1-25.781 88.668 129.381 129.381 0 0 1-110.37 54.48zm-8.285-180.02c-63.7 0-91.465 31.035-95.898 61.715v.004a83.522 83.522 0 0 0 16.199 58.66 83.522 83.522 0 0 0 51.699 32.105c54.367 11.668 100.8-2.684 127.4-40.484h.004a128.338 128.338 0 0 0 20.3-87.148 323.793 323.793 0 0 0-104.42-24.27c-5.366-.348-10.851-.465-15.284-.465z"/></svg>

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 1.0 KiB

+1 -1
View File
@@ -1 +1 @@
<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" class="svg-icon lucide-filter"><polygon fill="none" stroke-width="2" points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/></svg>
<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" class="lucide lucide-filter"><polygon fill="none" stroke-width="2" points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/></svg>

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 285 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-ruler-dimension-line"><path d="M10 15v-3"/><path d="M14 15v-3"/><path d="M18 15v-3"/><path d="M2 8V4"/><path d="M22 6H2"/><path d="M22 8V4"/><path d="M6 15v-3"/><rect x="2" y="12" width="20" height="8" rx="2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="110 80 500 400"><path d="M434 408.8a22.397 22.397 0 0 0-19.398 33.597A22.393 22.393 0 0 0 434 453.6h44.801a44.788 44.788 0 0 0 31.676-13.125 44.787 44.787 0 0 0 13.125-31.676v-257.6a44.788 44.788 0 0 0-13.125-31.676 44.787 44.787 0 0 0-31.676-13.125H434a22.403 22.403 0 0 0-19.398 33.601A22.399 22.399 0 0 0 434 151.198h44.801v56H434a22.397 22.397 0 0 0-19.398 11.199c-4 6.934-4 15.473 0 22.402A22.397 22.397 0 0 0 434 251.998h44.801v56H434a22.397 22.397 0 0 0-19.398 11.199c-4 6.93-4 15.469 0 22.402A22.397 22.397 0 0 0 434 352.798h44.801v56zM294 285.6v-97.105l28.953 28.953a22.42 22.42 0 0 0 21.648 5.8 22.42 22.42 0 0 0 15.848-15.847 22.419 22.419 0 0 0-5.8-21.648l-48.106-48.105a49.447 49.447 0 0 0-34.973-14.492 49.446 49.446 0 0 0-34.969 14.492l-48.105 48.105a22.41 22.41 0 0 0 10.047 37.496 22.419 22.419 0 0 0 21.648-5.801l29.008-28.953v183.01l-28.953-28.953a22.42 22.42 0 0 0-21.648-5.8 22.42 22.42 0 0 0-15.848 15.847 22.419 22.419 0 0 0 5.801 21.648l48.105 48.105a49.452 49.452 0 0 0 34.973 14.492 49.463 49.463 0 0 0 34.973-14.492l48.105-48.105h-.004a22.413 22.413 0 0 0-31.695-31.695L294 371.505z"/></svg>

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 1.1 KiB

+1 -1
View File
@@ -1 +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="svg-icon lucide-grid-3x3"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M9 3v18"/><path d="M15 3v18"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M448 32C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H448zM448 96H288V224H448V96zM448 288H288V416H448V288zM224 224V96H64V224H224zM64 416H224V288H64V416z"/></svg>

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 297 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-link-alias"><path d="M9 8h1a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-1M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1M5.5 12h0m3 0h0M16.75 8s-1.75 1.333-1.75 4 1.75 4 1.75 4M20.25 8s1.75 1.333 1.75 4-1.75 4-1.75 4"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 111 60" stroke="#000"><path fill="none" stroke-linecap="round" stroke-width="4" d="M20 10.333H10m10 0H10m0 0v40m0-40v40m0 0h10m-10 0h10M50 10.333h10m-10 0h10m0 0v40m0-40v40m0 0H50m10 0H50M80 10c-1.65 3.33-9.87 13.22-9.92 20-.04 6.78 8.06 17.22 9.67 20.67M80 10c-1.65 3.33-9.87 13.22-9.92 20-.04 6.78 8.06 17.22 9.67 20.67M90 10.333c1.85 3.22 10.96 12.67 11.08 19.33.13 6.67-8.61 17.23-10.33 20.67m-.75-40c1.85 3.22 10.96 12.67 11.08 19.33.13 6.67-8.61 17.23-10.33 20.67"/><g stroke-linecap="round"><path stroke-width="0" d="M23 30.333c0 .14-.01.29-.04.43-.02.15-.06.29-.11.43-.05.13-.11.26-.18.39-.08.13-.16.25-.25.36-.1.11-.2.21-.31.31-.11.09-.23.17-.36.25-.13.07-.26.13-.39.18-.14.05-.28.09-.43.11-.14.03-.29.04-.43.04s-.29-.01-.43-.04c-.15-.02-.29-.06-.43-.11a3.39 3.39 0 0 1-.39-.18c-.13-.08-.25-.16-.36-.25-.11-.1-.21-.2-.31-.31-.09-.11-.17-.23-.25-.36a3.39 3.39 0 0 1-.18-.39c-.05-.14-.09-.28-.11-.43-.03-.14-.04-.29-.04-.43s.01-.29.04-.43c.02-.15.06-.29.11-.43.05-.13.11-.26.18-.39.08-.13.16-.25.25-.36.1-.11.2-.21.31-.31.11-.09.23-.17.36-.25.13-.07.26-.13.39-.18.14-.05.28-.09.43-.11.14-.03.29-.04.43-.04s.29.01.43.04c.15.02.29.06.43.11.13.05.26.11.39.18.13.08.25.16.36.25.11.1.21.2.31.31.09.11.17.23.25.36.07.13.13.26.18.39.05.14.09.28.11.43.03.14.03.36.04.43.01.07.01-.07 0 0"/><path fill="none" stroke-width="4" d="M23 30.333c0 .14-.01.29-.04.43-.02.15-.06.29-.11.43-.05.13-.11.26-.18.39-.08.13-.16.25-.25.36-.1.11-.2.21-.31.31-.11.09-.23.17-.36.25-.13.07-.26.13-.39.18-.14.05-.28.09-.43.11-.14.03-.29.04-.43.04s-.29-.01-.43-.04c-.15-.02-.29-.06-.43-.11a3.39 3.39 0 0 1-.39-.18c-.13-.08-.25-.16-.36-.25-.11-.1-.21-.2-.31-.31-.09-.11-.17-.23-.25-.36a3.39 3.39 0 0 1-.18-.39c-.05-.14-.09-.28-.11-.43-.03-.14-.04-.29-.04-.43s.01-.29.04-.43c.02-.15.06-.29.11-.43.05-.13.11-.26.18-.39.08-.13.16-.25.25-.36.1-.11.2-.21.31-.31.11-.09.23-.17.36-.25.13-.07.26-.13.39-.18.14-.05.28-.09.43-.11.14-.03.29-.04.43-.04s.29.01.43.04c.15.02.29.06.43.11.13.05.26.11.39.18.13.08.25.16.36.25.11.1.21.2.31.31.09.11.17.23.25.36.07.13.13.26.18.39.05.14.09.28.11.43.03.14.03.36.04.43.01.07.01-.07 0 0"/></g><g stroke-linecap="round"><path stroke-width="0" d="M38 30.333c0 .14-.01.29-.04.43-.02.15-.06.29-.11.43-.05.13-.11.26-.18.39-.08.13-.16.25-.25.36-.1.11-.2.21-.31.31-.11.09-.23.17-.36.25-.13.07-.26.13-.39.18-.14.05-.28.09-.43.11-.14.03-.29.04-.43.04s-.29-.01-.43-.04c-.15-.02-.29-.06-.43-.11a3.39 3.39 0 0 1-.39-.18c-.13-.08-.25-.16-.36-.25-.11-.1-.21-.2-.31-.31-.09-.11-.17-.23-.25-.36a3.39 3.39 0 0 1-.18-.39c-.05-.14-.09-.28-.11-.43-.03-.14-.04-.29-.04-.43s.01-.29.04-.43c.02-.15.06-.29.11-.43.05-.13.11-.26.18-.39.08-.13.16-.25.25-.36.1-.11.2-.21.31-.31.11-.09.23-.17.36-.25.13-.07.26-.13.39-.18.14-.05.28-.09.43-.11.14-.03.29-.04.43-.04s.29.01.43.04c.15.02.29.06.43.11.13.05.26.11.39.18.13.08.25.16.36.25.11.1.21.2.31.31.09.11.17.23.25.36.07.13.13.26.18.39.05.14.09.28.11.43.03.14.03.36.04.43.01.07.01-.07 0 0"/><path fill="none" stroke-width="4" d="M38 30.333c0 .14-.01.29-.04.43-.02.15-.06.29-.11.43-.05.13-.11.26-.18.39-.08.13-.16.25-.25.36-.1.11-.2.21-.31.31-.11.09-.23.17-.36.25-.13.07-.26.13-.39.18-.14.05-.28.09-.43.11-.14.03-.29.04-.43.04s-.29-.01-.43-.04c-.15-.02-.29-.06-.43-.11a3.39 3.39 0 0 1-.39-.18c-.13-.08-.25-.16-.36-.25-.11-.1-.21-.2-.31-.31-.09-.11-.17-.23-.25-.36a3.39 3.39 0 0 1-.18-.39c-.05-.14-.09-.28-.11-.43-.03-.14-.04-.29-.04-.43s.01-.29.04-.43c.02-.15.06-.29.11-.43.05-.13.11-.26.18-.39.08-.13.16-.25.25-.36.1-.11.2-.21.31-.31.11-.09.23-.17.36-.25.13-.07.26-.13.39-.18.14-.05.28-.09.43-.11.14-.03.29-.04.43-.04s.29.01.43.04c.15.02.29.06.43.11.13.05.26.11.39.18.13.08.25.16.36.25.11.1.21.2.31.31.09.11.17.23.25.36.07.13.13.26.18.39.05.14.09.28.11.43.03.14.03.36.04.43.01.07.01-.07 0 0"/></g><g stroke-linecap="round"><path stroke-width="0" d="M53 30.333c0 .14-.01.29-.04.43-.02.15-.06.29-.11.43-.05.13-.11.26-.18.39-.08.13-.16.25-.25.36-.1.11-.2.21-.31.31-.11.09-.23.17-.36.25-.13.07-.26.13-.39.18-.14.05-.28.09-.43.11-.14.03-.29.04-.43.04s-.29-.01-.43-.04c-.15-.02-.29-.06-.43-.11a3.39 3.39 0 0 1-.39-.18c-.13-.08-.25-.16-.36-.25-.11-.1-.21-.2-.31-.31-.09-.11-.17-.23-.25-.36a3.39 3.39 0 0 1-.18-.39c-.05-.14-.09-.28-.11-.43-.03-.14-.04-.29-.04-.43s.01-.29.04-.43c.02-.15.06-.29.11-.43.05-.13.11-.26.18-.39.08-.13.16-.25.25-.36.1-.11.2-.21.31-.31.11-.09.23-.17.36-.25.13-.07.26-.13.39-.18.14-.05.28-.09.43-.11.14-.03.29-.04.43-.04s.29.01.43.04c.15.02.29.06.43.11.13.05.26.11.39.18.13.08.25.16.36.25.11.1.21.2.31.31.09.11.17.23.25.36.07.13.13.26.18.39.05.14.09.28.11.43.03.14.03.36.04.43.01.07.01-.07 0 0"/><path fill="none" stroke-width="4" d="M53 30.333c0 .14-.01.29-.04.43-.02.15-.06.29-.11.43-.05.13-.11.26-.18.39-.08.13-.16.25-.25.36-.1.11-.2.21-.31.31-.11.09-.23.17-.36.25-.13.07-.26.13-.39.18-.14.05-.28.09-.43.11-.14.03-.29.04-.43.04s-.29-.01-.43-.04c-.15-.02-.29-.06-.43-.11a3.39 3.39 0 0 1-.39-.18c-.13-.08-.25-.16-.36-.25-.11-.1-.21-.2-.31-.31-.09-.11-.17-.23-.25-.36a3.39 3.39 0 0 1-.18-.39c-.05-.14-.09-.Line truncated

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 5.3 KiB

@@ -1 +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="svg-icon lucide-pen-tool"><g transform="rotate(180 12 11.75)"><path d="M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z"/><path d="m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18"/><path d="m2.3 2.3 7.286 7.286"/><circle cx="11" cy="11" r="2"/></g><path d="M3 22h8"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="100 100 500 350"><g fill-rule="evenodd"><path d="M451.65 485.81a12.407 12.407 0 0 1 8.77 3.61c2.324 2.316 3.632 5.456 3.632 8.734s-1.308 6.422-3.633 8.738a12.387 12.387 0 0 1-8.769 3.606H227.29c-6.828-.012-12.359-5.536-12.359-12.344s5.531-12.332 12.359-12.344zM415.18 49.504l-226.5 130.56 74.664 62.102 168.47-96.812zM446.52 165.6 273.6 264.725l-8.512 70.004 225.14 128.82-72.148-123.81c-16.746 3.625-34.938-3.559-43.906-19.094-11.164-19.238-4.351-44.207 14.895-55.348 6.012-3.438 12.617-5.25 19.148-5.398 14.348-.332 28.555 7.062 36.168 20.25 8.977 15.469 6.336 34.55-5.027 47.25l71.371 122.46.582-256.88z"/><path d="M408.99 284.59h-.191c-2.461.09-5.07.828-7.352 2.121-7.934 4.594-10.383 13.73-5.8 21.602 4.28 7.441 13.948 10.082 21.468 5.785 7.887-4.601 10.371-13.75 5.805-21.598-2.914-5.062-8.406-7.976-13.926-7.906z"/></g></svg>

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 881 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-text-align-start"><path d="M21 4.5H3 M15 9.5H3 M17 14.5H3 M15 19.5H3"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M256 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H256C273.7 32 288 46.33 288 64C288 81.67 273.7 96 256 96zM256 352H32C14.33 352 0 337.7 0 320C0 302.3 14.33 288 32 288H256C273.7 288 288 302.3 288 320C288 337.7 273.7 352 256 352zM0 192C0 174.3 14.33 160 32 160H416C433.7 160 448 174.3 448 192C448 209.7 433.7 224 416 224H32C14.33 224 0 209.7 0 192zM416 480H32C14.33 480 0 465.7 0 448C0 430.3 14.33 416 32 416H416C433.7 416 448 430.3 448 448C448 465.7 433.7 480 416 480z"/></svg>

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 553 B

@@ -1 +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="svg-icon lucide-paint-bucket"><path d="M11 7 6 2"/><path d="M18.992 12H2.041"/><path d="M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595"/><path d="m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M41.37 9.372C53.87-3.124 74.13-3.124 86.63 9.372L168 90.74L221.1 37.66C249.2 9.539 294.8 9.539 322.9 37.66L474.3 189.1C502.5 217.2 502.5 262.8 474.3 290.9L283.9 481.4C246.4 518.9 185.6 518.9 148.1 481.4L30.63 363.9C-6.863 326.4-6.863 265.6 30.63 228.1L122.7 135.1L41.37 54.63C28.88 42.13 28.88 21.87 41.37 9.372V9.372zM217.4 230.6L168 181.3L75.88 273.4C71.69 277.6 68.9 282.6 67.52 288H386.7L429.1 245.7C432.2 242.5 432.2 237.5 429.1 234.3L277.7 82.91C274.5 79.79 269.5 79.79 266.3 82.91L213.3 136L262.6 185.4C275.1 197.9 275.1 218.1 262.6 230.6C250.1 243.1 229.9 243.1 217.4 230.6L217.4 230.6zM448 448C448 422.8 480.6 368.4 499.2 339.3C505.3 329.9 518.7 329.9 524.8 339.3C543.4 368.4 576 422.8 576 448C576 483.3 547.3 512 512 512C476.7 512 448 483.3 448 448H448z"/></svg>

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 843 B

+83 -153
View File
@@ -23,27 +23,17 @@ const HELP_TEXT = `
- 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>
😍 If you find this script helpful, please [buy me a coffee ☕](https://ko-fi.com/zsolt).
<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.");
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.0")) {
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
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:
@@ -59,10 +49,22 @@ interface ColorMap {
};
*/
// Main script state variables
let allElements = [];
let svgImageElements = [];
let lastSelectionIds = "";
// 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;
}
const originalColors = new Map();
const currentColors = new Map();
@@ -93,11 +95,10 @@ if(!settings[STROKE]) {
}
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 =>
const allElements = ea.getViewSelectedElements();
return allElements.filter(el =>
["rectangle", "ellipse", "diamond", "line", "arrow", "freedraw", "text"].includes(el.type)
);
}
@@ -119,10 +120,6 @@ 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;
@@ -148,7 +145,6 @@ async function storeOriginalColors() {
}
function copyOriginalsToCurrent() {
currentColors.clear();
for (const [key, value] of originalColors.entries()) {
if(value.type === "regular") {
currentColors.set(key, {...value});
@@ -328,40 +324,26 @@ function slider(contentEl, action, min, max, step, invert) {
}
}
let debounceColorPicker = true;
function showModal() {
let debounceColorPicker = true;
const modal = new ea.FloatingModal(app);
let dirty = false;
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);" }
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; " }
});
return;
}
//helpDetailsDiv.innerHTML = HELP_TEXT;
await ea.obsidian.MarkdownRenderer.render(ea.plugin.app, HELP_TEXT, helpDetailsDiv, "", ea.plugin);
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")
@@ -407,7 +389,6 @@ function renderSidepanel(contentEl) {
// 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));
@@ -423,8 +404,6 @@ function renderSidepanel(contentEl) {
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)
@@ -559,7 +538,7 @@ function renderSidepanel(contentEl) {
paletteButton.settingEl.style.padding = "0";
paletteButton.settingEl.style.border = "0";
paletteButton.infoEl.style.display = "none";
// Store references to the components
colorInputs.set(color, {
textInput,
@@ -603,39 +582,50 @@ function renderSidepanel(contentEl) {
});
}
}
}
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();
})
);
}
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("Reset")
.onClick(() => {
for (const resetter of sliderResetters) {
resetter();
}
copyOriginalsToCurrent();
setColors(originalColors);
}))
.addButton(button => button
.setButtonText("Close")
.setCta(true)
.onClick(() => modal.close()));
const maxHeight = Math.round(height * 0.6);
const maxWidth = Math.round(width * 0.9);
modalEl.style.maxHeight = `${maxHeight}px`;
modalEl.style.maxWidth = `${maxWidth}px`;
};
buttons.addButton(button => button
.setButtonText("Close")
.onClick(() => {
if(ea.sidepanelTab) {
ea.sidepanelTab.close();
}
ea.toggleSidepanelView();
}));
modal.onClose = () => {
terminate = true;
if (dirty) {
ea.setScriptSettings(settings);
}
if(ea.targetView.isDirty()) {
ea.targetView.save(false);
}
};
modal.open();
}
function executeChange(isDecrease, step, action) {
@@ -721,66 +711,6 @@ function run(action="Hue", isDecrease=true, step=0) {
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();
});
await storeOriginalColors();
showModal();
processQueue();
+1 -1
View File
@@ -1 +1 @@
<svg class="svg-icon lucide-swatch-book" 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="M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z"/><path d="M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7"/><path d="M 7 17h.01"/><path d="m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8"/></svg>
<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="M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z"/><path d="M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7"/><path d="M 7 17h.01"/><path d="m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8"/></svg>

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 434 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-projector"><path d="M5 7 3 5"/><path d="M9 6V3"/><path d="m13 7 2-2"/><circle cx="9" cy="13" r="3"/><path d="M11.83 12H20a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h2.17"/><path d="M16 16h2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 190 145.438" stroke="#000" fill="#fff"><path fill="none" stroke-linecap="round" stroke-width="8" d="M20 60.438h150m-150 0h150m0 0c10 0 15 5 15 15m-15-15c10 0 15 5 15 15m0 0v30m0-30v30m0 0c0 10-5 15-15 15m15-15c0 10-5 15-15 15m0 0H20m150 0H20m0 0c-10 0-15-5-15-15m15 15c-10 0-15-5-15-15m0 0v-30m0 30v-30m0 0c0-10 5-15 15-15m-15 15c0-10 5-15 15-15"/><g stroke-linecap="round"><path fill="var(--input-bg-color)" stroke-width="8" d="M165 90.438c0 2.18-.14 4.37-.43 6.53-.28 2.15-.71 4.31-1.27 6.41-.57 2.1-1.27 4.18-2.11 6.19-.83 2.01-1.8 3.99-2.89 5.87a51.975 51.975 0 0 1-3.63 5.44 53.055 53.055 0 0 1-4.31 4.92c-1.54 1.53-3.2 2.98-4.92 4.31a51.975 51.975 0 0 1-5.44 3.63 49.145 49.145 0 0 1-5.87 2.89c-2.01.84-4.09 1.54-6.19 2.11-2.1.56-4.26.99-6.41 1.27-2.16.29-4.35.43-6.53.43-2.18 0-4.37-.14-6.53-.43-2.15-.28-4.31-.71-6.41-1.27-2.1-.57-4.18-1.27-6.19-2.11-2.01-.83-3.99-1.8-5.87-2.89a51.975 51.975 0 0 1-5.44-3.63 53.055 53.055 0 0 1-4.92-4.31c-1.53-1.54-2.98-3.2-4.31-4.92a51.975 51.975 0 0 1-3.63-5.44 49.145 49.145 0 0 1-2.89-5.87c-.84-2.01-1.54-4.09-2.11-6.19-.56-2.1-.99-4.26-1.27-6.41-.29-2.16-.43-4.35-.43-6.53 0-2.18.14-4.37.43-6.53.28-2.15.71-4.31 1.27-6.41.57-2.1 1.27-4.18 2.11-6.19.83-2.01 1.8-3.99 2.89-5.87s2.31-3.71 3.63-5.44c1.33-1.72 2.78-3.38 4.31-4.92 1.54-1.53 3.2-2.98 4.92-4.31 1.73-1.32 3.56-2.54 5.44-3.63 1.88-1.09 3.86-2.06 5.87-2.89 2.01-.84 4.09-1.54 6.19-2.11 2.1-.56 4.26-.99 6.41-1.27 2.16-.29 4.35-.43 6.53-.43 2.18 0 4.37.14 6.53.43 2.15.28 4.31.71 6.41 1.27 2.1.57 4.18 1.27 6.19 2.11 2.01.83 3.99 1.8 5.87 2.89s3.71 2.31 5.44 3.63c1.72 1.33 3.38 2.78 4.92 4.31 1.53 1.54 2.98 3.2 4.31 4.92 1.32 1.73 2.54 3.56 3.63 5.44 1.09 1.88 2.06 3.86 2.89 5.87.84 2.01 1.54 4.09 2.11 6.19.56 2.1.99 4.26 1.27 6.41.29 2.16.36 5.44.43 6.53.07 1.09.07-1.09 0 0"/><path fill="none" stroke-width="8" d="M165 90.438c0 2.18-.14 4.37-.43 6.53-.28 2.15-.71 4.31-1.27 6.41-.57 2.1-1.27 4.18-2.11 6.19-.83 2.01-1.8 3.99-2.89 5.87a51.975 51.975 0 0 1-3.63 5.44 53.055 53.055 0 0 1-4.31 4.92c-1.54 1.53-3.2 2.98-4.92 4.31a51.975 51.975 0 0 1-5.44 3.63 49.145 49.145 0 0 1-5.87 2.89c-2.01.84-4.09 1.54-6.19 2.11-2.1.56-4.26.99-6.41 1.27-2.16.29-4.35.43-6.53.43-2.18 0-4.37-.14-6.53-.43-2.15-.28-4.31-.71-6.41-1.27-2.1-.57-4.18-1.27-6.19-2.11-2.01-.83-3.99-1.8-5.87-2.89a51.975 51.975 0 0 1-5.44-3.63 53.055 53.055 0 0 1-4.92-4.31c-1.53-1.54-2.98-3.2-4.31-4.92a51.975 51.975 0 0 1-3.63-5.44 49.145 49.145 0 0 1-2.89-5.87c-.84-2.01-1.54-4.09-2.11-6.19-.56-2.1-.99-4.26-1.27-6.41-.29-2.16-.43-4.35-.43-6.53 0-2.18.14-4.37.43-6.53.28-2.15.71-4.31 1.27-6.41.57-2.1 1.27-4.18 2.11-6.19.83-2.01 1.8-3.99 2.89-5.87s2.31-3.71 3.63-5.44c1.33-1.72 2.78-3.38 4.31-4.92 1.54-1.53 3.2-2.98 4.92-4.31 1.73-1.32 3.56-2.54 5.44-3.63 1.88-1.09 3.86-2.06 5.87-2.89 2.01-.84 4.09-1.54 6.19-2.11 2.1-.56 4.26-.99 6.41-1.27 2.16-.29 4.35-.43 6.53-.43 2.18 0 4.37.14 6.53.43 2.15.28 4.31.71 6.41 1.27 2.1.57 4.18 1.27 6.19 2.11 2.01.83 3.99 1.8 5.87 2.89s3.71 2.31 5.44 3.63c1.72 1.33 3.38 2.78 4.92 4.31 1.53 1.54 2.98 3.2 4.31 4.92 1.32 1.73 2.54 3.56 3.63 5.44 1.09 1.88 2.06 3.86 2.89 5.87.84 2.01 1.54 4.09 2.11 6.19.56 2.1.99 4.26 1.27 6.41.29 2.16.36 5.44.43 6.53.07 1.09.07-1.09 0 0"/></g><path fill="none" stroke-linecap="round" stroke-width="8" d="m101 29.438-20-20m20 20-20-20M115 29.438V4.997m0 24.44V4.997M129 29.438l20-20m-20 20 20-20M25 120.438v20m0-20v20M165 120.438v20m0-20v20"/><g stroke-linecap="round"><path stroke-width="0" d="M50.244 90.111c0 .25-.02.5-.06.74-.05.24-.11.48-.2.71-.08.23-.18.46-.31.67a4.257 4.257 0 0 1-1.54 1.54c-.21.13-.44.23-.67.31-.23.09-.47.15-.71.2a4.524 4.524 0 0 1-1.47 0c-.24-.05-.48-.11-.71-.2-.23-.08-.46-.18-.67-.31a4.257 4.257 0 0 1-1.54-1.54c-.13-.21-.23-.44-.32-.67a5.71 5.71 0 0 1-.19-.71 4.524 4.524 0 0 1 0-1.47c.05-.24.11-.48.19-.71.09-.23.19-.46.32-.67a4.257 4.257 0 0 1 1.54-1.54c.21-.13.44-.23.67-.32.23-.08.47-.14.71-.19a4.493 4.493 0 0 1 1.47 0c.24.05.48.11.71.19.23.09.46.19.67.32a4.257 4.257 0 0 1 1.54 1.54c.13.21.23.44.31.67.09.23.15.47.2.71.04.24.05.61.06.73.01.13.01-.12 0 0"/><path fill="none" stroke-width="8" d="M50.244 90.111c0 .25-.02.5-.06.74-.05.24-.11.48-.2.71-.08.23-.18.46-.31.67a4.257 4.257 0 0 1-1.54 1.54c-.21.13-.44.23-.67.31-.23.09-.47.15-.71.2a4.524 4.524 0 0 1-1.47 0c-.24-.05-.48-.11-.71-.2-.23-.08-.46-.18-.67-.31a4.257 4.257 0 0 1-1.54-1.54c-.13-.21-.23-.44-.32-.67a5.71 5.71 0 0 1-.19-.71 4.524 4.524 0 0 1 0-1.47c.05-.24.11-.48.19-.71.09-.23.19-.46.32-.67a4.257 4.257 0 0 1 1.54-1.54c.21-.13.44-.23.67-.32.23-.08.47-.14.71-.19a4.493 4.493 0 0 1 1.47 0c.24.05.48.11.71.19.23.09.46.19.67.32a4.257 4.257 0 0 1 1.54 1.54c.13.21.23.44.31.67.09.23.15.47.2.71.04.24.05.61.06.73.01.13.01-.12 0 0"/></g><g stroke-linecap="round"><path stroke-width="0" d="M29.437 90.111c0 .25-.02.5-.06.74-.05.24-.11.48-.2.71-.08.23-.18.46-.31.67a4.257 4.257 0 0 1-1.54 1.54c-.21.13-.44.23-.67.31-.23.09-.47.15-.71.2a4.524 4.524 0 0 1-1.47 0c-.24-.05-.48-.11-.71-.2-.23-.08-.46-.18-.67-.31a4.Line truncated

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 5.9 KiB

+10 -1
View File
@@ -1 +1,10 @@
<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="svg-icon lucide-ellipse-slash"><ellipse cx="12" cy="12" rx="10" ry="7"/><path d="M22 2 2 22"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 156.01944 159.27567">
<g
id="layer1"
transform="translate(-26.537155,-79.352678)">
<path
d="m 63.646518,79.35271 c -0.490272,0.0012 -0.981154,0.03861 -1.468128,0.112138 -1.298603,0.196162 -2.54592,0.646235 -3.670577,1.324467 -1.124629,0.677685 -2.104844,1.570274 -2.884578,2.626713 -0.779502,1.056481 -1.343361,2.256195 -1.65933,3.530534 -0.316216,1.274341 -0.37838,2.598559 -0.182935,3.89692 0.195591,1.298277 0.644957,2.545404 1.3224,3.67006 l 11.601876,19.253088 c -0.345867,0.1298 -0.699453,0.25003 -1.042314,0.38344 -1.048727,0.40806 -2.083433,0.83293 -3.10317,1.27434 -1.019736,0.44141 -2.024327,0.89943 -3.013769,1.37356 -0.989442,0.47413 -1.963426,0.96448 -2.921269,1.47071 -0.957843,0.50623 -1.899693,1.02809 -2.824634,1.5658 -0.92494,0.5377 -1.833131,1.09129 -2.723864,1.65984 -0.890734,0.56856 -1.765912,1.15531 -2.62413,1.7601 -0.858217,0.6048 -1.699713,1.22768 -2.522326,1.86759 -0.822614,0.63991 -1.626267,1.29703 -2.410189,1.97094 -0.783922,0.6739 -1.548156,1.36441 -2.2903,2.07119 -0.742144,0.70678 -1.462279,1.42981 -2.159558,2.16834 -0.697278,0.73853 -1.371739,1.49272 -2.021065,2.26188 -0.649326,0.76916 -1.273951,1.55312 -1.872237,2.3518 -0.598286,0.79867 -1.169949,1.61206 -1.714107,2.43912 -0.544159,0.82706 -1.060766,1.668 -1.547709,2.52233 -0.486944,0.85433 -0.944334,1.72195 -1.370976,2.60242 -0.426642,0.88048 -0.822204,1.77393 -1.185458,2.67943 -0.363253,0.9055 -0.694376,1.82288 -0.991154,2.75228 -0.296777,0.92941 -0.559301,1.8709 -0.786515,2.82309 -0.227213,0.95218 -0.419045,1.91538 -0.573608,2.88923 -0.154563,0.97384 -0.272058,1.95789 -0.350883,2.95227 -0.07882,0.99439 -0.118856,1.99894 -0.118856,3.01274 0,1.0138 0.04003,2.01835 0.118856,3.01273 0.07883,0.99439 0.19632,1.97895 0.350883,2.9528 0.154563,0.97384 0.346395,1.93704 0.573608,2.88922 0.227214,0.95219 0.489738,1.89317 0.786515,2.82257 0.296778,0.9294 0.627901,1.84731 0.991154,2.7528 0.363254,0.9055 0.758816,1.79844 1.185458,2.67891 0.426642,0.88048 0.884032,1.7481 1.370976,2.60243 0.486943,0.85432 1.00355,1.69578 1.547709,2.52284 0.544158,0.82706 1.115821,1.63994 1.714107,2.43861 0.598286,0.79867 1.222911,1.58315 1.872237,2.35231 0.649326,0.76916 1.323787,1.52335 2.021065,2.26188 0.697279,0.73853 1.417414,1.46105 2.159558,2.16783 0.742144,0.70677 1.506378,1.3978 2.2903,2.0717 0.783922,0.67391 1.587575,1.33103 2.410189,1.97094 0.822613,0.63991 1.664109,1.26228 2.522326,1.86707 0.858218,0.60479 1.733396,1.19206 2.62413,1.76062 0.890733,0.56855 1.798924,1.12162 2.723864,1.65933 0.924941,0.5377 1.866791,1.06008 2.824634,1.56631 0.957843,0.50623 1.931827,0.99658 2.921269,1.47071 0.989442,0.47414 1.994033,0.93163 3.013769,1.37305 1.019737,0.44141 2.054443,0.86627 3.10317,1.27434 1.048728,0.40806 2.111505,0.79948 3.187919,1.17357 1.076415,0.37409 2.166771,0.73124 3.269568,1.07073 1.102797,0.3395 2.218173,0.66157 3.346049,0.96584 1.127876,0.30427 2.267778,0.59043 3.41943,0.85886 1.151651,0.26842 2.31507,0.5189 3.489192,0.75086 1.174123,0.23195 2.359016,0.44541 3.554305,0.64027 1.19529,0.19485 2.401164,0.371 3.616317,0.52813 1.215153,0.15713 2.439966,0.29566 3.673678,0.41445 1.233712,0.11878 2.476453,0.21784 3.727421,0.29765 1.250967,0.0798 2.510111,0.14013 3.777029,0.18035 1.26692,0.0402 2.54146,0.0605 3.82302,0.0605 1.28157,0 2.55611,-0.0202 3.82303,-0.0605 1.26691,-0.0402 2.52606,-0.10053 3.77703,-0.18035 1.25096,-0.0798 2.49371,-0.17887 3.72742,-0.29765 1.23371,-0.11879 2.45852,-0.25732 3.67368,-0.41445 1.21515,-0.15713 2.42102,-0.33328 3.61631,-0.52813 0.93043,-0.15168 1.84907,-0.32397 2.76676,-0.49816 l 13.09997,21.73924 c 0.67785,1.12469 1.5706,2.10488 2.62723,2.88458 1.05657,0.77994 2.25644,1.34414 3.53105,1.66036 1.27473,0.31618 2.59928,0.37817 3.89796,0.18242 1.29854,-0.19585 2.54583,-0.64556 3.67057,-1.32343 0.37386,-0.22521 0.73258,-0.47466 1.07384,-0.74673 0.34117,-0.27227 0.66416,-0.5666 0.96687,-0.88108 0.3028,-0.31437 0.5847,-0.64823 0.84387,-0.99942 0.25908,-0.35128 0.49489,-0.71915 0.7059,-1.10123 0.21116,-0.38206 0.39708,-0.77755 0.55656,-1.18391 0.15933,-0.4062 0.29191,-0.8224 0.39687,-1.24592 0.10503,-0.42375 0.18219,-0.85393 0.231,-1.28777 0.0488,-0.43366 0.0692,-0.87006 0.061,-1.30638 -0.008,-0.43653 -0.045,-0.87207 -0.11007,-1.3038 -0.0652,-0.43145 -0.15861,-0.85819 -0.27957,-1.27744 -0.12076,-0.41955 -0.26887,-0.83074 -0.44338,-1.23093 -0.1746,-0.39992 -0.37519,-0.78798 -0.60048,-1.16169 l -10.43709,-17.32039 c 0.26843,-0.11306 0.54439,-0.21747 0.8108,-0.33279 1.01973,-0.44141 2.02434,-0.89892 3.01377,-1.37305 0.98944,-0.47413 1.96344,-0.96448 2.92127,-1.47071 0.95784,-0.50623 1.89971,-1.02861 2.82464,-1.56631 0.92493,-0.5377 1.83314,-1.09078 2.72386,-1.65933 0.89073,-0.56855 1.76592,-1.15583 2.62413,-1.76062 0.85821,-0.60478 1.69972,-1.22717 2.52233,-1.86707 0.8226,-0.6399 1.62679,-1.29704 2.4107,-1.97094 0.78392,-0.67389 1.54765,-1.36493 2.28979,-2.0717 0.74213,-0.70678 1.46228,-1.42931 2.15955,-2.16783 0.69728,-0.73853 1.37175,-1.49272 2.02107,-2.26188 0.64932,-0.76915 1.27396,-1.55364 1.87224,-2.35231 0.59828,-0.79866 1.16995,-1.61156 1.7141,-2.43861 0.54416,-0.82705 1.06077,-1.66852 1.54771,-2.52284 0.4Line truncated
style="stroke-linecap:round"
id="path7" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 11 KiB

+1 -1
View File
@@ -23,5 +23,5 @@ elements.forEach((el)=>{
ea.addText(el.x,el.y+i*el.height/text.length,text[i].trim());
}
});
await ea.addElementsToView(false,false,true);
ea.addElementsToView(false,false,true);
ea.deleteViewElements(elements);
+1 -1
View File
@@ -1 +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="svg-icon lucide-list"><path d="M3 5h.01"/><path d="M3 12h.01"/><path d="M3 19h.01"/><path d="M8 5h13"/><path d="M8 12h13"/><path d="M8 19h13"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="100 80 500 400"><path d="M309.12 184.8c0 21.957-17.801 39.758-39.762 39.758-21.957 0-39.758-17.801-39.758-39.758 0-21.961 17.801-39.762 39.758-39.762 21.961 0 39.762 17.801 39.762 39.762M341.6 159.04h179.2v51.52H341.6zM309.12 282.24c0 21.961-17.801 39.762-39.762 39.762-21.957 0-39.758-17.801-39.758-39.762 0-21.957 17.801-39.758 39.758-39.758 21.961 0 39.762 17.801 39.762 39.758M341.6 256.48h179.2V308H341.6zM309.12 379.12c0 21.957-17.801 39.758-39.762 39.758-21.957 0-39.758-17.801-39.758-39.758 0-21.961 17.801-39.762 39.758-39.762 21.961 0 39.762 17.801 39.762 39.762M341.6 353.36h179.2v51.52H341.6z"/></svg>

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 662 B

+17 -1
View File
@@ -1 +1,17 @@
<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="svg-icon lucide-type-outline"><path d="M14 16.5a.5.5 0 0 0 .5.5h.5a2 2 0 0 1 0 4H9a2 2 0 0 1 0-4h.5a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5V8a2 2 0 0 1-4 0V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v3a2 2 0 0 1-4 0v-.5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5Z"/></svg>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="120" height="120">
<!-- svg-source:excalidraw -->
<defs>
<style class="style-fonts">
@font-face {
font-family: "Virgil";
src: url("https://excalidraw.com/Virgil.woff2");
}
@font-face {
font-family: "Cascadia";
src: url("https://excalidraw.com/Cascadia.woff2");
}
</style>
</defs>
<g stroke-linecap="round"><g transform="translate(0 0) rotate(0 60 60)" fill-rule="evenodd"><path d="M0 0 L120 0 L120 40 L80 40 L80 120 L40 120 L40 40 L0 40 L0 0" stroke="none" stroke-width="0" fill="red" fill-rule="evenodd"></path><path d="M0 0 C41.51 0, 83.02 0, 120 0 M0 0 C30.58 0, 61.16 0, 120 0 M120 0 C120 12.11, 120 24.22, 120 40 M120 0 C120 13.92, 120 27.84, 120 40 M120 40 C108.75 40, 97.49 40, 80 40 M120 40 C107.65 40, 95.29 40, 80 40 M80 40 C80 66.51, 80 93.01, 80 120 M80 40 C80 70.33, 80 100.66, 80 120 M80 120 C66.08 120, 52.16 120, 40 120 M80 120 C70.07 120, 60.13 120, 40 120 M40 120 C40 89.21, 40 58.42, 40 40 M40 120 C40 92.66, 40 65.33, 40 40 M40 40 C25.35 40, 10.71 40, 0 40 M40 40 C27.7 40, 15.4 40, 0 40 M0 40 C0 24.03, 0 8.05, 0 0 M0 40 C0 27.82, 0 15.65, 0 0 M0 0 C0 0, 0 0, 0 0 M0 0 C0 0, 0 0, 0 0" stroke="transparent" stroke-width="0.5" fill="none"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(110 10) rotate(0 -50 50)" fill-rule="evenodd"><path d="M0 0 L-100 0 L-100 20 L-60 20 L-60 100 L-40 100 L-40 20 L0 20 L0 0" stroke="none" stroke-width="0" fill="currentColor" fill-rule="evenodd"></path><path d="M0 0 C-23.27 0, -46.54 0, -100 0 M0 0 C-23.31 0, -46.62 0, -100 0 M-100 0 C-100 6.13, -100 12.26, -100 20 M-100 0 C-100 5.84, -100 11.69, -100 20 M-100 20 C-87.37 20, -74.74 20, -60 20 M-100 20 C-88.34 20, -76.68 20, -60 20 M-60 20 C-60 37.78, -60 55.56, -60 100 M-60 20 C-60 39.34, -60 58.68, -60 100 M-60 100 C-52.58 100, -45.17 100, -40 100 M-60 100 C-54.72 100, -49.43 100, -40 100 M-40 100 C-40 83.83, -40 67.67, -40 20 M-40 100 C-40 77.76, -40 55.51, -40 20 M-40 20 C-25.4 20, -10.8 20, 0 20 M-40 20 C-28.47 20, -16.93 20, 0 20 M0 20 C0 15.42, 0 10.84, 0 0 M0 20 C0 14.54, 0 9.08, 0 0 M0 0 C0 0, 0 0, 0 0 M0 0 C0 0, 0 0, 0 0" stroke="currentColor" stroke-width="0.5" fill="none"></path></g></g><mask></mask></svg>

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 2.3 KiB

+345 -633
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-circle-ellipsis"><g stroke-width="2" fill="none"><circle cx="12" cy="12" r="10"></circle><path d="M17 12h.01"></path><path d="M12 12h.01"></path><path d="M7 12h.01"></path></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" stroke="#000" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><g stroke-width="2" fill="none"><circle cx="12" cy="12" r="10"></circle><path d="M17 12h.01"></path><path d="M12 12h.01"></path><path d="M7 12h.01"></path></g></svg>

Before

Width:  |  Height:  |  Size: 375 B

After

Width:  |  Height:  |  Size: 327 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-grip"><circle stroke-width="2" cx="12" cy="5" r="1"></circle><circle stroke-width="2" cx="19" cy="5" r="1"></circle><circle stroke-width="2" cx="5" cy="5" r="1"></circle><circle stroke-width="2" cx="12" cy="12" r="1"></circle><circle stroke-width="2" cx="19" cy="12" r="1"></circle><circle stroke-width="2" cx="5" cy="12" r="1"></circle><circle stroke-width="2" cx="12" cy="19" r="1"></circle><circle stroke-width="2" cx="19" cy="19" r="1"></circle><circle stroke-width="2" cx="5" cy="19" r="1"></circle></svg>
<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"><circle stroke-width="2" cx="12" cy="5" r="1"></circle><circle stroke-width="2" cx="19" cy="5" r="1"></circle><circle stroke-width="2" cx="5" cy="5" r="1"></circle><circle stroke-width="2" cx="12" cy="12" r="1"></circle><circle stroke-width="2" cx="19" cy="12" r="1"></circle><circle stroke-width="2" cx="5" cy="12" r="1"></circle><circle stroke-width="2" cx="12" cy="19" r="1"></circle><circle stroke-width="2" cx="19" cy="19" r="1"></circle><circle stroke-width="2" cx="5" cy="19" r="1"></circle></svg>

Before

Width:  |  Height:  |  Size: 714 B

After

Width:  |  Height:  |  Size: 685 B

+4 -1
View File
@@ -1 +1,4 @@
<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="svg-icon lucide-grid-2x2-x"><path d="M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3"/><path d="m16 16 5 5"/><path d="m16 21 5-5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 567 489">
<path
d="M 20.803582,0.35478208 A 25,25 0 0 0 5.9442069,8.8176728 25,25 0 0 0 8.8172543,44.055954 L 31.254754,63.108689 c -0.121266,0.849954 -0.301322,1.680716 -0.388672,2.541015 -0.218469,2.151668 -0.330078,4.335551 -0.330078,6.544922 V 392.19462 c 0,2.20625 0.111609,4.38587 0.330078,6.53516 0.218468,2.14929 0.544482,4.26807 0.970703,6.34961 0.426219,2.08154 0.952918,4.12591 1.576172,6.12891 0.623252,2.00299 1.342775,3.96328 2.152343,5.87695 0.80957,1.91367 1.708193,3.7802 2.69336,5.59375 0.985166,1.81355 2.056984,3.57472 3.207031,5.27734 1.150047,1.70264 2.379385,3.34681 3.683594,4.92774 1.304208,1.58093 2.683206,3.09844 4.130859,4.54687 1.447654,1.44844 2.964542,2.82767 4.544922,4.13282 1.58038,1.30514 3.223392,2.53642 4.925781,3.6875 1.70239,1.15106 3.463664,2.22277 5.277344,3.20898 1.81368,0.98621 3.679496,1.88672 5.59375,2.69727 1.914254,0.81053 3.87675,1.5302 5.880859,2.15429 2.00411,0.6241 4.049565,1.15323 6.132813,1.58008 2.083248,0.42686 4.203801,0.75188 6.355469,0.9707 2.151667,0.21883 4.335552,0.33204 6.544922,0.33203 H 478.53601 c 2.20625,0 4.38587,-0.1132 6.53515,-0.33203 2.14929,-0.21882 4.26808,-0.54384 6.34961,-0.9707 0.30707,-0.063 0.59887,-0.16503 0.9043,-0.23242 l 33.48047,28.43164 a 25,25 0 0 0 35.23828,-2.87305 25,25 0 0 0 -2.87305,-35.23828 L 41.182488,5.9446259 A 25,25 0 0 0 29.485222,0.40556338 25,25 0 0 0 20.803582,0.35478208 Z M 94.536004,8.1946259 c -2.209366,0 -4.39326,0.1116097 -6.544922,0.3300781 -2.151664,0.2184684 -4.272226,0.5425319 -6.355469,0.9687499 -2.083244,0.42622 -4.128707,0.9548741 -6.132813,1.5781251 -2.004105,0.623253 -3.966609,1.340824 -5.880859,2.150391 -0.337447,0.142712 -0.651869,0.326303 -0.986328,0.474609 l 68.884767,58.498047 h 93.49024 23.52539 v 19.978516 79.392578 l 109.07422,92.6289 h 93.49218 21.4336 v 18.20313 79.39258 l 60.42383,51.31445 c 0.22119,-0.63745 0.49391,-1.25011 0.69531,-1.89648 0.62409,-2.00299 1.15127,-4.04738 1.57812,-6.12891 0.42686,-2.08153 0.75188,-4.20033 0.97071,-6.34961 0.21882,-2.14928 0.33203,-4.32892 0.33203,-6.53516 V 336.74736 271.15166 72.194626 c 0,-2.209349 -0.11321,-4.393275 -0.33203,-6.544922 -0.21882,-2.151647 -0.54386,-4.272242 -0.97071,-6.355469 -0.42685,-2.083227 -0.95403,-4.128722 -1.57812,-6.132812 -0.62409,-2.00409 -1.34376,-3.966624 -2.1543,-5.88086 -0.81054,-1.914234 -1.71302,-3.780086 -2.69922,-5.59375 -0.98619,-1.813662 -2.05792,-3.574971 -3.20898,-5.277343 -1.15106,-1.702373 -2.38041,-3.34737 -3.68555,-4.927735 -1.30514,-1.580364 -2.68439,-3.097282 -4.13281,-4.544922 -1.44842,-1.447638 -2.96596,-2.82471 -4.54688,-4.128906 -1.5809,-1.304195 -3.22708,-2.535511 -4.92968,-3.685547 -1.70262,-1.150034 -3.46187,-2.219921 -5.27539,-3.205078 -1.81353,-0.985156 -3.68011,-1.885752 -5.59375,-2.695312 -1.91366,-0.809561 -3.87593,-1.527143 -5.87891,-2.150391 -2.00298,-0.623246 -4.04739,-1.1519091 -6.12891,-1.5781251 -2.08151,-0.426215 -4.20034,-0.7502832 -6.34961,-0.9687499 -2.14925,-0.2184666 -4.32893,-0.3300781 -6.53515,-0.3300781 H 232.88952 155.64538 Z M 318.53601,72.194626 h 160 V 200.19462 H 458.97937 381.73718 318.53601 V 146.52275 80.927048 Z M 94.536004,116.84892 192.67859,200.19462 H 94.536004 Z m 0,147.3457 H 254.53601 v 128 H 94.536004 Z m 224.000006,42.87891 100.23437,85.12109 H 318.53601 Z" />
</svg>

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 3.3 KiB

+1 -1
View File
@@ -1 +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="svg-icon lucide-layout-grid"><rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M40 352c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0zm192 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0zM40 320l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40zM232 192c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0zM40 160l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40L40 32C17.9 32 0 49.9 0 72l0 48c0 22.1 17.9 40 40 40zM232 32c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0z"/></svg>

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 930 B

+1 -1
View File
@@ -1 +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="svg-icon lucide-fullscreen"><path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><rect width="10" height="8" x="7" y="8" rx="1"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7c-12.23-91.55-87.28-166-178.9-177.6c-136.2-17.24-250.7 97.28-233.4 233.4c11.6 91.64 86.07 166.7 177.6 178.9c53.81 7.191 104.3-6.235 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 .0003C515.9 484.7 515.9 459.3 500.3 443.7zM288 232H231.1V288c0 13.26-10.74 24-23.1 24C194.7 312 184 301.3 184 288V232H127.1C114.7 232 104 221.3 104 208s10.74-24 23.1-24H184V128c0-13.26 10.74-24 23.1-24S231.1 114.7 231.1 128v56h56C301.3 184 312 194.7 312 208S301.3 232 288 232z"/></svg>

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 602 B

+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":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
[{"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
+6 -23
View File
@@ -1,14 +1,6 @@
<div style="text-align:center;margin-bottom:20px;">
<a href="https://community.sketch-your-mind.com/em" target="_blank"><img src="https://sketch-your-mind.com/images/logo-EM.png" style="width:50%; max-width: 200px;"></a>
</div>
If you are enjoying the Excalidraw plugin then please support my work and enthusiasm by buying me a coffee on [https://ko-fi/zsolt](https://ko-fi.com/zsolt).
**It looks like you want to get more out of Excalidraw!**
Scripts are a true superpower in Excalidraw. If you are ready to eliminate tool friction and build heavy-duty workflows, join[Excalidraw Mastery](https://community.sketch-your-mind.com/em). Master Excalidraw and Visual PKM alongside a supportive community of fellow visual thinkers in the [Sketch Your Mind Community](https://community.sketch-your-mind.com)!
---
If you are enjoying the Excalidraw plugin then please support my work and enthusiasm by buying me a coffee on [https://ko-fi/zsolt](https://ko-fi.com/zsolt). [<img src="https://user-images.githubusercontent.com/14358394/115450238-f39e8100-a21b-11eb-89d0-fa4b82cdbce8.png" class="coffee">](https://ko-fi.com/zsolt)
[<img src="https://user-images.githubusercontent.com/14358394/115450238-f39e8100-a21b-11eb-89d0-fa4b82cdbce8.png" class="coffee">](https://ko-fi.com/zsolt)
---
@@ -21,16 +13,6 @@ Script Engine scripts are installed in the `Downloaded` subfolder of the `Excali
In the `Command Palette` installed scripts are prefixed with `Downloaded/`, thus you can always know if you are executing a local script of your own, or one that you have downloaded from GitHub.
## Create Your Own Scripts with AI Superpowers
You don't need to know how to code to build custom scripts! In this video, I show how to create powerful, custom Excalidraw scripts from scratch using the power of AI.
Follow along as I generate a complete Layer Manager script for Excalidraw in Obsidian, allowing you to hide, show, lock, and manage elements on different layers. I'll walk you through the entire process, from using a custom training library for Excalidraw Automate to prompting Google's Gemini AI Studio to write the code for us. Discover how to unlock a true superpower for your Obsidian and Excalidraw workflow by generating any script you can imagine.
<div class="excalidraw-videoWrapper">
<a href="https://youtu.be/6BjhUyfS4iM" target="_blank"><img src="https://i.ytimg.com/vi/6BjhUyfS4iM/maxresdefault.jpg" style="width:560px;"></a>
</div>
## Attention developers and hobby hackers
<img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/hobby-programmer.svg' align='left' style='background-color:whitesmoke; width:80px; margin-right:15px; margin-bottom:10px;'/>
If you want to modify scripts, I recommend moving them to the `Excalidraw Automate script folder` or a different subfolder under the script folder. Scripts in the `Downloaded` folder will be overwritten when you click the `Update this script` button. Note also, that at this time, I do not check if the script file has been updated on GitHub, thus the `Update this script` button is always visible once you have installed a script, not only when an update is available (hope to build this feature in the future).
@@ -38,7 +20,8 @@ If you want to modify scripts, I recommend moving them to the `Excalidraw Automa
I would love to include your contribution in the script library. If you have a script of your own that you would like to share with the community, please open a [PR](https://github.com/zsviczian/obsidian-excalidraw-plugin/pulls) on GitHub. Be sure to include the following in your pull request
- The [script file](https://github.com/zsviczian/obsidian-excalidraw-plugin/tree/master/ea-scripts) with a self explanetory name. The name of the file will be the name of the script in the Command Palette.
- An [image](https://github.com/zsviczian/obsidian-excalidraw-plugin/tree/master/images) explaining the scripts purpose. Remember a picture speaks thousand words!
- An update to this file[ea-scripts/index-new.md](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/index-new.md)
- An update to this file [ea-scripts/index-new.md](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/index-new.md)
---
# List of available scripts
@@ -94,7 +77,7 @@ These are the scripts I use most often. I tried to order them by importance, but
|<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/ea-scripts/Mindmap%20Builder.svg"/></div>|[[#Mindmap Builder]]|
|<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]]|
@@ -487,7 +470,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/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>
<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.<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><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-mindmap-builder.png'></td></tr></table>
## Mindmap connector
```excalidraw-script-install
-776
View File
@@ -1,776 +0,0 @@
/*
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();
});
+2 -2
View File
@@ -1,8 +1,8 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.22.3",
"minAppVersion": "1.5.7",
"version": "2.19.0",
"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",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.22.3",
"version": "2.19.0",
"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",
+8147 -2991
View File
File diff suppressed because it is too large. Load diff
+11 -12
View File
@@ -17,20 +17,20 @@
"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",
"doc": "npm run lib && node scripts/generate-script-library.js",
"mindmap": "node scripts/deploy-mindmap-builder.js"
"doc": "npm run lib && node scripts/generate-script-library.js"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/excalidraw": "0.18.0-90",
"@zsviczian/excalidraw": "0.18.0-67",
"chroma-js": "^3.1.2",
"clsx": "^2.0.0",
"@zsviczian/colormaster": "^1.2.2",
"gl-matrix": "^3.4.3",
"js-yaml": "^4.1.0",
"lucide-react": "^0.479.0",
"mathjax-full": "^3.2.2",
"monkey-around": "^2.3.0",
"nanoid": "^4.0.2",
@@ -47,11 +47,11 @@
"@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
"@codemirror/commands": "6.8.1",
"@codemirror/language": "6.11.0",
"@codemirror/search": "6.5.11",
"@codemirror/state": "6.5.0",
"@codemirror/view": "6.38.6",
"@codemirror/commands": "^6.3.3",
"@codemirror/language": "^6.10.0",
"@codemirror/search": "^6.5.5",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.23.0",
"@excalidraw/eslint-config": "^1.0.3",
"@excalidraw/prettier-config": "^1.0.2",
"@rollup/plugin-babel": "^6.0.3",
@@ -63,7 +63,7 @@
"@types/chroma-js": "^3.1.1",
"@types/js-beautify": "^1.14.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "20.19.37",
"@types/node": "^20.10.5",
"@types/opentype.js": "^1.3.8",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
@@ -74,8 +74,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"lz-string": "^1.5.0",
"obsidian": "1.12.3",
"postcss": "^8.4.31",
"obsidian": "^1.10.0",
"prettier": "^3.0.1",
"rollup": "^2.70.1",
"rollup-plugin-copy": "^3.5.0",
@@ -84,7 +83,7 @@
"rollup-plugin-typescript2": "^0.36.0",
"tslib": "^2.8.1",
"ttypescript": "^1.5.15",
"typescript": "5.9.3",
"typescript": "^5.7.3",
"fs-extra": "^11.2.0",
"uglify-js": "^3.19.3"
},
+1 -4
View File
@@ -103,10 +103,7 @@ if (!isLib) {
const plugin_styles = fs.readFileSync("./styles.css", "utf8");
const styles = excalidraw_styles + plugin_styles;
cssnano()
.process(styles, {
from: path.resolve("styles.css"),
to: path.resolve(DIST_FOLDER, "styles.css"),
})
.process(styles) // Process the CSS
.then(result => {
fs.writeFileSync(`./${DIST_FOLDER}/styles.css`, result.css);
})
-137
View File
@@ -1,137 +0,0 @@
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)
> API documentation: [MindMapBuilderAPI.md](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/docs/ea-script-docs/MindMapBuilderAPI.md)
## 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.21.0")) {
new Notice("Please update the Excalidraw Plugin to version 2.21.0 or higher.");
return;
}
ea.skipSidepanelScriptRestore();
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;
});
+2 -5
View File
@@ -261,8 +261,6 @@ const TYPE_DEF_WHITELIST = [
"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",
];
/**
@@ -554,9 +552,8 @@ function main() {
.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'
d.name.endsWith('.md') &&
d.name.toLowerCase() !== 'index-new.md'
)
.map((d) => d.name)
.sort((a, b) => a.localeCompare(b, 'en', { sensitivity: 'base' }));
+456 -93
View File
@@ -1,47 +1,53 @@
import { getIcon } from "obsidian";
import { Bookmark, Camera, Copy, Crop, Globe, RotateCcw, Scan, Settings, TextSelect } from "lucide-react";
import * as React from "react";
import { PenStyle } from "src/types/penTypes";
import React from "react";
const toReactAttributeName = (attributeName: string) => {
if (attributeName === "class") return "className";
if (attributeName.startsWith("aria-") || attributeName.startsWith("data-")) {
return attributeName;
}
return attributeName.replace(/[-:]+([a-z])/g, (_, char: string) => char.toUpperCase());
};
const getIconAttributes = (icon: SVGSVGElement) =>
[...icon.attributes].reduce<Record<string, string>>((attributes, attr) => {
attributes[toReactAttributeName(attr.nodeName)] = attr.nodeValue;
return attributes;
}, {});
export const getIconAsJSX = (iconId: string) => {
const icon = getIcon(iconId);
if (!icon) return (<svg className="svg-icon excalidraw-icon-missing"/>);
return (
<svg
{...getIconAttributes(icon as SVGSVGElement)}
dangerouslySetInnerHTML={{__html: icon.innerHTML}}
/>
);
};
export const ICONS = {
ExportImage: getIconAsJSX("image-down"),
Info: getIconAsJSX("info"),
BackOfNote: getIconAsJSX("text-select"),
Reload: getIconAsJSX("rotate-ccw"),
Copy: getIconAsJSX("copy"),
Globe: getIconAsJSX("globe"),
Crop: getIconAsJSX("crop"),
Bookmark: getIconAsJSX("bookmark"),
Camera: getIconAsJSX("camera"),
ZoomToSelectedElement: getIconAsJSX("scan"),
Properties: getIconAsJSX("settings"),
ZoomToSection: getIconAsJSX("hash"),
ExportImage: (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<g strokeWidth="1.25">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M15 8h.01"></path>
<path d="M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"></path>
<path d="M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"></path>
<path d="M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"></path>
<path d="M19 16v6"></path>
<path d="M22 19l-3 3l-3 -3"></path>
</g>
</svg>
),
BackOfNote: (<TextSelect />),
Reload: (<RotateCcw />),
Copy: (<Copy /> ),
Globe: (<Globe />),
Crop: (<Crop />),
Bookmark: (<Bookmark />),
Camera: (<Camera />),
ZoomToSelectedElement: (<Scan />),
Properties: (<Settings />),
ZoomToSection: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="1"
strokeLinecap="round"
strokeLinejoin="round"
>
<text x="6" y="18" fontSize="22px">#</text>
</svg>
),
ZoomToBlock: (
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -55,11 +61,101 @@ export const ICONS = {
<text x="1" y="18" fontSize="22px">#^</text>
</svg>
),
Learn: getIconAsJSX("graduation-cap"),
Github: getIconAsJSX("github"),
YouTube: getIconAsJSX("youtube"),
heart: getIconAsJSX("heart"),
twitter: getIconAsJSX("twitter"),
Learn: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z"/>
<path d="M22 10v6"/>
<path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5"/>
</svg>
),
Discord: (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="var(--icon-fill-color)"
stroke="none"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="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>
),
Github: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path
d="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>
),
YouTube: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path
d="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>
)
,
heart: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path
d="M20.42 4.58a5.4 5.4 0 0 0-7.65 0l-.77.78-.77-.78a5.4 5.4 0 0 0-7.65 0C1.46 6.7 1.33 10.28 4 13l8 8 8-8c2.67-2.72 2.54-6.3.42-8.42z">
</path>
</svg>
),
twitter: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path
d="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>
),
exportLibrary: (
<svg
aria-hidden="true"
@@ -141,38 +237,142 @@ export const ICONS = {
/>
</svg>
),
insertImage: getIconAsJSX("image"),
insertMD: getIconAsJSX("file-text"),
insertLaTeX: getIconAsJSX("sigma"),
insertLink: getIconAsJSX("link"),
search: getIconAsJSX("search"),
//far fa-image
insertImage: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
fill="var(--icon-fill-color)"
stroke="none"
>
<path
d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"
/>
</svg>
),
//far fa-file-alt
insertMD: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 384 512"
fill="var(--icon-fill-color)"
stroke="none"
>
<path d="M288 248v28c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-28c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm-12 72H108c-6.6 0-12 5.4-12 12v28c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-28c0-6.6-5.4-12-12-12zm108-188.1V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48C0 21.5 21.5 0 48 0h204.1C264.8 0 277 5.1 286 14.1L369.9 98c9 8.9 14.1 21.2 14.1 33.9zm-128-80V128h76.1L256 51.9zM336 464V176H232c-13.3 0-24-10.7-24-24V48H48v416h288z" />
</svg>
),
//far fa-square-root-alt
insertLaTeX: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 576 512"
stroke="none"
fill="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M571.31 251.31l-22.62-22.62c-6.25-6.25-16.38-6.25-22.63 0L480 274.75l-46.06-46.06c-6.25-6.25-16.38-6.25-22.63 0l-22.62 22.62c-6.25 6.25-6.25 16.38 0 22.63L434.75 320l-46.06 46.06c-6.25 6.25-6.25 16.38 0 22.63l22.62 22.62c6.25 6.25 16.38 6.25 22.63 0L480 365.25l46.06 46.06c6.25 6.25 16.38 6.25 22.63 0l22.62-22.62c6.25-6.25 6.25-16.38 0-22.63L525.25 320l46.06-46.06c6.25-6.25 6.25-16.38 0-22.63zM552 0H307.65c-14.54 0-27.26 9.8-30.95 23.87l-84.79 322.8-58.41-106.1A32.008 32.008 0 0 0 105.47 224H24c-13.25 0-24 10.74-24 24v48c0 13.25 10.75 24 24 24h43.62l88.88 163.73C168.99 503.5 186.3 512 204.94 512c17.27 0 44.44-9 54.28-41.48L357.03 96H552c13.25 0 24-10.75 24-24V24c0-13.26-10.75-24-24-24z" />
</svg>
),
//fas fa-link
insertLink: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
stroke="none"
fill="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" />
</svg>
),
//fa-solid fa-magnifying-glass
search: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
stroke="var(--icon-fill-color)"
fill="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z" />
</svg>
),
ocr: (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
viewBox="0 0 24 24" fill="none" stroke="var(--icon-fill-color)"
strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"
className="svg-icon lucide-scan-line-2">
<path d="M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2M7.5,17l4.05,-9.7a.5,.5 0 0 1 .9,0l4.05,9.7M8.8,14h6.4" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="m6 18 6-12 6 12"></path><path d="M8 14h8"></path><path d="M3 7V5a2 2 0 0 1 2-2h2"></path><path d="M17 3h2a2 2 0 0 1 2 2v2"></path><path d="M21 17v2a2 2 0 0 1-2 2h-2"></path><path d="M7 21H5a2 2 0 0 1-2-2v-2"></path>
</svg>
),
scriptEngine: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
stroke="var(--icon-fill-color)"
fill="var(--icon-fill-color)"
strokeLinecap="round"
strokeWidth="4"
>
<g transform="translate(-8,-8)">
<path
d="M24.318 37.983c-1.234-1.232-8.433-3.903-7.401-7.387 1.057-3.484 9.893-12.443 13.669-13.517 3.776-1.074 6.142 6.523 9.012 7.073 2.87.55 6.797-1.572 8.207-3.694 1.384-2.148-3.147-7.413.15-9.168 3.298-1.755 16.389-2.646 19.611-1.284 3.247 1.363-1.611 7.335-.151 9.483 1.46 2.148 6.067 3.746 8.836 3.38 2.769-.368 4.154-6.733 7.728-5.633 3.575 1.1 12.36 8.828 13.67 12.233 1.308 3.406-5.186 5.423-5.79 8.2-.58 2.75-.026 6.705 2.265 8.355 2.266 1.65 9.642-1.78 11.404 1.598 1.762 3.38 1.007 15.35-.806 18.651-1.787 3.353-7.753-.367-9.969 1.31-2.215 1.65-3.901 5.92-3.373 8.67.504 2.777 7.754 4.48 6.445 7.885C96.49 87.543 87.15 95.454 83.5 96.685c-3.65 1.231-4.96-4.741-7.577-5.16-2.593-.393-6.57.707-8.03 2.75-1.436 2.017 2.668 7.806-.63 9.483-3.323 1.676-15.759 2.226-19.157.655-3.373-1.598.554-7.964-1.108-10.138-1.687-2.174-6.394-3.431-9.012-2.907-2.643.55-3.273 7.282-6.747 6.103-3.499-1.126-12.788-9.535-14.172-13.019-1.36-3.484 5.437-5.108 5.966-7.858.529-2.777-.68-7.073-2.744-8.697-2.064-1.624-7.93 2.41-9.642-1.126-1.737-3.537-2.441-16.765-.654-20.118 1.787-3.3 9.062 1.598 11.429.183 2.366-1.44 2.316-7.282 2.769-8.749m.126-.104c-1.234-1.232-8.433-3.903-7.401-7.387 1.057-3.484 9.893-12.443 13.669-13.517 3.776-1.074 6.142 6.523 9.012 7.073 2.87.55 6.797-1.572 8.207-3.694 1.384-2.148-3.147-7.413.15-9.168 3.298-1.755 16.389-2.646 19.611-1.284 3.247 1.363-1.611 7.335-.151 9.483 1.46 2.148 6.067 3.746 8.836 3.38 2.769-.368 4.154-6.733 7.728-5.633 3.575 1.1 12.36 8.828 13.67 12.233 1.308 3.406-5.186 5.423-5.79 8.2-.58 2.75-.026 6.705 2.265 8.355 2.266 1.65 9.642-1.78 11.404 1.598 1.762 3.38 1.007 15.35-.806 18.651-1.787 3.353-7.753-.367-9.969 1.31-2.215 1.65-3.901 5.92-3.373 8.67.504 2.777 7.754 4.48 6.445 7.885C96.49 87.543 87.15 95.454 83.5 96.685c-3.65 1.231-4.96-4.741-7.577-5.16-2.593-.393-6.57.707-8.03 2.75-1.436 2.017 2.668 7.806-.63 9.483-3.323 1.676-15.759 2.226-19.157.655-3.373-1.598.554-7.964-1.108-10.138-1.687-2.174-6.394-3.431-9.012-2.907-2.643.55-3.273 7.282-6.747 6.103-3.499-1.126-12.788-9.535-14.172-13.019-1.36-3.484 5.437-5.108 5.966-7.858.529-2.777-.68-7.073-2.744-8.697-2.064-1.624-7.93 2.41-9.642-1.126-1.737-3.537-2.441-16.765-.654-20.118 1.787-3.3 9.062 1.598 11.429.183 2.366-1.44 2.316-7.282 2.769-8.749" fill="none" strokeWidth="2"/>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
stroke="var(--icon-fill-color)"
fill="var(--icon-fill-color)"
strokeLinecap="round"
strokeWidth="4"
>
<g transform="translate(-8,-8)">
<path d="M24.318 37.983c-1.234-1.232-8.433-3.903-7.401-7.387 1.057-3.484 9.893-12.443 13.669-13.517 3.776-1.074 6.142 6.523 9.012 7.073 2.87.55 6.797-1.572 8.207-3.694 1.384-2.148-3.147-7.413.15-9.168 3.298-1.755 16.389-2.646 19.611-1.284 3.247 1.363-1.611 7.335-.151 9.483 1.46 2.148 6.067 3.746 8.836 3.38 2.769-.368 4.154-6.733 7.728-5.633 3.575 1.1 12.36 8.828 13.67 12.233 1.308 3.406-5.186 5.423-5.79 8.2-.58 2.75-.026 6.705 2.265 8.355 2.266 1.65 9.642-1.78 11.404 1.598 1.762 3.38 1.007 15.35-.806 18.651-1.787 3.353-7.753-.367-9.969 1.31-2.215 1.65-3.901 5.92-3.373 8.67.504 2.777 7.754 4.48 6.445 7.885C96.49 87.543 87.15 95.454 83.5 96.685c-3.65 1.231-4.96-4.741-7.577-5.16-2.593-.393-6.57.707-8.03 2.75-1.436 2.017 2.668 7.806-.63 9.483-3.323 1.676-15.759 2.226-19.157.655-3.373-1.598.554-7.964-1.108-10.138-1.687-2.174-6.394-3.431-9.012-2.907-2.643.55-3.273 7.282-6.747 6.103-3.499-1.126-12.788-9.535-14.172-13.019-1.36-3.484 5.437-5.108 5.966-7.858.529-2.777-.68-7.073-2.744-8.697-2.064-1.624-7.93 2.41-9.642-1.126-1.737-3.537-2.441-16.765-.654-20.118 1.787-3.3 9.062 1.598 11.429.183 2.366-1.44 2.316-7.282 2.769-8.749m.126-.104c-1.234-1.232-8.433-3.903-7.401-7.387 1.057-3.484 9.893-12.443 13.669-13.517 3.776-1.074 6.142 6.523 9.012 7.073 2.87.55 6.797-1.572 8.207-3.694 1.384-2.148-3.147-7.413.15-9.168 3.298-1.755 16.389-2.646 19.611-1.284 3.247 1.363-1.611 7.335-.151 9.483 1.46 2.148 6.067 3.746 8.836 3.38 2.769-.368 4.154-6.733 7.728-5.633 3.575 1.1 12.36 8.828 13.67 12.233 1.308 3.406-5.186 5.423-5.79 8.2-.58 2.75-.026 6.705 2.265 8.355 2.266 1.65 9.642-1.78 11.404 1.598 1.762 3.38 1.007 15.35-.806 18.651-1.787 3.353-7.753-.367-9.969 1.31-2.215 1.65-3.901 5.92-3.373 8.67.504 2.777 7.754 4.48 6.445 7.885C96.49 87.543 87.15 95.454 83.5 96.685c-3.65 1.231-4.96-4.741-7.577-5.16-2.593-.393-6.57.707-8.03 2.75-1.436 2.017 2.668 7.806-.63 9.483-3.323 1.676-15.759 2.226-19.157.655-3.373-1.598.554-7.964-1.108-10.138-1.687-2.174-6.394-3.431-9.012-2.907-2.643.55-3.273 7.282-6.747 6.103-3.499-1.126-12.788-9.535-14.172-13.019-1.36-3.484 5.437-5.108 5.966-7.858.529-2.777-.68-7.073-2.744-8.697-2.064-1.624-7.93 2.41-9.642-1.126-1.737-3.537-2.441-16.765-.654-20.118 1.787-3.3 9.062 1.598 11.429.183 2.366-1.44 2.316-7.282 2.769-8.749" fill="none" strokeWidth="2"/>
<path d="M81.235 56.502a23.3 23.3 0 0 1-1.46 8.068 20.785 20.785 0 0 1-1.762 3.72 24.068 24.068 0 0 1-5.337 6.26 22.575 22.575 0 0 1-3.449 2.358 23.726 23.726 0 0 1-7.803 2.803 24.719 24.719 0 0 1-8.333 0 24.102 24.102 0 0 1-4.028-1.074 23.71 23.71 0 0 1-3.776-1.729 23.259 23.259 0 0 1-6.369-5.265 23.775 23.775 0 0 1-2.416-3.353 24.935 24.935 0 0 1-1.762-3.72 23.765 23.765 0 0 1-1.083-3.981 23.454 23.454 0 0 1 0-8.173c.252-1.336.604-2.698 1.083-3.956a24.935 24.935 0 0 1 1.762-3.72 22.587 22.587 0 0 1 2.416-3.378c.881-1.048 1.888-2.017 2.946-2.908a24.38 24.38 0 0 1 3.423-2.357 23.71 23.71 0 0 1 3.776-1.73 21.74 21.74 0 0 1 4.028-1.047 23.437 23.437 0 0 1 8.333 0 24.282 24.282 0 0 1 7.803 2.777 26.198 26.198 0 0 1 3.45 2.357 24.62 24.62 0 0 1 5.336 6.287 20.785 20.785 0 0 1 1.762 3.72 21.32 21.32 0 0 1 1.083 3.955c.251 1.336.302 3.405.377 4.086.05.681.05-.68 0 0" fill="none"/>
<path d="M69.404 56.633c-6.596-3.3-13.216-6.6-19.51-9.744m19.51 9.744c-6.747-3.379-13.493-6.758-19.51-9.744m0 0v19.489m0-19.49v19.49m0 0c4.355-2.148 8.71-4.322 19.51-9.745m-19.51 9.745c3.978-1.965 7.93-3.956 19.51-9.745m0 0h0m0 0h0"/>
</g>
</svg>
),
openLink: getIconAsJSX("file-symlink"),
openLinkProperties: getIconAsJSX("file-code"),
openLink: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v7"/>
<polyline points="14 2 14 8 20 8"/>
<path d="m10 18 3-3-3-3"/>
<path d="M4 18v-1a2 2 0 0 1 2-2h6"/>
</svg>
),
openLinkProperties: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="3"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M10 12.5 8 15l2 2.5"/>
<path d="m14 12.5 2 2.5-2 2.5"/>
<path d="M14 2v4a2 2 0 0 0 2 2h4"/>
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"/>
</svg>
),
//fa-brands fa-markdown
switchToMarkdown: (
<svg
@@ -188,11 +388,80 @@ export const ICONS = {
<path d="M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z" />
</svg>
),
gotoFullScreen: getIconAsJSX("maximize"),
exitFullScreen: getIconAsJSX("minimize"),
releaseNotes: getIconAsJSX("megaphone"),
rawMode: getIconAsJSX("code-xml"),
parsedMode: getIconAsJSX("glasses"),
//fa-solid fa-expand
gotoFullScreen: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
stroke="var(--icon-fill-color)"
fill="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M128 32H32C14.31 32 0 46.31 0 64v96c0 17.69 14.31 32 32 32s32-14.31 32-32V96h64c17.69 0 32-14.31 32-32S145.7 32 128 32zM416 32h-96c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32V64C448 46.31 433.7 32 416 32zM128 416H64v-64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96c0 17.69 14.31 32 32 32h96c17.69 0 32-14.31 32-32S145.7 416 128 416zM416 320c-17.69 0-32 14.31-32 32v64h-64c-17.69 0-32 14.31-32 32s14.31 32 32 32h96c17.69 0 32-14.31 32-32v-96C448 334.3 433.7 320 416 320z" />
</svg>
),
//fa-solid fa-compress
exitFullScreen: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
stroke="var(--icon-fill-color)"
fill="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M128 320H32c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32v-96C160 334.3 145.7 320 128 320zM416 320h-96c-17.69 0-32 14.31-32 32v96c0 17.69 14.31 32 32 32s32-14.31 32-32v-64h64c17.69 0 32-14.31 32-32S433.7 320 416 320zM320 192h96c17.69 0 32-14.31 32-32s-14.31-32-32-32h-64V64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96C288 177.7 302.3 192 320 192zM128 32C110.3 32 96 46.31 96 64v64H32C14.31 128 0 142.3 0 160s14.31 32 32 32h96c17.69 0 32-14.31 32-32V64C160 46.31 145.7 32 128 32z" />
</svg>
),
//fa-solid fa-book-open-reader
releaseNotes: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
stroke="var(--icon-fill-color)"
fill="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M0 219.2v212.5c0 14.25 11.62 26.25 26.5 27C75.32 461.2 180.2 471.3 240 511.9V245.2C181.4 205.5 79.99 194.8 29.84 192C13.59 191.1 0 203.6 0 219.2zM482.2 192c-50.09 2.848-151.3 13.47-209.1 53.09C272.1 245.2 272 245.3 272 245.5v266.5c60.04-40.39 164.7-50.76 213.5-53.28C500.4 457.9 512 445.9 512 431.7V219.2C512 203.6 498.4 191.1 482.2 192zM352 96c0-53-43-96-96-96S160 43 160 96s43 96 96 96S352 149 352 96z" />
</svg>
),
rawMode: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 60"
>
<path
stroke="var(--icon-fill-color)"
strokeWidth="4"
d="M20 10H10m10 0H10m0 0v40m0-40v40m0 0h10m-10 0h10M40 10H30m10 0H30m0 0v40m0-40v40m0 0h10m-10 0h10M60 10h10m-10 0h10m0 0v40m0-40v40m0 0H60m10 0H60M80 10h10m-10 0h10m0 0v40m0-40v40m0 0H80m10 0H80"
/>
</svg>
),
//fa-solid fa-glasses
parsedMode: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 576 512"
stroke="var(--icon-fill-color)"
strokeWidth="20"
>
<path d="M574.1 280.4l-45.38-181.8c-5.875-23.63-21.62-44-43-55.75c-21.5-11.75-46.1-14.13-70.25-6.375l-15.25 5.125c-8.375 2.75-12.87 11.88-10 20.25l5 15.13c2.75 8.375 11.88 12.88 20.25 10.13l13.12-4.375c10.88-3.625 23-3.625 33.25 1.75c10.25 5.375 17.5 14.5 20.38 25.75l38.38 153.9c-22.12-6.875-49.75-12.5-81.13-12.5c-34.88 0-73.1 7-114.9 26.75H251.4C210.5 258.6 171.4 251.6 136.5 251.6c-31.38 0-59 5.625-81.12 12.5l38.38-153.9c2.875-11.25 10.12-20.38 20.5-25.75C124.4 79.12 136.5 79.12 147.4 82.74l13.12 4.375c8.375 2.75 17.5-1.75 20.25-10.13l5-15.13C188.6 53.49 184.1 44.37 175.6 41.62l-15.25-5.125c-23.13-7.75-48.75-5.375-70.13 6.375c-21.37 11.75-37.12 32.13-43 55.75L1.875 280.4C.6251 285.4 .0001 290.6 .0001 295.9v70.25C.0001 428.1 51.63 480 115.3 480h37.13c60.25 0 110.4-46 114.9-105.4l2.875-38.63h35.75l2.875 38.63C313.3 433.1 363.4 480 423.6 480h37.13c63.62 0 115.2-51 115.2-113.9V295.9C576 290.6 575.4 285.5 574.1 280.4zM203.4 369.7c-2 26-24.38 46.25-51 46.25H115.2C87 415.1 64 393.6 64 366.1v-37.5c18.12-6.5 43.38-13 72.62-13c23.88 0 47.25 4.375 69.88 13L203.4 369.7zM512 366.1c0 27.5-23 49.88-51.25 49.88h-37.13c-26.62 0-49-20.25-51-46.25l-3.125-41.13c22.62-8.625 46.13-13 70-13c29 0 54.38 6.5 72.5 13V366.1z" />
</svg>
),
convertFile: (
<svg
aria-hidden="true"
@@ -206,20 +475,101 @@ export const ICONS = {
<path d="m593.95 239.4v-1.5742c-0.85547-1.8828-2.043-3.6016-3.5-5.0742l-52.5-52.5c-1.4688-1.457-3.1875-2.6445-5.0742-3.5h-1.5742c-1.4727-0.49219-3.0039-0.78516-4.5508-0.875h-124.25c-4.6406 0-9.0938 1.8438-12.375 5.125s-5.125 7.7344-5.125 12.375v87.5h-70v-105.88-1.0508c-0.089844-1.5469-0.38281-3.0781-0.875-4.5508v-1.5742c-0.85547-1.8828-2.043-3.6016-3.5-5.0742l-52.5-52.5c-1.4727-1.457-3.1914-2.6445-5.0742-3.5h-1.5742c-1.7031-0.875-3.5352-1.4688-5.4258-1.75h-123.55c-4.6406 0-9.0938 1.8438-12.375 5.125s-5.125 7.7344-5.125 12.375v245c0 4.6406 1.8438 9.0938 5.125 12.375s7.7344 5.125 12.375 5.125h175c4.6406 0 9.0938-1.8438 12.375-5.125s5.125-7.7344 5.125-12.375v-52.5h70v122.5c0 4.6406 1.8438 9.0938 5.125 12.375s7.7344 5.125 12.375 5.125h175c4.6406 0 9.0938-1.8438 12.375-5.125s5.125-7.7344 5.125-12.375v-192.5-1.0508c-0.14453-1.5547-0.5-3.0859-1.0508-4.5508zm-313.95 110.6h-140v-210h87.5v35c0 4.6406 1.8438 9.0938 5.125 12.375s7.7344 5.125 12.375 5.125h35v87.5h-52.5c-6.2539 0-12.031 3.3359-15.156 8.75s-3.125 12.086 0 17.5 8.9023 8.75 15.156 8.75h52.5zm140 70v-105h27.824l-5.0742 5.0742c-3.7031 3.1719-5.9141 7.7461-6.1055 12.617-0.1875 4.8711 1.668 9.6016 5.1133 13.051 3.4492 3.4453 8.1797 5.3008 13.051 5.1133 4.8711-0.19141 9.4453-2.4023 12.617-6.1055l35-35c3.2578-3.2773 5.0898-7.7148 5.0898-12.336 0-4.625-1.832-9.0586-5.0898-12.34l-35-35c-4.5078-3.8555-10.66-5.1719-16.348-3.4883-5.6875 1.6797-10.137 6.1289-11.816 11.816-1.6836 5.6914-0.37109 11.844 3.4883 16.348l5.0742 5.0742h-27.824v-69.824h87.5v35c0 4.6406 1.8438 9.0938 5.125 12.375s7.7344 5.125 12.375 5.125h35v157.5z" />
</svg>
),
cog: getIconAsJSX("settings"),
cog: (
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
fill="var(--icon-fill-color)"
stroke="none"
>
<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 className="svg-icon lucide-vector-square-link" width="24" height="24" fill="none" stroke="var(--icon-fill-color)"
strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path d="m19.5 7a24 24 0 0 1 0 10M4.5 7a24 24 0 0 0 0 10M7 19.5a24 24 0 0 0 10 0M7 4.5a24 24 0 0 1 10 0"/>
<rect x="17" y="17" width="5" height="5" rx="1"/>
<path d="m17 5v-2c0-0.554 0.446-1 1-1h3c0.554 0 1 0.446 1 1v3c0 0.554-0.446 1-1 1h-2"/>
<path d="m7 19v2c0 0.554-0.446 1-1 1h-3c-0.554 0-1-0.446-1-1v-3c0-0.554 0.446-1 1-1h2"/>
<rect x="2" y="2" width="5" height="5" rx="1"/>
<path d="m13.041 15.135-0.58926 0.58926c-2.9856 2.9856-7.2282-1.2571-4.2426-4.2426l0.58926-0.58926M10.92 8.7708m0.49474-0.49474c2.9856-2.9856 7.2282 1.2571 4.2426 4.2426l-0.49474 0.49474M10.213 13.721 l3.5355-3.5355"/>
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 260 260"
aria-hidden="true"
focusable="false"
role="img"
>
<path
stroke="var(--icon-fill-color)"
fill="none"
strokeLinecap="round"
strokeWidth="8"
d="M10 10h40m-40 0h40m0 0v40m0-40v40m0 0H10m40 0H10m0 0V10m0 40V10M210 10h40m-40 0h40m0 0v40m0-40v40m0 0h-40m40 0h-40m0 0V10m0 40V10M210 210h40m-40 0h40m0 0v40m0-40v40m0 0h-40m40 0h-40m0 0v-40m0 40v-40M10 210h40m-40 0h40m0 0v40m0-40v40m0 0H10m40 0H10m0 0v-40m0 40v-40M30 210V50m0 160V50M50 30h160M50 30h160M230 50v160m0-160v160M50 230h160m-160 0h160"
/>
<path
stroke="var(--icon-fill-color)"
fill="none"
strokeLinecap="round"
strokeWidth="16"
d="M110 90c-6.67 1.67-30 3.11-40 10-10 6.89-20 21.37-20 31.37S60 153.56 70 160c10 6.44 33.33 8.33 40 10m0-80c-6.67 1.67-30 3.11-40 10-10 6.89-20 21.37-20 31.37S60 153.56 70 160c10 6.44 33.33 8.33 40 10M150 90c6.67 1.67 30 3.11 40 10 10 6.89 20 21.37 20 31.37s-10 22.19-20 28.63c-10 6.44-33.33 8.33-40 10m0-80c6.67 1.67 30 3.11 40 10 10 6.89 20 21.37 20 31.37s-10 22.19-20 28.63c-10 6.44-33.33 8.33-40 10"
/>
<path
stroke="var(--icon-fill-color)"
fill="none"
strokeLinecap="round"
strokeWidth="16"
d="M89.868 130.198c13.36-.03 66.78-.17 80.13-.2m-80.13.2c13.36-.03 66.78-.17 80.13-.2"
/>
</svg>
),
importSVG: (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 526 526">
<g fillRule="evenodd" strokeLinecap="round">
<path
fill="var(--input-bg-color)"
strokeWidth="0"
d="m133.462 71 .33-6.54.97-6.34 1.58-6.13 2.16-5.88 2.69-5.6 3.21-5.27 3.69-4.93 4.13-4.55 4.55-4.13 4.93-3.69 5.27-3.21 5.6-2.69 5.88-2.16 6.13-1.58 6.34-.97 6.54-.33h160v128l.16 3.28.49 3.18.79 3.07 1.07 2.94 1.35 2.8 1.6 2.63 1.84 2.47 2.06 2.27 2.27 2.06 2.47 1.84 2.63 1.6 2.8 1.35 2.94 1.07 3.07.79 3.18.49 3.28.16h128v288l-.33 6.54-.97 6.34-1.58 6.13-2.16 5.88-2.69 5.6-3.21 5.27-3.69 4.93-4.13 4.55-4.55 4.13-4.93 3.69-5.27 3.21-5.6 2.69-5.88 2.16-6.13 1.58-6.34.97-6.54.33h-256l-6.54-.33-6.34-.97-6.13-1.58-5.88-2.16-5.6-2.69-5.27-3.21-4.93-3.69-4.55-4.13-4.13-4.55-3.69-4.93-3.21-5.27-2.69-5.6-2.16-5.88-1.58-6.13-.97-6.34-.33-6.54V343h174.1l-39 39-1.65 1.83-1.43 1.94-1.22 2.05-.99 2.13-.77 2.2-.55 2.25-.33 2.29-.11 2.3.11 2.3.33 2.28.55 2.24.77 2.19.99 2.12 1.22 2.04 1.43 1.93 1.65 1.81 1.83 1.64 1.94 1.42 2.05 1.2 2.13.99 2.2.76 2.25.56 2.29.33 2.3.11 2.3-.1 2.28-.33 2.24-.54 2.19-.77 2.12-.98 2.04-1.21 1.93-1.43 1.81-1.65 80-80 1.65-1.83 1.43-1.94 1.22-2.05.99-2.13.77-2.2.55-2.25.33-2.29.11-2.3-.11-2.3-.33-2.28-.55-2.24-.77-2.19-.99-2.12-1.22-2.04-1.43-1.93-1.65-1.81-80-80-1.83-1.65-1.94-1.43-2.05-1.22-2.13-.99-2.2-.77-2.25-.55-2.29-.33-2.3-.11-2.3.11-2.28.33-2.24.55-2.19.77-2.12.99-2.04 1.22-1.93 1.43-1.81 1.65-1.64 1.83-1.42 1.94-1.2 2.05-.99 2.13-.76 2.2-.56 2.25-.33 2.29-.11 2.3.1 2.3.33 2.28.54 2.24.77 2.19.98 2.12 1.21 2.04 1.43 1.93 1.65 1.81 39 39h-174.1V71"
/>
<path
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="18"
d="M133.462 71s0 0 0 0m0 0s0 0 0 0m0 0 .33-6.54m-.33 6.54c.13-2.57.26-5.13.33-6.54m0 0c.36-2.33.72-4.67.97-6.34m-.97 6.34c.35-2.26.69-4.53.97-6.34m0 0c.51-1.99 1.03-3.98 1.58-6.13m-1.58 6.13c.4-1.56.81-3.12 1.58-6.13m0 0c.81-2.22 1.62-4.43 2.16-5.88m-2.16 5.88c.45-1.22.9-2.44 2.16-5.88m0 0c.72-1.51 1.45-3.01 2.69-5.6m-2.69 5.6c.69-1.45 1.39-2.9 2.69-5.6m0 0c.93-1.52 1.86-3.05 3.21-5.27m-3.21 5.27c.97-1.59 1.94-3.18 3.21-5.27m0 0c.86-1.15 1.71-2.29 3.69-4.93m-3.69 4.93c.78-1.04 1.56-2.08 3.69-4.93m0 0c1.53-1.69 3.07-3.38 4.13-4.55m-4.13 4.55c1.54-1.69 3.07-3.38 4.13-4.55m0 0c1.03-.93 2.06-1.87 4.55-4.13m-4.55 4.13c.98-.89 1.97-1.78 4.55-4.13m0 0c1.64-1.23 3.28-2.46 4.93-3.69m-4.93 3.69c1.72-1.29 3.45-2.58 4.93-3.69m0 0c1.11-.68 2.23-1.35 5.27-3.21m-5.27 3.21c1.5-.91 3.01-1.83 5.27-3.21m0 0c1.87-.89 3.73-1.79 5.6-2.69m-5.6 2.69c2.09-1 4.17-2.01 5.6-2.69m0 0c1.72-.64 3.44-1.27 5.88-2.16m-5.88 2.16c1.94-.72 3.89-1.43 5.88-2.16m0 0c2.3-.59 4.6-1.19 6.13-1.58m-6.13 1.58c2.32-.6 4.65-1.2 6.13-1.58m0 0c2.06-.31 4.12-.63 6.34-.97m-6.34.97c2.34-.36 4.69-.72 6.34-.97m0 0c2.05-.1 4.09-.21 6.54-.33m-6.54.33c2.06-.1 4.12-.21 6.54-.33m0 0h160m-160 0h160m0 0v128m0-128v128m0 0s0 0 0 0m0 0s0 0 0 0m0 0 .16 3.28m-.16-3.28c.06 1.16.12 2.32.16 3.28m0 0c.13.82.26 1.64.49 3.18m-.49-3.18c.18 1.13.35 2.26.49 3.18m0 0c.24.95.49 1.91.79 3.07m-.79-3.07c.28 1.1.56 2.2.79 3.07m0 0c.39 1.06.78 2.13 1.07 2.94m-1.07-2.94c.42 1.15.84 2.3 1.07 2.94m0 0c.38.79.76 1.57 1.35 2.8m-1.35-2.8c.4.82.79 1.64 1.35 2.8m0 0c.45.75.91 1.5 1.6 2.63m-1.6-2.63c.4.65.8 1.31 1.6 2.63m0 0c.56.76 1.13 1.52 1.84 2.47m-1.84-2.47c.58.79 1.17 1.57 1.84 2.47m0 0c.75.82 1.5 1.65 2.06 2.27m-2.06-2.27c.75.82 1.5 1.65 2.06 2.27m0 0c.74.66 1.47 1.33 2.27 2.06m-2.27-2.06c.89.81 1.78 1.61 2.27 2.06m0 0c.69.51 1.37 1.02 2.47 1.84m-2.47-1.84c.68.5 1.35 1.01 2.47 1.84m0 0c.81.49 1.62.99 2.63 1.6m-2.63-1.6c.74.45 1.47.9 2.63 1.6m0 0c.72.35 1.43.69 2.8 1.35m-2.8-1.35c.61.3 1.22.59 2.8 1.35m0 0c.85.31 1.69.62 2.94 1.07m-2.94-1.07c1.03.38 2.07.75 2.94 1.07m0 0c.83.22 1.67.43 3.07.79m-3.07-.79 3.07.79m0 0c1.07.16 2.14.33 3.18.49m-3.18-.49c1.2.18 2.39.36 3.18.49m0 0 3.28.16m-3.28-.16c.97.04 1.93.09 3.28.16m0 0h128m-128 0h128m0 0v288m0-288v288m0 0s0 0 0 0m0 0s0 0 0 0m0 0c-.1 2.02-.2 4.04-.33 6.54m.33-6.54c-.13 2.52-.26 5.05-.33 6.54m0 0c-.33 2.14-.66 4.29-.97 6.34m.97-6.34c-.32 2.06-.63 4.12-.97 6.34m0 0c-.59 2.28-1.17 4.55-1.58 6.13m1.58-6.13c-.53 2.07-1.07 4.14-1.58 6.13m0 0c-.73 1.99-1.46 3.97-2.16 5.88m2.16-5.88c-.72 1.97-1.44 3.94-2.16 5.88m0 0c-.94 1.97-1.89 3.93-2.69 5.6m2.69-5.6c-.91 1.89-1.82 3.77-2.69 5.6m0 0c-.89 1.46-1.78 2.92-3.21 5.27m3.21-5.27c-.65 1.05-1.29 2.11-3.21 5.27m0 0c-1.13 1.51-2.25 3.01-3.69 4.93m3.69-4.93c-1.29 1.72-2.58 3.44-3.69 4.93m0 0c-1.29 1.42-2.58 2.84-4.13 4.55m4.13-4.55-4.13 4.55m0 0-4.55 4.13m4.55-4.13-4.55 4.13m0 0c-1.2.9-2.41 1.8-4.93 3.69m4.93-3.69-4.93 3.69m0 0c-1.56.95-3.13 1.9-5.27 3.21m5.27-3.21c-1.99 1.21-3.98 2.42-5.27 3.21m0 0c-1.8.86-3.6 1.73-5.6 2.69m5.6-2.69c-1.34.64-2.67 1.28-5.6 2.69m0 0c-2.24.82-4.48 1.65-5.88 2.16m5.88-2.16c-1.38.51-2.77 1.02-5.88 2.16m0 0c-1.46.38-2.93.76-6.13 1.58m6.13-1.58c-1.54.4-3.09.79-6.13 1.58m0 0c-2.12.32-4.24.65-6.34.97m6.34-.97c-2.47.38-4.94.75-6.34.97m0 0c-2.23.11-4.46.22-6.54.33m6.54-.33c-1.97.1-3.93.2-6.54.33m0 0h-256m256 0h-256m0 0s0 0 0 0m0 0s0 0 0 0m0 0c-2.33-.12-4.66-.24-6.54-.33m6.54.33c-1.33-.07-2.65-.13-6.54-.33m0 0c-1.88-.29-3.77-.58-6.34-.97m6.34.97c-2.07-.32-4.14-.63-6.34-.97m0 0c-1.52-.39-3.04-.79-6.13-1.58m6.13 1.58c-2.02-.52-4.04-1.04-6.13-1.58m0 0c-1.6-.59-3.19-1.17-5.88-2.16m5.88 2.16c-1.9-.7-3.8-1.39-5.88-2.16m0 0c-1.41-.68-2.82-1.36-5.6-2.69m5.6 2.69c-1.6-.77-3.2-1.54-5.6-2.69m0 0c-1.4-.86-2.81-1.71-5.27-3.21m5.27 3.21c-2.08-1.27-4.17-2.54-5.27-3.21m0 0c-1.72-1.29-3.43-2.57-4.93-3.69m4.93 3.69c-1.79-1.34-3.57-2.67-4.93-3.69m0 0c-1.18-1.07-2.36-2.15-4.55-4.13m4.55 4.13c-1.64-1.49-3.27-2.97-4.55-4.13m0 0c-1.07-1.19-2.15-2.37-4.13-4.55m4.13 4.55c-1.46-1.61-2.93-3.23-4.13-4.55m0 0-3.69-4.93m3.69 4.93c-.88-1.17-1.76-2.35-3.69-4.93m0 0c-.83-1.37-1.67-2.75-3.21-5.27m3.21 5.27c-1.15-1.89-2.3-3.79-3.21-5.27m0 0c-1.03-2.14-2.05-4.27-2.69-5.6m2.69 5.6c-.68-1.43-1.37-2.85-2.69-5.6m0 0c-.8-2.17-1.59-4.34-2.16-5.88m2.16 5.88c-.82-2.22-1.63-4.44-2.16-5.88m0 0c-.47-1.82-.94-3.64-1.58-6.13m1.58 6.13c-.37-1.44-.74-2.88-1.58-6.13m0 0-.97-6.34m.97 6.34c-.3-1.98-.61-3.97-.97-6.34m0 0c-.13-2.54-.26-5.07-.33-6.54m.33 6.54-.33-6.54m0 0V343m0 112V343m0 0h174.1m-174.1 0h174.1m0 0-39 39m39-39-39 39m0 0s0 0 0 0m0 0s0 0 0 0m0 0c-.65.72-1.3 1.44-1.65 1.83m1.65-1.83c-.34.38-.68.76-1.65 1.83m0 0c-.35.47-.7.95-1.43 1.94m1.43-1.94c-.38.5-.75 1.01-1.43 1.94m0 0c-.32.54-.64 1.08-1.22 2.05m1.22-2.05c-.38.64-.76 1.28-1.22 2.05m0 0c-.2.45-.41.89-.99 2.13m.99-2.13c-.38.82-.76 1.64-.99 2.13m0 0c-.18.53-.36 1.05-.77 2.2m.77-2.2c-.3.88-.61 1.75-.77 2.2m0 0c-.15.61-.3 1.22-.55 2.25m.55-2.25c-.16.68-.33 1.35-.55 2.25m0 0-.33 2.29m.33-2.29c-.13.9-.26 1.79-.33 2.29m0 0-.11 2.3m.11-2.3c-.03.59-.06 1.19-.11 2.3m0 0c.03.Line truncated
/>
</g>
<path
fill="none"
stroke="var(--icon-fill-color)"
strokeLinecap="round"
strokeWidth="18"
d="M135 343.068H31m104 0H31m0 0s0 0 0 0m0 0s0 0 0 0m0 0c-.74-.04-1.48-.07-2.46-.12m2.46.12c-.77-.04-1.54-.08-2.46-.12m0 0c-.87-.14-1.75-.27-2.39-.37m2.39.37c-.55-.09-1.1-.17-2.39-.37m0 0c-.87-.22-1.74-.44-2.3-.59m2.3.59c-.62-.15-1.24-.31-2.3-.59m0 0c-.82-.29-1.64-.59-2.21-.8m2.21.8c-.52-.18-1.03-.37-2.21-.8m0 0c-.55-.26-1.09-.52-2.1-1.01m2.1 1.01c-.64-.31-1.28-.61-2.1-1.01m0 0c-.74-.45-1.48-.89-1.98-1.2m1.98 1.2c-.42-.25-.84-.51-1.98-1.2m0 0c-.7-.52-1.41-1.05-1.84-1.38m1.84 1.38c-.37-.28-.75-.56-1.84-1.38m0 0c-.4-.36-.8-.71-1.71-1.54m1.71 1.54c-.35-.31-.7-.63-1.71-1.54m0 0c-.43-.47-.85-.95-1.54-1.71m1.54 1.71c-.61-.68-1.23-1.36-1.54-1.71m0 0c-.29-.38-.58-.76-1.38-1.84m1.38 1.84c-.54-.71-1.08-1.43-1.38-1.84m0 0c-.46-.76-.92-1.52-1.2-1.98m1.2 1.98c-.45-.74-.89-1.47-1.2-1.98m0 0c-.37-.77-.74-1.53-1.01-2.1m1.01 2.1c-.3-.62-.6-1.25-1.01-2.1m0 0c-.2-.54-.39-1.07-.8-2.21m.8 2.21c-.2-.54-.4-1.09-.8-2.21m0 0c-.22-.85-.44-1.71-.59-2.3m.59 2.3c-.12-.46-.24-.92-.59-2.3m0 0c-.11-.72-.22-1.43-.37-2.39m.37 2.39c-.08-.48-.15-.96-.37-2.39m0 0c-.03-.74-.07-1.48-.12-2.46m.12 2.46c-.04-.79-.08-1.59-.12-2.46m0 0c.04-.74.07-1.49.12-2.46m-.12 2.46.12-2.46m0 0c.08-.53.16-1.07.37-2.39m-.37 2.39c.09-.56.17-1.12.37-2.39m0 0c.17-.69.35-1.38.59-2.3m-.59 2.3c.15-.61.31-1.23.59-2.3m0 0c.17-.48.34-.96.8-2.21m-.8 2.21c.2-.55.4-1.1.8-2.21m0 0c.25-.52.49-1.03 1.01-2.1m-1.01 2.1c.36-.76.73-1.52 1.01-2.1m0 0c.43-.72.87-1.44 1.2-1.98m-1.2 1.98c.27-.45.55-.91 1.2-1.98m0 0c.54-.73 1.09-1.47 1.38-1.84m-1.38 1.84c.4-.54.81-1.09 1.38-1.84m0 0c.53-.59 1.07-1.18 1.54-1.71m-1.54 1.71c.59-.66 1.19-1.32 1.54-1.71m0 0c.54-.49 1.08-.97 1.71-1.54m-1.71 1.54c.48-.43.95-.86 1.71-1.54m0 0c.46-.35.92-.7 1.84-1.38m-1.84 1.38c.5-.38 1.01-.76 1.84-1.38m0 0c.52-.32 1.04-.63 1.98-1.2m-1.98 1.2c.72-.44 1.44-.88 1.98-1.2m0 0 2.1-1.01m-2.1 1.01c.84-.4 1.67-.81 2.1-1.01m0 0c.45-.17.91-.33 2.21-.8m-2.21.8c.56-.21 1.12-.41 2.21-.8m0 0c.89-.23 1.79-.46 2.3-.59m-2.3.59c.48-.13.95-.25 2.3-.59m0 0c.51-.08 1.02-.16 2.39-.37m-2.39.37 2.39-.37m0 0c.52-.02 1.03-.05 2.46-.12m-2.46.12c.74-.03 1.48-.07 2.46-.12m0 0 103.34-.27m-103.34.27c30.04-.08 60.08-.16 103.34-.27"
/>
<g fillRule="evenodd" strokeLinecap="round">
<path
fill="var(--input-bg-color)"
strokeWidth="0"
d="M517.462 135h-128V7l128 128"
/>
<path
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="18"
d="M517.462 135h-128m128 0h-128m0 0V7m0 128V7m0 0 128 128m-128-128 128 128m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0m0 0s0 0 0 0"
/>
</g>
</svg>
),
importSVG: getIconAsJSX("file-input"),
obsidian: (
<svg
//aria-hidden="true"
@@ -282,8 +632,22 @@ export const ICONS = {
<path fillRule="evenodd" clipRule="evenodd" d="M302.7 299.5c43.5 16.3 60.3 52 72.8 81.9-15.5-31.2-37-65.7-74.4-78.5-28.4-9.8-52.4-8.6-93.5.7l-.9-4c43.6-10 66.4-11.2 96 0Z" fill="url(#i)"/>
</svg>
),
"add-file": getIconAsJSX("file-plus"),
tray: getIconAsJSX("monitor-cog"),
"add-file": (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="var(--icon-fill-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="12" x2="12" y1="18" y2="12"/>
<line x1="9" x2="15" y1="15" y2="15"/>
</svg>
),
};
export const SwordColors = {
@@ -390,11 +754,10 @@ export const saveIcon = (isDirty: boolean) => {
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke={isDirty ? "var(--color-accent)" : "var(--icon-fill-color)"}
stroke={isDirty?"var(--color-accent)":"var(--icon-fill-color)"}
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="svg-icon lucide-save"
>
<path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/>
<polyline points="17 21 17 13 7 13 7 21"/>
@@ -516,7 +879,7 @@ export const penIcon = (pen: PenStyle) => {
}
export const stringToSVG = (svg: string) => {
if (svg.match(/class=["'][^"']*(lucide|skip)[^"']*["']/)) {
if(svg.match(/class=("|')[^"']*(lucide|skip)[^"']*("|')/)) {
return <div dangerouslySetInnerHTML={{__html: svg}}></div>
}
svg = svg
@@ -536,4 +899,4 @@ export const LogoWrapper = ({ children }: { children: React.ReactNode }) => {
{children} {/* Render the children, including the ExcalidrawSword SVG icon */}
</div>
);
};
};
+2 -1
View File
@@ -1,3 +1,4 @@
export const TAG_PDFEXPORT = "PDFExport";
export const TAG_MDREADINGMODE = "MDReadingMode";
export const TAG_AUTOEXPORT = "Autoexport";
export const TAG_AUTOEXPORT = "Autoexport";
export const TAG_IMAGECACHE = "ResetImageCache";
-2
View File
@@ -515,5 +515,3 @@ export const DISK_ICON_NAME = "save";
export const EXPORT_IMG_ICON = ` <g transform="scale(4.166)" strokeWidth="1.25" fill="none" stroke="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M15 8h.01"></path><path d="M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"></path><path d="M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"></path><path d="M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"></path><path d="M19 16v6"></path><path d="M22 19l-3 3l-3 -3"></path></g>`;
export const EXPORT_IMG_ICON_NAME = `export-img`;
export const EXCALIDRAW_ICON = `<path d="M24 17h121v121H24z" style="fill:none" transform="matrix(.8843 0 0 .83471 -21.223 -14.19)"/><path d="M119.81 105.98a.549.549 0 0 0-.53-.12c-4.19-6.19-9.52-12.06-14.68-17.73l-.85-.93c0-.11-.05-.21-.12-.3a.548.548 0 0 0-.34-.2l-.17-.18-.12-.09c-.15-.32-.53-.56-.95-.35-1.58.81-3 1.97-4.4 3.04-1.87 1.43-3.7 2.92-5.42 4.52-.7.65-1.39 1.33-1.97 2.09-.28.37-.07.72.27.87-1.22 1.2-2.45 2.45-3.68 3.74-.11.12-.17.28-.16.44.01.16.09.31.22.41l2.16 1.65s.01.03.03.04c3.09 3.05 8.51 7.28 14.25 11.76.85.67 1.71 1.34 2.57 2.01.39.47.76.94 1.12 1.4.19.25.55.3.8.11.13.1.26.21.39.31a.57.57 0 0 0 .8-.1c.07-.09.1-.2.11-.31.04 0 .07.03.1.03.15 0 .31-.06.42-.18l10.18-11.12a.56.56 0 0 0-.04-.8l.01-.01Zm-29.23-3.85c.07.09.14.17.21.25 1.16.98 2.4 2.04 3.66 3.12l-5.12-3.91s-.32-.22-.52-.36c-.11-.08-.21-.16-.31-.24l-.38-.32s.07-.07.1-.11l.35-.35c1.72-1.74 4.67-4.64 6.19-6.06-1.61 1.62-4.87 6.37-4.17 7.98h-.01Zm17.53 13.81-4.22-3.22c-1.65-1.71-3.43-3.4-5.24-5.03 2.28 1.76 4.23 3.25 4.52 3.51 2.21 1.97 2.11 1.61 3.63 2.91l1.83 1.33c-.18.16-.36.33-.53.49l.01.01Zm1.06.81-.08-.06c.16-.13.33-.25.49-.38l-.4.44h-.01Zm-66.93-65.3c.14.72.27 1.43.4 2.11.69 3.7 1.33 7.03 2.55 9.56l.48 1.92c.19.73.46 1.64.71 1.83 2.85 2.52 7.22 6.28 11.89 9.82.21.16.5.15.7-.01.01.02.03.03.04.04.11.1.24.15.38.15.16 0 .31-.06.42-.19 5.98-6.65 10.43-12.12 13.6-16.7.2-.25.3-.54.29-.84.2-.24.41-.48.6-.68a.558.558 0 0 0-.1-.86.578.578 0 0 0-.17-.36c-1.39-1.34-2.42-2.31-3.46-3.28-1.84-1.72-3.74-3.5-7.77-7.51-.02-.02-.05-.04-.07-.06a.555.555 0 0 0-.22-.14c-1.11-.39-3.39-.78-6.26-1.28-4.22-.72-10-1.72-15.2-3.27h-.04v-.01s-.02 0-.03.02h-.01l.04-.02s-.31.01-.37.04c-.08.04-.14.09-.19.15-.05.06-.09.12-.47.2-.38.08.08 0 .11 0h-.11v.03c.07.34.05.58.16.97-.02.1.21 1.02.24 1.11l1.83 7.26h.03Zm30.95 6.54s-.03.04-.04.05l-.64-.71c.22.21.44.42.68.66Zm-7.09 9.39s-.07.08-.1.12l-.02-.02c.04-.03.08-.07.13-.1h-.01Zm-7.07 8.47Zm3.02-28.57c.35.35 1.74 1.65 2.06 1.97-1.45-.66-5.06-2.34-6.74-2.88 1.65.29 3.93.66 4.68.91Zm-19.18-2.77c.84 1.44 1.5 6.49 2.16 11.4-.37-1.58-.69-3.12-.99-4.6-.52-2.56-1-4.85-1.67-6.88.14.01.31.03.49.05 0 .01 0 .02.02.03h-.01Zm-.29-1.21c-.23-.02-.44-.04-.62-.05-.02-.04-.03-.08-.04-.12l.66.18v-.01Zm-2.22.45v-.02.02Zm78.54-1.18c.04-.23-1.1-1.24-.74-1.26.85-.04.86-1.35 0-1.31-1.13.06-2.27.32-3.37.53-1.98.37-3.95.78-5.92 1.21-4.39.94-8.77 1.93-13.1 3.11-1.36.37-2.86.7-4.11 1.36-.42.22-.4.67-.17.95-.09.05-.18.08-.28.09-.37.07-.74.13-1.11.19a.566.566 0 0 0-.39.86c-2.32 3.1-4.96 6.44-7.82 9.95-2.81 3.21-5.73 6.63-8.72 10.14-9.41 11.06-20.08 23.6-31.9 34.64-.23.21-.24.57-.03.8.05.06.12.1.19.13-.16.15-.32.3-.48.44-.1.09-.14.2-.16.32-.08.08-.16.17-.23.25-.21.23-.2.59.03.8.23.21.59.2.8-.03.04-.04.08-.09.12-.13a.84.84 0 0 1 1.22 0c.69.74 1.34 1.44 1.95 2.09l-1.38-1.15a.57.57 0 0 0-.8.07c-.2.24-.17.6.07.8l14.82 12.43c.11.09.24.13.37.13.15 0 .29-.06.4-.17l.36-.36a.56.56 0 0 0 .63-.12c20.09-20.18 36.27-35.43 54.8-49.06.17-.12.25-.32.23-.51a.57.57 0 0 0 .48-.39c3.42-10.46 4.08-19.72 4.28-24.27 0-.03.01-.05.02-.07.02-.05.03-.1.04-.14.03-.11.05-.19.05-.19.26-.78.17-1.53-.15-2.15v.02ZM82.98 58.94c.9-1.03 1.79-2.04 2.67-3.02-5.76 7.58-15.3 19.26-28.81 33.14 9.2-10.18 18.47-20.73 26.14-30.12Zm-32.55 52.81-.03-.03c.11.02.19.04.2.04a.47.47 0 0 0-.17 0v-.01Zm6.9 6.42-.05-.04.03-.03c.02 0 .03.02.04.02 0 .02-.02.03-.03.05h.01Zm8.36-7.21 1.38-1.44c.01.01.02.03.03.05-.47.46-.94.93-1.42 1.39h.01Zm2.24-2.21c.26-.3.56-.65.87-1.02.01-.01.02-.03.04-.04 3.29-3.39 6.68-6.82 10.18-10.25.02-.02.05-.04.07-.06.86-.66 1.82-1.39 2.72-2.08-4.52 4.32-9.11 8.78-13.88 13.46v-.01Zm21.65-55.88c-1.86 2.42-3.9 5.56-5.63 8.07-5.46 7.91-23.04 27.28-23.43 27.65-2.71 2.62-10.88 10.46-16.09 15.37-.14.13-.25.24-.34.35a.794.794 0 0 1 .03-1.13c24.82-23.4 39.88-42.89 46-51.38-.13.33-.24.69-.55 1.09l.01-.02Zm16.51 7.1-.01.02c0-.02-.02-.07.01-.02Zm-.91-5.13Zm-5.89 9.45c-2.26-1.31-3.32-3.27-2.71-5.25l.19-.66c.08-.19.17-.38.28-.57.59-.98 1.49-1.85 2.52-2.36.05-.02.1-.03.15-.04a.795.795 0 0 1-.04-.43c.05-.31.25-.58.66-.58.67 0 2.75.62 3.54 1.3.24.19.47.4.68.63.3.35.74.92.96 1.33.13.06.23.62.38.91.14.46.2.93.18 1.4 0 .02 0 .02.01.03-.03.07 0 .37-.04.4-.1.72-.36 1.43-.75 2.05-.04.05-.07.11-.11.16 0 .01-.02.02-.03.04-.3.43-.65.83-1.08 1.13-1.26.89-2.73 1.16-4.2.79a6.33 6.33 0 0 1-.57-.25l-.02-.03Zm16.27-1.63c-.49 2.05-1.09 4.19-1.8 6.38-.03.08-.03.16-.03.23-.1.01-.19.05-.27.11-4.44 3.26-8.73 6.62-12.98 10.11 3.67-3.32 7.39-6.62 11.23-9.95a6.409 6.409 0 0 0 2.11-3.74l.56-3.37.03-.1c.25-.71 1.34-.4 1.17.33h-.02Z" style="fill:currentColor;fill-rule:nonzero" transform="translate(-26.41 -29.49)"/>`;
export const LOGO_EXCALIDRAW_MASTERY = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMQAAADECAYAAADApo5rAAAQAElEQVR4AeydB5xU1fn3n1lQEaWIBV0pSwdB0bAWgsCuDWPsRo389QWUptFoYmJMVFiwxBaTqImIRECxJ7H3sgtobGgUKzYWVGpARGwI7Hu/9865c26buTNzp+zu8OHZ0+t9fud5nnPOvVMmpX+lGSjNgD0DJUDYU5Ejz8SJFQKNHVsl48aNtmn8+Mmi04QJMx1hPS9loRx1sVRtYgZKgEjMReY+GB4GVgw+blytwfi1BoM3yJYti00qK6uVWGymTSI1olNDw2hHWM9LWWj8+AajzsUm0QYgol2oBBhj+rL/XwJEunMI88N8MD9MCZPC9DCwYvBYrMpg/Kp0qw6Zv8LIV2HWD4hoF7IAs9gEogIKfTUyl/6Hn4ESIFLNFUzlZn6YT6TGZEopqn9OoADU8eMXSwkgoR9SIwJE6DFln1GBAGaCqSJg/ooOO4iiqp7dRdHo/SpFJxWPq/LjZjGoClGShLEwJgCOlMui0qZatKypDiztccEgMIpSgQCBSIWE/AfTwsQw9+TDDxWo9uwJsnjS76XhL1ebLn6o9uyJomjmyJNEJxWPS143USf5qZ+2aDNkF1U2xlQjSDnAoaSHSm3mbvMGREISNJgMYoEgJUvA/BBMCXMqhoeJCdcYgICqevYwpULKCkNkoD2IOgEC9dMWbar2CZNWZUigEFWSJSE9AAcLAgsDKc2UmicgePAYxKgQIUBgMWJ3x6rPyg1TwoDFwDv0kb4ACj+QhOijU3KwcxWiUFPL0nwAoUsDQMBOUJKnCYMhAVBRYH6YDABUGat+kmJFlcQYFEisMUwwQV2VWoJUGBsGnItYBjlzV1Qjy11nmj4geJhIhBDSAAYCBDAPlDEAcve8Mq6ZsVUZYGZMgJvxIU2qkoPDUqm2bKk1d6qYy4x70DgKNl1A8PBCAAFGcYOAuHw8vvolS6Xm8iulbt4L+WjO0QZjRHoocDAHjgzOgAKGJTGasJ3R9AABENg5SSERYAiYgJWSVZOwkwdyG5o1507p1m8vmWIAovrwn5rAyG2LwbUzduaAuUgpNdjCZYeKOW6CwGg6gAAISiLw0AKevwIBDx8mCMiWs2glFcaMP8vRxmwDIJa0eN4Rn88AwAgtNZhjBQzmPp8dzWFbTQMQCggYywGTBRDYngQEPPiAbJFFz5pzl8wymLxu3vMCCPDD8EoqqIaqhh5oesljSYsjTckBYMgPURYSiUm+/jFHzBULB3MX2C7AwMbgGQRmajwJjRsQiGz2zwOAwEPlYSog5OuxwPRjxp8pMHX14QkGh+H1Pky+6EKZOf3vgqvHAw4AQH6IeqBu/fbUs0XiT1UJcxgCGBVGPTXmpUOeiRForP8bJyAQ0eiwiOyA02SAwOrGw8z3w4Ghk7WJVFj83kKpMQBBPlzCAIM04oqNQgODZ8Kz4RkV2yBC9KfxAYIDIwxmRLXPANGB8y0R3N2AsVUcDD761JECEQ/j1z75iJlcPcKSHkgUJALAII08ENKjomsXMy9/Rhn14BaSQgGDZ9NI1ajGAwhWHE6XuerswxE8KA7R2CXxSc5rFCBQDQ4fdqCpFsHcMLxicFSguvmWAY1EQTXC3qAceSDqIY04iPK4xUDMN9IXKYzfp0+WGsUz49n5ZCjGqMYBCPRSpILP6TIPQ6lHVcbBUzFMMsys+sHukfIrF2mgwKDnBRQqD64eRroQV2zE/HOWwTPw7RvPDGmBZPfNUFyRxQ8Idi/QS33mDfWIFYqVyie5YFEwOas7HWCFVys/YTfpalD90qWOZAUaIqkTtxgJUPAMeBYBwKgQJDvPMvMB5KVk8QICMYu49dlB4gEUi3oU9JRQlVSaztgqzs+t6JKwF0gHTLgQNghuMRPPBWAkUVutnSiebZEOpDgBkURFqurZ3Xy3oKpI1KOg56okBOlzjbMIXEU64+tqkS4FUKtU/sYABtVXXCW5q4xnRdhFFVLEKlTxAQJdM0BFQhyjr7omuCiDOnO7VaEqw9DWAaMGoKtPOoj0eJW32F2kxcyRJ5u3a336igplfXXEJ7GQUcUFCHRMdE3XjDC5qEiIY1dS0QYBhGJ6VB+3HcGuk0onb+0TjwhAUQPSJYQer9Ibg8tz45lhW+B39bnCCKNCTTbcovlfPIAIsBcQu0xoVZGrSH5PFEZX8W47gjTOHBq+WSecOehMr4OhsalLary6CxiQ7Eh4PT7urzG/FBIPFNqJBhDZjAIDCzCwPeeqB12UiXRFN5pgV+1QTVeBUg0AiaLy6Ma5imuMLqDgefqCgmfPFRx4ocCDKywgmIDNm2caW3JV7nmYGX/53h3fmMJKJaLPbjuCuCBasiSx/arXEZS/scQDClQoX1BwBQdjG54o4IAKBwgGHgAG7AVWkwLOSyRNoxYphmbVh8JUrKtX1BGmTGPKAyhQg336bO1AwRs+ifmIKgwgGLAPGFhBAENjtBf8HhbMrKs8YQERNp9fm40ljmcNKHBdfS4oKPIPiCRgYIKaChjUQ1YSgrC+8hP2Ix0MTcGg9hujigMM2Ii4Ki7uFgwU+QVECjDEJyOnTiErD2NY66DRjfJC9juXbQOGYgJF/gDRTMGA2qQYKh3DWpVpDm4xgSJ/gAiwGVCTmvJDBxBKbdLVoaAx63koG5SvqcWnBEWeBpwfQPicMzABTR0Mfs/QfWLtzqNvuep3ntz5mmIYnghUn3gLLw+Dzj0grOsYjnMGBt6cwJDpSp9puTzwTc6agDd8QcFbePBSzlq2Ks4tILi1KlIjrn8curmimk0wDTui2cyJe6AKFO54I5zzu0+5AwRg8Lm1Wuhzhg0bvhbUlrvv+5esWLnSmOPc/9d3i5SN8N333xvtr5Jvvv1WGrQuqHQtKmvvylWr5P6HHpE77r7XHPt3332XdZ1hK9DbfuqZ5+TL9etDFbVAMcEv72iBt/xSIojLDSDYUfIBA5Ih3+cMDQ0N5neRJl/2R+m7977SZpfdhU/DnDLqDLl4ymWyadOmCKYxeRW66kN/Pl+2XBZ98KHALB9+9LG8/c47snzFStmyZYvoebMBxw8//CCAvueAfWTXit5y/M9PlVNPH2+OvW3HznLZldfI119/k7zjGaZS76zb7xR32yOOPl7a79pFTjp1tHz2+bKUtcMrM0ee5M5XIWVlM80fsnSnRBDODSDYUXJ1jqsYkCs6J0GY7oMPP5LzfnuhdCivMD/8NfWKq0wm1Bu8/8FHBIbU43Lh143j1f/7n/xvzRpHM1u2NMiq1avlAwMcGzdudKSlG4AZ//q3abJT5+4C6D/+ZLGnCsByydTLZeD+Q+TV1173pGca8elnn8svzvuNtO3YScZMOEv82qbu+/79gHTfY6DcdsfdwrMiLojgGZ+7TxXG6lEbVCab+OgBgeHD7UWtV1U9u5u/kqNFRe5lYllRWfU7du0lfQZWCoyx7ssvA9ta+8UXMu+F/wSmR5Xwn5detqtqMJjfDrg83xtqVLv27Vyx4YIA4err/io7d+luLgTr13+VsiAMO+SgEaEYM1lliwxphwTq0ru//H36DINXtyTLbqYBylHjJsp11/8tFCgAhlkw8afC/CJ5IhyJL1pAjB1bZfTKYURbuuBEIzo3/1E7YIROPfuZkuDyq64VVuGwrT39bG3O1CbUAhjloppLw3ZHkgHGr5Jvv/1Obp09R8p79JHfXTxZCPvlC4qDMVnNZ8+5S1hUgvK548m78O135LCjjpO+e+9r2ijuPGHCF1w0Sf794MNJs8JDSAkWVkdGdp4snnNEZxOIFhDodq7ezPTqgK4c6QdZDefcdY/sc8BQUz+GEZYtX5F+RUaJBa//19DlVxu+6P7DlIAUtQBjVq+5vHxXPZjU/+DDjwamb968We791/2GXVQpZ5x5toSRCEGVbTFsF+pIxZiUV0D4cfVhMnC/IcKCQnymRNtjzzxHXlnwWtIqAMXMkSd788Bz2KzelIxiogMEh2/cade6YaG6hxaTuRcGQPX46XEnmTrqaWdMkDcWvpV5hfGSSz/9TN57f1E8lJ1DH++695/Stc8Ac7Vm9U23xspB+9hF7rv/Ac+qrRhycNWhcvJpY4T+2wWy8MCYE8/5lbzz3vuBtbxrpGEYA4SXXnk1MF+6Cai1p0/4hWlHJStrgcLHyG5oiOw11GgAwYcBfOyGmsMPTTa+UGkYaudfeJG5O4S++9iTT4XSUUNVbmSCwWrnzTd8mf+njpdfXSCDDSYdOXpsUpWt8kcJhvdrsXy3hARZuWq16JIPFeyEU04zV+YojWHVD4z9Cy+u8ahdiwwb4ZgTT5H+gw7IWiKottwuQLzi6j95FgB3PmwJX9UJ29WdOYNw9oBAXPl8GGCmn3gL2UFUIrVth6GG4YUaErJ42tleePEl4Xwi7YJGgUUGsxx70kg5YPghoXZsynfbzSgV/J90BRq2hBfXLzG3R6+89s/mzoxbBQuuKbOUR594Uh5/6mmzMGMDCGxXP/To42ZcLv/cdMut8vx/XkrZxEyDt5AWroyjo9iKzR4QPlusHL75dNjVf2cQdeM/xm4MakCqbTtnyexDb739rnz62WdpVYSYP/H/Rhk6/L4SllnaGztI04yHrmiSsfWJ/uymZcuX231hexSD+feTpohbBWvfvr2dLyoP0o4t6qNO+HlaY4uifbacsb1SLX7wFuq4q80K8eFFVx6RFBHZAQIL36UqWSItvN2wZu1aYRJ269ZHUIkwFNFnU/Q70mS2Xz/8+JO06vzWOGFOZQi6K1y37kuZNuNWmwASRr2bdDWpzlDnggzmdevWyY47dnA3k3X4zbfelkcefyLrejKpAAk193nrI9DJysNnkCMPvAhPOiLTC2QHiFjMY8z4INfTI1YhDLT/N3ai7NSpu2mAprNV6qkwgohnnqtLu5avv/467 Line truncated
+6 -73
View File
@@ -60,7 +60,6 @@ import {
isCallerFromTemplaterPlugin,
versionUpdateCheckTimer,
getFontMetrics,
calculateUIModeValue,
} from "../utils/utils";
import { foldExcalidrawSection, getExcalidrawViews, setExcalidrawView } from "../utils/obsidianUtils";
import { FileId } from "@zsviczian/excalidraw/types/element/src/types";
@@ -97,7 +96,6 @@ 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;
@@ -111,13 +109,6 @@ type FileMasterInfo = {
colorMapJSON?: string
}
const PHONE_FOOTER_SAFE_AREA_STYLE_ID = "excalidraw-phone-footer-safe-area";
const PHONE_FOOTER_SAFE_AREA_CSS = `
.excalidraw .App-bottom-bar {
padding-bottom: 50px;
}
`;
export default class ExcalidrawPlugin extends Plugin {
private fileManager: PluginFileManager;
private observerManager: ObserverManager;
@@ -160,7 +151,6 @@ export default class ExcalidrawPlugin extends Plugin {
public wasPenModeActivePreviously: boolean = false;
public popScope: Function = null;
public lastPDFLeafID: string = null;
public forceExcalidrawViewMode: boolean = false;
constructor(app: App, manifest: PluginManifest) {
super(app, manifest);
@@ -409,8 +399,6 @@ export default class ExcalidrawPlugin extends Plugin {
}
this.logStartupEvent("Styles manager initialized");
this.updatePhoneFooterSafeAreaPadding();
try {
this.scriptEngine = new ScriptEngine(this);
} catch (e) {
@@ -627,41 +615,6 @@ export default class ExcalidrawPlugin extends Plugin {
}
});
}
public updatePhoneFooterSafeAreaPadding() {
const documents = new Set<Document>([document, ...this.getOpenObsidianDocuments()]);
const shouldEnable = DEVICE.isPhone && this.settings?.phoneFooterSafeAreaPadding;
documents.forEach((ownerDocument) => {
const existingStylesheet = ownerDocument.getElementById(PHONE_FOOTER_SAFE_AREA_STYLE_ID);
if (!shouldEnable) {
if (existingStylesheet) {
ownerDocument.head.removeChild(existingStylesheet);
}
return;
}
if (existingStylesheet instanceof HTMLStyleElement) {
existingStylesheet.textContent = PHONE_FOOTER_SAFE_AREA_CSS;
return;
}
const stylesheet = ownerDocument.createElement("style");
stylesheet.id = PHONE_FOOTER_SAFE_AREA_STYLE_ID;
stylesheet.textContent = PHONE_FOOTER_SAFE_AREA_CSS;
ownerDocument.head.appendChild(stylesheet);
});
}
private removePhoneFooterSafeAreaPadding() {
const documents = new Set<Document>([document, ...this.getOpenObsidianDocuments()]);
documents.forEach((ownerDocument) => {
const existingStylesheet = ownerDocument.getElementById(PHONE_FOOTER_SAFE_AREA_STYLE_ID);
if (existingStylesheet) {
ownerDocument.head.removeChild(existingStylesheet);
}
});
}
private getOpenObsidianDocuments(): Document[] {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.getOpenObsidianDocuments,`ExcalidrawPlugin.getOpenObsidianDocuments`);
@@ -820,26 +773,6 @@ 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}`);
@@ -1254,7 +1187,6 @@ export default class ExcalidrawPlugin extends Plugin {
this.stylesManager = null;
this.removeFonts();
this.removePhoneFooterSafeAreaPadding();
this.eaInstances.forEach((ea) => ea?.destroy());
this.eaInstances.clear();
@@ -1306,9 +1238,13 @@ export default class ExcalidrawPlugin extends Plugin {
terminateCompressionWorker();
}
public async loadSettings(opts: { reEnableAutosave?: boolean } = { reEnableAutosave: false }
public async loadSettings(opts: {
applyLefthandedMode?: boolean,
reEnableAutosave?: boolean
} = {applyLefthandedMode: true, reEnableAutosave: false}
) {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.loadSettings,`ExcalidrawPlugin.loadSettings`, opts);
if(typeof opts.applyLefthandedMode === "undefined") opts.applyLefthandedMode = true;
if(typeof opts.reEnableAutosave === "undefined") opts.reEnableAutosave = false;
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
if(!this.settings.previewImageType) { //migration 1.9.13
@@ -1320,6 +1256,7 @@ export default class ExcalidrawPlugin extends Plugin {
: PreviewImageType.PNG;
}
}
if(opts.applyLefthandedMode) setLeftHandedMode(this.settings.isLeftHanded);
if(opts.reEnableAutosave) this.settings.autosave = true;
setDebugging(this.settings.isDebugMode);
}
@@ -1594,8 +1531,4 @@ export default class ExcalidrawPlugin extends Plugin {
};
return new InlineLinkSuggester(this.app, this, inputEl, getSourcePath, widthWrapper, surpessPlaceholder, containerEl);
}
public getPreferredUIMode(): UIMode {
return calculateUIModeValue(this.settings);
}
}
+16 -37
View File
@@ -15,12 +15,10 @@ import {
ICON_NAME,
IMAGE_TYPES,
DEVICE,
CaptureUpdateAction,
sceneCoordsToViewportCoords,
fileid,
} from "../../constants/constants";
import ExcalidrawView from "../../view/ExcalidrawView";
import { TextMode } from "../../shared/TextMode";
import ExcalidrawView, { TextMode } from "../../view/ExcalidrawView";
import {
REGEX_LINK,
} from "../../shared/ExcalidrawData";
@@ -53,8 +51,7 @@ import {
decompress,
getImageSize,
} from "../../utils/utils";
import { extractSVGPNGFileName, getActivePDFPageNumberFromPDFView, getExcalidrawViews, isObsidianThemeDark, mergeMarkdownFiles, setExcalidrawView } from "../../utils/obsidianUtils";
import { getAttachmentsFolderAndFilePath } from "../../utils/pathUtils";
import { extractSVGPNGFileName, getActivePDFPageNumberFromPDFView, getAttachmentsFolderAndFilePath, isObsidianThemeDark, mergeMarkdownFiles, setExcalidrawView } from "../../utils/obsidianUtils";
import { ExcalidrawElement, ExcalidrawEmbeddableElement, ExcalidrawImageElement, ExcalidrawTextElement, FileId } from "@zsviczian/excalidraw/types/element/src/types";
import { ReleaseNotes } from "../../shared/Dialogs/ReleaseNotes";
import { ScriptInstallPrompt } from "../../shared/Dialogs/ScriptInstallPrompt";
@@ -106,19 +103,6 @@ export class CommandManager {
this.plugin = plugin;
}
private setAllExcalidrawViewsToViewMode(enabled: boolean) {
getExcalidrawViews(this.app, true).forEach((view) => {
view.updateScene({
appState: {
viewModeEnabled: enabled,
zenModeEnabled: enabled ? false : view.excalidrawAPI?.getAppState()?.zenModeEnabled,
},
captureUpdate: CaptureUpdateAction.NEVER,
});
view.toolsPanelRef?.current?.setExcalidrawViewMode(enabled);
});
}
public initialize() {
try {
this.taskbone = new Taskbone(this.plugin);
@@ -410,17 +394,6 @@ export class CommandManager {
}
})
this.addCommand({
id: "excalidraw-toggle-session-view-mode",
name: t("TEMPORARY_TOGGLE_VIEW_MODE_FOR_ALL_DRAWINGS"),
checkCallback: (checking) => {
if (checking) return true;
this.plugin.forceExcalidrawViewMode = !this.plugin.forceExcalidrawViewMode;
this.setAllExcalidrawViewsToViewMode(this.plugin.forceExcalidrawViewMode);
return true;
}
})
this.addCommand({
id: "excalidraw-download-lib",
name: t("DOWNLOAD_LIBRARY"),
@@ -1027,7 +1000,7 @@ export class CommandManager {
if(this.app.workspace.getActiveViewOfType(ExcalidrawView)) {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
const api = view?.excalidrawAPI as ExcalidrawImperativeAPI;
if(!api || !api.isTrayModeEnabled()) return false;
if(!api.isTrayModeEnabled()) return false;
return true;
}
return false;
@@ -1035,10 +1008,13 @@ export class CommandManager {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
(async()=>{
const isLeftHanded = this.settings.isLeftHanded;
await this.plugin.loadSettings();
await this.plugin.loadSettings({applyLefthandedMode: false});
this.settings.isLeftHanded = !isLeftHanded;
this.plugin.saveSettings();
//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(!isLeftHanded);
setTimeout(()=>setLeftHandedMode(!isLeftHanded));
})()
return true;
},
@@ -1049,7 +1025,12 @@ export class CommandManager {
name: t("TOGGLE_ENABLE_CONTEXT_MENU"),
checkCallback: (checking: boolean) => {
if (checking) {
return Boolean(this.app.workspace.getActiveViewOfType(ExcalidrawView));
if(this.app.workspace.getActiveViewOfType(ExcalidrawView)) {
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
const api = view?.excalidrawAPI as ExcalidrawImperativeAPI;
return true;
}
return false;
}
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
view.toggleEnableContextMenu();
@@ -1061,7 +1042,7 @@ export class CommandManager {
id: "flip-image",
name: t("FLIP_IMAGE"),
checkCallback: (checking:boolean) => {
if (!DEVICE.isDesktop) return false;
if (!DEVICE.isDesktop) return;
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
if(!view) return false;
if(!view.excalidrawAPI) return false;
@@ -1120,10 +1101,8 @@ export class CommandManager {
if(checking) return true;
(async()=>{
const ea = getEA(view) as ExcalidrawAutomate;
const isAnchored = Boolean(el.customData?.isAnchored);
const imgId = ef.pdfPageViewProps
? await ea.addImage(el.x+el.width/5, el.y+el.height/5, el.link?.match(/\[\[([^\]]+)]]/)?.[1] ?? ef.linkParts.original,!isAnchored, isAnchored)
: await ea.addImage(el.x+el.width/5, el.y+el.height/5, ef.file,!isAnchored, isAnchored);
const isAnchored = Boolean(el.customData?.isAnchored);
const imgId = await ea.addImage(el.x+el.width/5, el.y+el.height/5, ef.file,!isAnchored, isAnchored);
const img = ea.getElement(imgId) as Mutable<ExcalidrawImageElement>;
img.width = el.width;
img.height = el.height;
+18 -9
View File
@@ -8,7 +8,6 @@ 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
@@ -119,9 +118,7 @@ export class EventManager {
}
private onLayoutChangeHandler() {
if (this.app.workspace.layoutReady) {
getExcalidrawViews(this.app, true).forEach(excalidrawView=>!!excalidrawView?.refresh && excalidrawView.refresh());
}
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.refresh());
}
private onPasteHandler (evt: ClipboardEvent, editor: Editor, info: MarkdownView | MarkdownFileInfo ) {
@@ -142,15 +139,12 @@ export class EventManager {
if (element.type === "image") {
const fileinfo = this.plugin.filesMaster.get(element.fileId);
if(fileinfo && fileinfo.path) {
let path = fileinfo.path.split("|")[0]; // strip size anchoring (e.g. |100%)
let path = fileinfo.path;
const sourceFile = info.file;
const imageFile = this.app.vault.getAbstractFileByPath(path);
if(sourceFile && imageFile && imageFile instanceof TFile) {
path = this.app.metadataCache.fileToLinktext(imageFile,sourceFile.path);
}
if (fileinfo.blockrefData) {
path = `${path}#${fileinfo.blockrefData.split("|")[0]}`; // strip size anchoring (e.g. |100%)
}
editorInsertText(editor, getLink(this.plugin, {path}));
}
return;
@@ -240,7 +234,22 @@ export class EventManager {
this.plugin.removeModalContainerObserver();
}
setMobileNavbarPosition(!!newActiveviewEV);
//!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="";
}
}
//----------------------
//----------------------
+1 -7
View File
@@ -3,8 +3,7 @@ import { App, FrontMatterCache, MarkdownView, MetadataCache, normalizePath, Noti
import { BLANK_DRAWING, DARK_BLANK_DRAWING, DEVICE, EXPORT_TYPES, FRONTMATTER, FRONTMATTER_KEYS, JSON_parse, nanoid, VIEW_TYPE_EXCALIDRAW } from "src/constants/constants";
import { Prompt, templatePromt } from "src/shared/Dialogs/Prompt";
import { changeThemeOfExcalidrawMD, ExcalidrawData, getMarkdownDrawingSection } from "../../shared/ExcalidrawData";
import ExcalidrawView from "src/view/ExcalidrawView";
import { getTextMode } from "src/shared/TextMode";
import ExcalidrawView, { getTextMode } from "src/view/ExcalidrawView";
import ExcalidrawPlugin from "src/core/main";
import { DEBUGGING } from "src/utils/debugHelper";
import { checkAndCreateFolder, createFileAndAwaitMetacacheUpdate, download, getIMGFilename, getLink, getListOfTemplateFiles, getNewUniqueFilepath } from "src/utils/fileUtils";
@@ -412,11 +411,6 @@ export class PluginFileManager {
if (!this.isExcalidrawFile(file)) {
return;
}
if (this.app.workspace.activeLeaf?.view instanceof ExcalidrawView && this.app.workspace.activeLeaf.view.file === file) {
this.plugin.lastActiveExcalidrawFilePath = file.path;
}
this.moveBAKFile(oldPath, file.path);
if (!this.settings.keepInSync) {
+9 -26
View File
@@ -150,17 +150,16 @@ const _getPNG = async ({imgAttributes,filenameParts,theme,cacheReady,img,file,ex
return img;
}
const setStyle = ({element,imgAttributes,onCanvas, isNativeSVG}:{
const setStyle = ({element,imgAttributes,onCanvas}:{
element: HTMLElement,
imgAttributes: imgElementAttributes,
onCanvas: boolean,
isNativeSVG: boolean,
}
) => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(setStyle, `MarkdownPostProcessor.ts > setStyle`);
let style = "";
if(imgAttributes.fwidth) {
style = `${isNativeSVG ? "max-width:" : "max-width:100%; width:"}${imgAttributes.fwidth}${imgAttributes.fwidth.match(/\d$/) ? "px":""}; `; //width:100%;`; //removed !important https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/886
style = `max-width:${imgAttributes.fwidth}${imgAttributes.fwidth.match(/\d$/) ? "px":""}; `; //width:100%;`; //removed !important https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/886
} else {
style = "width: fit-content;"
}
@@ -243,13 +242,12 @@ const _getSVGIMG = async ({filenameParts,theme,cacheReady,img,file,exportSetting
}
//need to remove width and height attributes to support area= embeds
//svg.removeAttribute("width");
svg.setAttribute("width", "6000");
svg.removeAttribute("width");
svg.removeAttribute("height");
return addSVGToImgSrc(img, svg, cacheReady, cacheKey);
}
const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,file,exportSettings,loader, width}:{
const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,file,exportSettings,loader}:{
filenameParts: FILENAMEPARTS,
theme: string,
cacheReady: boolean,
@@ -257,7 +255,6 @@ 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;
@@ -305,11 +302,7 @@ const _getSVGNative = async ({filenameParts,theme,cacheReady,containerElement,fi
cacheReady && imageCache.addImageToCache(cacheKey,"", svg);
}
if(width && !isNaN(width)) {
svg.setAttribute("width", width.toString());
} else {
svg.removeAttribute("width");
}
svg.removeAttribute("width");
svg.removeAttribute("height");
containerElement.append(svg);
return containerElement;
@@ -374,28 +367,18 @@ const getIMG = async (
switch (plugin.settings.previewImageType) {
case PreviewImageType.PNG: {
const img = createEl("img");
setStyle({element:img,imgAttributes,onCanvas, isNativeSVG: false});
setStyle({element:img,imgAttributes,onCanvas});
return await _getPNG({imgAttributes,filenameParts,theme,cacheReady,img,file,exportSettings,loader});
}
case PreviewImageType.SVGIMG: {
const img = createEl("img");
setStyle({element:img,imgAttributes,onCanvas, isNativeSVG: false});
setStyle({element:img,imgAttributes,onCanvas});
return await _getSVGIMG({filenameParts,theme,cacheReady,img,file,exportSettings,loader});
}
case PreviewImageType.SVG: {
const img = createEl("div");
setStyle({element:img,imgAttributes,onCanvas, isNativeSVG: true});
return await _getSVGNative({
filenameParts,
theme,
cacheReady,
containerElement: img,file,
exportSettings,
loader,
width: imgAttributes.fwidth
? (!imgAttributes.fwidth.endsWith("%") ? parseInt(imgAttributes.fwidth) : 6000)
: undefined,
});
setStyle({element:img,imgAttributes,onCanvas});
return await _getSVGNative({filenameParts,theme,cacheReady,containerElement: img,file,exportSettings,loader});
}
}
};
+50 -117
View File
@@ -1,7 +1,6 @@
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";
@@ -30,9 +29,6 @@ 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);
@@ -80,9 +76,9 @@ export class ObserverManager {
setTimeout(()=>{ //run async to avoid blocking the UI
const theme = isObsidianThemeDark() ? "dark" : "light";
const excalidrawViews = getExcalidrawViews(this.app, true);
const excalidrawViews = getExcalidrawViews(this.app);
excalidrawViews.forEach(excalidrawView => {
if (excalidrawView.file) {
if (excalidrawView.file && excalidrawView.excalidrawAPI) {
excalidrawView.setTheme(theme);
}
});
@@ -123,9 +119,8 @@ 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 || el.querySelector(`.${tagClassName}`)) {
if (el.childElementCount !== 1) {
return;
}
const filename = el.getAttribute("data-path");
@@ -139,7 +134,7 @@ export class ObserverManager {
if (this.plugin.isExcalidrawFile(f)) {
el.insertAfter(
createDiv({
cls: ["nav-file-tag", tagClassName],
cls: "nav-file-tag",
text: this.settings.experimentalFileTag,
}),
el.firstChild,
@@ -149,27 +144,14 @@ export class ObserverManager {
const fileExplorerObserverFn:MutationCallback = (mutationsList) => {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(fileExplorerObserverFn, `ExcalidrawPlugin.experimentalFileTypeDisplay > fileExplorerObserverFn`, mutationsList);
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);
const mutationsWithNodes = mutationsList.filter((mutation) => mutation.addedNodes.length > 0);
mutationsWithNodes.forEach((mutationNode) => {
mutationNode.addedNodes.forEach((node) => {
if (!(node instanceof Element)) {
return;
}
return;
}
if (mutation.type === "attributes" && mutation.target instanceof Element) {
ensureFiletypes(mutation.target);
}
node.querySelectorAll(".nav-file-title").forEach(insertFiletype);
});
});
};
@@ -177,44 +159,11 @@ export class ObserverManager {
? new CustomMutationObserver(fileExplorerObserverFn, "fileExplorerObserver")
: new MutationObserver(fileExplorerObserverFn);
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, {
//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, {
childList: true,
subtree: true,
});
@@ -270,60 +219,44 @@ export class ObserverManager {
private addWorkspaceDrawerObserver() {
//when the user activates the sliding drawers on Obsidian Mobile
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;
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;
}
this.plugin.activeExcalidrawView.save();
};
const options = {
attributeOldValue: true,
attributeFilter: ["style"],
};
// Drawer just opened after being hidden: keep the previous autosave safeguard
if (oldDisplay === "none" && newDisplay !== "none" && activeView.isDirty()) {
activeView.save();
}
if (leftWorkspaceDrawer) {
this.workspaceDrawerLeftObserver = DEBUGGING
? new CustomMutationObserver(action, "slidingDrawerLeftObserver")
: new MutationObserver(action);
this.workspaceDrawerLeftObserver.observe(leftWorkspaceDrawer, 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);
if (rightWorkspaceDrawer) {
this.workspaceDrawerRightObserver = DEBUGGING
? new CustomMutationObserver(action, "slidingDrawerRightObserver")
: new MutationObserver(action);
this.workspaceDrawerRightObserver.observe(
rightWorkspaceDrawer,
options,
);
}
}
}
}
+111 -189
View File
@@ -2,6 +2,7 @@ import {
App,
ButtonComponent,
DropdownComponent,
ExtraButtonComponent,
getIcon,
Modifier,
normalizePath,
@@ -10,7 +11,7 @@ import {
TextComponent,
TFile,
} from "obsidian";
import { GITHUB_RELEASES, LOGO_EXCALIDRAW_MASTERY, setRootElementSize } from "src/constants/constants";
import { GITHUB_RELEASES, setRootElementSize, THEME_FILTER } from "src/constants/constants";
import { t } from "src/lang/helpers";
import type ExcalidrawPlugin from "src/core/main";
import { PenStyle } from "src/types/penTypes";
@@ -38,7 +39,7 @@ import { ANNOTATED_PREFIX, CROPPED_PREFIX } from "src/utils/carveout";
import { EDITOR_FADEOUT } from "src/core/editor/EditorHandler";
import { setDebugging } from "src/utils/debugHelper";
import { Rank } from "src/constants/actionIcons";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { TAG_AUTOEXPORT, TAG_IMAGECACHE, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { HotkeyEditor } from "src/shared/Dialogs/HotkeyEditor";
import { getExcalidrawViews } from "src/utils/obsidianUtils";
import { createSliderWithText } from "src/utils/sliderUtils";
@@ -48,10 +49,12 @@ import { UIMode, UIModeSettingsComponent } from "src/shared/Dialogs/UIModeSettin
import { ScriptSettingValue } from "src/types/excalidrawAutomateTypes";
export interface ExcalidrawSettings {
invertSVGforDarkMode: boolean;
invertBitmapforDarkMode: boolean;
themeFilter: string;
copyLinkToElemenetAnchorTo100: boolean;
copyFrameLinkByName: boolean;
disableDoubleClickTextEditing: boolean;
phoneFooterSafeAreaPadding: boolean;
folder: string;
cropFolder: string;
annotateFolder: string;
@@ -93,7 +96,6 @@ export interface ExcalidrawSettings {
isLeftHanded: boolean;
desktopUIMode: UIMode;
tabletUIMode: UIMode;
phoneUIMode: UIMode;
iframeMatchExcalidrawTheme: boolean;
matchTheme: boolean;
matchThemeAlways: boolean;
@@ -180,7 +182,6 @@ export interface ExcalidrawSettings {
};
previousRelease: string;
showReleaseNotes: boolean;
excalidrawMasteryPromoCollapsed: boolean;
compareManifestToPluginVersion: boolean;
showNewVersionNotification: boolean;
//mathjaxSourceURL: string;
@@ -242,10 +243,12 @@ export interface ExcalidrawSettings {
declare const PLUGIN_VERSION:string;
export const DEFAULT_SETTINGS: ExcalidrawSettings = {
invertSVGforDarkMode: true,
invertBitmapforDarkMode: false,
themeFilter: THEME_FILTER,
copyLinkToElemenetAnchorTo100: false,
copyFrameLinkByName: false,
disableDoubleClickTextEditing: false,
phoneFooterSafeAreaPadding: false,
folder: "Excalidraw",
cropFolder: "",
annotateFolder: "",
@@ -273,8 +276,8 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
annotateSuffix: "",
annotatePrefix: ANNOTATED_PREFIX,
annotatePreserveSize: false,
displaySVGInPreview: false,
previewImageType: PreviewImageType.SVG,
displaySVGInPreview: undefined,
previewImageType: undefined,
renderingConcurrency: 3,
allowImageCache: true,
allowImageCacheInScene: true,
@@ -287,7 +290,6 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
isLeftHanded: false,
desktopUIMode: "tray",
tabletUIMode: "compact",
phoneUIMode: "mobile",
iframeMatchExcalidrawTheme: true,
matchTheme: false,
matchThemeAlways: false,
@@ -375,7 +377,6 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
scriptEngineSettings: {},
previousRelease: "0.0.0",
showReleaseNotes: true,
excalidrawMasteryPromoCollapsed: false,
compareManifestToPluginVersion: true,
showNewVersionNotification: true,
//mathjaxSourceURL: "https://cdn.jsdelivr.net/npm/mathjax@3.2.1/es5/tex-svg.js",
@@ -435,10 +436,10 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
startupScriptPath: "",
aiEnabled: true,
openAIAPIToken: "",
openAIDefaultTextModel: "gpt-5-mini",
openAIDefaultTextModel: "gpt-3.5-turbo-1106",
openAIDefaultTextModelMaxTokens: 4096,
openAIDefaultVisionModel: "gpt-5-mini",
openAIDefaultImageGenerationModel: "gpt-image-1",
openAIDefaultVisionModel: "gpt-4o",
openAIDefaultImageGenerationModel: "dall-e-3",
openAIURL: "https://api.openai.com/v1/chat/completions",
openAIImageGenerationURL: "https://api.openai.com/v1/images/generations",
openAIImageEditsURL: "https://api.openai.com/v1/images/edits",
@@ -475,11 +476,11 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
LinkClickAction: {
defaultAction: "new-tab",
rules: [
{ shift: true, ctrl_cmd: true, alt_opt: false, meta_ctrl: false, result: "active-pane" },
{ shift: false, ctrl_cmd: true, alt_opt: false, meta_ctrl: false, result: "new-tab" },
{ shift: false, ctrl_cmd: true, alt_opt: true , meta_ctrl: false, result: "new-pane" },
{ shift: true , ctrl_cmd: true, alt_opt: true , meta_ctrl: false, result: "popout-window" },
{ shift: false, ctrl_cmd: true, alt_opt: false, meta_ctrl: true , result: "md-properties" },
{ shift: false, ctrl_cmd: false, alt_opt: false, meta_ctrl: false, result: "active-pane" },
{ shift: false, ctrl_cmd: true , alt_opt: false, meta_ctrl: false, result: "new-tab" },
{ shift: false, ctrl_cmd: true , alt_opt: true , meta_ctrl: false, result: "new-pane" },
{ shift: true , ctrl_cmd: true , alt_opt: true , meta_ctrl: false, result: "popout-window" },
{ shift: false, ctrl_cmd: true , alt_opt: false, meta_ctrl: true , result: "md-properties" },
],
},
},
@@ -554,10 +555,6 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
private requestReloadDrawings: boolean = false;
private requestUpdatePinnedPens: boolean = false;
private requestUpdateDynamicStyling: boolean = false;
private settingsDirty: boolean = false;
private settingsRevision: number = 0;
private isPersistingSettings: boolean = false;
private settingsFocusoutHandler: ((event: FocusEvent) => void) | null = null;
private hotkeyEditor: HotkeyEditor;
//private reloadMathJax: boolean = false;
//private applyDebounceTimer: number = 0;
@@ -567,12 +564,21 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.plugin = plugin;
}
private markSettingsDirty() {
this.settingsDirty = true;
this.settingsRevision += 1;
applySettingsUpdate(requestReloadDrawings: boolean = false) {
if (requestReloadDrawings) {
this.requestReloadDrawings = true;
}
}
private normalizeSettingsBeforeSave() {
async hide() {
if(this.plugin.settings.overrideObsidianFontSize) {
document.documentElement.style.fontSize = "";
setRootElementSize(16);
} else if(!document.documentElement.style.fontSize) {
document.documentElement.style.fontSize = getComputedStyle(document.body).getPropertyValue("--font-text-size");
setRootElementSize();
}
this.plugin.settings.scriptFolderPath = normalizePath(
this.plugin.settings.scriptFolderPath,
);
@@ -582,80 +588,14 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
) {
this.plugin.settings.scriptFolderPath = "Excalidraw/Scripts";
}
}
private async persistDirtySettings() {
if (!this.settingsDirty || this.isPersistingSettings) {
return;
}
this.isPersistingSettings = true;
try {
while (this.settingsDirty) {
const revisionToSave = this.settingsRevision;
this.normalizeSettingsBeforeSave();
await this.plugin.saveSettings();
if (this.settingsRevision === revisionToSave) {
this.settingsDirty = false;
}
}
} finally {
this.isPersistingSettings = false;
}
}
private detachSettingsFocusoutHandler() {
if (!this.settingsFocusoutHandler) {
return;
}
this.containerEl.removeEventListener("focusout", this.settingsFocusoutHandler);
this.settingsFocusoutHandler = null;
}
private attachSettingsFocusoutHandler() {
this.detachSettingsFocusoutHandler();
this.settingsFocusoutHandler = (event: FocusEvent) => {
window.setTimeout(() => {
if (!this.settingsDirty || !this.containerEl?.isConnected) {
return;
}
const nextFocusTarget = (event.relatedTarget as Node | null) ?? this.containerEl.ownerDocument.activeElement;
if (nextFocusTarget && this.containerEl.contains(nextFocusTarget)) {
return;
}
void this.persistDirtySettings();
}, 0);
};
this.containerEl.addEventListener("focusout", this.settingsFocusoutHandler);
}
applySettingsUpdate(requestReloadDrawings: boolean = false) {
this.markSettingsDirty();
if (requestReloadDrawings) {
this.requestReloadDrawings = true;
}
}
async hide() {
this.detachSettingsFocusoutHandler();
if(this.plugin.settings.overrideObsidianFontSize) {
document.documentElement.style.fontSize = "";
setRootElementSize(16);
} else if(!document.documentElement.style.fontSize) {
document.documentElement.style.fontSize = getComputedStyle(document.body).getPropertyValue("--font-text-size");
setRootElementSize();
}
await this.persistDirtySettings();
this.plugin.saveSettings();
if (this.requestUpdatePinnedPens) {
getExcalidrawViews(this.app, true).forEach(excalidrawView =>
getExcalidrawViews(this.app).forEach(excalidrawView =>
excalidrawView.updatePinnedCustomPens()
)
}
if (this.requestUpdateDynamicStyling) {
getExcalidrawViews(this.app, true).forEach(excalidrawView =>
getExcalidrawViews(this.app).forEach(excalidrawView =>
setDynamicStyle(this.plugin.ea,excalidrawView,excalidrawView.previousBackgroundColor,this.plugin.settings.dynamicStyling)
)
}
@@ -664,7 +604,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.plugin.registerHotkeyOverrides();
}
if (this.requestReloadDrawings) {
const excalidrawViews = getExcalidrawViews(this.app, true);
const excalidrawViews = getExcalidrawViews(this.app);
for (const excalidrawView of excalidrawViews) {
await excalidrawView.save(false);
//debug({where:"ExcalidrawSettings.hide",file:v.view.file.name,before:"reload(true)"})
@@ -685,13 +625,11 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
let detailsEl: HTMLElement;
await this.plugin.loadSettings(); //in case sync loaded changed settings in the background
this.settingsDirty = false;
this.requestEmbedUpdate = false;
this.requestReloadDrawings = false;
const { containerEl } = this;
containerEl.addClass("excalidraw-settings");
this.containerEl.empty();
this.attachSettingsFocusoutHandler();
// ------------------------------------------------
// Search and Settings to Clipboard
@@ -712,73 +650,6 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}`;
}
);
const excalidrawMasteryPromo = containerEl.createEl("details", {
cls: "setting-item-description excalidraw-mastery-promo",
});
excalidrawMasteryPromo.open = !this.plugin.settings.excalidrawMasteryPromoCollapsed;
excalidrawMasteryPromo.classList.toggle(
"is-collapsed",
this.plugin.settings.excalidrawMasteryPromoCollapsed,
);
const excalidrawMasterySummary = excalidrawMasteryPromo.createEl("summary", {
cls: "excalidraw-mastery-promo__summary",
});
const excalidrawMasterySummaryTitle = excalidrawMasterySummary.createEl("span", {
cls: "excalidraw-mastery-promo__summary-title",
text: "Excalidraw Mastery",
});
const excalidrawMasterySummaryState = excalidrawMasterySummary.createEl("span", {
cls: "excalidraw-mastery-promo__summary-state",
});
const excalidrawMasteryLink = "https://community.sketch-your-mind.com/em";
const updateExcalidrawMasteryPromoState = (persist: boolean) => {
const isCollapsed = !excalidrawMasteryPromo.open;
this.plugin.settings.excalidrawMasteryPromoCollapsed = isCollapsed;
excalidrawMasteryPromo.classList.toggle("is-collapsed", isCollapsed);
excalidrawMasterySummaryTitle.classList.toggle("is-hidden", !isCollapsed);
excalidrawMasterySummaryState.setText(
isCollapsed ? t("EXCALIDRAW_MASTERY_PROMO_SHOW") : t("EXCALIDRAW_MASTERY_PROMO_HIDE"),
);
if (persist) {
void this.plugin.saveSettings();
}
};
excalidrawMasteryPromo.addEventListener("toggle", () => updateExcalidrawMasteryPromoState(true));
updateExcalidrawMasteryPromoState(false);
const excalidrawMasteryContent = excalidrawMasteryPromo.createDiv({
cls: "excalidraw-mastery-promo__content",
});
const excalidrawMasteryImageLink = excalidrawMasteryContent.createEl("a", {
cls: "excalidraw-mastery-promo__image-link",
href: excalidrawMasteryLink,
attr: {
"aria-label": t("EXCALIDRAW_MASTERY_PROMO_ARIA"),
"target": "_blank",
"rel": "noopener noreferrer",
},
});
excalidrawMasteryImageLink.createEl("img", {
cls: "excalidraw-mastery-promo__image",
attr: {
src: LOGO_EXCALIDRAW_MASTERY,
alt: "Excalidraw Mastery",
},
});
const excalidrawMasteryText = excalidrawMasteryContent.createDiv({
cls: "excalidraw-mastery-promo__text",
});
excalidrawMasteryText.innerHTML = t("EXCALIDRAW_MASTERY_PROMO_HTML");
excalidrawMasteryText.querySelectorAll("a").forEach((anchor: HTMLAnchorElement) => {
anchor.setAttribute("aria-label", t("EXCALIDRAW_MASTERY_PROMO_ARIA"));
anchor.setAttribute("target", "_blank");
anchor.setAttribute("rel", "noopener noreferrer");
});
// ------------------------------------------------
@@ -806,7 +677,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
},
{
icon: getIcon("globe").outerHTML,
href: "https://community.sketch-your-mind.com/wiki",
href: "https://excalidraw-obsidian.online/",
aria: t("LINKS_WIKI_ARIA"),
text: t("LINKS_WIKI"),
},
@@ -817,10 +688,10 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
text: t("LINKS_YT"),
},
{
icon: getIcon("graduation-cap").outerHTML,
href: "https://community.sketch-your-mind.com/ee",
aria: t("LINKS_JOIN_SYM_ARIA"),
text: t("LINKS_JOIN_SYM"),
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: t("LINKS_DISCORD_ARIA"),
text: t("LINKS_DISCORD"),
},
{
icon: getIcon("twitter").outerHTML,
@@ -828,6 +699,12 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
aria: t("LINKS_TWITTER"),
text: t("LINKS_TWITTER"),
},
{
icon: getIcon("graduation-cap").outerHTML,
href: "https://visual-thinking-workshop.com",
aria: t("LINKS_VTW_ARIA"),
text: t("LINKS_VTW"),
},
{
icon: getIcon("book").outerHTML,
href: "https://sketch-your-mind.com",
@@ -843,7 +720,6 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
});
});
// ------------------------------------------------
// Saving
// ------------------------------------------------
@@ -1553,19 +1429,6 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}),
);
new Setting(detailsEl)
.setName(t("PHONE_FOOTER_SAFE_AREA_PADDING_NAME"))
.setDesc(fragWithHTML(t("PHONE_FOOTER_SAFE_AREA_PADDING_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.phoneFooterSafeAreaPadding)
.onChange(async (value) => {
this.plugin.settings.phoneFooterSafeAreaPadding = value;
this.plugin.updatePhoneFooterSafeAreaPadding();
this.applySettingsUpdate();
}),
);
detailsEl = displayDetailsEl.createEl("details");
detailsEl.createEl("summary", {
text: t("ZOOM_AND_PAN_HEAD"), //mfuria #329
@@ -1594,7 +1457,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
.setValue(this.plugin.settings.allowPinchZoom)
.onChange(async (value) => {
this.plugin.settings.allowPinchZoom = value;
getExcalidrawViews(this.app, true).forEach(excalidrawView=>excalidrawView.updatePinchZoom())
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.updatePinchZoom())
this.applySettingsUpdate();
}),
);
@@ -1608,7 +1471,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
.setValue(this.plugin.settings.allowWheelZoom)
.onChange(async (value) => {
this.plugin.settings.allowWheelZoom = value;
getExcalidrawViews(this.app, true).forEach(excalidrawView=>excalidrawView.updateWheelZoom());
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.updateWheelZoom());
this.applySettingsUpdate();
}),
);
@@ -1758,11 +1621,11 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
});
const updateGridColor = () => {
getExcalidrawViews(this.app, true).forEach(excalidrawView=>excalidrawView.updateGridColor());
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.updateGridColor());
};
const updateGridDirection = () => {
getExcalidrawViews(this.app, true).forEach(excalidrawView=>
getExcalidrawViews(this.app).forEach(excalidrawView=>
excalidrawView.updateGridDirection(this.plugin.settings.gridSettings.GRID_DIRECTION));
}
@@ -2367,7 +2230,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}
});
new Setting(detailsEl)
const embedImageCacheSetting = new Setting(detailsEl)
.setName(t("EMBED_IMAGE_CACHE_NAME"))
.setDesc(fragWithHTML(t("EMBED_IMAGE_CACHE_DESC")))
.addToggle((toggle) =>
@@ -2378,6 +2241,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
})
)
embedImageCacheSetting.controlEl.setAttribute("id",TAG_IMAGECACHE);
new Setting(detailsEl)
.setName(t("SCENE_IMAGE_CACHE_NAME"))
.setDesc(fragWithHTML(t("SCENE_IMAGE_CACHE_DESC")))
@@ -2560,6 +2424,64 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("EMBED_INVERT_SVG"))
.setDesc(fragWithHTML(t("EMBED_INVERT_SVG_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.invertSVGforDarkMode)
.onChange(async (value) => {
this.plugin.settings.invertSVGforDarkMode = value;
this.applySettingsUpdate();
}),
);
new Setting(detailsEl)
.setName(t("EMBED_INVERT_BITMAP"))
.setDesc(fragWithHTML(t("EMBED_INVERT_BITMAP_DESC")))
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.invertBitmapforDarkMode)
.onChange(async (value) => {
this.plugin.settings.invertBitmapforDarkMode = value;
this.applySettingsUpdate();
}),
);
let themeFilterSettingText:TextComponent;
let themeFilterResetButton:ExtraButtonComponent;
new Setting(detailsEl)
.setName(t("EMBED_THEME_FILTER_NAME"))
.setDesc(fragWithHTML(t("EMBED_THEME_FILTER_DESC")))
.addText((text) => {
themeFilterSettingText = text;
text
.setPlaceholder("e.g.: brightness(0.9) contrast(1.2)")
.setValue(this.plugin.settings.themeFilter)
.onChange(async (value) => {
this.plugin.settings.themeFilter = value;
this.applySettingsUpdate();
if (value !== THEME_FILTER) {
themeFilterResetButton.extraSettingsEl.style.display = "";
}
})
})
.addExtraButton((btn) => {
themeFilterResetButton = btn;
btn
.setIcon("rotate-ccw")
.setTooltip(t("RESET")!)
.onClick(() => {
themeFilterSettingText.setValue(THEME_FILTER);
this.plugin.settings.themeFilter = THEME_FILTER;
themeFilterResetButton.extraSettingsEl.style.display = "none";
this.applySettingsUpdate();
})
});
if(this.plugin.settings.themeFilter === THEME_FILTER) {
themeFilterResetButton.extraSettingsEl.style.display = "none";
}
detailsEl = exportDetailsEl.createEl("details");
detailsEl.createEl("summary", {
+25 -46
View File
@@ -3,8 +3,8 @@ import {
FRONTMATTER_KEYS,
CJK_FONTS,
} from "src/constants/constants";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierKeyLabels";
import { TAG_AUTOEXPORT, TAG_IMAGECACHE, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierkeyHelper";
declare const PLUGIN_VERSION:string;
@@ -59,8 +59,10 @@ 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: "Marker Frames Visible",
MARKER_FRAME_TITLE_SHOW: "Marker Frame Titles Visible",
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",
@@ -91,13 +93,10 @@ 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",
INSERT_LATEX:
`Insert LaTeX formula (e.g. \\binom{n}{k} = \\frac{n!}{k!(n-k)!}).`,
ENTER_LATEX: "Enter a valid LaTeX expression",
EDIT_LATEX: "Edit LaTeX formula",
READ_RELEASE_NOTES: "Read latest release notes",
ABOUT_EXCALIDRAW: "About Excalidraw",
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",
@@ -111,7 +110,6 @@ export default {
RESET_IMG_ASPECT_RATIO: "Reset selected image element aspect ratio",
TEMPORARY_DISABLE_AUTOSAVE: "Disable autosave until next time Obsidian starts (only set this if you know what you are doing)",
TEMPORARY_ENABLE_AUTOSAVE: "Enable autosave",
TEMPORARY_TOGGLE_VIEW_MODE_FOR_ALL_DRAWINGS: "Toggle view mode for all Excalidraw drawings until Obsidian restarts",
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)",
@@ -190,6 +188,8 @@ export default {
CONVERT_TO_MARKDOWN: "Convert to file...",
SELECT_TEXTELEMENT_ONLY: "Select text element only (not container)",
REMOVE_LINK: "Remove text element link",
LASER_ON: "Enable laser pointer",
LASER_OFF: "Disable laser pointer",
WELCOME_RANK_NEXT: "more drawings until the next rank!",
WELCOME_RANK_LEGENDARY: "You're at the top. Keep on being legendary!",
WELCOME_COMMAND_PALETTE: 'Type "Excalidraw" in the Command Palette',
@@ -198,8 +198,8 @@ export default {
WELCOME_HELP_MENU: "Find help in the hamburger-menu",
WELCOME_YOUTUBE_ARIA: "Visual PKM YouTube Channel",
WELCOME_YOUTUBE_LINK: "Check out the Visual PKM YouTube channel.",
WELCOME_SYM_ARIA: "Learn Excalidraw, Master PKM, Join the Community",
WELCOME_SYM_LINK: "Learn Excalidraw, Master PKM, Join the Community",
WELCOME_DISCORD_ARIA: "Join the Discord Server",
WELCOME_DISCORD_LINK: "Join the Discord Server",
WELCOME_TWITTER_ARIA: "Follow me on Twitter",
WELCOME_TWITTER_LINK: "Follow me on Twitter",
WELCOME_LEARN_ARIA: "Learn Visual PKM",
@@ -223,16 +223,12 @@ export default {
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.",
EXCALIDRAW_MASTERY_PROMO_ARIA: "Open Excalidraw Mastery",
EXCALIDRAW_MASTERY_PROMO_HTML: `<p><b>Feeling lost in the toggles and menus?</b></p><p>Excalidraw is a Visual PKM powerhouse built for heavy-duty workflows like <b>Visual-First Daily Notes</b>, deep <b>PDF research</b>, <b>automation</b>, <b>AI integration</b>, and <b>Visual Zettelkasten</b>. But all this power comes with complexity.</p><p>Skip the trial and error. <a href="https://community.sketch-your-mind.com/em" target="_blank">👉 Join Excalidraw Mastery</a> to learn these exact setups step-by-step. Overcome tool friction and master your knowledge alongside a supportive community of visual thinkers!</p>`,
EXCALIDRAW_MASTERY_PROMO_SHOW: "Show",
EXCALIDRAW_MASTERY_PROMO_HIDE: "Hide",
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_JOIN_SYM_ARIA: "Learn Excalidraw, Master Visual Thinking, Join the Community",
LINKS_JOIN_SYM: "Learn Excalidraw",
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",
@@ -319,16 +315,17 @@ 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-5-mini",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "Enter your default AI model here. e.g.: gpt-3.5-turbo-1106",
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 and gpt-image-1 at this time by OpenAI.<br>" +
"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>" +
"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.: gpt-image-1",
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "Enter your default Image Generation AI model here e.g.: dall-e-3",
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. " +
@@ -338,7 +335,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-5-mini",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "Enter your default AI vision model here. e.g.: gpt-4o",
SAVING_HEAD: "Saving",
SAVING_DESC: "In the 'Saving' section of Excalidraw Settings, you can configure how your drawings are saved. This includes options for compressing Excalidraw JSON in Markdown, setting autosave intervals for both desktop and mobile, defining filename formats, and choosing whether to use the .excalidraw.md or .md file extension. ",
COMPRESS_NAME: "Compress Excalidraw JSON in Markdown",
@@ -432,8 +429,6 @@ export default {
DEFAULT_OPEN_MODE_DESC:
"Specifies the mode how Excalidraw opens: Normal, Zen, or View mode. You may also set this behavior on a file level by " +
"adding the excalidraw-default-mode frontmatter key with a value of: normal, view, or zen to your document.",
PHONE_FOOTER_SAFE_AREA_PADDING_NAME: "Extra bottom padding for phone controls",
PHONE_FOOTER_SAFE_AREA_PADDING_DESC: "Adds extra bottom padding to the Excalidraw footer controls so zoom and undo buttons stay above the system navigation bar on phones. This setting only applies on phones.",
DEFAULT_PEN_MODE_NAME: "Pen mode",
DEFAULT_PEN_MODE_DESC:
"Should pen mode be automatically enabled when opening Excalidraw?",
@@ -469,13 +464,9 @@ export default {
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. " +
@@ -698,6 +689,13 @@ export default {
EMBED_IMAGE_CACHE_NAME: "Cache images for embedding in markdown",
EMBED_IMAGE_CACHE_DESC: "Cache images for embedding in markdown. This will speed up the embedding process, but in case you compose images of several sub-component drawings, " +
"the embedded image in Markdown won't update until you open the drawing and save it to trigger an update of the cache.",
EMBED_INVERT_SVG: "Invert embedded Excalidraw drawings and SVG images in dark mode",
EMBED_INVERT_SVG_DESC: "The change will only take affect when you reopen your drawing. When changing this setting, you may need to clear the <a href='#"+TAG_IMAGECACHE+"'>image cache</a>. This is the default for all images; set colorMap.invertInDarkMode to override per image.",
EMBED_INVERT_BITMAP: "Invert embedded bitmap images in dark mode",
EMBED_INVERT_BITMAP_DESC: "The change will only take affect when you reopen your drawing. When changing this setting, you may need to clear the <a href='#"+TAG_IMAGECACHE+"'>image cache</a>. This is the default for all images; set colorMap.invertInDarkMode to override per image.",
EMBED_THEME_FILTER_NAME: "Theme filter for color inversion",
EMBED_THEME_FILTER_DESC: "Modify this only if you know what you are doing. The change will only take affect when you reopen your drawing. When changing this setting, you may need to clear the <a href='#"+TAG_IMAGECACHE+"'>image cache</a>.",
RESET: "Reset to default",
SCENE_IMAGE_CACHE_NAME: "Cache nested Excalidraws in Scene",
SCENE_IMAGE_CACHE_DESC: "Cache nested Excalidraws in the Scene for faster scene rendering. This will speed up the rendering process, especially if you have deeply nested Excalidraws in your scene. " +
"Excalidraw will try to intelligently identify if any children of a nested Excalidraw have changed and will update the cache accordingly. " +
@@ -1229,30 +1227,11 @@ export default {
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_PDF: "as Pdf",
UIFM_BTN_IMAGE: "as Image",
//ReleaseNotes.ts
RN_WELCOME: "Welcome to Excalidraw",
FIRST_RUN: `
The Excalidraw Obsidian plugin is much more than "just" a drawing tool. Because it integrates deeply with Obsidian, it opens up a whole new paradigm for Visual Personal Knowledge Management.
<div style="text-align:center;margin-top:10px;">
<a href="https://community.sketch-your-mind.com/ee" target="_blank"><img src="https://sketch-your-mind.com/images/logo-EE.png" style="width:50%;"></a>
</div>
To help you get started without the overwhelm, I highly recommend taking the free **[Excalidraw Essentials](https://community.sketch-your-mind.com/ee)** mini-course. It cuts through the noise and teaches you the fundamentals in a fast, structured way.
You also don't have to figure it all out alone! Come join the **[Sketch Your Mind Community](https://community.sketch-your-mind.com)** to connect with fellow visual thinkers, share your workflows, and build a frictionless PKM system together.
If you'd like to see what's possible right now, here is a showcase of the key features. To keep abreast of the latest updates and to explore visual PKM, please subscribe to my YouTube channel: [Visual PKM](https://www.youtube.com/@visualPKM).
Thank you & Enjoy!
<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>
`,
//Excalidraw component
COMP_IMG: "Image & Files",
+5 -1
View File
@@ -4,7 +4,7 @@ import {
CJK_FONTS,
} from "src/constants/constants";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierKeyLabels";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierkeyHelper";
declare const PLUGIN_VERSION:string;
@@ -59,7 +59,9 @@ export default {
TOGGLE_LOCK: "Alternar Elemento de Texto entre edición RAW y VISTA PREVIA",
DELETE_FILE: "Eliminar imagen o archivo Markdown seleccionado de la Bóveda de Obsidian",
MARKER_FRAME_SHOW: "Mostrar Marker Frames(marcos de marcador)",
MARKER_FRAME_HIDE: "Ocultar Marker Frames(marcos de marcador)",
MARKER_FRAME_TITLE_SHOW: "Mostrar títulos de Marker Frames(marcos de marcador)",
MARKER_FRAME_TITLE_HIDE: "Ocultar títulos de Marker Frames(marcos de marcador)",
COPY_ELEMENT_LINK: "Copiar [[enlace]] para el/los elemento(s) seleccionado(s)",
COPY_DRAWING_LINK: "Copiar ![[enlace incrustado]] de este bosquejo",
INSERT_LINK_TO_ELEMENT:
@@ -182,6 +184,8 @@ export default {
CONVERT_TO_MARKDOWN: "Convertir a archivo...",
SELECT_TEXTELEMENT_ONLY: "Seleccionar solo elemento de texto (no contenedor)",
REMOVE_LINK: "Eliminar enlace del elemento de texto",
LASER_ON: "Activar puntero láser",
LASER_OFF: "Desactivar puntero láser",
WELCOME_RANK_NEXT: "¡más bosquejos hasta el siguiente rango!",
WELCOME_RANK_LEGENDARY: "Estás en la cima. ¡Sigue siendo legendario!",
WELCOME_COMMAND_PALETTE: 'Escribe "Excalidraw" en la Paleta de Comandos',
+3 -28
View File
@@ -1,6 +1,6 @@
import { DEVICE, FRONTMATTER_KEYS, CJK_FONTS } from "src/constants/constants";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierKeyLabels";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierkeyHelper";
// русский
export default {
@@ -67,7 +67,6 @@ export default {
INSERT_LATEX: `Вставьте формулу LaTeX (например, \\\binom{n}{k} = \\\frac{n!}{k!(n-k)!}).`,
ENTER_LATEX: "Введите правильное выражение LaTeX",
READ_RELEASE_NOTES: "Прочитать последние заметки о выпуске",
ABOUT_EXCALIDRAW: "О Excalidraw",
RUN_OCR: "OCR полного чертежа: Захват текста из freedraw + изображения в буфер обмена и doc.props",
RERUN_OCR: "Повторный запуск полного чертежа OCR: Захват текста из freedraw + изображения в буфер обмена и doc.props",
RUN_OCR_ELEMENTS: "OCR выделенных элементов: Захват текста из freedraw + изображения в буфер обмена",
@@ -82,28 +81,6 @@ export default {
TEMPORARY_DISABLE_AUTOSAVE: "Отключить автосохранение до следующего запуска Obsidian (устанавливайте этот параметр, только если вы знаете, что делаете)",
TEMPORARY_ENABLE_AUTOSAVE: "Включить автосохранение",
//ReleaseNotes.ts
RN_WELCOME: "Добро пожаловать в Excalidraw",
FIRST_RUN: `
Плагин Excalidraw для Obsidian - это гораздо больше, чем «просто» инструмент для рисования. Благодаря глубокой интеграции с Obsidian он открывает совершенно новый подход к визуальному управлению личными знаниями.
<div style="text-align:center;margin-top:10px;">
<a href="https://community.sketch-your-mind.com/ee" target="_blank"><img src="https://sketch-your-mind.com/images/logo-EE.png" style="width:50%;"></a>
</div>
Чтобы начать без перегруза, очень рекомендую бесплатный мини-курс **[Excalidraw Essentials](https://community.sketch-your-mind.com/ee)**. Он помогает быстро разобраться в главном и освоить базовые принципы в структурированном формате.
Вам не обязательно разбираться во всем в одиночку. Присоединяйтесь к **[сообществу Sketch Your Mind](https://community.sketch-your-mind.com)**, чтобы общаться с другими визуально мыслящими людьми, делиться своими рабочими процессами и выстраивать более плавную систему PKM.
Если хотите увидеть, что уже возможно прямо сейчас, ниже есть обзор ключевых возможностей. А чтобы следить за новыми обновлениями и идеями по Visual PKM, подписывайтесь на мой YouTube-канал: [Visual PKM](https://www.youtube.com/@visualPKM).
Спасибо и приятной работы!
<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>
`,
//ExcalidrawView.ts
NO_SEARCH_RESULT: "Не удалось найти подходящий элемент на чертеже",
FORCE_SAVE_ABORTED: "Принудительное сохранение прервано, поскольку идет процесс сохранения",
@@ -155,6 +132,8 @@ export default {
CONVERT_TO_MARKDOWN: "Преобразовать в файл...",
SELECT_TEXTELEMENT_ONLY: "Выбрать только текстовый элемент (не контейнер)",
REMOVE_LINK: "Удалить ссылку на текстовый элемент",
LASER_ON: "Включить лазерный указатель",
LASER_OFF: "Отключить лазерный указатель",
WELCOME_RANK_NEXT: "Больше рисунков до следующего ранга!",
WELCOME_RANK_LEGENDARY: "Вы на вершине. Продолжайте быть легендарным!",
WELCOME_COMMAND_PALETTE: 'Введите «Excalidraw» в палитре коман',
@@ -179,10 +158,6 @@ export default {
RELEASE_NOTES_DESC:
"<b><u>Переключатель ВКЛ:</u></b> Отображение информации о выпуске при каждом обновлении Excalidraw до новой версии.<br>" +
"<b><u>Переключатель ВЫКЛ:</u></b> Тихий режим. Вы все еще можете прочитать заметки о выпуске на <a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/releases'>GitHub</a>.",
EXCALIDRAW_MASTERY_PROMO_ARIA: "Открыть Excalidraw Mastery",
EXCALIDRAW_MASTERY_PROMO_HTML: `<p><b>Потерялись в переключателях и меню?</b></p><p>Excalidraw - мощный инструмент Visual PKM, созданный для сложных рабочих процессов: <b>Visual-First Daily Notes</b>, глубокое <b>PDF-исследование</b>, <b>автоматизация</b>, <b>интеграция ИИ</b> и <b>визуальный Zettelkasten</b>. Но такая мощность неизбежно приносит и сложность.</p><p>Пропустите этап проб и ошибок. <a href="https://community.sketch-your-mind.com/em" target="_blank">👉 Присоединяйтесь к Excalidraw Mastery</a>, чтобы шаг за шагом освоить именно эти настройки. Уберите трение инструмента и развивайте свои знания вместе с поддерживающим сообществом визуально мыслящих людей!</p>`,
EXCALIDRAW_MASTERY_PROMO_SHOW: "Показать",
EXCALIDRAW_MASTERY_PROMO_HIDE: "Скрыть",
NEWVERSION_NOTIFICATION_NAME: "Уведомление об обновлении плагина",
NEWVERSION_NOTIFICATION_DESC:
"<b><u>Переключатель ВКЛ:</u></b> Показывайте уведомление о появлении новой версии плагина.<br>" +
+17 -45
View File
@@ -4,7 +4,7 @@ import {
CJK_FONTS,
} from "src/constants/constants";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierKeyLabels";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierkeyHelper";
declare const PLUGIN_VERSION:string;
@@ -18,7 +18,7 @@ export default {
ZIP_CURRENT_FILE: "压缩当前 Excalidraw 文件",
PUBLISH_SVG_CHECK: "Obsidian Publish:搜索过期的 SVG 和 PNG 导出文件",
EMBEDDABLE_PROPERTIES: "Embeddable 元素设置",
EMBEDDABLE_RELATIVE_ZOOM: "使元素的缩放级别等于当前绘图的缩放级别",
EMBEDDABLE_RELATIVE_ZOOM: "使元素的缩放等级等于当前绘图的缩放等级",
OPEN_IMAGE_SOURCE: "打开 Excalidraw 绘图",
INSTALL_SCRIPT: "安装此脚本",
UPDATE_SCRIPT: "有可用更新 - 点击安装",
@@ -30,7 +30,7 @@ export default {
"脚本已是最新 - 点击重新安装",
OPEN_AS_EXCALIDRAW: "打开为 Excalidraw 绘图",
TOGGLE_MODE: "在 Excalidraw 和 Markdown 模式之间切换",
DUPLICATE_IMAGE: "复制所选图像,并分配一个不同的图像 ID",
DUPLICATE_IMAGE: "复制选定的图像,并分配一个不同的图像 ID",
CONVERT_NOTE_TO_EXCALIDRAW: "转换:空白 Markdown 文档 => Excalidraw 绘图",
CONVERT_EXCALIDRAW: "转换: *.excalidraw => *.md",
CREATE_NEW: "新建绘图文件",
@@ -60,7 +60,9 @@ export default {
TOGGLE_LOCK: "文本元素:原文模式(RAW)⟺ 预览模式(PREVIEW)",
DELETE_FILE: "从仓库中删除所选图片(或以图像形式嵌入的 Markdown)源文件",
MARKER_FRAME_SHOW: "显示标记画框",
MARKER_FRAME_HIDE: "隐藏标记画框",
MARKER_FRAME_TITLE_SHOW: "显示标记画框名称",
MARKER_FRAME_TITLE_HIDE: "隐藏标记画框名称",
COPY_ELEMENT_LINK: "复制所选元素的 [[file#^id]] 链接",
FRAME_WITH_NAME: "按名称复制画框链接",
COPY_DRAWING_LINK: "复制绘图的 ![[drawing]] 链接",
@@ -91,13 +93,10 @@ export default {
CONVERT_CARD_TO_FILE: "将“背景笔记”卡片保存到文件",
ERROR_TRY_AGAIN: "请重试。",
PASTE_CODEBLOCK: "粘贴代码块",
INVERT_IMAGES_IN_DARK_MODE: "深色主题下反转颜色",
INSERT_LATEX:
`插入 LaTeX 公式到当前绘图中`,
ENTER_LATEX: "输入 LaTeX 公式",
EDIT_LATEX: "编辑 LaTeX 公式",
READ_RELEASE_NOTES: "阅读本插件的更新说明",
ABOUT_EXCALIDRAW: "关于 Excalidraw",
RUN_OCR: "OCR 整个绘图:识别涂鸦和图片里的文本并复制到剪贴板和笔记属性中",
RERUN_OCR: "重新 OCR 整个绘图:识别涂鸦和图片里的文本并复制到剪贴板和笔记属性中",
RUN_OCR_ELEMENTS: "OCR 选中的元素:识别涂鸦和图片里的文本并复制到剪贴板",
@@ -111,7 +110,6 @@ export default {
RESET_IMG_ASPECT_RATIO: "重置所选图像的纵横比",
TEMPORARY_DISABLE_AUTOSAVE: "临时禁用自动保存功能,直到本次 Obsidian 退出(小白慎用!)",
TEMPORARY_ENABLE_AUTOSAVE: "启用自动保存功能",
TEMPORARY_TOGGLE_VIEW_MODE_FOR_ALL_DRAWINGS: "切换所有 Excalidraw 绘图的查看模式,直到本次 Obsidian 退出",
FONTS_LOADED: "Excalidraw: CJK 字体已加载",
FONTS_LOAD_ERROR: "Excalidraw: 在资源文件夹下找不到 CJK 字体\n",
TOGGLE_ENABLE_CONTEXT_MENU: "切换是否启用上下文菜单(在移动设备上很有用)",
@@ -190,6 +188,8 @@ export default {
CONVERT_TO_MARKDOWN: "转存为 Markdown 文档(并嵌入当前绘图)",
SELECT_TEXTELEMENT_ONLY: "只选择文本元素(非容器)",
REMOVE_LINK: "移除文字元素链接",
LASER_ON: "启用激光笔",
LASER_OFF: "关闭激光笔",
WELCOME_RANK_NEXT: "张绘图之后,到达下一等级!",
WELCOME_RANK_LEGENDARY: "您已是绘图大师,续写传奇吧!",
WELCOME_COMMAND_PALETTE: '在命令面板中输入 "Excalidraw"',
@@ -223,10 +223,6 @@ export default {
DISABLE_CONTEXT_MENU_DESC: "禁用 Excalidraw 的上下文菜单。这在移动设备上很有用,因为上下文菜单有时会在不需要的时候弹出。",
NOTEBOOKLM_LINK_ARIA: "向 NotebookLM 咨询有关插件的帮助。此模型已预加载了我所有的视频转录稿、发布说明和其他帮助内容。与 NotebookLM 聊天,浏览我的 250+ 视频和 Excalidraw 文件。",
NOTEBOOKLM_LINK_TEXT: "学习插件。访问 NotebookLM 知识库。",
EXCALIDRAW_MASTERY_PROMO_ARIA: "打开 Excalidraw Mastery",
EXCALIDRAW_MASTERY_PROMO_HTML: `<p><b>在各种开关和菜单里有点迷路吗?</b></p><p>Excalidraw 是一款为高强度工作流打造的 Visual PKM 强力工具,适合 <b>Visual-First Daily Notes</b>、深入的 <b>PDF 研究</b>、<b>自动化</b>、<b>AI 集成</b> 和 <b>Visual Zettelkasten</b>。但强大能力也意味着更高的复杂度。</p><p>跳过反复试错。<a href="https://community.sketch-your-mind.com/em" target="_blank">👉 加入 Excalidraw Mastery</a>,一步一步学会这些具体配置。减少工具摩擦,与一群善于视觉思考的支持型社群一起掌握你的知识体系。</p>`,
EXCALIDRAW_MASTERY_PROMO_SHOW: "显示",
EXCALIDRAW_MASTERY_PROMO_HIDE: "隐藏",
LINKS_BUGS_ARIA: "在插件的 GitHub 页面报告错误和提交功能请求",
LINKS_BUGS: "报告错误",
LINKS_YT_ARIA: "访问我的 YouTube 频道学习视觉思维和 Excalidraw",
@@ -302,7 +298,7 @@ export default {
SCRIPT_FOLDER_DESC:
"此文件夹用于存放 Excalidraw 自动化脚本。" +
"您可以在 Obsidian 命令面板中执行这些脚本," +
"还可以为喜欢的脚本分配热键,就像为其他 Obsidian 命令分配热键一样。<br>" +
"还可以为喜欢的脚本分配快捷键,就像为其他 Obsidian 命令分配快捷键一样。<br>" +
"该项不能设为仓库根目录。",
AI_HEAD: "AI(实验性)",
AI_DESC: `OpenAI GPT API 的设置。` +
@@ -319,16 +315,17 @@ export default {
AI_OPENAI_DEFAULT_MODEL_DESC:
"使用哪个 AI 模型来生成文本。请填写有效的 OpenAI 模型名称。" +
"您可访问 <a href='https://platform.openai.com/docs/models'>OpenAI 网站</a> 了解更多模型信息。",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "gpt-5-mini",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "gpt-3.5-turbo-1106",
AI_OPENAI_DEFAULT_MAX_TOKENS_NAME: "最大 token 数",
AI_OPENAI_DEFAULT_MAX_TOKENS_DESC:
"API 响应中生成的最大 token 数。设置为 0 以忽略 max_tokens 字段(适用于不支持该参数的模型,如 GPT-5)。",
AI_OPENAI_DEFAULT_IMAGE_MODEL_NAME: "默认的图片 AI 模型",
AI_OPENAI_DEFAULT_IMAGE_MODEL_DESC:
"使用哪个 AI 模型来生成图片。图生图目前只有 dall-e-2 和 gpt-image-1 模型支持 Image editing and variations。" +
"使用哪个 AI 模型来生成图片。图生图会强制使用 dall-e-2 模型," +
"因为目前只有该模型支持 Image editing and variations。" +
"请填写有效的 OpenAI 模型名称。" +
"您可访问 <a href='https://platform.openai.com/docs/models'>OpenAI 网站</a> 了解更多模型信息。",
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "gpt-image-1",
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "dall-e-3",
AI_OPENAI_DEFAULT_VISION_MODEL_NAME: "默认的 AI 视觉模型",
AI_OPENAI_DEFAULT_VISION_MODEL_DESC:
"根据文本生成图片时,使用哪个 AI 视觉模型。请填写有效的 OpenAI 模型名称。" +
@@ -338,7 +335,7 @@ export default {
"默认的 OpenAI API URL。请填写有效的 OpenAI API URL。" +
"Excalidraw 会通过该 URL 发送 API 请求给 OpenAI。我没有对该项做任何错误处理,请谨慎修改。",
AI_OPENAI_DEFAULT_IMAGE_API_URL_NAME: "OpenAI 图片生成 API URL",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "输入默认 AI 模型名称,如 gpt-5-mini",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "输入默认 AI 模型名称,如 gpt-4o",
SAVING_HEAD: "保存",
SAVING_DESC: "包括:压缩,自动保存的时间间隔,文件的命名格式和扩展名等。",
COMPRESS_NAME: "压缩 Excalidraw JSON",
@@ -432,8 +429,6 @@ export default {
DEFAULT_OPEN_MODE_DESC:
"设置 Excalidraw 的运行模式:普通模式(Normal)/禅模式(Zen)/查看模式(View)。<br>" +
"可为某个绘图单独设置,方法是在其 frontmatter 中添加如 <code>excalidraw-default-mode: normal/zen/view</code> 的键值对。",
PHONE_FOOTER_SAFE_AREA_PADDING_NAME: "为手机端底部控件增加额外留白",
PHONE_FOOTER_SAFE_AREA_PADDING_DESC: "为 Excalidraw 底部控件增加额外底部留白,让缩放和撤销按钮在手机上保持位于系统导航栏之上。该设置仅在手机上生效。",
DEFAULT_PEN_MODE_NAME: "触控笔模式(Pen mode)",
DEFAULT_PEN_MODE_DESC:
"打开绘图时,是否自动开启触控笔模式?",
@@ -469,13 +464,9 @@ export default {
DESKTOP_UI_MODE_DESC: "桌面端设备默认 UI 模式。",
TABLET_UI_MODE_NAME: "平板端偏好模式",
TABLET_UI_MODE_DESC: "平板端设备默认 UI 模式。",
PHONE_UI_MODE_NAME: "手机端偏好模式",
PHONE_UI_MODE_DESC: "手机端设备默认 UI 模式。",
MODE_FULL: "Desktop-mode",
MODE_COMPACT: "Compact-mode",
MODE_TRAY: "Tray-mode",
MODE_PHONE: "Phone-mode",
REAPPLY_UI_MODE_BUTTON: "重新应用 UI 模式",
TRAY_MODE_NAME: "启用托盘模式",
PREFER_COMPACT_MODE_DESKTOP_NAME: "在桌面端偏好紧凑模式",
PREFER_COMPACT_MODE_DESKTOP_DESC: "切换托盘模式时,开启该项,Excalidraw 将在紧凑模式与托盘模式之间切换。" +
@@ -697,7 +688,7 @@ export default {
EMBED_THEME_BACKGROUND: "图像的主题和背景色",
EMBED_IMAGE_CACHE_NAME: "为嵌入到 Markdown 文档中的绘图创建预览图缓存",
EMBED_IMAGE_CACHE_DESC: "可提高下次嵌入的速度。" +
"但如果绘图包含子绘图,(当子绘图改变时)预览图不会更新,直到您打开绘图并手动保存。",
"但如果绘图包含子绘图,(当子绘图改变时)您需要打开父绘图并手动保存,才能够更新预览图。",
SCENE_IMAGE_CACHE_NAME: "缓存场景中嵌套的绘图",
SCENE_IMAGE_CACHE_DESC: "Excalidraw 将智能地尝试识别嵌套的绘图的子元素是否发生变化,并更新缓存。" +
"这将加快渲染过程,特别是在您的场景中有深度嵌套的绘图时。<br>" +
@@ -729,7 +720,7 @@ export default {
EMBED_WIDTH_NAME: "预览图的默认宽度",
EMBED_WIDTH_DESC:
"嵌入到 Markdown 文档中的绘图的预览图的默认宽度。该项也适用于鼠标悬停时浮现的预览图。<br>" +
"可为某个要嵌入到 Markdown 文档中的绘图单独设置," +
"可为某个要嵌入到 Markdown 文档中的绘图文件单独设置," +
"方法是修改相应的内部链接格式为如 <code>![[drawing.excalidraw|100]]</code> 或 <code>[[drawing.excalidraw|100x100]]</code>。",
EMBED_HEIGHT_NAME: "预览图的默认高度",
EMBED_HEIGHT_DESC:
@@ -1035,7 +1026,7 @@ export default {
ES_FILENAME_VISIBLE: "显示页内标题",
ES_BACKGROUND_HEAD: "背景色",
ES_BACKGROUND_DESC_INFO: "点击此处查看更多颜色信息",
ES_BACKGROUND_DESC_DETAIL: "背景色仅影响预览模式的 MD-Embeddable。在编辑模式,它会根据场景(通过笔记属性设置)或插件设置,遵循 Obsidian 的深色/浅色主题。背景色有两层:元素背景色(下层颜色)和上层颜色。选择“匹配元素”表示两层都遵循元素背景色。选择“匹配绘图”或特定背景色不会改变元素背景色。设置不透明度(如 50%)会将绘图或所选颜色与元素背景色混合。要移除元素背景色,可以在 Excalidraw 的元素属性编辑器中将元素背景色设置为透明,这样只有上层颜色生效。",
ES_BACKGROUND_DESC_DETAIL: "背景色仅影响预览模式的 MD-Embeddable。在编辑模式,它会根据场景(通过笔记属性设置)或插件设置,遵循 Obsidian 的深色/浅色主题。背景色有两层:元素背景色(下层颜色)和上层颜色。选择“匹配元素”表示两层都遵循元素背景色。选择“匹配绘图”或特定背景色不会改变元素背景色。设置不透明度(如 50%)会将绘图或选定的颜色与元素背景色混合。要移除元素背景色,可以在 Excalidraw 的元素属性编辑器中将元素背景色设置为透明,这样只有上层颜色生效。",
ES_BACKGROUND_MATCH_ELEMENT: "匹配元素背景色",
ES_BACKGROUND_MATCH_CANVAS: "匹配绘图背景色",
ES_BACKGROUND_COLOR: "背景色",
@@ -1046,7 +1037,7 @@ export default {
ES_BORDER_OPACITY: "边框不透明度",
ES_EMBEDDABLE_SETTINGS: "MD-Embeddable 设置",
ES_USE_OBSIDIAN_DEFAULTS: "使用 Obsidian 默认设置",
ES_ZOOM_100_RELATIVE_DESC: "使元素的缩放级别等于当前绘图的缩放级别",
ES_ZOOM_100_RELATIVE_DESC: "使元素的缩放等级等于当前绘图的缩放等级",
ES_ZOOM_100: "Relative 100%",
//Prompts.ts
@@ -1234,25 +1225,6 @@ export default {
//ReleaseNotes.ts
RN_WELCOME: "欢迎使用 Excalidraw",
FIRST_RUN: `
Obsidian 的 Excalidraw 插件远不只是一个“画图工具”。由于它与 Obsidian 深度集成,它为可视化个人知识管理带来了全新的工作范式。
<div style="text-align:center;margin-top:10px;">
<a href="https://community.sketch-your-mind.com/ee" target="_blank"><img src="https://sketch-your-mind.com/images/logo-EE.png" style="width:50%;"></a>
</div>
如果你想顺利入门、避免一开始就被大量功能淹没,我非常推荐免费的 **[Excalidraw Essentials](https://community.sketch-your-mind.com/ee)** 微课程。它能帮你快速抓住重点,用清晰的结构掌握核心基础。
你也不必独自摸索。欢迎加入 **[Sketch Your Mind 社区](https://community.sketch-your-mind.com)**,与其他视觉思考者交流、分享工作流,一起构建更顺滑的 PKM 系统。
如果你想先看看它现在都能做到什么,下面有一个核心功能展示。想持续了解最新更新,并进一步探索 Visual PKM,也欢迎订阅我的 YouTube 频道:[Visual PKM](https://www.youtube.com/@visualPKM)。
感谢使用,祝你玩得开心!
<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>
`,
//Excalidraw component
COMP_IMG: "图片 & 文件",
+29 -72
View File
@@ -4,7 +4,7 @@ import {
CJK_FONTS,
} from "src/constants/constants";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierKeyLabels";
import { labelALT, labelCTRL, labelMETA, labelSHIFT } from "src/utils/modifierkeyHelper";
declare const PLUGIN_VERSION:string;
@@ -18,7 +18,7 @@ export default {
ZIP_CURRENT_FILE: "壓縮當前 Excalidraw 檔案",
PUBLISH_SVG_CHECK: "Obsidian Publish:搜尋過期的 SVG 和 PNG 匯出檔案",
EMBEDDABLE_PROPERTIES: "Embeddable 元素設定",
EMBEDDABLE_RELATIVE_ZOOM: "使元素的縮放級別等於當前繪圖的縮放級別",
EMBEDDABLE_RELATIVE_ZOOM: "使元素的縮放等級等於當前繪圖的縮放等級",
OPEN_IMAGE_SOURCE: "開啟 Excalidraw 繪圖",
INSTALL_SCRIPT: "安裝此指令碼",
UPDATE_SCRIPT: "有可用更新 - 點選安裝",
@@ -30,14 +30,13 @@ export default {
"指令碼已是最新 - 點選重新安裝",
OPEN_AS_EXCALIDRAW: "開啟為 Excalidraw 繪圖",
TOGGLE_MODE: "在 Excalidraw 和 Markdown 模式之間切換",
DUPLICATE_IMAGE: "複製所選影像,並分配一個不同的影像 ID",
DUPLICATE_IMAGE: "複製選定的影像,並分配一個不同的影像 ID",
CONVERT_NOTE_TO_EXCALIDRAW: "轉換:空白 Markdown 文件 => Excalidraw 繪圖",
CONVERT_EXCALIDRAW: "轉換: *.excalidraw => *.md",
CREATE_NEW: "新建繪圖檔案",
CONVERT_FILE_KEEP_EXT: "轉換:*.excalidraw => *.excalidraw.md",
CONVERT_FILE_REPLACE_EXT: "轉換:*.excalidraw => *.md (相容 Logseq)",
DOWNLOAD_LIBRARY: "匯出 stencil 庫為 *.excalidrawlib 檔案",
OPEN_SIDEPANEL: "開啟 Excalidraw 側邊面板",
OPEN_EXISTING_NEW_PANE: "開啟已有的繪圖 - 於新面板",
OPEN_EXISTING_ACTIVE_PANE:
"開啟已有的繪圖 - 於當前面板",
@@ -60,9 +59,10 @@ export default {
TOGGLE_LOCK: "文字元素:原文模式(RAW)⟺ 預覽模式(PREVIEW)",
DELETE_FILE: "從倉庫中刪除所選圖片(或以影像形式嵌入的 Markdown)原始檔",
MARKER_FRAME_SHOW: "顯示標記畫框",
MARKER_FRAME_HIDE: "隱藏標記畫框",
MARKER_FRAME_TITLE_SHOW: "顯示標記畫框名稱",
MARKER_FRAME_TITLE_HIDE: "隱藏標記畫框名稱",
COPY_ELEMENT_LINK: "複製所選元素的 [[file#^id]] 連結",
FRAME_WITH_NAME: "按名稱複製畫框連結",
COPY_DRAWING_LINK: "複製繪圖的 ![[drawing]] 連結",
INSERT_LINK_TO_ELEMENT:
`單擊=複製所選元素的 [[file#^id]] 連結\n${labelCTRL()}=複製元素所在分組為 [[file#^group=id]] 連結\n${labelSHIFT()}=複製所選元素所在區域為 [[file#^area=id]] 連結`,
@@ -91,13 +91,10 @@ export default {
CONVERT_CARD_TO_FILE: "將“背景筆記”卡片儲存到檔案",
ERROR_TRY_AGAIN: "請重試。",
PASTE_CODEBLOCK: "貼上程式碼塊",
INVERT_IMAGES_IN_DARK_MODE: "深色主題下反轉顏色",
INSERT_LATEX:
`插入 LaTeX 公式到當前繪圖中`,
ENTER_LATEX: "輸入 LaTeX 公式",
EDIT_LATEX: "編輯 LaTeX 公式",
READ_RELEASE_NOTES: "閱讀本外掛的更新說明",
ABOUT_EXCALIDRAW: "關於 Excalidraw",
RUN_OCR: "OCR 整個繪圖:識別塗鴉和圖片裡的文字並複製到剪貼簿和筆記屬性中",
RERUN_OCR: "重新 OCR 整個繪圖:識別塗鴉和圖片裡的文字並複製到剪貼簿和筆記屬性中",
RUN_OCR_ELEMENTS: "OCR 選中的元素:識別塗鴉和圖片裡的文字並複製到剪貼簿",
@@ -111,7 +108,6 @@ export default {
RESET_IMG_ASPECT_RATIO: "重置所選影像的縱橫比",
TEMPORARY_DISABLE_AUTOSAVE: "臨時停用自動儲存功能,直到本次 Obsidian 退出(小白慎用!)",
TEMPORARY_ENABLE_AUTOSAVE: "啟用自動儲存功能",
TEMPORARY_TOGGLE_VIEW_MODE_FOR_ALL_DRAWINGS: "切換所有 Excalidraw 繪圖的檢視模式,直到本次 Obsidian 退出",
FONTS_LOADED: "Excalidraw: CJK 字型已載入",
FONTS_LOAD_ERROR: "Excalidraw: 在資原始檔夾下找不到 CJK 字型\n",
TOGGLE_ENABLE_CONTEXT_MENU: "切換是否啟用上下文選單(在移動裝置上很有用)",
@@ -157,7 +153,6 @@ export default {
OPEN_AS_MD: "開啟為 Markdown",
EXPORT_IMAGE: `匯出為圖片`,
OPEN_LINK: "開啟所選元素裡的連結 \n(按住 Shift 在新面板開啟)",
EXCALIDRAW_SIDEPANEL: "Excalidraw 側邊面板",
EXPORT_EXCALIDRAW: "匯出為 .excalidraw 檔案(舊版繪圖檔案格式)",
LINK_BUTTON_CLICK_NO_TEXT:
"請選擇一個包含內部或外部連結的元素。\n",
@@ -190,6 +185,8 @@ export default {
CONVERT_TO_MARKDOWN: "轉存為 Markdown 文件(並嵌入當前繪圖)",
SELECT_TEXTELEMENT_ONLY: "只選擇文字元素(非容器)",
REMOVE_LINK: "移除文字元素連結",
LASER_ON: "啟用雷射筆",
LASER_OFF: "關閉雷射筆",
WELCOME_RANK_NEXT: "張繪圖之後,到達下一等級!",
WELCOME_RANK_LEGENDARY: "您已是繪圖大師,續寫傳奇吧!",
WELCOME_COMMAND_PALETTE: '在命令面板中輸入 "Excalidraw"',
@@ -223,10 +220,6 @@ export default {
DISABLE_CONTEXT_MENU_DESC: "停用 Excalidraw 的上下文選單。這在移動裝置上很有用,因為上下文選單有時會在不需要的時候彈出。",
NOTEBOOKLM_LINK_ARIA: "向 NotebookLM 諮詢有關外掛的幫助。此模型已預載入了我所有的影片轉錄稿、釋出說明和其他幫助內容。與 NotebookLM 聊天,瀏覽我的 250+ 影片和 Excalidraw 檔案。",
NOTEBOOKLM_LINK_TEXT: "學習外掛。訪問 NotebookLM 知識庫。",
EXCALIDRAW_MASTERY_PROMO_ARIA: "開啟 Excalidraw Mastery",
EXCALIDRAW_MASTERY_PROMO_HTML: `<p><b>在各種切換與選單中感到迷失嗎?</b></p><p>Excalidraw 是為高強度工作流程打造的 Visual PKM 強大工具,適合 <b>Visual-First Daily Notes</b>、深入的 <b>PDF 研究</b>、<b>自動化</b>、<b>AI 整合</b> 與 <b>Visual Zettelkasten</b>。但這些強大功能也伴隨著複雜度。</p><p>跳過反覆試錯。<a href="https://community.sketch-your-mind.com/em" target="_blank">👉 加入 Excalidraw Mastery</a>,一步一步學會這些具體設定。降低工具摩擦,並與一群擅長視覺思考的支持型社群一起掌握你的知識系統。</p>`,
EXCALIDRAW_MASTERY_PROMO_SHOW: "顯示",
EXCALIDRAW_MASTERY_PROMO_HIDE: "隱藏",
LINKS_BUGS_ARIA: "在外掛的 GitHub 頁面報告錯誤和提交功能請求",
LINKS_BUGS: "報告錯誤",
LINKS_YT_ARIA: "訪問我的 YouTube 頻道學習視覺思維和 Excalidraw",
@@ -302,7 +295,7 @@ export default {
SCRIPT_FOLDER_DESC:
"此資料夾用於存放 Excalidraw 自動化指令碼。" +
"您可以在 Obsidian 命令面板中執行這些指令碼," +
"還可以為喜歡的指令碼分配熱鍵,就像為其他 Obsidian 命令分配熱鍵一樣。<br>" +
"還可以為喜歡的指令碼分配快捷鍵,就像為其他 Obsidian 命令分配快捷鍵一樣。<br>" +
"該項不能設為倉庫根目錄。",
AI_HEAD: "AI(實驗性)",
AI_DESC: `OpenAI GPT API 的設定。` +
@@ -319,16 +312,17 @@ export default {
AI_OPENAI_DEFAULT_MODEL_DESC:
"使用哪個 AI 模型來生成文字。請填寫有效的 OpenAI 模型名稱。" +
"您可訪問 <a href='https://platform.openai.com/docs/models'>OpenAI 網站</a> 瞭解更多模型資訊。",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "gpt-5-mini",
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "gpt-3.5-turbo-1106",
AI_OPENAI_DEFAULT_MAX_TOKENS_NAME: "最大 token 數",
AI_OPENAI_DEFAULT_MAX_TOKENS_DESC:
"API 響應中生成的最大 token 數。設定為 0 以忽略 max_tokens 欄位(適用於不支援該引數的模型,如 GPT-5)。",
"API 生成的最大 token 數。設定為 0 以忽略 max_tokens 欄位(適用於不支援該引數的模型,如 GPT-5)。",
AI_OPENAI_DEFAULT_IMAGE_MODEL_NAME: "預設的圖片 AI 模型",
AI_OPENAI_DEFAULT_IMAGE_MODEL_DESC:
"使用哪個 AI 模型來生成圖片。圖生圖目前只有 dall-e-2 和 gpt-image-1 模型支援 Image editing and variations。" +
"使用哪個 AI 模型來生成圖片。圖生圖會強制使用 dall-e-2 模型," +
"因為目前只有該模型支援 Image editing and variations。" +
"請填寫有效的 OpenAI 模型名稱。" +
"您可訪問 <a href='https://platform.openai.com/docs/models'>OpenAI 網站</a> 瞭解更多模型資訊。",
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "gpt-image-1",
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "dall-e-3",
AI_OPENAI_DEFAULT_VISION_MODEL_NAME: "預設的 AI 視覺模型",
AI_OPENAI_DEFAULT_VISION_MODEL_DESC:
"根據文字生成圖片時,使用哪個 AI 視覺模型。請填寫有效的 OpenAI 模型名稱。" +
@@ -338,7 +332,7 @@ export default {
"預設的 OpenAI API URL。請填寫有效的 OpenAI API URL。" +
"Excalidraw 會透過該 URL 傳送 API 請求給 OpenAI。我沒有對該項做任何錯誤處理,請謹慎修改。",
AI_OPENAI_DEFAULT_IMAGE_API_URL_NAME: "OpenAI 圖片生成 API URL",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "輸入預設 AI 模型名稱,如 gpt-5-mini",
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "輸入預設 AI 模型名稱,如 gpt-4o",
SAVING_HEAD: "儲存",
SAVING_DESC: "包括:壓縮,自動儲存的時間間隔,檔案的命名格式和副檔名等。",
COMPRESS_NAME: "壓縮 Excalidraw JSON",
@@ -432,8 +426,6 @@ export default {
DEFAULT_OPEN_MODE_DESC:
"設定 Excalidraw 的執行模式:普通模式(Normal)/禪模式(Zen)/檢視模式(View)。<br>" +
"可為某個繪圖單獨設定,方法是在其 frontmatter 中新增如 <code>excalidraw-default-mode: normal/zen/view</code> 的鍵值對。",
PHONE_FOOTER_SAFE_AREA_PADDING_NAME: "為手機端底部控制項增加額外留白",
PHONE_FOOTER_SAFE_AREA_PADDING_DESC: "為 Excalidraw 底部控制項增加額外底部留白,讓縮放與復原按鈕在手機上保持位於系統導覽列之上。該設定僅在手機上生效。",
DEFAULT_PEN_MODE_NAME: "觸控筆模式(Pen mode)",
DEFAULT_PEN_MODE_DESC:
"開啟繪圖時,是否自動開啟觸控筆模式?",
@@ -469,13 +461,9 @@ export default {
DESKTOP_UI_MODE_DESC: "桌面端裝置預設 UI 模式。",
TABLET_UI_MODE_NAME: "平板端偏好模式",
TABLET_UI_MODE_DESC: "平板端裝置預設 UI 模式。",
PHONE_UI_MODE_NAME: "手機端偏好模式",
PHONE_UI_MODE_DESC: "手機端裝置預設 UI 模式。",
MODE_FULL: "Desktop-mode",
MODE_COMPACT: "Compact-mode",
MODE_TRAY: "Tray-mode",
MODE_PHONE: "Phone-mode",
REAPPLY_UI_MODE_BUTTON: "重新應用 UI 模式",
TRAY_MODE_NAME: "啟用托盤模式",
PREFER_COMPACT_MODE_DESKTOP_NAME: "在桌面端偏好緊湊模式",
PREFER_COMPACT_MODE_DESKTOP_DESC: "切換托盤模式時,開啟該項,Excalidraw 將在緊湊模式與托盤模式之間切換。" +
@@ -520,8 +508,9 @@ export default {
GRID_DYNAMIC_COLOR_DESC:
"<b>開啟:</b>更改網格顏色以匹配繪圖顏色。<br><b>關閉:</b>將以下顏色用作網格顏色。",
GRID_COLOR_NAME: "網格顏色",
GRID_OPACITY_NAME: "網格不透明度",
GRID_OPACITY_DESC: "設定網格的不透明度。0 全透明 ⟺ 100 不透明。",
GRID_OPACITY_NAME: "網格透明度",
GRID_OPACITY_DESC: "設定網格的透明度。還將控制將箭頭繫結到元素時繫結框的透明度。" +
"0 全透明 ⟺ 100 不透明。",
GRID_DIRECTION_NAME: "網格方向",
GRID_DIRECTION_DESC: "第一個開關顯示/隱藏水平網格,第二個開關顯示/隱藏垂直網格。",
GRID_HORIZONTAL: "渲染水平網格",
@@ -552,8 +541,7 @@ export default {
LONG_PRESS_MOBILE_NAME: "長按開啟(移動端)",
LONG_PRESS_MOBILE_DESC: "長按開啟在 Markdown 文件中嵌入的 Excalidraw 繪圖。單位:毫秒。",
DOUBLE_CLICK_LINK_OPEN_VIEW_MODE: "在檢視模式下允許雙擊開啟連結",
ELEMENT_LINK_SYNC_NAME: "文字元素同步正文連結",
ELEMENT_LINK_SYNC_DESC: "若開啟,Excalidraw 將匹配 2.19.0 之前的行為:始終將正文第一個連結複製到元素連結欄位。匯出 SVG/PNG 僅在元素連結欄位包含單個連結(不包括正文內的連結)時保留連結。開啟:若你依賴正文連結並希望元素連結始終映象第一個連結。關閉:若你獨立管理元素連結,用於標籤、行內連結本體等元資料、或多個連結,如 Dataview 風格的筆記 '(reminds me of:: [[link]]) #noteToSelf'。",
FOCUS_ON_EXISTING_TAB_NAME: "聚焦於當前標籤頁",
FOCUS_ON_EXISTING_TAB_DESC: "當開啟一個連結時,如果該檔案已經開啟,Excalidraw 將會聚焦到現有的標籤頁上。" +
"啟用該項時,如果檔案已開啟,將覆蓋“在相鄰面板中開啟”,但“開啟所選繪圖的背景筆記”命令面板操作除外。",
@@ -576,12 +564,6 @@ export default {
"文字元素處於 PREVIEW 模式時,在內部連結的兩側顯示中括號。<br>" +
"可為某個繪圖單獨設定該項,方法是在其 frontmatter 中新增如 <code>"
}${FRONTMATTER_KEYS["link-brackets"].name}: true/false</code> 的鍵值對。`,
/*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_DESC: `${
"文字元素處於 PREVIEW 模式時,如果其中包含連結,則新增此字首。<br>" +
@@ -603,9 +585,9 @@ export default {
`<b>開啟:</b>在 Excalidraw <u>檢視模式(View)</u>下,滑鼠懸停在 <code>[[內部連結]]</code> 上即可預覽;` +
"而在<u>普通模式(Normal)</u>下,滑鼠懸停在內部連結右上角的藍色標識上即可預覽。<br>" +
`<b>關閉:</b>滑鼠懸停在 <code>[[內部連結]]</code> 上,並且按住 ${labelCTRL()} 才能預覽。`,
LINKOPACITY_NAME: "連結標識的不透明度",
LINKOPACITY_NAME: "連結標識的透明度",
LINKOPACITY_DESC:
"含有連結的元素,其右上角的連結標識的不透明度。0 全透明 ⟺ 100 不透明。",
"含有連結的元素,其右上角的連結標識的透明度。0 全透明 ⟺ 100 不透明。",
LINK_CTRL_CLICK_NAME:
`按住 ${labelCTRL()} 並點選含有 [[連結]] 或 [別名](連結) 的文字來開啟連結`,
LINK_CTRL_CLICK_DESC:
@@ -697,7 +679,7 @@ export default {
EMBED_THEME_BACKGROUND: "影像的主題和背景色",
EMBED_IMAGE_CACHE_NAME: "為嵌入到 Markdown 文件中的繪圖建立預覽圖快取",
EMBED_IMAGE_CACHE_DESC: "可提高下次嵌入的速度。" +
"但如果繪圖包含子繪圖,(當子繪圖改變時)預覽圖不會更新,直到您開啟繪圖並手動儲存。",
"但如果繪圖包含子繪圖,(當子繪圖改變時)您需要開啟父繪圖並手動儲存,才能夠更新預覽圖。",
SCENE_IMAGE_CACHE_NAME: "快取場景中巢狀的繪圖",
SCENE_IMAGE_CACHE_DESC: "Excalidraw 將智慧地嘗試識別巢狀的繪圖的子元素是否發生變化,並更新快取。" +
"這將加快渲染過程,特別是在您的場景中有深度巢狀的繪圖時。<br>" +
@@ -710,7 +692,7 @@ export default {
EMBED_REUSE_EXPORTED_IMAGE_DESC:
"該項與下方“匯出”部分“匯出設定”中的 <a href='#"+TAG_AUTOEXPORT+"'>自動匯出 SVG/PNG 副本</a> 選項配合使用。如果嵌入到 Markdown 文件中的繪圖檔案存在同名的 SVG/PNG 副本,則將其作為預覽圖,而不再重新生成。<br>" +
"該項能夠提高 Markdown 文件的開啟速度,尤其是當嵌入到 Markdown 文件中的繪圖檔案中含有大量圖片或 MD-Embed 時。" +
"但是,該項也可能導致預覽圖無法立即響應繪圖檔案或者 Obsidian 主題的修改。<br>" +
"但是,該項也可能導致預覽圖無法即時反應繪圖檔案或者 Obsidian 主題的修改。<br>" +
"該項僅作用於嵌入到 Markdown 文件中的繪圖。" +
"該項無法提升繪圖檔案的開啟速度。詳見 <a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.6.23' target='_blank'>此說明</a>。",
/*EMBED_PREVIEW_SVG_NAME: "生成 SVG 格式的預覽圖",
@@ -729,7 +711,7 @@ export default {
EMBED_WIDTH_NAME: "預覽圖的預設寬度",
EMBED_WIDTH_DESC:
"嵌入到 Markdown 文件中的繪圖的預覽圖的預設寬度。該項也適用於滑鼠懸停時浮現的預覽圖。<br>" +
"可為某個要嵌入到 Markdown 文件中的繪圖單獨設定," +
"可為某個要嵌入到 Markdown 文件中的繪圖檔案單獨設定," +
"方法是修改相應的內部連結格式為如 <code>![[drawing.excalidraw|100]]</code> 或 <code>[[drawing.excalidraw|100x100]]</code>。",
EMBED_HEIGHT_NAME: "預覽圖的預設高度",
EMBED_HEIGHT_DESC:
@@ -941,9 +923,9 @@ export default {
SELECT_FILE_TO_LINK: "選擇要以連結形式插入到當前繪圖中的檔案",
SELECT_COMMAND_PLACEHOLDER: "選擇要插入到當前繪圖中的命令",
SELECT_DRAWING: "選擇要以影像形式嵌入到當前繪圖中的圖片或繪圖檔案",
TYPE_FILENAME: "輸入要選擇的繪圖名稱",
TYPE_FILENAME: "鍵入要選擇的繪圖名稱",
SELECT_FILE_OR_TYPE_NEW:
"選擇已有繪圖,或者輸入新繪圖檔案的名稱,然後按回車。",
"選擇已有繪圖,或者鍵入新繪圖檔案的名稱,然後按回車。",
SELECT_TO_EMBED: "選擇要嵌入到當前 Markdown 文件中的繪圖",
SELECT_MD: "選擇要以影像形式嵌入到當前繪圖中的 Markdown 文件",
SELECT_PDF: "選擇要以影像形式嵌入到當前繪圖中的 PDF",
@@ -1035,18 +1017,18 @@ export default {
ES_FILENAME_VISIBLE: "顯示頁內標題",
ES_BACKGROUND_HEAD: "背景色",
ES_BACKGROUND_DESC_INFO: "點選此處檢視更多顏色資訊",
ES_BACKGROUND_DESC_DETAIL: "背景色僅影響預覽模式的 MD-Embeddable。在編輯模式,它會根據場景(透過筆記屬性設定)或外掛設定,遵循 Obsidian 的深色/淺色主題。背景色有兩層:元素背景色(下層顏色)和上層顏色。選擇“匹配元素”表示兩層都遵循元素背景色。選擇“匹配繪圖”或特定背景色不會改變元素背景色。設定不透明度(如 50%)會將繪圖或所選顏色與元素背景色混合。要移除元素背景色,可以在 Excalidraw 的元素屬性編輯器中將元素背景色設定為透明,這樣只有上層顏色生效。",
ES_BACKGROUND_DESC_DETAIL: "背景色僅影響預覽模式的 MD-Embeddable。在編輯模式,它會根據場景(透過筆記屬性設定)或外掛設定,遵循 Obsidian 的深色/淺色主題。背景色有兩層:元素背景色(下層顏色)和上層顏色。選擇“匹配元素”表示兩層都遵循元素背景色。選擇“匹配繪圖”或特定背景色不會改變元素背景色。設定透明度(如 50%)會將繪圖或選定的顏色與元素背景色混合。要移除元素背景色,可以在 Excalidraw 的元素屬性編輯器中將元素背景色設定為透明,這樣只有上層顏色生效。",
ES_BACKGROUND_MATCH_ELEMENT: "匹配元素背景色",
ES_BACKGROUND_MATCH_CANVAS: "匹配繪圖背景色",
ES_BACKGROUND_COLOR: "背景色",
ES_BORDER_HEAD: "邊框顏色",
ES_BORDER_COLOR: "邊框顏色",
ES_BORDER_MATCH_ELEMENT: "匹配元素邊框顏色",
ES_BACKGROUND_OPACITY: "背景不透明度",
ES_BORDER_OPACITY: "邊框不透明度",
ES_BACKGROUND_OPACITY: "背景透明度",
ES_BORDER_OPACITY: "邊框透明度",
ES_EMBEDDABLE_SETTINGS: "MD-Embeddable 設定",
ES_USE_OBSIDIAN_DEFAULTS: "使用 Obsidian 預設設定",
ES_ZOOM_100_RELATIVE_DESC: "使元素的縮放級別等於當前繪圖的縮放級別",
ES_ZOOM_100_RELATIVE_DESC: "使元素的縮放等級等於當前繪圖的縮放等級",
ES_ZOOM_100: "Relative 100%",
//Prompts.ts
@@ -1234,25 +1216,6 @@ export default {
//ReleaseNotes.ts
RN_WELCOME: "歡迎使用 Excalidraw",
FIRST_RUN: `
Obsidian 的 Excalidraw 外掛遠不只是「畫圖工具」。由於它與 Obsidian 深度整合,它為視覺化個人知識管理帶來了全新的工作方式。
<div style="text-align:center;margin-top:10px;">
<a href="https://community.sketch-your-mind.com/ee" target="_blank"><img src="https://sketch-your-mind.com/images/logo-EE.png" style="width:50%;"></a>
</div>
如果你想順利上手、避免一開始就被大量功能淹沒,我非常推薦免費的 **[Excalidraw Essentials](https://community.sketch-your-mind.com/ee)** 微課程。它能幫你快速抓住重點,用清楚的結構掌握核心基礎。
你也不必自己摸索。歡迎加入 **[Sketch Your Mind 社群](https://community.sketch-your-mind.com)**,與其他視覺思考者交流、分享工作流程,一起打造更順暢的 PKM 系統。
如果你想先看看它現在能做到什麼,下面有一段核心功能展示。若想持續了解最新更新,並進一步探索 Visual PKM,也歡迎訂閱我的 YouTube 頻道:[Visual PKM](https://www.youtube.com/@visualPKM)。
感謝使用,祝你玩得愉快!
<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>
`,
//Excalidraw component
COMP_IMG: "圖片 & 檔案",
@@ -1284,10 +1247,4 @@ Obsidian 的 Excalidraw 外掛遠不只是「畫圖工具」。由於它與 Obsi
VERSION_MISMATCH_DISABLE_DESC: "可在以下位置重新啟用:設定 → Excalidraw → 基本 → 警告外掛更新不完整",
VERSION_MISMATCH_REDOWNLOAD: "重新下載外掛",
VERSION_MISMATCH_IGNORE: "忽略",
//InlineLinkSuggester.ts
INLINE_HINT: "輸入 [[ 以搜尋並插入連結",
//SuggestionModal.ts
SUGGESTION_NOMATCH: "未找到匹配結果",
};
+1 -1
View File
@@ -5,7 +5,7 @@ import { Notice } from "obsidian";
import { getEA } from "src/core";
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { cloneElement } from "src/utils/excalidrawViewHelpers";
import { cloneElement } from "src/utils/excalidrawAutomateUtils";
import { nanoid } from "src/constants/constants";
import { svgToBase64 } from "../utils/utils";
import { ExportSettings } from "src/types/exportUtilTypes";
+5 -5
View File
@@ -25,7 +25,7 @@ export class ExportDialog extends Modal {
public exportInternalLinks: boolean = true;
public saveSettings: boolean;
public dirty: boolean = false;
private selectedOnlySetting: Setting | null = null;
private selectedOnlySetting: Setting;
private hasSelectedElements: boolean = false;
private boundingBox: {
topX: number;
@@ -39,15 +39,15 @@ export class ExportDialog extends Modal {
public pageSize: PageSize = "A4";
public pageOrientation: PageOrientation = "portrait";
private activeTab: "image" | "pdf" | "screenshot" = "image";
private contentContainer: HTMLDivElement | null = null;
private buttonContainerRow1: HTMLDivElement | null = null;
private buttonContainerRow2: HTMLDivElement | null = null;
private contentContainer: HTMLDivElement;
private buttonContainerRow1: HTMLDivElement;
private buttonContainerRow2: HTMLDivElement;
public fitToPage: number = 1;
public paperColor: "white" | "scene" | "custom" = "white";
public customPaperColor: string = "#ffffff";
public alignment: PDFPageAlignment = "center";
public margin: PDFPageMarginString = "normal";
private scaleSetting:Setting | null = null;
private scaleSetting:Setting;
constructor(
private plugin: ExcalidrawPlugin,
+55 -44
View File
@@ -1,5 +1,4 @@
import { App, Modal } from "obsidian";
import { clamp } from "@radix-ui/number";
function getClientPoint(e: PointerEvent | TouchEvent) {
if (e.type.startsWith("touch")) {
@@ -27,13 +26,13 @@ function isPointOnText(e: PointerEvent | TouchEvent, doc: Document): boolean {
let offset: number | null = null;
// Chromium/Firefox-ish
const caretPos = doc.caretPositionFromPoint?.(pt.x, pt.y);
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.caretRangeFromPoint?.(pt.x, pt.y);
const caretRange = (doc as any).caretRangeFromPoint?.(pt.x, pt.y);
if (caretRange?.startContainer) {
offsetNode = caretRange.startContainer;
offset = typeof caretRange.startOffset === "number" ? caretRange.startOffset : null;
@@ -68,13 +67,14 @@ export class FloatingModal extends Modal {
private dragging = false;
private offsetX = 0;
private offsetY = 0;
private readonly pointerDownHandler: (e: PointerEvent | TouchEvent) => void;
private readonly pointerMoveHandler: (e: PointerEvent | TouchEvent) => void;
private readonly pointerUpHandler: () => void;
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; // stores element focused before opening
private readonly modalKeydownStopHandler: (e: KeyboardEvent) => void; // store handler so we can remove it
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;
@@ -84,22 +84,8 @@ export class FloatingModal extends Modal {
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();
this.setDimBackground(false);
}
protected shouldNotStartDrag(target: HTMLElement, event: PointerEvent | TouchEvent): boolean {
return Boolean(
target instanceof HTMLInputElement ||
target instanceof HTMLTextAreaElement ||
target instanceof HTMLSelectElement ||
target instanceof HTMLButtonElement ||
isPointOnText(event, this.ownerDocument) ||
target.closest(".clickable-icon") ||
// ensure close button never starts drag
target.closest(".modal-close-button")
)
}
private handlePointerDown(e: PointerEvent | TouchEvent): void {
@@ -107,7 +93,15 @@ export class FloatingModal extends Modal {
const target = e.target as HTMLElement;
// Ignore if clicking on interactive elements
if (this.shouldNotStartDrag(target, e)) {
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;
}
@@ -155,18 +149,25 @@ export class FloatingModal extends Modal {
e.preventDefault();
if (e.type === "touchmove") e.stopPropagation();
const { clientX, clientY } = (e.type === "touchmove") ?
(e as TouchEvent).touches[0] : e as PointerEvent;
let clientX, clientY;
// Prevent moving the modal offscreen
const { width, height } = modalEl.getBoundingClientRect();
const margin = 8;
const x = clamp(clientX - this.offsetX, [margin, this.ownerWindow.innerWidth - width - margin]);
const y = clamp(clientY - this.offsetY, [margin, this.ownerWindow.innerHeight - height - margin]);
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 {
@@ -179,6 +180,13 @@ export class FloatingModal extends Modal {
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;
@@ -187,17 +195,20 @@ export class FloatingModal extends Modal {
if (this.disableKeyCapture) {
this.previousActive = this.ownerDocument.activeElement as HTMLElement | null;
try {
// Release modal scope so focus and key handling can return to the workspace.
// @ts-ignore
// @ts-ignore pop modal's key scope so keys are not intercepted
this.app.keymap.popScope(this.scope);
} catch {}
// prevent automatic selection / focus restoration
this.shouldRestoreSelection = false;
try {
// @ts-ignore prevent automatic selection / focus restoration
this.shouldRestoreSelection = false;
} catch {}
}
setTimeout(() => {
// @ts-ignore
const { containerEl, modalEl, bgEl } = this;
containerEl.addClass("mod-excalidraw-draggable")
//@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) {
@@ -213,6 +224,9 @@ export class FloatingModal extends Modal {
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);
@@ -223,12 +237,6 @@ export class FloatingModal extends Modal {
if (this.disableKeyCapture) {
// Prevent the modal from stealing focus
modalEl.setAttr("tabindex", "-1");
// In order to propagate keypresses, modal container and backdrop
// need to ignore (and thus propagate) any pointerEvents.
containerEl.style.pointerEvents = "none";
if (bgEl) bgEl.style.pointerEvents = "none";
// Refocus previous element (if still in DOM)
if (this.previousActive?.isConnected) {
this.previousActive.focus({ preventScroll: true });
@@ -236,6 +244,8 @@ export class FloatingModal extends Modal {
// 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");
@@ -261,6 +271,7 @@ export class FloatingModal extends Modal {
}
// Remove any remaining document event listeners
this.handlePointerUp();
this.ownerDocument.removeEventListener("keydown", this.escListener, { capture: true });
super.close();
}
+27 -78
View File
@@ -20,7 +20,6 @@ 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;
@@ -64,7 +63,6 @@ export class InsertPDFModal extends Modal {
this.pdfDoc.destroy();
this.pdfDoc = null;
}
this.pageDimensionsByPage.clear();
this.plugin = null;
this.view = null;
this.app = null;
@@ -72,44 +70,23 @@ export class InsertPDFModal extends Modal {
this.setImageSizeMessage = null;
}
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 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;
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;
}
//https://github.com/excalidraw/excalidraw/issues/4036
canvas.width = 0;
canvas.height = 0;
this.setImageSizeMessage();
} catch(e) {
console.log(e);
}
return { width, height };
}
@@ -141,11 +118,7 @@ export class InsertPDFModal extends Modal {
return this.pagesToImport;
}
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)}`;
};
private setImageSizeMessage = () => this.imageSizeMessage.innerText = `${Math.round(this.pageDimensions.width*this.importScale)} x ${Math.round(this.pageDimensions.height*this.importScale)}`;
async createForm() {
await this.plugin.loadSettings();
@@ -163,7 +136,7 @@ export class InsertPDFModal extends Modal {
let numPagesMessage: HTMLParagraphElement;
let numPages: number = 0;
let numPages: number;
let importButton: ButtonComponent;
let importMessage: HTMLElement;
@@ -201,15 +174,8 @@ export class InsertPDFModal extends Modal {
let pageRangesTextComponent: TextComponent
let importPagesMessage: HTMLParagraphElement;
const rangeOnChange = async (value:string) => {
const rangeOnChange = (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 {
@@ -221,10 +187,6 @@ 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);
@@ -232,16 +194,14 @@ export class InsertPDFModal extends Modal {
if(this.pdfDoc) {
numPages = this.pdfDoc.numPages;
pageRangesTextComponent.setValue(`1-${numPages}`);
await rangeOnChange(`1-${numPages}`);
rangeOnChange(`1-${numPages}`);
importButtonMessages();
numPagesMessages();
this.getPDFPageDimensions(this.pdfDoc);
} else {
importButton.setDisabled(true);
}
} else {
importButtonMessages();
numPagesMessages();
}
}
}
const search = new TextComponent(ce);
@@ -265,7 +225,7 @@ export class InsertPDFModal extends Modal {
pageRangesTextComponent = text;
text
.setValue("")
.onChange(async (value) => { await rangeOnChange(value); })
.onChange((value) => rangeOnChange(value))
text.inputEl.style.width = "100%";
})
importPagesMessage = ce.createEl("p", {text: ""});
@@ -422,10 +382,9 @@ export class InsertPDFModal extends Modal {
el.innerText = ` ${this.gapSize.toString()}`;
});
const initialDims = this.getMaxSelectedPageDimensions();
const importSizeSetting = new Setting(ce)
.setName("Imported page size")
.setDesc(`${Math.round(initialDims.width*this.importScale)} x ${Math.round(initialDims.height*this.importScale)}`)
.setDesc(`${this.pageDimensions.width*this.importScale} x ${this.pageDimensions.height*this.importScale}`)
.addSlider(slider => slider
.setLimits(0.1, 1.5, 0.1)
.setValue(this.importScale)
@@ -436,7 +395,6 @@ export class InsertPDFModal extends Modal {
}))
this.imageSizeMessage = importSizeSetting.descEl;
this.setImageSizeMessage();
const actionButton = new Setting(ce)
.setDesc("Select a document first")
@@ -448,22 +406,13 @@ export class InsertPDFModal extends Modal {
const ea = getEA(this.view) as ExcalidrawAutomate;
let column = 0;
let row = 0;
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;
}
const imgWidth = Math.round(this.pageDimensions.width*this.importScale);
const imgHeight = Math.round(this.pageDimensions.height*this.importScale);
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 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);
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);
ea.style.strokeColor = this.borderBox ? "#000000" : "transparent";
const boxID = ea.addRect(
+13 -279
View File
@@ -1,287 +1,21 @@
export const FIRST_RUN = `
The Excalidraw Obsidian plugin is much more than "just" a drawing tool. To help you get started here's a showcase of the key Excalidraw plugin features.
If you'd like to learn more, please subscribe to my YouTube channel: [Visual PKM](https://www.youtube.com/channel/UCC0gns4a9fhVkGkngvSumAQ) where I regularly share videos about Obsidian-Excalidraw and about tools and techniques for Visual Personal Knowledge Management.
Thank you & Enjoy!
<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).
I build this plugin as a labor of love. Curious about the philosophy behind it? Check out [📕 Sketch Your Mind](https://sketch-your-mind.com). Want to master Excalidraw? Join [Excalidraw Mastery](https://community.sketch-your-mind.com/em). If you find it valuable, say THANK YOU or…
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.22.3":`
Feeling overwhelmed by Excalidraw’s endless features?
It's not just a drawing tool. Inside Obsidian, it becomes a thinking tool.
To unlock linking, embedding, and referencing, you need a mindset shift.
**Join Excalidraw Mastery** to make that shift.
Courses, live Q&As, and deep dives to help you move into true 4D Visual PKM. 👉 https://community.sketch-your-mind.com/em
<div style="text-align:center;margin-top:10px;">
<a href="https://community.sketch-your-mind.com/em" target="_blank"><img src="https://sketch-your-mind.com/images/logo-EM.png" style="width:50%"></a>
</div>
Excalidraw Mastery is part of the **Sketch Your Mind Community**—a space for visual thinkers.
Share your work. Ask questions. Learn from others. 👉 https://community.sketch-your-mind.com
Curious about the philosophy behind it?
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=TnwRlaIdhSU" target="_blank"><img src ="https://sketch-your-mind.com/images/Thumbnail-podcast.jpg" style="width:100%;"></a>
</div>
`,
"2.22.1": `
## New
- Added a command palette action to switch all currently open Excalidraw drawings to view mode.
- While this temporary mode is enabled, any Excalidraw drawing opened afterward will also open in view mode.
- This is useful when presenting multiple drawings and you want to avoid accidentally moving elements, and when you don't want the tools to be in the way.
- Added an optional phone-only layout setting to push Excalidraw's footer controls above the system navigation bar on some Android devices [#2688](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2688), [#2652](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2652), [#798](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/798)
- Look for ""Extra bottom padding for phone controls" in the plugin settings.
## Fixed
- invisible cursor color in color picker, mermaid chat, in text elements in dark mode [#2739](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2739)
- image sizing issue when embedding image type "SVG Image" to markdown
- copying a nested image fragment in Excalidraw and pasting to markdown lost the image block reference
- modifier keys conflicted with Excalidraw alt-select (lasso) behavior
`,
"2.22.0":`
## Fixed
- Fixed misaligned panel buttons in tray mode [#2718](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2718) 🙏[@heinrich26](https://github.com/heinrich26)
- Improved loading of nested Excalidraw files within a scene, with some additional performance gains.
- Fixed an issue where the caret color did not match the text color [#11018](https://github.com/excalidraw/excalidraw/issues/11018)
## New from Excalidraw.com
- Added several text editing improvements, including a right-side handle on wrapped text for easier auto-resizing without opening the context menu [#10979](https://github.com/excalidraw/excalidraw/pull/10979)
- Added support for Mermaid state diagrams [#11031](https://github.com/excalidraw/excalidraw/pull/11031)
- There is a new Preferences menu above the Dark/Light mode switch in the main menu [#10760](https://github.com/excalidraw/excalidraw/pull/10760)
- Added a new Preferences option to switch between Wrap and Overlap selection modes. Overlap mode behaves similarly to the lasso selection tool available under More Tools [#11053](https://github.com/excalidraw/excalidraw/pull/11053)
## New
- Added support for embedding the [Sheet Plus](obsidian://show-plugin?id=sheet-plus) plugin as an active embeddable element in Excalidraw. At the moment, changing the canvas theme between dark and light mode does not automatically re-render embedded sheets. To apply the theme change, close and reopen the drawing. This will likely be improved in a future update.
`,
"2.21.3":`
## Fixed
- Caret color for link editor, text elemnts in dark mode, color picker input element.
- Link click behavior modifier keys setting in plugin settings now enforces CTRL/CMD for link clicks and improves on clarity of setting UI by adding a header row
- Link click conbinations that included ALT/OPT did not work because they trigger lasso selection in Excalidraw. This is now fixed, if you CTRL+ALT click a link it will navigate while retaining the lasso select feature when pressing ALT/OPT.
- Copying an image block embed (e.g. \`![[drawing#^frame=my_frame]]\`) from the excalidraw scene and pasting it to markdown no longer loses the frame reference
- Embed "SVG Image" to markdown should size correctly now when setting a percentage \`![[drawing|50%]]\` where 50% is relative to the width of the markdown note.
`,
"2.21.2":`
## Fixed
- The new ExcalidrawAutomate function \`parseText()\` broke if the text was a transcluded image or PDF document, causing downstream paste issues in MindMap Builder.
- Custom pen sloppiness not being saved to a template drawing [#2715](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2715) 🙏[@sreedharsreeram](https://github.com/sreedharsreeram)
`,
"2.21.1":`
## Fixed
- Drawing and editor fails to initialize in a new window [#2713](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2713)
- Duplicate selected image with a different image ID command palette action did not duplicate cropped PDF images.
- Memory leak issue with PDF import as images.
## New
- Put caret at pointer position when clicking on selected text element [#10970](https://github.com/excalidraw/excalidraw/pull/10970)
`,
"2.21.0":`
## New
- LaTeX editor is now floating [#2684](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2684) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1), [#2698](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2698) 🙏[@heinrich26](https://github.com/heinrich26)
- Inline link suggester supports new triggers \`![[drawing#^frame=\` and \`![[drawing#^clippedframe=\`, thus it is easy to reference frames like pdf pages, slides or other parts of your scene marked using marker frames.
- Support for mermaid Entity Relationship Diagrams, and new ERD/cardinality arrowheads [#10940](https://github.com/excalidraw/excalidraw/pull/10940)
- New Context Menu options to disable arrow binding and midpoint snapping [#10906](https://github.com/excalidraw/excalidraw/pull/10906)
- Improved UI styling and icons are better aligned with Obsidian [#2703](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2703), [#2687](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2687), [#2697](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2697) 🙏[@heinrich26](https://github.com/heinrich26)
## Fixed
- Sizing of embedded images in Markdown when image type is set to SVG [#2685](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2685)
- Fixed Enter, Up/Down arrows, and TAB keys stopped working in text elements after deleting the \`#\` character [#2704](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2704)
## MindMap Builder
- Fixed navigation (arrow keys) scoping and recognition
- Added new feature to paste images and single Excalidraw elements like container with text, text element, or image element directly as a map leaf (using the MindMap Builder default paste shortcut: ALT/OPT+V)
- Added new action to toggle a markdown link between markdown embeddable and link as text. Default shortcut is ALT/OPT+E.
## New in ExcalidrawAutomate
\`\`\`ts
/**
* Parses text using the target view's ExcalidrawData parser.
*
* This reuses ExcalidrawData parsing logic directly, including transclusion
* resolution, link bracket rendering, and link/url prefixes based on the
* target file's frontmatter.
*
* @param {string} text - Raw text to parse.
* @returns {Promise<string | undefined>} Parsed text, or undefined when input/view is unavailable.
*/
public async parseText (text: string): Promise<string | undefined>;
\`\`\`
`,
"2.20.6":`
<div class="excalidraw-videoWrapper">
<a href="https://www.youtube.com/watch?v=g-BiyQ7TJTM" target="_blank"><img src ="https://i.ytimg.com/vi/g-BiyQ7TJTM/maxresdefault.jpg" style="width:100%;"></a>
</div>
## New
- Inline suggester now supports searching for tags in addition to files. Trigger with "#".
- In Mindmap Builder
- Added Up-Facing, Down-Facing, and Up-Down maps
- Added submaps. You can now promote any node to be a new mindmap root (a sub-map). Sub-maps can have different layout settings such as different growth strategies, different colors, etc.
- Added experimental MindMap Builder API, accessible via \`window.MindMapBuilderAPI\`. See [MindMap Builder API documentation](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/docs/ea-script-docs/MindMapBuilderAPI.md) for more. Essentially, the API allows mindmaps to be created using the Obsidian CLI.
## New from Excalidraw.com
- Allow clicking on links and embeds with laser tool [#10797](https://github.com/excalidraw/excalidraw/pull/10797)
- Improved paste text to diagram with more options and support for more data [#10824](https://github.com/excalidraw/excalidraw/pull/10824)
try copy/pasting this into Excalidraw:
\`\`\`
skill, junior, medior, senior
business_analysis, 2, 6, 9
business_writing, 3, 7, 9
stakeholder_mgmt, 1, 6, 10
\`\`\`
## New in ExcalidrawAutomate
- Added \`skipScriptRestore(scriptName?: string): boolean\` function to the API. This allows scripts to queue a one-time skip marker so sidepanel persisted restoration will not re-run the script. Intended for startup race conditions where a script is started from the Command Palette/hotkey before the sidepanel has opened. If scriptName is omitted, the function uses ea.activeScript.
## Fixed
- Significant performance improvement of MindMap Builder and all other scripts modifying elements in large scenes containing thousands of elements.
- Multiple arrow related updates and fixes from Excalidraw.com [#10832](https://github.com/excalidraw/excalidraw/pull/10832) [#10831](https://github.com/excalidraw/excalidraw/pull/10831) [#10816](https://github.com/excalidraw/excalidraw/pull/10816)
- Hide MindMap Builder and other floating tools when creating a screenshot
`,
"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
- 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).
## 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)
`,
"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)
## 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)
## 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)
## 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">
+3 -32
View File
@@ -45,31 +45,6 @@ export class ModifierKeySettingsComponent {
text: t("DEFAULT_ACTION_DESC") + modifierKeyTooltipMessages()[modifierSetType][modifierKeys.defaultAction],
cls: "setting-item-description"
});
// Ensure all LinkClickAction rules have ctrl_cmd enabled
if (modifierSetType === "LinkClickAction") {
let dirty = false;
modifierKeys.rules.forEach((rule) => {
if (!rule.ctrl_cmd) { rule.ctrl_cmd = true; dirty = true; }
});
if (dirty) this.update?.();
}
// Column header row
const headerSetting = new Setting(detailsEl);
headerSetting.settingEl.addClass("modifier-key-header-row");
headerSetting.infoEl.remove();
[
"SHIFT",
this.isMacOS ? "CMD" : "CTRL",
this.isMacOS ? "OPT" : "ALT",
this.isMacOS ? "CTRL" : "META",
].forEach((key) => {
headerSetting.controlEl.createEl("span", {
text: key,
cls: "modifier-key-col-header",
});
});
Object.entries(modifierKeys.rules).forEach(([action, rule]) => {
const setting = new Setting(detailsEl)
//@ts-ignore
@@ -85,18 +60,14 @@ export class ModifierKeySettingsComponent {
})
);
setting.addToggle((toggle) => {
const isLinkClick = modifierSetType === "LinkClickAction";
toggle
.setValue(isLinkClick ? true : rule.ctrl_cmd)
.setValue(rule.ctrl_cmd)
.setTooltip(this.isMacOS ? "CMD" : "CTRL")
.onChange((value) => {
rule.ctrl_cmd = value;
this.update();
});
if (isLinkClick || this.isMacOS) {
// CMD is always required for link-click actions (Excalidraw detects
// the click via CMD being held). On macOS, CMD is also reserved for
// non-link-click actions.
})
if(this.isMacOS && modifierSetType !== "LinkClickAction") {
toggle.setDisabled(true);
toggle.toggleEl.style.opacity = "0.5";
}
+1 -1
View File
@@ -67,7 +67,7 @@ export class PenSettingsModal extends Modal {
async onClose() {
if(this.dirty) {
await this.plugin.saveSettings();
getExcalidrawViews(this.app, true).forEach(excalidrawView=>excalidrawView.updatePinnedCustomPens());
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.updatePinnedCustomPens());
const pen = this.plugin.settings.customPens[this.pen]
const api = this.view.excalidrawAPI;
setPen(pen,api);
+34 -40
View File
@@ -7,7 +7,8 @@ import {
Instruction,
TFile,
Notice,
TextAreaComponent
TextAreaComponent,
getIcon,
} from "obsidian";
import ExcalidrawView from "../../view/ExcalidrawView";
import ExcalidrawPlugin from "../../core/main";
@@ -24,12 +25,10 @@ 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 { history } from "@codemirror/commands";
import { parser } from "./math-only";
import { LRLanguage } from "@codemirror/language";
import { editorLivePreviewField } from "obsidian";
import { Extension } from "@codemirror/state";
import { FloatingModal } from "./FloatingModal";
export class Prompt extends Modal {
private promptEl: HTMLInputElement;
@@ -86,13 +85,13 @@ export class Prompt extends Modal {
}
}
export class LaTexPrompt extends FloatingModal {
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 readonly latexsSuitePlugin : any;
private latexsSuitePlugin : any;
protected constructor(
app: App,
@@ -103,7 +102,6 @@ export class LaTexPrompt extends FloatingModal {
this.titleEl.setText(this.prompt_text);
this.contentEl.addClass("excalidraw-LatexPrompt");
this.latexsSuitePlugin = app.plugins.plugins["obsidian-latex-suite"];
super.enableKeyCapture(); // otherwise latex-suite (or Ctrl-Enter) do not get the key event
const mainContentContainer: HTMLDivElement = this.contentEl.createDiv();
this.display(default_value, mainContentContainer);
this.waitForClose = new Promise<string>((resolve, reject) => {
@@ -113,55 +111,51 @@ export class LaTexPrompt extends FloatingModal {
this.editorView.focus();
}
protected shouldNotStartDrag(target: HTMLElement, event: PointerEvent | TouchEvent): boolean {
return target.closest(".cm-editor") != null || super.shouldNotStartDrag(target, event);
}
public static Prompt(app: App,
prompt_text?: string,
default_value?: string,
): Promise<string>{
const latexprompt = new this(app, prompt_text, default_value);
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;}
}]),
// obsidian class to inherit styling
EditorView.editorAttributes.of({class: "multi-select-container"}),
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([
const extensions = [
language,
keymap.of([{
key:"Mod-Enter",
run : () => {this.submitCallback(); return true;}
}]),
history(),
editorLivePreviewField.init(() => false),
this.latexsSuitePlugin.editorExtensions
]);
}
... this.latexsSuitePlugin.editorExtensions
];
this.editorView = new EditorView({
doc: value,
extensions : extensions,
parent : container,
});
this.editorView = new EditorView({
doc: value,
parent : container,
extensions : extensions,
});
} else {
const extensions = [
keymap.of([{
key:"Mod-Enter",
run : () => {this.submitCallback(); return true;}
}]),
history(),
];
this.editorView = new EditorView({
doc: value,
extensions : extensions,
parent : container,
});
}
const buttonBarContainer: HTMLDivElement = container.createDiv();
buttonBarContainer.addClass(`excalidraw-prompt-buttonbar-bottom`);
@@ -1249,4 +1243,4 @@ export const templatePromt = async (files: TFile[], app: App): Promise<TFile> =>
undefined,
t("PROMPT_SELECT_TEMPLATE")
))??[null, null, null])[0];
}
}
+5 -16
View File
@@ -1,26 +1,18 @@
import { App, MarkdownRenderer, Modal } from "obsidian";
import { isVersionNewerThanOther } from "src/utils/utils";
import ExcalidrawPlugin from "../../core/main";
import { RELEASE_NOTES } from "./Messages";
import { FIRST_RUN, RELEASE_NOTES } from "./Messages";
import { t } from "src/lang/helpers";
declare const PLUGIN_VERSION:string;
type ReleaseNotesOptions = {
message?: string;
persistVersion?: boolean;
title?: string;
};
export class ReleaseNotes extends Modal {
private plugin: ExcalidrawPlugin;
private options: ReleaseNotesOptions;
private version: string;
constructor(app: App, plugin: ExcalidrawPlugin, version: string, options: ReleaseNotesOptions = {}) {
constructor(app: App, plugin: ExcalidrawPlugin, version: string) {
super(app);
this.plugin = plugin;
this.options = options;
this.version = version;
}
@@ -29,7 +21,7 @@ export class ReleaseNotes extends Modal {
const { containerEl, contentEl, titleEl, headerEl } = this;
//this.contentEl.classList.add("excalidraw-release");
containerEl.classList.add("excalidraw-release");
titleEl.setText(this.options.title ?? `${t("RN_WELCOME")} ${this.version ?? ""}`.trim());
titleEl.setText(`${t("RN_WELCOME")} ${this.version ?? ""}`);
this.createForm();
if(headerEl) headerEl.style.pointerEvents = "none"; // Disable pointer events on header to allow clicks through
@@ -37,9 +29,6 @@ export class ReleaseNotes extends Modal {
async onClose() {
this.contentEl.empty();
if (this.options.persistVersion === false) {
return;
}
await this.plugin.loadSettings();
if(this.plugin.settings.previousRelease !== PLUGIN_VERSION) {
this.plugin.settings.previousRelease = PLUGIN_VERSION;
@@ -50,13 +39,13 @@ export class ReleaseNotes extends Modal {
async createForm() {
let prevRelease = this.plugin.settings.previousRelease;
prevRelease = this.version === prevRelease ? "0.0.0" : prevRelease;
const message = this.options.message ?? (this.version
const message = this.version
? Object.keys(RELEASE_NOTES)
.filter((key) => key === "Intro" || isVersionNewerThanOther(key,prevRelease))
.map((key: string) => `${key==="Intro" ? "" : `# ${key}\n`}${RELEASE_NOTES[key]}`)
.slice(0, 10)
.join("\n\n---\n")
: t("FIRST_RUN"));
: FIRST_RUN;
await MarkdownRenderer.render(
this.app,
message,
+9 -28
View File
@@ -208,7 +208,6 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
"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" +
@@ -418,12 +417,13 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
{
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" +
"type ColorMap = { [color: string]: 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"+
"Set colorMap.invertInDarkMode to force or disable dark-mode inversion for that image.\n"+
"type ColorMap = { [color: string]: string; invertInDarkMode?: boolean; }",
after: "",
},
{
@@ -617,12 +617,8 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
},
{
field: "addElementsToView",
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.",
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",
after: "",
},
{
@@ -955,15 +951,6 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
desc: "Returns the WorkspaceLeaf hosting the Excalidraw sidepanel view, or null if the sidepanel is not present.",
after: "();"
},
{
field: "skipSidepanelScriptRestore",
code: "skipSidepanelScriptRestore(scriptName?: string): boolean;",
desc: "Queues a one-time skip marker so sidepanel persisted restoration will not re-run the script. " +
"Intended for startup race conditions where a script is started from Command Palette/hotkey before the sidepanel has opened. " +
"If scriptName is omitted the function uses ea.activeScript. " +
"The marker is queued only when getSidepanelLeaf() is null; returns true when queued, otherwise false.",
after: "();"
},
{
field: "toggleSidepanelView",
code: "toggleSidepanelView(): void;",
@@ -982,12 +969,6 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
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: "parseText",
code: "async parseText(text: string): Promise<string | undefined>;",
desc: "Parses raw text through targetView.excalidrawData using the same parsing pipeline as ExcalidrawData (including transclusion resolution, link brackets, and link/url prefixes from frontmatter). Works only when ea.targetView is set and loaded.",
after: "",
},
{
field: "getleaf",
code: "getLeaf(origo: WorkspaceLeaf, targetPane?: PaneTarget): WorkspaceLeaf;",
+6 -38
View File
@@ -4,8 +4,9 @@ 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";
export type UIMode = "full" | "compact" | "tray" | "phone";
//setTrayMode(this.app, this.plugin.settings);
//setDesktopUIMode(this.app, this.plugin.settings);
@@ -14,20 +15,17 @@ export class UIModeSettingsComponent {
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 {
@@ -56,7 +54,6 @@ export class UIModeSettingsComponent {
.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)
@@ -69,25 +66,6 @@ export class UIModeSettingsComponent {
}),
);
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")))
@@ -96,23 +74,13 @@ export class UIModeSettingsComponent {
.setValue(this.settings.isLeftHanded)
.onChange(async (value) => {
this.settings.isLeftHanded = value;
setLeftHandedMode(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();
}),
);
}
}
}
+1 -1
View File
@@ -1,6 +1,7 @@
import ExcalidrawPlugin from "src/core/main";
import { t } from "src/lang/helpers";
import { UIModeSettingsComponent } from "./UIModeSettingComponent";
import { FloatingModal } from "./FloatingModal";
import { Modal } from "obsidian";
export class UIModeSettings extends Modal {
@@ -30,7 +31,6 @@ export class UIModeSettings extends Modal {
this.plugin.settings,
this.app,
()=>this.applySettingsUpdate(),
()=>this.close(),
).render();
}
@@ -9,7 +9,7 @@ import { getEA } from "src/core";
import { InsertPDFModal } from "./InsertPDFModal";
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
import { cleanSectionHeading } from "src/utils/pathUtils";
import { cleanSectionHeading } from "src/utils/obsidianUtils";
import { t } from "src/lang/helpers";
export class UniversalInsertFileModal extends Modal {
Loaded 100 of 147 files, more files were not shown because too many files have changed in this diff. Show more