mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2026-12-03 06:43:35 +00:00
Compare commits
304
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e977a3d9d3 | ||
|
|
c3b0803676 | ||
|
|
1e696bdcc1 | ||
|
|
99cf5c26e2 | ||
|
|
dd81b137e4 | ||
|
|
82a41e7cc1 | ||
|
|
5b7644e5a3 | ||
|
|
bdd55aea2c | ||
|
|
b26cb5d067 | ||
|
|
d2e1d72678 | ||
|
|
76e5d82c0f | ||
|
|
9391ba45a3 | ||
|
|
e08db69c4c | ||
|
|
59d2650a99 | ||
|
|
fcecb19d11 | ||
|
|
5cbe209666 | ||
|
|
922aa5d17b | ||
|
|
6206962185 | ||
|
|
0204a1d19c | ||
|
|
cfa18cdd6d | ||
|
|
ab3bed01cd | ||
|
|
711142a899 | ||
|
|
cc5a3006c9 | ||
|
|
03d3e25611 | ||
|
|
478fca4306 | ||
|
|
0446b3dbed | ||
|
|
b0b2afb972 | ||
|
|
5d5970c62d | ||
|
|
4bcb9be49d | ||
|
|
8d9546f4cd | ||
|
|
5257a0a73f | ||
|
|
955b0de308 | ||
|
|
e2739fe34c | ||
|
|
3ac427f813 | ||
|
|
36044e41a1 | ||
|
|
91156279c5 | ||
|
|
1083c9fb10 | ||
|
|
1e40fe28db | ||
|
|
c3d8f8e5d5 | ||
|
|
49d657aad9 | ||
|
|
d844daaaec | ||
|
|
ecd24f57a6 | ||
|
|
30c901e6f3 | ||
|
|
2d7873ad0d | ||
|
|
b1786a35e8 | ||
|
|
7033020101 | ||
|
|
9853b6b0fc | ||
|
|
bfc4e4561a | ||
|
|
c557d1c0e8 | ||
|
|
e912ab698b | ||
|
|
1657837830 | ||
|
|
20e305931b | ||
|
|
33be7275b1 | ||
|
|
97f425b6de | ||
|
|
46d69db8a6 | ||
|
|
6326c62bcd | ||
|
|
f0e231a3e5 | ||
|
|
7b1d91ce0d | ||
|
|
b6fd3bd665 | ||
|
|
7c24821011 | ||
|
|
9ae74c7af0 | ||
|
|
14d5521483 | ||
|
|
6865fdf33c | ||
|
|
c573d2cba3 | ||
|
|
9186537a1a | ||
|
|
d89a212c46 | ||
|
|
6a1d773d87 | ||
|
|
4c23be299c | ||
|
|
4e9baf72ec | ||
|
|
1136f19bb6 | ||
|
|
230c0e9c4b | ||
|
|
a0e251af36 | ||
|
|
dddd13e439 | ||
|
|
83337cbec7 | ||
|
|
7c14328226 | ||
|
|
dd579e8d52 | ||
|
|
c5b34b0e50 | ||
|
|
6651db8c3a | ||
|
|
60a692ba7b | ||
|
|
a21481aae5 | ||
|
|
e1ec75f7c7 | ||
|
|
b15a9cff91 | ||
|
|
375c29171c | ||
|
|
c7bbb0ca0f | ||
|
|
3dd3f6c5a3 | ||
|
|
3931fa95b8 | ||
|
|
fc03c0bfd2 | ||
|
|
00ce6b1883 | ||
|
|
a9a2c63873 | ||
|
|
4bd42bff9a | ||
|
|
a2ae59965b | ||
|
|
49d6e2180e | ||
|
|
75f69af2cd | ||
|
|
0a5a7660fc | ||
|
|
f2eed2a755 | ||
|
|
9b0c656e0b | ||
|
|
ada0caea1a | ||
|
|
37c1c2459f | ||
|
|
38ad0c9eed | ||
|
|
dd37894ddd | ||
|
|
54bb7558f7 | ||
|
|
d698f2d3f7 | ||
|
|
135e634df3 | ||
|
|
bec690c792 | ||
|
|
d57d8ecc9d | ||
|
|
ab5d26078c | ||
|
|
1b7f9c19de | ||
|
|
22324613f3 | ||
|
|
3baf7de216 | ||
|
|
250a1a14d5 | ||
|
|
fd0d84d240 | ||
|
|
a9ffdde8e5 | ||
|
|
5206aff1cf | ||
|
|
8022f9a89b | ||
|
|
5216d81db9 | ||
|
|
949789ec8c | ||
|
|
53f21bca9b | ||
|
|
1246eca2f3 | ||
|
|
06014da0b7 | ||
|
|
24b6a610b8 | ||
|
|
35dd6dd650 | ||
|
|
26ce6dfe0d | ||
|
|
ebaab2702c | ||
|
|
1638d9cc42 | ||
|
|
9bb5d7249e | ||
|
|
7986ed4000 | ||
|
|
4d9a8d90ba | ||
|
|
3994f63e69 | ||
|
|
956cdf07ea | ||
|
|
03692dfd77 | ||
|
|
5340669fd6 | ||
|
|
4ac8dcc4de | ||
|
|
aa6f07e652 | ||
|
|
df281889ff | ||
|
|
25629ee5eb | ||
|
|
e6e61d3a99 | ||
|
|
7c9a2e9d57 | ||
|
|
41177030ae | ||
|
|
6a09b3f873 | ||
|
|
0acacc8f9f | ||
|
|
1efb8f3049 | ||
|
|
7d99259cdc | ||
|
|
a97d90653f | ||
|
|
06debd4106 | ||
|
|
62ae0b8230 | ||
|
|
0e2044ba72 | ||
|
|
0db8ab9cda | ||
|
|
9319b39c96 | ||
|
|
75cbc47bc5 | ||
|
|
66e31110e2 | ||
|
|
a0ec16cdf1 | ||
|
|
a5105688e4 | ||
|
|
60fe7a413f | ||
|
|
ee3da19290 | ||
|
|
4a71042fea | ||
|
|
fc51cf9a15 | ||
|
|
1b5a6ae18a | ||
|
|
fee74f4edd | ||
|
|
bfcab155ca | ||
|
|
56934e0279 | ||
|
|
d89ef4caeb | ||
|
|
f939db2cba | ||
|
|
04e9723048 | ||
|
|
5e68f29f7c | ||
|
|
b82ab59126 | ||
|
|
894906cebb | ||
|
|
b0828011e2 | ||
|
|
ef70901263 | ||
|
|
b934c429bc | ||
|
|
57b00f7c69 | ||
|
|
1e245f1136 | ||
|
|
a5632866b0 | ||
|
|
a96f0d0889 | ||
|
|
5cbaf5b203 | ||
|
|
3cd05b0be2 | ||
|
|
70a6c0167d | ||
|
|
7150aaf795 | ||
|
|
ad3874889e | ||
|
|
15d15b35e7 | ||
|
|
7680396b99 | ||
|
|
3f582d87fe | ||
|
|
b37ed015e3 | ||
|
|
22cf76b1f9 | ||
|
|
588dfc5dc2 | ||
|
|
e1f36d910b | ||
|
|
cbec7f4d9f | ||
|
|
6585a75b6e | ||
|
|
d3b8d07d9c | ||
|
|
9cda26faad | ||
|
|
cc18cf9166 | ||
|
|
8ce71c262b | ||
|
|
0116125a10 | ||
|
|
f214633db8 | ||
|
|
bd191f0d2d | ||
|
|
afa8fbff80 | ||
|
|
5236a73a1e | ||
|
|
45d95856ca | ||
|
|
4e050f76e1 | ||
|
|
aee74ca6d9 | ||
|
|
c6459b6a87 | ||
|
|
0eb4b2a1f5 | ||
|
|
23b793d21f | ||
|
|
77dd95f089 | ||
|
|
faa900a352 | ||
|
|
2ceebab04f | ||
|
|
0b0232aa62 | ||
|
|
497125d7cc | ||
|
|
4e8baed49f | ||
|
|
3f93be3b45 | ||
|
|
bb17694219 | ||
|
|
51ffcdf3de | ||
|
|
12bc2a1680 | ||
|
|
4c8ed3fe57 | ||
|
|
bbb3a63106 | ||
|
|
b801a1e4d2 | ||
|
|
96bf5d4880 | ||
|
|
0962eadcf9 | ||
|
|
4d57bf6fb5 | ||
|
|
da8937499b | ||
|
|
4818d23f8b | ||
|
|
a1561de832 | ||
|
|
1900cfcf84 | ||
|
|
aa47d1375b | ||
|
|
61ae34968a | ||
|
|
296ac84f08 | ||
|
|
bcd63ad7fe | ||
|
|
1fec09c367 | ||
|
|
4cd5dde3d6 | ||
|
|
36ee7f6e52 | ||
|
|
32f76d4ea4 | ||
|
|
53aed86777 | ||
|
|
573587bd88 | ||
|
|
558d0105a5 | ||
|
|
76910a3352 | ||
|
|
e2c9e2b256 | ||
|
|
9630db68a4 | ||
|
|
7541fa22b4 | ||
|
|
c5cf6d630f | ||
|
|
2f296c7a46 | ||
|
|
095ff057cd | ||
|
|
b38956cb51 | ||
|
|
03392db757 | ||
|
|
2bd252fcff | ||
|
|
12b52e42f2 | ||
|
|
76675591fe | ||
|
|
966f6b53ea | ||
|
|
efbca80f74 | ||
|
|
ee8ac2f7ad | ||
|
|
0ac7ccde66 | ||
|
|
b5bd27f115 | ||
|
|
600b2d9621 | ||
|
|
c709562925 | ||
|
|
c3cfe0b0ed | ||
|
|
686ff92f4d | ||
|
|
37f3937bd6 | ||
|
|
16c61c44ce | ||
|
|
2f968a7bbc | ||
|
|
475492beda | ||
|
|
ab11258d0d | ||
|
|
1ab682e726 | ||
|
|
cb370645b7 | ||
|
|
c80420772e | ||
|
|
5fd76e07ba | ||
|
|
fda8d5ce77 | ||
|
|
2e52744743 | ||
|
|
a634d24f6b | ||
|
|
ebc0ecbfc4 | ||
|
|
9622e137ba | ||
|
|
b3bf3b5a60 | ||
|
|
cc1ae730d1 | ||
|
|
9841941431 | ||
|
|
f179b6720b | ||
|
|
b44d2a4a9a | ||
|
|
6a82011bdb | ||
|
|
c835943fc5 | ||
|
|
a4f0676686 | ||
|
|
e69487c456 | ||
|
|
e7a067d53a | ||
|
|
fe8ece275a | ||
|
|
a5f2da74ba | ||
|
|
ce602b8268 | ||
|
|
7bb718da81 | ||
|
|
cceb2cae82 | ||
|
|
f5f0134509 | ||
|
|
44588ab4b8 | ||
|
|
989e7969dc | ||
|
|
f5c7820315 | ||
|
|
c416c21985 | ||
|
|
e5f6466542 | ||
|
|
95ba981445 | ||
|
|
31cc45ff6d | ||
|
|
62f51511ed | ||
|
|
5c628e08f4 | ||
|
|
0e11150055 | ||
|
|
37b4cdd44a | ||
|
|
a2a33bc463 | ||
|
|
00531325ea | ||
|
|
a7d4d59619 | ||
|
|
b05e26d138 | ||
|
|
ce3cda7a1d | ||
|
|
ba5d1aa6d6 | ||
|
|
686f462716 | ||
|
|
21dec11170 | ||
|
|
c332608bb5 |
No files matched your search
@@ -14,6 +14,7 @@ data.json
|
||||
lib
|
||||
dist
|
||||
tmp
|
||||
deploy.ps1
|
||||
|
||||
#VSCode
|
||||
.vscode
|
||||
|
||||
Generated
+5
-5
@@ -9,7 +9,7 @@
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"mathjax-full": "^3.2.2",
|
||||
"nanoid": "^4.0.2"
|
||||
"nanoid": "^5.0.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^26.0.1",
|
||||
@@ -749,9 +749,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz",
|
||||
"integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==",
|
||||
"version": "5.0.9",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.9.tgz",
|
||||
"integrity": "sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -763,7 +763,7 @@
|
||||
"nanoid": "bin/nanoid.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14 || ^16 || >=18"
|
||||
"node": "^18 || >=20"
|
||||
}
|
||||
},
|
||||
"node_modules/obsidian": {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"mathjax-full": "^3.2.2",
|
||||
"nanoid": "^4.0.2"
|
||||
"nanoid": "^5.0.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^26.0.1",
|
||||
|
||||
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
Vendored
+3
-1
@@ -577,9 +577,11 @@ export declare class ExcalidrawAutomate {
|
||||
* @param {number} topX - The x-coordinate of the top-left corner.
|
||||
* @param {number} topY - The y-coordinate of the top-left corner.
|
||||
* @param {string} tex - The LaTeX equation string.
|
||||
* @param {number} [scaleX=1] - The x-scaling factor (post mathjax creation)
|
||||
* @param {number} [scaleY=1] - The y-scaling factor (post mathjax creation)
|
||||
* @returns {Promise<string>} Promise resolving to the ID of the added LaTeX image element.
|
||||
*/
|
||||
addLaTex(topX: number, topY: number, tex: string): Promise<string>;
|
||||
addLaTex(topX: number, topY: number, tex: string, scaleX?: number, scaleY?: number): Promise<string>;
|
||||
/**
|
||||
* Returns the base64 dataURL of the LaTeX equation rendered as an SVG.
|
||||
* @param {string} tex - The LaTeX equation string.
|
||||
|
||||
+3
-1
@@ -577,9 +577,11 @@ export declare class ExcalidrawAutomate {
|
||||
* @param {number} topX - The x-coordinate of the top-left corner.
|
||||
* @param {number} topY - The y-coordinate of the top-left corner.
|
||||
* @param {string} tex - The LaTeX equation string.
|
||||
* @param {number} [scaleX=1] - The x-scaling factor (post mathjax creation)
|
||||
* @param {number} [scaleY=1] - The y-scaling factor (post mathjax creation)
|
||||
* @returns {Promise<string>} Promise resolving to the ID of the added LaTeX image element.
|
||||
*/
|
||||
addLaTex(topX: number, topY: number, tex: string): Promise<string>;
|
||||
addLaTex(topX: number, topY: number, tex: string, scaleX?: number, scaleY?: number): Promise<string>;
|
||||
/**
|
||||
* Returns the base64 dataURL of the LaTeX equation rendered as an SVG.
|
||||
* @param {string} tex - The LaTeX equation string.
|
||||
|
||||
@@ -5,7 +5,7 @@ const room = Array.from(window.crypto.getRandomValues(new Uint8Array(10))).map((
|
||||
const key = (await window.crypto.subtle.exportKey("jwk",await window.crypto.subtle.generateKey({name:"AES-GCM",length:128},true,["encrypt", "decrypt"]))).k;
|
||||
const link = `https://excalidraw.com/#room=${room},${key}`;
|
||||
|
||||
ea.addIFrame(0,0,800,600,link);
|
||||
ea.addEmbeddable(0,0,800,600,link);
|
||||
ea.addElementsToView(true,true);
|
||||
|
||||
window.navigator.clipboard.writeText(link);
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
|
||||
This script generates a linear (horizontal) calendar for a specified year, with days flowing left to right and months as rows.
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
- Horizontal timeline layout with days of the week as columns
|
||||
- Month names displayed on both left and right sides
|
||||
- Weekend days (Saturday & Sunday) highlighted
|
||||
- Day-of-week headers at top and bottom
|
||||
|
||||
## Customizable Colors
|
||||
|
||||
You can personalize the calendar's appearance by defining your own colors:
|
||||
|
||||
1. Create two rectangles in your design.
|
||||
2. Select both rectangles before running the script:
|
||||
• The **fill and stroke colors of the first rectangle** will be applied to weekdays.
|
||||
• The **fill and stroke colors of the second rectangle** will be used for weekends.
|
||||
|
||||
If no rectangles are selected, the default color schema will be used (white and light blue-gray for weekends).
|
||||
|
||||
```javascript
|
||||
*/
|
||||
|
||||
// -------------------------------------
|
||||
// Constants initiation
|
||||
// -------------------------------------
|
||||
|
||||
const CELL_WIDTH = 176; // Width of each day cell
|
||||
const CELL_HEIGHT = 288; // Height of each day cell
|
||||
const START_X = 0; // X start position
|
||||
const START_Y = 0; // Y start position
|
||||
const ROW_SPACING = 32; // Space between month rows
|
||||
const MONTH_LABEL_WIDTH = 240; // Space for month labels on sides
|
||||
|
||||
// Colors
|
||||
let COLOR_WEEKEND = "#e8eaed";
|
||||
let COLOR_WEEKDAY = "#ffffff";
|
||||
let COLOR_TEXT = "#000000";
|
||||
let COLOR_WEEKEND_TEXT = "#000000";
|
||||
let COLOR_HEADER_TEXT = "#000000";
|
||||
const COLOR_STROKE = "#d0d4db";
|
||||
let STROKE_WIDTH = 1;
|
||||
let FILLSTYLE = "solid";
|
||||
const ROUGHNESS = 0; // 0 = Architect, 1 = Artist, 2 = Cartoonist
|
||||
const FONT_FAMILY = 3; // 1 = Virgil, 2 = Helvetica, 3 = Cascadia (code), 4 = Little One
|
||||
|
||||
// Font sizes
|
||||
const FONT_SIZE_DAY = 56;
|
||||
const FONT_SIZE_HEADER = 48;
|
||||
const FONT_SIZE_MONTH = 64;
|
||||
const FONT_SIZE_YEAR = 112;
|
||||
|
||||
// Day constants
|
||||
const SATURDAY = 6;
|
||||
const SUNDAY = 0;
|
||||
const JANUARY = 0;
|
||||
const FIRST_DAY_OF_THE_MONTH = 1;
|
||||
|
||||
// Day names (short)
|
||||
const DAY_NAMES = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
||||
|
||||
// Month names (short)
|
||||
const MONTH_NAMES = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
|
||||
// Number of day columns needed (max 37 to cover all possible month alignments: 6 days offset + 31 days)
|
||||
const NUM_COLUMNS = 37;
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
// Ask for requested Year
|
||||
let requestedYear = parseFloat(new Date().getFullYear());
|
||||
requestedYear = parseFloat(await utils.inputPrompt("Year?", requestedYear, requestedYear));
|
||||
if (isNaN(requestedYear)) {
|
||||
new Notice("Invalid number");
|
||||
return;
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Use selected elements for calendar style
|
||||
// -------------------------------------
|
||||
|
||||
let elements = ea.getViewSelectedElements();
|
||||
if (elements.length >= 1) {
|
||||
COLOR_WEEKDAY = elements[0].backgroundColor;
|
||||
FILLSTYLE = elements[0].fillStyle;
|
||||
STROKE_WIDTH = elements[0].strokeWidth;
|
||||
}
|
||||
if (elements.length >= 2) {
|
||||
COLOR_WEEKEND = elements[1].backgroundColor;
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Helper function to get days in a month
|
||||
// -------------------------------------
|
||||
|
||||
function getDaysInMonth(year, month) {
|
||||
return new Date(year, month + 1, 0).getDate();
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Helper function to get the day of week for first day of month
|
||||
// -------------------------------------
|
||||
|
||||
function getFirstDayOfMonth(year, month) {
|
||||
return new Date(year, month, 1).getDay();
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Draw day-of-week headers
|
||||
// -------------------------------------
|
||||
|
||||
function drawDayHeaders(yPosition) {
|
||||
ea.style.fontSize = FONT_SIZE_HEADER;
|
||||
ea.style.strokeColor = COLOR_TEXT;
|
||||
ea.style.fontFamily = FONT_FAMILY;
|
||||
|
||||
for (let col = 0; col < NUM_COLUMNS; col++) {
|
||||
const dayIndex = col % 7;
|
||||
const x = START_X + MONTH_LABEL_WIDTH + (col * CELL_WIDTH);
|
||||
|
||||
// Center the text in the cell (approximate width of 2 chars)
|
||||
const textX = x + (CELL_WIDTH / 2) - (FONT_SIZE_HEADER * 0.6);
|
||||
ea.addText(textX, yPosition, DAY_NAMES[dayIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Draw month row
|
||||
// -------------------------------------
|
||||
|
||||
function drawMonthRow(year, month, rowIndex) {
|
||||
const daysInMonth = getDaysInMonth(year, month);
|
||||
const firstDayOfWeek = getFirstDayOfMonth(year, month);
|
||||
const y = START_Y + 160 + (rowIndex * (CELL_HEIGHT + ROW_SPACING));
|
||||
|
||||
// Draw month label on the left
|
||||
ea.style.fontSize = FONT_SIZE_MONTH;
|
||||
ea.style.strokeColor = COLOR_TEXT;
|
||||
ea.style.fontFamily = FONT_FAMILY;
|
||||
const monthLabelY = y + (CELL_HEIGHT / 2) - (FONT_SIZE_MONTH / 2);
|
||||
ea.addText(START_X, monthLabelY, MONTH_NAMES[month]);
|
||||
|
||||
// Draw day cells
|
||||
for (let day = 1; day <= daysInMonth; day++) {
|
||||
const date = new Date(year, month, day);
|
||||
const dayOfWeek = date.getDay();
|
||||
const col = firstDayOfWeek + day - 1; // Column position based on day of week alignment
|
||||
|
||||
const x = START_X + MONTH_LABEL_WIDTH + (col * CELL_WIDTH);
|
||||
const isWeekend = dayOfWeek === SATURDAY || dayOfWeek === SUNDAY;
|
||||
|
||||
// Set cell style
|
||||
ea.style.backgroundColor = isWeekend ? COLOR_WEEKEND : COLOR_WEEKDAY;
|
||||
ea.style.strokeColor = COLOR_STROKE;
|
||||
ea.style.strokeWidth = STROKE_WIDTH;
|
||||
ea.style.fillStyle = FILLSTYLE;
|
||||
ea.style.roughness = ROUGHNESS;
|
||||
|
||||
// Draw cell rectangle
|
||||
ea.addRect(x, y, CELL_WIDTH, CELL_HEIGHT);
|
||||
|
||||
// Draw day number
|
||||
ea.style.fontSize = FONT_SIZE_DAY;
|
||||
ea.style.strokeColor = COLOR_TEXT;
|
||||
ea.style.fontFamily = FONT_FAMILY;
|
||||
|
||||
// Position the day number at top center of the cell
|
||||
const dayStr = String(day).padStart(2, "0");
|
||||
const charWidth = FONT_SIZE_DAY * 0.6; // Approximate character width
|
||||
const textWidth = dayStr.length * charWidth;
|
||||
const textX = x + (CELL_WIDTH - textWidth) / 2;
|
||||
const textY = y + 32; // 32px padding from top
|
||||
ea.addText(textX, textY, dayStr);
|
||||
}
|
||||
|
||||
// Draw month label on the right
|
||||
ea.style.fontSize = FONT_SIZE_MONTH;
|
||||
ea.style.strokeColor = COLOR_TEXT;
|
||||
const rightLabelX = START_X + MONTH_LABEL_WIDTH + (NUM_COLUMNS * CELL_WIDTH) + 60;
|
||||
ea.addText(rightLabelX, monthLabelY, MONTH_NAMES[month]);
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Main calendar generation
|
||||
// -------------------------------------
|
||||
|
||||
// Draw year title (centered above calendar)
|
||||
ea.style.fontSize = FONT_SIZE_YEAR;
|
||||
ea.style.strokeColor = COLOR_TEXT;
|
||||
ea.style.fontFamily = FONT_FAMILY;
|
||||
const yearX = START_X + MONTH_LABEL_WIDTH + ((NUM_COLUMNS * CELL_WIDTH) / 2) - 120;
|
||||
ea.addText(yearX, START_Y - 200, String(requestedYear));
|
||||
|
||||
// Draw top day-of-week headers
|
||||
drawDayHeaders(START_Y);
|
||||
|
||||
// Draw all 12 months
|
||||
for (let month = 0; month < 12; month++) {
|
||||
drawMonthRow(requestedYear, month, month);
|
||||
}
|
||||
|
||||
// Draw bottom day-of-week headers
|
||||
const bottomHeaderY = START_Y + 160 + (12 * (CELL_HEIGHT + ROW_SPACING)) + 40;
|
||||
drawDayHeaders(bottomHeaderY);
|
||||
|
||||
await ea.addElementsToView(false, false, true);
|
||||
@@ -0,0 +1,24 @@
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50.097575068473816 56.100231877975375" width="50.097575068473816" height="56.100231877975375" class="excalidraw-svg">
|
||||
<!-- Linear calendar icon (same size/viewBox as original) -->
|
||||
|
||||
<g stroke="#1e1e1e" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" fill="none">
|
||||
<!-- Binding rings -->
|
||||
<path d="M16 3 L16 12" />
|
||||
<path d="M34.5 3 L34.5 12" />
|
||||
|
||||
<!-- Outer calendar body -->
|
||||
<rect x="4" y="9" width="42.097575068473816" height="44.100231877975375" rx="5" ry="5" />
|
||||
|
||||
<!-- Header separator -->
|
||||
<path d="M4 19 L46.097575068473816 19" />
|
||||
|
||||
<!-- A single highlighted date block -->
|
||||
<rect x="10" y="23" width="8" height="8" rx="1.5" ry="1.5" />
|
||||
|
||||
<!-- Linear agenda lines -->
|
||||
<path d="M22 27 L42 27" />
|
||||
<path d="M10 35 L42 35" />
|
||||
<path d="M10 43 L42 43" />
|
||||
<path d="M10 51 L30 51" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 929 B |
@@ -0,0 +1,45 @@
|
||||
async function compress () {
|
||||
ea = ExcalidrawAutomate;
|
||||
const f = app.workspace.activeLeaf.view.file;
|
||||
const data = await app.vault.read(f);
|
||||
const compressed = ea.compressToBase64(data);
|
||||
let result = '';
|
||||
const chunkSize = 256;
|
||||
for (let i = 0; i < compressed.length; i += chunkSize) {
|
||||
result += compressed.slice(i, i + chunkSize) + '\n\n';
|
||||
}
|
||||
|
||||
await app.vault.modify(f,`/*
|
||||
# Mind Map Builder: Technical Specification & User Guide
|
||||
|
||||
## Overview
|
||||
**Mind Map Builder** transforms the Obsidian-Excalidraw canvas into a rapid brainstorming environment, allowing users to build complex, structured, and visually organized mind maps using primarily keyboard shortcuts.
|
||||
|
||||
The script balances **automation** (auto-layout, recursive grouping, and contrast-aware coloring) with **explicit flexibility** (node pinning and redirection logic), ensuring that the mind map stays organized even as it grows to hundreds of nodes. It leverages the Excalidraw Sidepanel API to provide a persistent control interface utilizing the Obsidian sidepanel, that can also be undocked into a floating modal.
|
||||
|
||||
> [!Note]
|
||||
> Mindmap Builder is Minified for reasons of size and performance. You can find the source here: [Mindmap Builder.js](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.js)
|
||||
|
||||
\`\`\`js*/
|
||||
if (!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.0")) {
|
||||
new Notice("Please update the Excalidraw Plugin to version 2.19.0 or higher.");
|
||||
return;
|
||||
}
|
||||
|
||||
const existingTab = ea.checkForActiveSidepanelTabForScript();
|
||||
if (existingTab) {
|
||||
const hostEA = existingTab.getHostEA();
|
||||
if (hostEA && hostEA !== ea) {
|
||||
hostEA.activateMindmap = true;
|
||||
hostEA.setView(ea.targetView);
|
||||
existingTab.open();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const mmbSource = \`${result}\`;
|
||||
const script = ea.decompressFromBase64(mmbSource.replaceAll("\\n", "").trim())
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
|
||||
await new AsyncFunction("ea", "utils", script)(ea, utils);
|
||||
`);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,644 @@
|
||||
/*
|
||||
|
||||
# Mind Map Builder
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
**Mind Map Builder** transforms the Obsidian-Excalidraw canvas into a rapid brainstorming environment, allowing users to build complex, structured, and visually organized mind maps using primarily keyboard shortcuts.
|
||||
|
||||
The script balances **automation** (auto-layout, recursive grouping, and contrast-aware coloring) with **explicit flexibility** (node pinning and redirection logic), ensuring that the mind map stays organized even as it grows to hundreds of nodes. It leverages the Excalidraw Sidepanel API to provide a persistent control interface utilizing the Obsidian sidepanel, that can also be undocked into a floating modal.
|
||||
|
||||
> [!Tip]
|
||||
> 🚀 Become a MindMap Builder Pro with the Official [MindMap Builder Course](https://www.visual-thinking-workshop.com/mindmap)!
|
||||
|
||||
> [!Info]
|
||||
> Mindmap Builder is Minified and compressed to reduce size and improve performance. You can find the source here: [Mindmap Builder.js](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.js)
|
||||
|
||||
## Show Your Love!
|
||||
|
||||
💖 **If you love MindMap Builder** say thank you, and [Buy me a Coffee](https://ko-fi.com/zsolt) 🍵
|
||||
|
||||
## The Script
|
||||
|
||||
```js*/
|
||||
|
||||
const VERSION = "v26.01.24";
|
||||
|
||||
if (!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.1")) {
|
||||
new Notice("Please update the Excalidraw Plugin to version 2.19.1 or higher.");
|
||||
return;
|
||||
}
|
||||
|
||||
const existingTab = ea.checkForActiveSidepanelTabForScript();
|
||||
if (existingTab) {
|
||||
const hostEA = existingTab.getHostEA();
|
||||
if (hostEA && hostEA !== ea) {
|
||||
hostEA.activateMindmap = true;
|
||||
hostEA.setView(ea.targetView);
|
||||
existingTab.open();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const mmbSource = `
|
||||
DYUwLgBAlgvAFAShgPgN4HcoDsAmB7dAOgFlscBbAQwAcAhAVymBxACcAyduTXAksqnUbM2hANYgAnvnRYAEpVyhWAZ0IAzPKwCilAMYALOCBSowrSahCIAvnsphDxhKj14sKvKEJtWWuABEpLiCEAxMLKwAXBDarH6sEKwg5HgAbtgA5hAS0gRYEAaKOMpRAQA0IAg2NgjlPDL8ITThIqziUjLyxcoqMADaALrV5ZLwSGhQiADc5pYNfMEULcKR
|
||||
|
||||
APyE1HjUAPIARipQOFCKcnhguQDKbtQgG7b2jkZVru6e3r7+QQI0YatsMTiCQgW2o1CyhXOuQgKhuIDKlWqcwwZEWPyEETYG2SqTSIAACnhsGA2AARfIKJRYwgPBxOF5uDxeEA+eJfJahVqRQFsxI49IQrbEthdQo9AEVKo2ZELIgclaY1jYlLpEAAQT0YCgeIAMiBKOodVAVCSsNTaU9nK8mR9eYF5dQ/oqecD+RksNl9Fq8QBaUAGn2GRSZEAQ
|
||||
|
||||
YDG00SxE1cqk+CyprLDFtNaSRBRBMOrlsGCoXJdSklNgqKJDGzlRAofWEEN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GAD1s8IL1s+tycpvzPXb8Yqq/FK4UdljkeHTgXUe1rc6dgAQ0ec/yuvQN9Zuyfbrj1nwE49j8wpPdA1D1/oc8HJuB/miPzsJ02X8YQuiqZ
|
||||
|
||||
pxACtVJusF9FCpO/vxuCNwMbj/gO+ej7VZk/+TeUJ6+7TAc8fY/hr/Q/xUBB7xvKMbyfnRr98BZK2H+qgRL23ju0fNxjVeTdgMPPjrA4BykqfvjzIOfjhP9LNswM2VIq2rt7YEZDhmZK/8+ccbqM+1AIAA==`;
|
||||
const script = ea.decompressFromBase64(mmbSource.replaceAll("\n", "").trim())
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
|
||||
await new AsyncFunction("ea", "utils", "VERSION", script)(ea, utils, VERSION);
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="skip"><path d="m11 19-1.106-.552a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0l4.212 2.106a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619V12"/><path d="M15 5.764V12"/><path d="M18 15v6"/><path d="M21 18h-6"/><path d="M9 3.236v15"/></svg>
|
||||
|
After Width: | Height: | Size: 485 B |
@@ -5,9 +5,9 @@ Scribble Helper can improve handwriting and add links. It lets you create and ed
|
||||
|
||||
<a href="https://www.youtube.com/watch?v=BvYkOaly-QM" target="_blank"><img src ="https://i.ytimg.com/vi/BvYkOaly-QM/maxresdefault.jpg" style="width:560px;"></a>
|
||||
|
||||
```javascript
|
||||
```js
|
||||
*/
|
||||
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.11.0")) {
|
||||
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.0")) {
|
||||
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
|
||||
return;
|
||||
}
|
||||
@@ -58,39 +58,10 @@ if(typeof win.ExcalidrawScribbleHelper.action === "undefined") {
|
||||
// Helper Functions
|
||||
//---------------------------------------
|
||||
|
||||
// Color Palette for stroke color setting
|
||||
// https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.6.8
|
||||
const defaultStrokeColors = [
|
||||
"#000000", "#343a40", "#495057", "#c92a2a", "#a61e4d",
|
||||
"#862e9c", "#5f3dc4", "#364fc7", "#1864ab", "#0b7285",
|
||||
"#087f5b", "#2b8a3e", "#5c940d", "#e67700", "#d9480f"
|
||||
];
|
||||
|
||||
function loadColorPalette() {
|
||||
const st = api.getAppState();
|
||||
const strokeColors = new Set();
|
||||
let strokeColorPalette = st.colorPalette?.elementStroke ?? defaultStrokeColors;
|
||||
if(Object.entries(strokeColorPalette).length === 0) {
|
||||
strokeColorPalette = defaultStrokeColors;
|
||||
}
|
||||
|
||||
ea.getViewElements().forEach(el => {
|
||||
if(el.strokeColor.toLowerCase()==="transparent") return;
|
||||
strokeColors.add(el.strokeColor);
|
||||
});
|
||||
|
||||
strokeColorPalette.forEach(color => {
|
||||
strokeColors.add(color)
|
||||
});
|
||||
|
||||
strokeColors.add(st.currentItemStrokeColor ?? ea.style.strokeColor);
|
||||
return strokeColors;
|
||||
}
|
||||
|
||||
// Event handler management
|
||||
function addEventHandler(handler) {
|
||||
if(win.ExcalidrawScribbleHelper.eventHandler) {
|
||||
win.removeEventListner("pointerdown", handler);
|
||||
win.removeEventListener("pointerdown", handler);
|
||||
}
|
||||
win.addEventListener("pointerdown",handler);
|
||||
win.ExcalidrawScribbleHelper.eventHandler = handler;
|
||||
@@ -147,19 +118,17 @@ function customControls (container) {
|
||||
const viewBackground = api.getAppState().viewBackgroundColor;
|
||||
const el1 = new ea.obsidian.Setting(container)
|
||||
.setName(`Text color`)
|
||||
.addDropdown(dropdown => {
|
||||
Array.from(loadColorPalette()).forEach(color => {
|
||||
const options = dropdown.addOption(color, color).selectEl.options;
|
||||
options[options.length-1].setAttribute("style",`color: ${color
|
||||
}; background: ${viewBackground};`);
|
||||
});
|
||||
dropdown
|
||||
.setValue(ea.style.strokeColor)
|
||||
.onChange(value => {
|
||||
ea.style.strokeColor = value;
|
||||
el1.nameEl.style.color = value;
|
||||
})
|
||||
})
|
||||
.addButton(button => button
|
||||
.setIcon("swatch-book")
|
||||
.onClick(async () => {
|
||||
const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");
|
||||
if(selected) {
|
||||
ea.style.strokeColor = selected;
|
||||
el1.nameEl.style.color = selected;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
el1.nameEl.style.color = ea.style.strokeColor;
|
||||
el1.nameEl.style.background = viewBackground;
|
||||
el1.nameEl.style.fontWeight = "bold";
|
||||
|
||||
+48
-58
@@ -23,11 +23,13 @@ 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
|
||||
|
||||
😍 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.7.2")) {
|
||||
if(!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.0")) {
|
||||
new Notice("This script requires a newer version of Excalidraw. Please install the latest version.");
|
||||
return;
|
||||
}
|
||||
@@ -324,7 +326,7 @@ function slider(contentEl, action, min, max, step, invert) {
|
||||
|
||||
function showModal() {
|
||||
let debounceColorPicker = true;
|
||||
const modal = new ea.obsidian.Modal(app);
|
||||
const modal = new ea.FloatingModal(app);
|
||||
let dirty = false;
|
||||
|
||||
modal.onOpen = async () => {
|
||||
@@ -492,6 +494,50 @@ function showModal() {
|
||||
.setValue(ea.getCM(info.mappedTo).stringHEX({alpha: false}).toLowerCase());
|
||||
|
||||
colorPicker.colorPickerEl.style.maxWidth = "2.5rem";
|
||||
|
||||
// Add palette picker button
|
||||
const paletteButton = new ea.obsidian.Setting(row.controlEl)
|
||||
.addButton(button => button
|
||||
.setIcon("swatch-book")
|
||||
.setTooltip("Pick from Palette")
|
||||
.onClick(async () => {
|
||||
const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");
|
||||
if (selected) {
|
||||
try {
|
||||
const cm = ea.getCM(selected);
|
||||
if (cm) {
|
||||
const format = settings[FORMAT].value;
|
||||
|
||||
// Preserve alpha from original color
|
||||
const currentInfo = currentColors.get(svgElement.id).colors.get(color);
|
||||
const originalAlpha = ea.getCM(currentInfo.mappedTo).alpha;
|
||||
cm.alphaTo(originalAlpha);
|
||||
const alpha = originalAlpha < 1 ? true : false;
|
||||
|
||||
const newColor = format === "RGB"
|
||||
? cm.stringRGB({alpha , precision }).toLowerCase()
|
||||
: format === "HEX"
|
||||
? cm.stringHEX({alpha}).toLowerCase()
|
||||
: cm.stringHSL({alpha, precision }).toLowerCase();
|
||||
|
||||
// Update text input
|
||||
textInput.setValue(newColor);
|
||||
|
||||
// Update Color Picker visual
|
||||
colorPicker.setValue(cm.stringHEX({alpha: false}).toLowerCase());
|
||||
|
||||
// Update SVG mapping
|
||||
currentInfo.mappedTo = newColor;
|
||||
run("Update SVG color");
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Invalid color value:", e);
|
||||
}
|
||||
}
|
||||
}));
|
||||
paletteButton.settingEl.style.padding = "0";
|
||||
paletteButton.settingEl.style.border = "0";
|
||||
paletteButton.infoEl.style.display = "none";
|
||||
|
||||
// Store references to the components
|
||||
colorInputs.set(color, {
|
||||
@@ -562,8 +608,6 @@ function showModal() {
|
||||
.setButtonText("Close")
|
||||
.setCta(true)
|
||||
.onClick(() => modal.close()));
|
||||
|
||||
makeModalDraggable(modalEl);
|
||||
|
||||
const maxHeight = Math.round(height * 0.6);
|
||||
const maxWidth = Math.round(width * 0.9);
|
||||
@@ -584,60 +628,6 @@ function showModal() {
|
||||
modal.open();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add draggable functionality to the modal element.
|
||||
* @param {HTMLElement} modalEl - The modal element to make draggable.
|
||||
*/
|
||||
function makeModalDraggable(modalEl) {
|
||||
let isDragging = false;
|
||||
let startX, startY, initialX, initialY;
|
||||
|
||||
const header = modalEl.querySelector('.modal-titlebar') || modalEl; // Default to modalEl if no titlebar
|
||||
header.style.cursor = 'move';
|
||||
|
||||
const onPointerDown = (e) => {
|
||||
// Ensure the event target isn't an interactive element like slider, button, or input
|
||||
if (e.target.tagName === 'INPUT' || e.target.tagName === 'BUTTON') return;
|
||||
|
||||
isDragging = true;
|
||||
startX = e.clientX;
|
||||
startY = e.clientY;
|
||||
const rect = modalEl.getBoundingClientRect();
|
||||
initialX = rect.left;
|
||||
initialY = rect.top;
|
||||
|
||||
modalEl.style.position = 'absolute';
|
||||
modalEl.style.margin = '0';
|
||||
modalEl.style.left = `${initialX}px`;
|
||||
modalEl.style.top = `${initialY}px`;
|
||||
};
|
||||
|
||||
const onPointerMove = (e) => {
|
||||
if (!isDragging) return;
|
||||
|
||||
const dx = e.clientX - startX;
|
||||
const dy = e.clientY - startY;
|
||||
|
||||
modalEl.style.left = `${initialX + dx}px`;
|
||||
modalEl.style.top = `${initialY + dy}px`;
|
||||
};
|
||||
|
||||
const onPointerUp = () => {
|
||||
isDragging = false;
|
||||
};
|
||||
|
||||
header.addEventListener('pointerdown', onPointerDown);
|
||||
document.addEventListener('pointermove', onPointerMove);
|
||||
document.addEventListener('pointerup', onPointerUp);
|
||||
|
||||
// Clean up event listeners on modal close
|
||||
modalEl.addEventListener('remove', () => {
|
||||
header.removeEventListener('pointerdown', onPointerDown);
|
||||
document.removeEventListener('pointermove', onPointerMove);
|
||||
document.removeEventListener('pointerup', onPointerUp);
|
||||
});
|
||||
}
|
||||
|
||||
function executeChange(isDecrease, step, action) {
|
||||
const modifyStroke = settings[STROKE].value;
|
||||
const modifyBackground = settings[BACKGROUND].value;
|
||||
|
||||
+19
-2
@@ -61,6 +61,7 @@ const SVG_MINIMIZE = ea.obsidian.getIcon("lucide-minimize").outerHTML;
|
||||
const SVG_LASER_ON = ea.obsidian.getIcon("lucide-hand").outerHTML;
|
||||
const SVG_LASER_OFF = ea.obsidian.getIcon("lucide-wand").outerHTML;
|
||||
const SVG_PRINTER = ea.obsidian.getIcon("lucide-printer").outerHTML;
|
||||
const SVG_REFOCUS = ea.obsidian.getIcon("lucide-scan-eye").outerHTML;
|
||||
|
||||
//-------------------------------
|
||||
//utility & convenience functions
|
||||
@@ -500,9 +501,22 @@ const createPresentationNavigationPanel = () => {
|
||||
}
|
||||
});
|
||||
|
||||
el.createEl("button",{
|
||||
attr: {
|
||||
title: "Re-focus current slide (shortcut: HOME)"
|
||||
}
|
||||
}, button => {
|
||||
button.innerHTML = SVG_REFOCUS;
|
||||
button.onclick = () => {
|
||||
debugger;
|
||||
slide--;
|
||||
navigate("fwd");
|
||||
}
|
||||
});
|
||||
|
||||
el.createEl("button",{
|
||||
attr: {
|
||||
title: "Toggle fullscreen. If you hold ALT/OPT when starting the presentation it will not go fullscreen."
|
||||
title: "Toggle fullscreen. If you hold ALT/OPT when starting the presentation it will not go fullscreen. (shortcut: f)"
|
||||
},
|
||||
}, button => {
|
||||
toggleFullscreenButton = button;
|
||||
@@ -591,7 +605,7 @@ const keydownListener = (e) => {
|
||||
navigate("fwd");
|
||||
break;
|
||||
case "Home":
|
||||
slide = -1;
|
||||
slide--;
|
||||
navigate("fwd");
|
||||
break;
|
||||
case "e":
|
||||
@@ -601,6 +615,9 @@ const keydownListener = (e) => {
|
||||
exitPresentation(true);
|
||||
})()
|
||||
break;
|
||||
case "f":
|
||||
toggleFullscreen();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
[{"fname":"Mindmap connector.md","mtime":1658686599427},{"fname":"Mindmap connector.svg","mtime":1658686599427},{"fname":"Add Connector Point.md","mtime":1735420748564},{"fname":"Add Connector Point.svg","mtime":1645944722000},{"fname":"Add Link to Existing File and Open.md","mtime":1647807918345},{"fname":"Add Link to Existing File and Open.svg","mtime":1645964261000},{"fname":"Add Link to New Page and Open.md","mtime":1654168862138},{"fname":"Add Link to New Page and Open.svg","mtime":1645960639000},{"fname":"Add Next Step in Process.md","mtime":1688304760357},{"fname":"Add Next Step in Process.svg","mtime":1645960639000},{"fname":"Box Each Selected Groups.md","mtime":1645305706000},{"fname":"Box Each Selected Groups.svg","mtime":1645967510000},{"fname":"Box Selected Elements.md","mtime":1645305706000},{"fname":"Box Selected Elements.svg","mtime":1645960639000},{"fname":"Change shape of selected elements.md","mtime":1652701169236},{"fname":"Change shape of selected elements.svg","mtime":1645960775000},{"fname":"Connect elements.md","mtime":1645305706000},{"fname":"Connect elements.svg","mtime":1645960639000},{"fname":"Convert freedraw to line.md","mtime":1645305706000},{"fname":"Convert freedraw to line.svg","mtime":1645960639000},{"fname":"Convert selected text elements to sticky notes.md","mtime":1670169501383},{"fname":"Convert selected text elements to sticky notes.svg","mtime":1645960639000},{"fname":"Convert text to link with folder and alias.md","mtime":1641639819000},{"fname":"Convert text to link with folder and alias.svg","mtime":1645960639000},{"fname":"Copy Selected Element Styles to Global.md","mtime":1642232088000},{"fname":"Copy Selected Element Styles to Global.svg","mtime":1645960639000},{"fname":"Create new markdown file and embed into active drawing.md","mtime":1640866935000},{"fname":"Create new markdown file and embed into active drawing.svg","mtime":1645960639000},{"fname":"Darken background color.md","mtime":1663059051059},{"fname":"Darken background color.svg","mtime":1645960639000},{"fname":"Elbow connectors.md","mtime":1671126911490},{"fname":"Elbow connectors.svg","mtime":1645960639000},{"fname":"Expand rectangles horizontally keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles horizontally keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles horizontally.md","mtime":1644950235000},{"fname":"Expand rectangles horizontally.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles vertically keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically.md","mtime":1658686599427},{"fname":"Expand rectangles vertically.svg","mtime":1645967510000},{"fname":"Fixed horizontal distance between centers.md","mtime":1646743234000},{"fname":"Fixed horizontal distance between centers.svg","mtime":1645960639000},{"fname":"Fixed inner distance.md","mtime":1646743234000},{"fname":"Fixed inner distance.svg","mtime":1645960639000},{"fname":"Fixed spacing.md","mtime":1646743234000},{"fname":"Fixed spacing.svg","mtime":1645967510000},{"fname":"Fixed vertical distance between centers.md","mtime":1646743234000},{"fname":"Fixed vertical distance between centers.svg","mtime":1645967510000},{"fname":"Fixed vertical distance.md","mtime":1646743234000},{"fname":"Fixed vertical distance.svg","mtime":1645967510000},{"fname":"Lighten background color.md","mtime":1663059051059},{"fname":"Lighten background color.svg","mtime":1645959546000},{"fname":"Modify background color opacity.md","mtime":1644924415000},{"fname":"Modify background color opacity.svg","mtime":1645944722000},{"fname":"Normalize Selected Arrows.md","mtime":1670403743278},{"fname":"Normalize Selected Arrows.svg","mtime":1645960639000},{"fname":"Organic Line.md","mtime":1672920172531},{"fname":"Organic Line.svg","mtime":1645964261000},{"fname":"Organic Line Legacy.md","mtime":1690607372668},{"fname":"Organic Line Legacy.svg","mtime":1690607372668},{"fname":"README.md","mtime":1645175700000},{"fname":"Repeat Elements.md","mtime":1663059051059},{"fname":"Repeat Elements.svg","mtime":1645960639000},{"fname":"Reverse arrows.md","mtime":1645305706000},{"fname":"Reverse arrows.svg","mtime":1645960639000},{"fname":"Scribble Helper.md","mtime":1747585400113},{"fname":"Scribble Helper.svg","mtime":1645944722000},{"fname":"Select Elements of Type.md","mtime":1643464321000},{"fname":"Select Elements of Type.svg","mtime":1645960639000},{"fname":"Set Dimensions.md","mtime":1645305706000},{"fname":"Set Dimensions.svg","mtime":1645944722000},{"fname":"Set Font Family.md","mtime":1645305706000},{"fname":"Set Font Family.svg","mtime":1645944722000},{"fname":"Set Grid.md","mtime":1693725826368},{"fname":"Set Grid.svg","mtime":1645960639000},{"fname":"Set Link Alias.md","mtime":1645305706000},{"fname":"Set Link Alias.svg","mtime":1645960639000},{"fname":"Set Stroke Width of Selected Elements.md","mtime":1748189277Line truncated
|
||||
[{"fname":"Mindmap connector.md","mtime":1658686599427},{"fname":"Mindmap connector.svg","mtime":1658686599427},{"fname":"Add Connector Point.md","mtime":1735420748564},{"fname":"Add Connector Point.svg","mtime":1645944722000},{"fname":"Add Link to Existing File and Open.md","mtime":1647807918345},{"fname":"Add Link to Existing File and Open.svg","mtime":1645964261000},{"fname":"Add Link to New Page and Open.md","mtime":1654168862138},{"fname":"Add Link to New Page and Open.svg","mtime":1645960639000},{"fname":"Add Next Step in Process.md","mtime":1688304760357},{"fname":"Add Next Step in Process.svg","mtime":1645960639000},{"fname":"Box Each Selected Groups.md","mtime":1645305706000},{"fname":"Box Each Selected Groups.svg","mtime":1645967510000},{"fname":"Box Selected Elements.md","mtime":1645305706000},{"fname":"Box Selected Elements.svg","mtime":1645960639000},{"fname":"Change shape of selected elements.md","mtime":1652701169236},{"fname":"Change shape of selected elements.svg","mtime":1645960775000},{"fname":"Connect elements.md","mtime":1645305706000},{"fname":"Connect elements.svg","mtime":1645960639000},{"fname":"Convert freedraw to line.md","mtime":1645305706000},{"fname":"Convert freedraw to line.svg","mtime":1645960639000},{"fname":"Convert selected text elements to sticky notes.md","mtime":1670169501383},{"fname":"Convert selected text elements to sticky notes.svg","mtime":1645960639000},{"fname":"Convert text to link with folder and alias.md","mtime":1641639819000},{"fname":"Convert text to link with folder and alias.svg","mtime":1645960639000},{"fname":"Copy Selected Element Styles to Global.md","mtime":1642232088000},{"fname":"Copy Selected Element Styles to Global.svg","mtime":1645960639000},{"fname":"Create new markdown file and embed into active drawing.md","mtime":1640866935000},{"fname":"Create new markdown file and embed into active drawing.svg","mtime":1645960639000},{"fname":"Darken background color.md","mtime":1663059051059},{"fname":"Darken background color.svg","mtime":1645960639000},{"fname":"Elbow connectors.md","mtime":1671126911490},{"fname":"Elbow connectors.svg","mtime":1645960639000},{"fname":"Expand rectangles horizontally keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles horizontally keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles horizontally.md","mtime":1644950235000},{"fname":"Expand rectangles horizontally.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically keep text centered.md","mtime":1646563692000},{"fname":"Expand rectangles vertically keep text centered.svg","mtime":1645967510000},{"fname":"Expand rectangles vertically.md","mtime":1658686599427},{"fname":"Expand rectangles vertically.svg","mtime":1645967510000},{"fname":"Fixed horizontal distance between centers.md","mtime":1646743234000},{"fname":"Fixed horizontal distance between centers.svg","mtime":1645960639000},{"fname":"Fixed inner distance.md","mtime":1646743234000},{"fname":"Fixed inner distance.svg","mtime":1645960639000},{"fname":"Fixed spacing.md","mtime":1646743234000},{"fname":"Fixed spacing.svg","mtime":1645967510000},{"fname":"Fixed vertical distance between centers.md","mtime":1646743234000},{"fname":"Fixed vertical distance between centers.svg","mtime":1645967510000},{"fname":"Fixed vertical distance.md","mtime":1646743234000},{"fname":"Fixed vertical distance.svg","mtime":1645967510000},{"fname":"Lighten background color.md","mtime":1663059051059},{"fname":"Lighten background color.svg","mtime":1645959546000},{"fname":"Modify background color opacity.md","mtime":1644924415000},{"fname":"Modify background color opacity.svg","mtime":1645944722000},{"fname":"Normalize Selected Arrows.md","mtime":1670403743278},{"fname":"Normalize Selected Arrows.svg","mtime":1645960639000},{"fname":"Organic Line.md","mtime":1672920172531},{"fname":"Organic Line.svg","mtime":1645964261000},{"fname":"Organic Line Legacy.md","mtime":1690607372668},{"fname":"Organic Line Legacy.svg","mtime":1690607372668},{"fname":"README.md","mtime":1645175700000},{"fname":"Repeat Elements.md","mtime":1663059051059},{"fname":"Repeat Elements.svg","mtime":1645960639000},{"fname":"Reverse arrows.md","mtime":1645305706000},{"fname":"Reverse arrows.svg","mtime":1645960639000},{"fname":"Scribble Helper.md","mtime":1767536720161},{"fname":"Scribble Helper.svg","mtime":1645944722000},{"fname":"Select Elements of Type.md","mtime":1643464321000},{"fname":"Select Elements of Type.svg","mtime":1645960639000},{"fname":"Set Dimensions.md","mtime":1645305706000},{"fname":"Set Dimensions.svg","mtime":1645944722000},{"fname":"Set Font Family.md","mtime":1645305706000},{"fname":"Set Font Family.svg","mtime":1645944722000},{"fname":"Set Grid.md","mtime":1693725826368},{"fname":"Set Grid.svg","mtime":1645960639000},{"fname":"Set Link Alias.md","mtime":1645305706000},{"fname":"Set Link Alias.svg","mtime":1645960639000},{"fname":"Set Stroke Width of Selected Elements.md","mtime":1748189277Line truncated
|
||||
@@ -55,6 +55,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/Excalidraw%20Writing%20Machine.svg"/></div>|[[#Excalidraw Writing Machine]]|
|
||||
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Convert%20freedraw%20to%20line.svg"/></div>|[[#Convert freedraw to line]]|
|
||||
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Crop%20Vintage%20Mask.svg"/></div>|[[#Crop Vintage Mask]]|
|
||||
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Mindmap%20Builder.svg"/></div>|[[#Mindmap Builder]]|
|
||||
|
||||
## Layout and Organization
|
||||
**Keywords**: Design, Placement, Arrangement, Structure, Formatting, Alignment
|
||||
@@ -76,6 +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/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]]|
|
||||
@@ -181,6 +183,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/Convert%20freedraw%20to%20line.svg"/></div>|[[#Convert freedraw to line]]|
|
||||
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Deconstruct%20selected%20elements%20into%20new%20drawing.svg"/></div>|[[#Deconstruct selected elements into new drawing]]|
|
||||
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Full-Year%20Calendar%20Generator.svg"/></div>|[[#Full-Year Calendar Generator]]|
|
||||
|<div><img src="https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Linear%20Calendar%20Generator.svg"/></div>|[[#Linear Calendar Generator]]|
|
||||
|
||||
## Masking and cropping
|
||||
**Keywords**: Crop, Mask, Transform images
|
||||
@@ -457,6 +460,18 @@ https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea
|
||||
```
|
||||
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/1-2-3'>@1-2-3</a></td></tr><tr valign='top'><td class="label">Source</td><td class="data"><a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Lighten%20background%20color.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">This script lightens the background color of the selected element by 2% at a time. You can use this script several times until you are satisfied. It is recommended to set a shortcut key for this script so that you can quickly try to DARKEN and LIGHTEN the color effect.In contrast to the `Modify background color opacity` script, the advantage is that the background color of the element is not affected by the canvas color, and the color value does not appear in a strange rgba() form.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/darken-lighten-background-color.png'></td></tr></table>
|
||||
|
||||
## Linear Calendar Generator
|
||||
```excalidraw-script-install
|
||||
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Linear%20Calendar%20Generator.md
|
||||
```
|
||||
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/iwanhoogendoorn'>@iwanhoogendoorn</a></td></tr><tr valign='top'><td class="label">Source</td><td class="data"><a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Linear%20Calendar%20Generator.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Generates a complete calendar for a specified year.<br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-Linear-Calendar-Generator.jpg'></td></tr></table>
|
||||
|
||||
## Mindmap Builder
|
||||
```excalidraw-script-install
|
||||
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Mindmap%20Builder.md
|
||||
```
|
||||
<table><tr valign='top'><td class="label">Author</td><td class="data"><a href='https://github.com/zsviczian'>@zsviczian</a></td></tr><tr valign='top'><td class="label">Source</td><td class="data"><a href='https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.md'>File on GitHub</a></td></tr><tr valign='top'><td class="label">Description</td><td class="data">Rapid mind mapping workflow driven by keyboard shortcuts: add sibling/child nodes, auto-layout and branch styling, quick navigation, optional recursive grouping, and Markdown copy/paste import/export for bullet-list sync.Sign up for the <a href="https://visual-thinking-workshop.com/mindmap" target="_blank">MindMap Builder Self-Paced Course</a>!<br><a href="https://www.youtube.com/watch?v=qY66yoobaX4" target="_blank"><img src ="https://i.ytimg.com/vi/qY66yoobaX4/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/qY66yoobaX4' target='_blank'>Link to video on YouTube</a><br><a href="https://www.youtube.com/watch?v=5G9QF-u9w0Q" target="_blank"><img src ="https://i.ytimg.com/vi/5G9QF-u9w0Q/maxresdefault.jpg" style="width:400px;"></a><br><a href='https://youtu.be/5G9QF-u9w0Q' target='_blank'>Link to video on YouTube</a><br><img src='https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/scripts-mindmap-builder.png'></td></tr></table>
|
||||
|
||||
## Mindmap connector
|
||||
```excalidraw-script-install
|
||||
https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/ea-scripts/Mindmap%20connector.md
|
||||
|
||||
@@ -0,0 +1,766 @@
|
||||
/*
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
// Replaces showModal with renderSidepanel logic
|
||||
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;
|
||||
}
|
||||
|
||||
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();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
buttons
|
||||
.addButton(button => button
|
||||
.setButtonText("Reset")
|
||||
.onClick(() => {
|
||||
for (const resetter of sliderResetters) {
|
||||
resetter();
|
||||
}
|
||||
copyOriginalsToCurrent();
|
||||
setColors(originalColors);
|
||||
}));
|
||||
// Close button removed for sidepanel implementation
|
||||
}
|
||||
|
||||
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", true, true).then(tab => {
|
||||
if (!tab) return;
|
||||
|
||||
const initializeAndRender = async () => {
|
||||
refreshSelectionState();
|
||||
await storeOriginalColors();
|
||||
renderSidepanel(tab.contentEl);
|
||||
processQueue();
|
||||
};
|
||||
|
||||
tab.onOpen = async () => {
|
||||
terminate = false;
|
||||
// Initial load
|
||||
await initializeAndRender();
|
||||
};
|
||||
|
||||
tab.onFocus = async (view) => {
|
||||
if (view && view !== ea.targetView) {
|
||||
ea.setView(view);
|
||||
ea.clear();
|
||||
}
|
||||
|
||||
// Check if selection changed
|
||||
const currentSelectionStr = ea.getViewSelectedElements().map(e => e.id).sort().join(",");
|
||||
if (currentSelectionStr !== lastSelectionIds) {
|
||||
await initializeAndRender();
|
||||
}
|
||||
};
|
||||
|
||||
tab.onClose = async () => {
|
||||
terminate = true;
|
||||
if (dirty) {
|
||||
ea.setScriptSettings(settings);
|
||||
}
|
||||
if(ea.targetView && ea.targetView.isDirty()) {
|
||||
ea.targetView.save(false);
|
||||
}
|
||||
};
|
||||
|
||||
tab.open();
|
||||
});
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 344 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
+2
-2
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "2.18.0-beta-3",
|
||||
"version": "2.20.0-beta-4",
|
||||
"minAppVersion": "1.5.7",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.",
|
||||
"author": "Zsolt Viczian",
|
||||
"authorUrl": "https://excalidraw-obsidian.online",
|
||||
"isDesktopOnly": false
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "2.17.2",
|
||||
"version": "2.19.2",
|
||||
"minAppVersion": "1.5.7",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.",
|
||||
"author": "Zsolt Viczian",
|
||||
"authorUrl": "https://excalidraw-obsidian.online",
|
||||
"fundingUrl": "https://ko-fi.com/zsolt",
|
||||
"helpUrl": "https://github.com/zsviczian/obsidian-excalidraw-plugin#readme",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
}
|
||||
Generated
+6652
-682
File diff suppressed because it is too large.
Load diff
+3
-2
@@ -17,14 +17,15 @@
|
||||
"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"
|
||||
"doc": "npm run lib && node scripts/generate-script-library.js",
|
||||
"mindmap": "node scripts/deploy-mindmap-builder.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"@zsviczian/excalidraw": "0.18.0-56",
|
||||
"@zsviczian/excalidraw": "0.18.0-71",
|
||||
"chroma-js": "^3.1.2",
|
||||
"clsx": "^2.0.0",
|
||||
"@zsviczian/colormaster": "^1.2.2",
|
||||
|
||||
+4
-2
@@ -188,8 +188,10 @@ const BUILD_CONFIG = {
|
||||
},
|
||||
}),
|
||||
postprocess([
|
||||
[/React=require\("react"\),state=require\("@codemirror\/state"\),view=require\("@codemirror\/view"\)/,
|
||||
`state=require("@codemirror/state"),view=require("@codemirror/view")` + packageString],
|
||||
[
|
||||
/(var[^;]*?),\s*React\s*=\s*require\(["']react["']\)([^;]*;)/,
|
||||
(_, g1, g2) => `${g1}${g2}${packageString}`
|
||||
],
|
||||
]),
|
||||
] : [
|
||||
postprocess([ [/var React = require\('react'\);/, packageString] ]),
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs/promises");
|
||||
const { minify } = require("uglify-js");
|
||||
const LZString = require("lz-string");
|
||||
|
||||
const CHUNK_SIZE = 256;
|
||||
const NEEDLE = "const removeKeydownHandlers";
|
||||
|
||||
const root = path.resolve(__dirname, "..");
|
||||
const sourcePath = path.join(root, "ea-scripts", "Mindmap Builder.js");
|
||||
const outputPath = path.join(root, "ea-scripts", "Mindmap Builder.md");
|
||||
|
||||
const HEADER = `/*
|
||||
|
||||
# Mind Map Builder
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
**Mind Map Builder** transforms the Obsidian-Excalidraw canvas into a rapid brainstorming environment, allowing users to build complex, structured, and visually organized mind maps using primarily keyboard shortcuts.
|
||||
|
||||
The script balances **automation** (auto-layout, recursive grouping, and contrast-aware coloring) with **explicit flexibility** (node pinning and redirection logic), ensuring that the mind map stays organized even as it grows to hundreds of nodes. It leverages the Excalidraw Sidepanel API to provide a persistent control interface utilizing the Obsidian sidepanel, that can also be undocked into a floating modal.
|
||||
|
||||
> [!Tip]
|
||||
> 🚀 Become a MindMap Builder Pro with the Official [MindMap Builder Course](https://www.visual-thinking-workshop.com/mindmap)!
|
||||
|
||||
> [!Info]
|
||||
> Mindmap Builder is Minified and compressed to reduce size and improve performance. You can find the source here: [Mindmap Builder.js](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.js)
|
||||
|
||||
## Show Your Love!
|
||||
|
||||
💖 **If you love MindMap Builder** say thank you, and [Buy me a Coffee](https://ko-fi.com/zsolt) 🍵
|
||||
|
||||
## The Script
|
||||
|
||||
\`\`\`js*/
|
||||
`;
|
||||
|
||||
const FOOTER = `
|
||||
const VERSION = "v${new Date().toISOString().slice(2, 10).replace(/-/g, ".")}";
|
||||
|
||||
if (!ea.verifyMinimumPluginVersion || !ea.verifyMinimumPluginVersion("2.19.1")) {
|
||||
new Notice("Please update the Excalidraw Plugin to version 2.19.1 or higher.");
|
||||
return;
|
||||
}
|
||||
|
||||
const existingTab = ea.checkForActiveSidepanelTabForScript();
|
||||
if (existingTab) {
|
||||
const hostEA = existingTab.getHostEA();
|
||||
if (hostEA && hostEA !== ea) {
|
||||
hostEA.activateMindmap = true;
|
||||
hostEA.setView(ea.targetView);
|
||||
existingTab.open();
|
||||
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;
|
||||
});
|
||||
@@ -30,6 +30,35 @@ For a reference, follow the implementation pattern used in the "Printable Layout
|
||||
- Elements can be deleted from the scene by setting their isDeleted property to true.
|
||||
- The Obsidian.md module is available on ea.obsidian.
|
||||
|
||||
**Sidepanels and multi-view tooling:**
|
||||
- Sidepanels are for scripts that must stay open while users hop between multiple Excalidraw views. They should implement the SidepanelTab hooks (\`onOpen\`, \`onFocus(view)\`, \`onClose\`, \`onExcalidrawViewClosed\`) and manage their own \`ea.targetView\` explicitly.
|
||||
- Persisted sidepanel scripts are launched during plugin startup (e.g., Obsidian restart, plugin update) with \`ea.targetView === null\`. Scripts must handle this by deferring view-bound work until \`onFocus\` delivers a view; call \`ea.setView(view)\` when you decide to bind.
|
||||
- Each \`ea\` instance may host a single \`sidepanelTab\`. This sidepanel tab is stored in \`ea.sidepanelTab\`. Create the tab with \`ea.createSidepanelTab(title, persist=false, reveal=true)\`; the returned \`ea.sidepanelTab\` exposes \`contentEl\`, \`setContent\`, \`setTitle\`, \`setDisabled\`, \`setCloseCallback\`, \`open/close\`, and focus lifecycle hooks. Note auto-reveal during tab creation via \`ea.createSidepanelTab()\` is disabled during plugin startup. You can reveal a tab with \`ea.sidepanelTab?.open()\`. You can persist with \`ea.persistSidepanelTab()\` (tabs are restored and scripts re-run on next startup). Close with \`ea.sidepanelTab?.close()\`.
|
||||
- Mobile UX: sidepanels slide in without disturbing canvas layout and are better for longer forms than floating modals. Prefer them for complex inputs, especially on phones.
|
||||
- Auto-closing patterns: For scripts that use sidepanels but perform operations that are single-\`ExcalidrawView\` relevant, they can call \`ea.closeSidepanelTab()\` after completing the operation, and/or inside \`ea.sidepanelTab.onFocus = (view) => { if (view !== ea.targetView) { ea.sidepanelTab?.close(); } }\` to shut down when the user leaves the originating view.
|
||||
- Scripts can detect view change in \`onFocus(view)\` by comparing \`ea.targetView\` to the provided \`view\` parameter.
|
||||
- Persistence UX: scripts may offer a “Persist tab” control inside \`contentEl\` that calls \`ea.persistSidepanelTab()\`. Once persisted, hide that control; users can later remove the tab via the sidepanel close button (scripts cannot unpersist themselves, but can close themselves via \`ea.sidepanelTab?.close()\`).
|
||||
- Use \`checkForActiveSidepanelTabForScript\` to avoid creating duplicate tabs for the same script name. This method returns the \`ExcalidrawSidepanelTab\` associated with the supplied \`scriptName\` (or \`ea.activeScript\` when omitted), or \`null\` if none exists. It is intended to let a script detect an existing tab that may be owned by another \`ExcalidrawAutomate\` instance (for example, a persisted tab restored at startup). Typical pattern:
|
||||
- Before creating a new sidepanel, call \`ea.checkForActiveSidepanelTabForScript()\` to see if a tab already exists.
|
||||
- If a tab exists and \`tab.getHostEA() === ea\`, reuse it (your script already hosts it).
|
||||
- If a tab exists but is hosted by a different \`ea\` instance, decide whether to reuse or hand off control — e.g. open the existing tab and exit to avoid duplicates.
|
||||
- Note: persisted tabs restored on startup may be created with \`ea.targetView === null\` and hosted by a different \`ea\` instance; handle that case by waiting for \`onFocus\` before binding view-specific work.
|
||||
- Example usage:
|
||||
\`const sp = ea.checkForActiveSidepanelTabForScript();
|
||||
if (sp) {
|
||||
if (sp.getHostEA() === ea) {
|
||||
// we already own the tab — reuse it
|
||||
sp.open();
|
||||
} else {
|
||||
// another EA instance hosts the tab — open it for the user and exit
|
||||
sp.open();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// no existing tab — safe to create a new one
|
||||
// ea.createSidepanelTab("My Script", false, true);\`
|
||||
- A dedicated section "sidepanelTabTypes.d.ts" in this document lists the \`ExcalidrawSidepanelTab\` function signatures.
|
||||
|
||||
#### **1. The Core Workflow: Handling Element Immutability**
|
||||
|
||||
* **Central Rule:** Elements in the Excalidraw scene are immutable and should never be modified directly. Always use the ExcalidrawAutomate (EA) "workbench" pattern for modifications.
|
||||
@@ -79,14 +108,21 @@ For a reference, follow the implementation pattern used in the "Printable Layout
|
||||
#### **6. Best Practices and Advanced Techniques**
|
||||
|
||||
* **Embrace \`await\`:** Many EA functions are asynchronous and return a \`Promise\` (e.g., \`ea.addElementsToView()\`, \`ea.createSVG()\`, \`utils.inputPrompt()\`). **Always** use \`await\` when calling these functions to ensure your script executes in the correct order.
|
||||
* **Version Checking:** At the beginning of your script, include a check like \`if(!ea.verifyMinimumPluginVersion("1.X.X")) { new Notice(...); return; }\` to ensure the user has a compatible version of the Excalidraw plugin, preventing errors from missing API functions.
|
||||
* **Accessing Obsidian API:** The full Obsidian API is available via \`ea.obsidian\`. For example, use \`new ea.obsidian.Notice("message")\` or \`ea.obsidian.normalizePath(filepath)\`.
|
||||
* **Accessing Excalidraw API:** The full Excalidraw API is available on ea.getExcalidrawAPI(), these API functions are Scene dependent. Additional support functions are avalable on ExcalidrawLib.
|
||||
* **Visibility vs. Deletion:**
|
||||
* To temporarily hide an element, set \`element.opacity = 0\`. It's good practice to store the original opacity in \`customData\` so it can be restored. It is also recommended to lock hidden elements so they do not get accidentally selected or moved around.
|
||||
* To permanently remove an element from the scene, set \`element.isDeleted = true\`.
|
||||
* **Image Handling:** When dealing with image elements, use \`ea.getViewFileForImageElement(imageElement)\` to get the corresponding \`TFile\` from the Obsidian vault. This is necessary for any logic that needs to read or manipulate the source image file.
|
||||
|
||||
#### **7. Custom Pens and Perfect Freehand**
|
||||
#### **9. Text Element**
|
||||
* There are three text properties.
|
||||
* **textElement.text** holds the wrapped, rendered text. This is what is displayed in the view. Excalidraw adds '\\n' linebreaks during dynamic wrapping.
|
||||
* **textElement.originalText** holds the rendered, but unwrapped text. Any '\\n' character in originalText is an intentional linebreak by the user. Rendered means that for example [[wiki links]] are rendered without the square brackets.
|
||||
* **textElement.rawText** holds the original raw text including intentional new line characters and the full markdown markup (thought currently only links are rendered, so markdown support is limited to these)
|
||||
* When modifying element text from script, typically all 3 of these properties must be updated, though in case textElement.autoresize === true, or when a text element is bound in a container, excalidraw will update textElement.text following the size of the text element or the container.
|
||||
|
||||
#### **8. Custom Pens and Perfect Freehand**
|
||||
|
||||
Excalidraw's freehand tool is powered by the open-source Perfect Freehand library. The plugin exposes “custom pens” that bundle:
|
||||
- Canvas style for the next strokes (colors, width, fillStyle, roughness).
|
||||
@@ -217,6 +253,7 @@ const ADDITIONAL_TYPE_DEFS_FOR_AI_TRAINING = [
|
||||
const TYPE_DEF_WHITELIST = [
|
||||
"lib/shared/ExcalidrawAutomate.d.ts",
|
||||
"lib/types/excalidrawAutomateTypes.d.ts",
|
||||
"lib/types/sidepanelTabTypes.d.ts",
|
||||
"lib/types/penTypes.d.ts",
|
||||
"lib/types/utilTypes.d.ts",
|
||||
"lib/types/exportUtilTypes.d.ts",
|
||||
@@ -224,6 +261,8 @@ 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",
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -515,8 +554,9 @@ function main() {
|
||||
.filter(
|
||||
(d) =>
|
||||
d.isFile() &&
|
||||
d.name.endsWith('.md') &&
|
||||
d.name.toLowerCase() !== 'index-new.md'
|
||||
(d.name.endsWith('.md') || d.name.toLowerCase() === "mindmap builder.js") &&
|
||||
d.name.toLowerCase() !== 'index-new.md' &&
|
||||
d.name.toLowerCase() !== 'mindmap builder.md'
|
||||
)
|
||||
.map((d) => d.name)
|
||||
.sort((a, b) => a.localeCompare(b, 'en', { sensitivity: 'base' }));
|
||||
@@ -590,7 +630,7 @@ function main() {
|
||||
const excalidrawLibFunctionsSection = buildExcalidrawLibFunctionsSection();
|
||||
|
||||
const combined =
|
||||
AI_TRAINING_INTRO +
|
||||
(AI_TRAINING_INTRO +
|
||||
'\n---\n\n' +
|
||||
typeDefContent.trim() +
|
||||
'\n\n---\n\n' +
|
||||
@@ -600,7 +640,10 @@ function main() {
|
||||
'\n---\n\n' +
|
||||
scriptLibContent.trim() +
|
||||
startupSection +
|
||||
'\n';
|
||||
'\n')
|
||||
.replaceAll("https://youtu.be/", "YouTube: ")
|
||||
.replaceAll("https://www.youtube.com/watch?v=", "YouTube: ")
|
||||
.replaceAll("https://www.youtube.com/", "YouTube: "); // prevent accidental link triggering
|
||||
|
||||
fs.writeFileSync(AI_TRAINING_OUT, combined, 'utf8');
|
||||
console.log('[script-library] Wrote:', AI_TRAINING_OUT);
|
||||
|
||||
@@ -879,7 +879,7 @@ export const penIcon = (pen: PenStyle) => {
|
||||
}
|
||||
|
||||
export const stringToSVG = (svg: string) => {
|
||||
if(svg.match('class="skip"')) {
|
||||
if(svg.match(/class=("|')[^"']*(lucide|skip)[^"']*("|')/)) {
|
||||
return <div dangerouslySetInnerHTML={{__html: svg}}></div>
|
||||
}
|
||||
svg = svg
|
||||
|
||||
@@ -97,7 +97,7 @@ export let {
|
||||
exportToSvg,
|
||||
exportToBlob,
|
||||
mutateElement,
|
||||
restore,
|
||||
restoreElements,
|
||||
mermaidToExcalidraw,
|
||||
getFontFamilyString,
|
||||
getContainerElement,
|
||||
@@ -106,6 +106,7 @@ export let {
|
||||
loadSceneFonts,
|
||||
loadMermaid,
|
||||
syncInvalidIndices,
|
||||
getDefaultColorPalette,
|
||||
} = excalidrawLib;
|
||||
|
||||
export function updateExcalidrawLib() {
|
||||
@@ -123,7 +124,7 @@ export function updateExcalidrawLib() {
|
||||
'getCommonBoundingBox',
|
||||
'measureText',
|
||||
'getLineHeight',
|
||||
'restore'
|
||||
'restoreElements'
|
||||
];
|
||||
|
||||
for (const fnName of requiredFunctions) {
|
||||
@@ -147,7 +148,7 @@ export function updateExcalidrawLib() {
|
||||
exportToSvg,
|
||||
exportToBlob,
|
||||
mutateElement,
|
||||
restore,
|
||||
restoreElements,
|
||||
mermaidToExcalidraw,
|
||||
getFontFamilyString,
|
||||
getContainerElement,
|
||||
@@ -156,6 +157,7 @@ export function updateExcalidrawLib() {
|
||||
loadSceneFonts,
|
||||
loadMermaid,
|
||||
syncInvalidIndices,
|
||||
getDefaultColorPalette,
|
||||
} = excalidrawLib);
|
||||
} catch (error) {
|
||||
errorHandler.handleError(error, "updateExcalidrawLib", true);
|
||||
@@ -212,7 +214,7 @@ export const ROUNDNESS = { //should at one point publish @zsviczian/excalidraw/t
|
||||
PROPORTIONAL_RADIUS: 2,
|
||||
ADAPTIVE_RADIUS: 3,
|
||||
} as const;
|
||||
export const THEME_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
||||
export const THEME_FILTER = "invert(93%) hue-rotate(180deg) saturate(1.25)";
|
||||
export const GITHUB_RELEASES = "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/";
|
||||
export const URLFETCHTIMEOUT = 3000;
|
||||
export const PLUGIN_ID = "obsidian-excalidraw-plugin";
|
||||
@@ -299,6 +301,7 @@ export const CaptureUpdateAction = {
|
||||
|
||||
export const EMBEDDABLE_THEME_FRONTMATTER_VALUES = ["light", "dark", "auto", "dafault"];
|
||||
export const VIEW_TYPE_EXCALIDRAW = "excalidraw";
|
||||
export const VIEW_TYPE_SIDEPANEL = "excalidraw-sidepanel";
|
||||
export const VIEW_TYPE_EXCALIDRAW_LOADING = "excalidraw-loading";
|
||||
export const ICON_NAME = "excalidraw-icon";
|
||||
export const MAX_COLORS = 5;
|
||||
|
||||
+67
-2
@@ -17,6 +17,7 @@ import {
|
||||
} from "obsidian";
|
||||
import {
|
||||
VIEW_TYPE_EXCALIDRAW,
|
||||
VIEW_TYPE_SIDEPANEL,
|
||||
EXCALIDRAW_ICON,
|
||||
ICON_NAME,
|
||||
SCRIPTENGINE_ICON,
|
||||
@@ -86,10 +87,15 @@ import { PluginFileManager } from "./managers/FileManager";
|
||||
import { ObserverManager } from "./managers/ObserverManager";
|
||||
import { PackageManager } from "./managers/PackageManager";
|
||||
import ExcalidrawView from "../view/ExcalidrawView";
|
||||
import { ExcalidrawSidepanelView } from "../view/sidepanel/Sidepanel";
|
||||
import { CommandManager } from "./managers/CommandManager";
|
||||
import { EventManager } from "./managers/EventManager";
|
||||
import { UniversalInsertFileModal } from "src/shared/Dialogs/UniversalInsertFileModal";
|
||||
import en from "src/lang/locale/en";
|
||||
import { get } from "http";
|
||||
import { getHighlightColor } from "src/utils/dynamicStyling";
|
||||
import { InlineLinkSuggester } from "src/shared/Suggesters/InlineLinkSuggester";
|
||||
import { KeyBlocker } from "src/types/excalidrawAutomateTypes";
|
||||
|
||||
declare const PLUGIN_VERSION:string;
|
||||
declare const INITIAL_TIMESTAMP: number;
|
||||
@@ -116,6 +122,7 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
public settings: ExcalidrawSettings;
|
||||
public activeExcalidrawView: ExcalidrawView = null;
|
||||
public lastActiveExcalidrawFilePath: string = null;
|
||||
public lastActiveExcalidrawLeafID: string = null;
|
||||
public hover: { linkText: string; sourcePath: string } = {
|
||||
linkText: null,
|
||||
sourcePath: null,
|
||||
@@ -279,6 +286,10 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
}
|
||||
},
|
||||
);
|
||||
this.registerView(
|
||||
VIEW_TYPE_SIDEPANEL,
|
||||
(leaf: WorkspaceLeaf) => new ExcalidrawSidepanelView(leaf, this),
|
||||
);
|
||||
//Compatibility mode with .excalidraw files
|
||||
this.registerExtensions(["excalidraw"], VIEW_TYPE_EXCALIDRAW);
|
||||
|
||||
@@ -558,7 +569,7 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
let fontMetrics = f.extension.startsWith("woff") ? undefined : await getFontMetrics(fourthFontDataURL, "Local Font");
|
||||
|
||||
if (!fontMetrics) {
|
||||
console.log("Font Metrics not found, using default");
|
||||
//console.log("Font Metrics not found, using default");
|
||||
fontMetrics = {
|
||||
unitsPerEm: 1000,
|
||||
ascender: 750,
|
||||
@@ -762,6 +773,26 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
if(Object.keys(this.scriptEngine.scriptIconMap).length === 0) {
|
||||
this.scriptEngine.loadScripts();
|
||||
}
|
||||
const restartSidepanelTabIfActive = async () => {
|
||||
if (!this.scriptEngine || !(scriptFile instanceof TFile)) {
|
||||
return;
|
||||
}
|
||||
const scriptName = this.scriptEngine.getScriptName(scriptFile);
|
||||
const spView = ExcalidrawSidepanelView.getExisting(false);
|
||||
if (!spView || !scriptName || !spView.getTabByScript(scriptName)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await spView.restartTabForScript(scriptName);
|
||||
} catch (error) {
|
||||
errorlog({
|
||||
where: "ExcalidrawPlugin.registerInstallCodeblockProcessor.restartSidepanelTab",
|
||||
error,
|
||||
scriptName,
|
||||
});
|
||||
}
|
||||
};
|
||||
await restartSidepanelTabIfActive();
|
||||
new Notice(`Installed: ${(scriptFile as TFile).basename}`);
|
||||
} catch (e) {
|
||||
new Notice(`Error installing script: ${fname}`);
|
||||
@@ -1153,6 +1184,7 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
}
|
||||
|
||||
onunload() {
|
||||
ExcalidrawSidepanelView.onPluginUnload(this);
|
||||
const excalidrawViews = getExcalidrawViews(this.app);
|
||||
excalidrawViews.forEach(({leaf}) => {
|
||||
this.setMarkdownView(leaf);
|
||||
@@ -1254,6 +1286,10 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
|
||||
public async openSidepanel(reveal: boolean = true): Promise<ExcalidrawSidepanelView | null> {
|
||||
return ExcalidrawSidepanelView.getOrCreate(this, reveal);
|
||||
}
|
||||
|
||||
public getStencilLibrary(): {} {
|
||||
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.getStencilLibrary,`ExcalidrawPlugin.getStencilLibrary`);
|
||||
if (
|
||||
@@ -1265,10 +1301,14 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
return JSON_parse(this.settings.library);
|
||||
}
|
||||
|
||||
public setStencilLibrary(library: {}) {
|
||||
public async setStencilLibrary(library: {}) {
|
||||
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.setStencilLibrary,`ExcalidrawPlugin.setStencilLibrary`, library);
|
||||
this.settings.library = "deprecated";
|
||||
if(JSON.stringify(this.settings.library2) === JSON.stringify(library)) {
|
||||
return;
|
||||
}
|
||||
this.settings.library2 = library;
|
||||
await this.saveSettings();
|
||||
}
|
||||
|
||||
public triggerEmbedUpdates(filepath?: string) {
|
||||
@@ -1486,4 +1526,29 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
public getObsidianDevice(): DeviceType {
|
||||
return DEVICE;
|
||||
}
|
||||
|
||||
public getHighlightColor(sceneBgColor: string, opacity: number = 1): string {
|
||||
return getHighlightColor(this.ea, sceneBgColor, opacity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attaches an inline link suggester to the specified input element.
|
||||
* @param inputEl The HTML input element to attach the suggester to.
|
||||
* @param widthWrapper Optional HTML element to wrap the width of suggester element.
|
||||
* @param containerEl Optional container element used as collision boundary.
|
||||
* @param surpessPlaceholder Whether to suppress the placeholder text. Defaults to true.
|
||||
* @returns A KeyBlocker instance for managing keyboard input.
|
||||
*/
|
||||
public attachInlineLinkSuggester(
|
||||
inputEl: HTMLInputElement,
|
||||
widthWrapper?: HTMLElement,
|
||||
containerEl?: HTMLDivElement,
|
||||
surpessPlaceholder: boolean = true
|
||||
): KeyBlocker {
|
||||
const getSourcePath = () => {
|
||||
this.ea.setView();
|
||||
return this.ea.targetView?.file?.path;
|
||||
};
|
||||
return new InlineLinkSuggester(this.app, this, inputEl, getSourcePath, widthWrapper, surpessPlaceholder, containerEl);
|
||||
}
|
||||
}
|
||||
@@ -400,6 +400,14 @@ export class CommandManager {
|
||||
callback: ()=>this.plugin.exportLibrary(),
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
id: "excalidraw-open-sidepanel",
|
||||
name: t("OPEN_SIDEPANEL"),
|
||||
callback: () => {
|
||||
void this.plugin.openSidepanel();
|
||||
},
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
id: "excalidraw-open",
|
||||
name: t("OPEN_EXISTING_NEW_PANE"),
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
|
||||
import { DEVICE, FRONTMATTER_KEYS, ICON_NAME, VIEW_TYPE_EXCALIDRAW } from "src/constants/constants";
|
||||
import ExcalidrawView from "src/view/ExcalidrawView";
|
||||
import { t } from "src/lang/helpers";
|
||||
import { setMobileNavbarPosition } from "src/utils/excalidrawViewUtils";
|
||||
|
||||
/**
|
||||
* Registers event listeners for the plugin
|
||||
@@ -53,6 +54,10 @@ export class EventManager {
|
||||
window.clearTimeout(this.leafChangeTimeout);
|
||||
this.leafChangeTimeout = null;
|
||||
}
|
||||
if(this.debunceActiveLeafChangeHandlerTimer) {
|
||||
window.clearTimeout(this.debunceActiveLeafChangeHandlerTimer);
|
||||
this.debunceActiveLeafChangeHandlerTimer = null;
|
||||
}
|
||||
this.removeEventLisnters.forEach((removeEventListener) =>
|
||||
removeEventListener(),
|
||||
);
|
||||
@@ -189,6 +194,15 @@ export class EventManager {
|
||||
this.plugin.lastPDFLeafID = leaf.id;
|
||||
}
|
||||
|
||||
if (leaf.view && leaf.view.getViewType() === VIEW_TYPE_EXCALIDRAW) {
|
||||
this.plugin.lastActiveExcalidrawLeafID = leaf.id;
|
||||
} else {
|
||||
const lastLeaf = this.app.workspace.getLeafById(this.plugin.lastActiveExcalidrawLeafID);
|
||||
if(!lastLeaf || !(lastLeaf.view instanceof ExcalidrawView)) {
|
||||
this.plugin.lastActiveExcalidrawLeafID = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.leafChangeTimeout) {
|
||||
window.clearTimeout(this.leafChangeTimeout);
|
||||
}
|
||||
@@ -221,22 +235,7 @@ export class EventManager {
|
||||
this.plugin.removeModalContainerObserver();
|
||||
}
|
||||
|
||||
//!Temporary hack
|
||||
//https://discord.com/channels/686053708261228577/817515900349448202/1031101635784613968
|
||||
if (DEVICE.isMobile && newActiveviewEV && !previouslyActiveEV) {
|
||||
const navbar = document.querySelector("body>.app-container>.mobile-navbar");
|
||||
if(navbar && navbar instanceof HTMLDivElement) {
|
||||
navbar.style.position="relative";
|
||||
}
|
||||
}
|
||||
|
||||
if (DEVICE.isMobile && !newActiveviewEV && previouslyActiveEV) {
|
||||
const navbar = document.querySelector("body>.app-container>.mobile-navbar");
|
||||
if(navbar && navbar instanceof HTMLDivElement) {
|
||||
navbar.style.position="";
|
||||
}
|
||||
}
|
||||
|
||||
setMobileNavbarPosition(newActiveviewEV && !previouslyActiveEV);
|
||||
//----------------------
|
||||
//----------------------
|
||||
|
||||
|
||||
@@ -136,8 +136,17 @@ const _getPNG = async ({imgAttributes,filenameParts,theme,cacheReady,img,file,ex
|
||||
if (!png) {
|
||||
return null;
|
||||
}
|
||||
img.src = URL.createObjectURL(png);
|
||||
cacheReady && imageCache.addImageToCache(cacheKey, img.src, png);
|
||||
const blobUrl = URL.createObjectURL(png);
|
||||
img.src = blobUrl;
|
||||
|
||||
// Revoke the ObjectURL after the image loads or fails to prevent memory leaks
|
||||
if (!cacheReady) {
|
||||
const cleanup = () => URL.revokeObjectURL(blobUrl);
|
||||
img.addEventListener('load', cleanup, { once: true });
|
||||
img.addEventListener('error', cleanup, { once: true });
|
||||
}
|
||||
|
||||
cacheReady && imageCache.addImageToCache(cacheKey, blobUrl, png);
|
||||
return img;
|
||||
}
|
||||
|
||||
@@ -382,6 +391,14 @@ const addSVGToImgSrc = (img: HTMLImageElement, svg: SVGSVGElement, cacheReady: b
|
||||
const blob = new Blob([svgString], { type: 'image/svg+xml' });
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
img.setAttribute("src", blobUrl);
|
||||
|
||||
// Revoke the ObjectURL after the image loads or fails to prevent memory leaks
|
||||
if (!cacheReady) {
|
||||
const cleanup = () => URL.revokeObjectURL(blobUrl);
|
||||
img.addEventListener('load', cleanup, { once: true });
|
||||
img.addEventListener('error', cleanup, { once: true });
|
||||
}
|
||||
|
||||
cacheReady && imageCache.addImageToCache(cacheKey, blobUrl, blob);
|
||||
return img;
|
||||
}
|
||||
@@ -812,7 +829,10 @@ const tmpObsidianWYSIWYG = async (
|
||||
}
|
||||
if(warningEl) {
|
||||
const dataHeading = warningEl.getAttr("data-heading");
|
||||
const ref = dataHeading.match(/.+(\^(?:group=|area=|frame=|clippedframe=)[A-Za-z0-9_-]{8,21})/)?.[1];
|
||||
const ref = dataHeading.match(/.+(\^(?:group=|area=|frame=|clippedframe=)[A-Za-z0-9_-]{8,21})/)?.[1]
|
||||
// I am unsure if this works with all Obsidian translations,
|
||||
// thus I kept the first with the fix ID length and have the frame name as fallback
|
||||
?? dataHeading.match(/.+(\^(?:group=|area=|frame=|clippedframe=)[\p{L}\p{N}_ -]+)/u)?.[1];
|
||||
if(ref) {
|
||||
attr.fname = file.path + "#" +ref;
|
||||
areaPreview = true;
|
||||
@@ -836,6 +856,13 @@ const tmpObsidianWYSIWYG = async (
|
||||
imgDiv.firstChild.style.maxHeight = "100%";
|
||||
imgDiv.firstChild.style.maxWidth = null;
|
||||
}
|
||||
// Resolve the cyclic size dependency by applying a CSS width and/or height
|
||||
if(!onCanvas && isHoverPopover && imgDiv.firstChild instanceof HTMLImageElement) {
|
||||
internalEmbedDiv.style.setProperty("--popover-width", attr.fwidth + "px");
|
||||
internalEmbedDiv.style.setProperty("--popover-height", attr.fheight + "px");
|
||||
internalEmbedDiv.style.width = "var(--popover-width)";
|
||||
internalEmbedDiv.style.height = "var(--popover-height)";
|
||||
}
|
||||
internalEmbedDiv.appendChild(imgDiv.firstChild);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ export class ObserverManager {
|
||||
if(this.settings.matchThemeTrigger) this.addThemeObserver();
|
||||
this.experimentalFileTypeDisplayToggle(this.settings.experimentalFileType);
|
||||
this.addModalContainerObserver();
|
||||
if (this.app.isMobile) {
|
||||
this.addWorkspaceDrawerObserver();
|
||||
}
|
||||
} catch (e) {
|
||||
new Notice("Error adding ObserverManager", 6000);
|
||||
console.error("Error adding ObserverManager", e);
|
||||
@@ -41,19 +44,20 @@ export class ObserverManager {
|
||||
this.removeModalContainerObserver();
|
||||
if (this.workspaceDrawerLeftObserver) {
|
||||
this.workspaceDrawerLeftObserver.disconnect();
|
||||
this.workspaceDrawerLeftObserver = null;
|
||||
}
|
||||
if (this.workspaceDrawerRightObserver) {
|
||||
this.workspaceDrawerRightObserver.disconnect();
|
||||
this.workspaceDrawerRightObserver = null;
|
||||
}
|
||||
if (this.fileExplorerObserver) {
|
||||
this.fileExplorerObserver.disconnect();
|
||||
this.fileExplorerObserver = null;
|
||||
}
|
||||
if (this.workspaceDrawerRightObserver) {
|
||||
this.workspaceDrawerRightObserver.disconnect();
|
||||
}
|
||||
if (this.workspaceDrawerLeftObserver) {
|
||||
this.workspaceDrawerLeftObserver.disconnect();
|
||||
}
|
||||
|
||||
this.plugin = null;
|
||||
this.app = null;
|
||||
this.activeViewDoc = null;
|
||||
}
|
||||
|
||||
public addThemeObserver() {
|
||||
@@ -218,44 +222,60 @@ export class ObserverManager {
|
||||
|
||||
private addWorkspaceDrawerObserver() {
|
||||
//when the user activates the sliding drawers on Obsidian Mobile
|
||||
const leftWorkspaceDrawer = document.querySelector(
|
||||
".workspace-drawer.mod-left",
|
||||
);
|
||||
const rightWorkspaceDrawer = document.querySelector(
|
||||
".workspace-drawer.mod-right",
|
||||
);
|
||||
if (leftWorkspaceDrawer || rightWorkspaceDrawer) {
|
||||
const action = async (m: MutationRecord[]) => {
|
||||
if (
|
||||
m[0].oldValue !== "display: none;" ||
|
||||
!this.plugin.activeExcalidrawView ||
|
||||
!this.plugin.activeExcalidrawView?.isDirty()
|
||||
) {
|
||||
return;
|
||||
if (this.workspaceDrawerLeftObserver || this.workspaceDrawerRightObserver) return;
|
||||
|
||||
const leftWorkspaceDrawer = document.querySelector<HTMLElement>(".workspace .workspace-drawer.mod-left");
|
||||
const rightWorkspaceDrawer = document.querySelector<HTMLElement>(".workspace .workspace-drawer.mod-right");
|
||||
if (!leftWorkspaceDrawer && !rightWorkspaceDrawer) return;
|
||||
|
||||
const parseDisplay = (value?: string | null): string => {
|
||||
if (!value) return "";
|
||||
const match = value.match(/display:\s*([^;]+);?/i);
|
||||
return match ? match[1].trim() : "";
|
||||
};
|
||||
|
||||
const action: MutationCallback = (mutations) => {
|
||||
const activeView = this.plugin.activeExcalidrawView;
|
||||
if (!activeView || activeView.semaphores?.viewunload) return;
|
||||
|
||||
for (const mutation of mutations) {
|
||||
if (mutation.type !== "attributes" || mutation.attributeName !== "style") continue;
|
||||
|
||||
const target = mutation.target as HTMLElement;
|
||||
const newDisplay = target.style.display;
|
||||
const oldDisplay = parseDisplay(mutation.oldValue as string);
|
||||
|
||||
// Drawer finished closing: refresh to fix pointer offset after CSS transitions
|
||||
if (newDisplay === "none" && oldDisplay !== "none") {
|
||||
activeView.refresh();
|
||||
continue;
|
||||
}
|
||||
this.plugin.activeExcalidrawView.save();
|
||||
};
|
||||
const options = {
|
||||
attributeOldValue: true,
|
||||
attributeFilter: ["style"],
|
||||
};
|
||||
|
||||
if (leftWorkspaceDrawer) {
|
||||
this.workspaceDrawerLeftObserver = DEBUGGING
|
||||
? new CustomMutationObserver(action, "slidingDrawerLeftObserver")
|
||||
: new MutationObserver(action);
|
||||
this.workspaceDrawerLeftObserver.observe(leftWorkspaceDrawer, options);
|
||||
// Drawer just opened after being hidden: keep the previous autosave safeguard
|
||||
if (oldDisplay === "none" && newDisplay !== "none" && activeView.isDirty()) {
|
||||
activeView.save();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (rightWorkspaceDrawer) {
|
||||
this.workspaceDrawerRightObserver = DEBUGGING
|
||||
? new CustomMutationObserver(action, "slidingDrawerRightObserver")
|
||||
: new MutationObserver(action);
|
||||
this.workspaceDrawerRightObserver.observe(
|
||||
rightWorkspaceDrawer,
|
||||
options,
|
||||
);
|
||||
}
|
||||
const options = {
|
||||
attributes: true,
|
||||
attributeOldValue: true,
|
||||
attributeFilter: ["style"],
|
||||
};
|
||||
|
||||
if (leftWorkspaceDrawer) {
|
||||
this.workspaceDrawerLeftObserver = DEBUGGING
|
||||
? new CustomMutationObserver(action, "slidingDrawerLeftObserver")
|
||||
: new MutationObserver(action);
|
||||
this.workspaceDrawerLeftObserver.observe(leftWorkspaceDrawer, options);
|
||||
}
|
||||
|
||||
if (rightWorkspaceDrawer) {
|
||||
this.workspaceDrawerRightObserver = DEBUGGING
|
||||
? new CustomMutationObserver(action, "slidingDrawerRightObserver")
|
||||
: new MutationObserver(action);
|
||||
this.workspaceDrawerRightObserver.observe(rightWorkspaceDrawer, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export class PackageManager {
|
||||
return (
|
||||
typeof lib === 'object' &&
|
||||
lib !== null &&
|
||||
typeof lib.restore === 'function' &&
|
||||
typeof lib.restoreElements === 'function' &&
|
||||
typeof lib.exportToSvg === 'function'
|
||||
);
|
||||
}
|
||||
|
||||
+27
-11
@@ -45,8 +45,11 @@ import { createSliderWithText } from "src/utils/sliderUtils";
|
||||
import { PDFExportSettingsComponent, PDFExportSettings } from "src/shared/Dialogs/PDFExportSettingsComponent";
|
||||
import { ContentSearcher } from "src/shared/components/ContentSearcher";
|
||||
import { UIMode, UIModeSettingsComponent } from "src/shared/Dialogs/UIModeSettingComponent";
|
||||
import { ScriptSettingValue } from "src/types/excalidrawAutomateTypes";
|
||||
|
||||
export interface ExcalidrawSettings {
|
||||
copyLinkToElemenetAnchorTo100: boolean;
|
||||
copyFrameLinkByName: boolean;
|
||||
disableDoubleClickTextEditing: boolean;
|
||||
folder: string;
|
||||
cropFolder: string;
|
||||
@@ -115,6 +118,7 @@ export interface ExcalidrawSettings {
|
||||
focusOnFileTab: boolean;
|
||||
openInMainWorkspace: boolean;
|
||||
showLinkBrackets: boolean;
|
||||
syncElementLinkWithText: boolean;
|
||||
linkPrefix: string;
|
||||
urlPrefix: string;
|
||||
parseTODO: boolean;
|
||||
@@ -169,13 +173,7 @@ export interface ExcalidrawSettings {
|
||||
mdCSS: string;
|
||||
scriptEngineSettings: {
|
||||
[key:string]: {
|
||||
[key:string]: {
|
||||
value?:string,
|
||||
hidden?: boolean,
|
||||
description?: string,
|
||||
valueset?: string[],
|
||||
height?: number,
|
||||
}
|
||||
[key:string]: ScriptSettingValue;
|
||||
}
|
||||
};
|
||||
previousRelease: string;
|
||||
@@ -188,6 +186,7 @@ export interface ExcalidrawSettings {
|
||||
taskboneEnabled: boolean;
|
||||
taskboneAPIkey: string;
|
||||
pinnedScripts: string[];
|
||||
sidepanelTabs: string[];
|
||||
customPens: PenStyle[];
|
||||
numberOfCustomPens: number;
|
||||
pdfScale: number;
|
||||
@@ -240,6 +239,8 @@ export interface ExcalidrawSettings {
|
||||
declare const PLUGIN_VERSION:string;
|
||||
|
||||
export const DEFAULT_SETTINGS: ExcalidrawSettings = {
|
||||
copyLinkToElemenetAnchorTo100: false,
|
||||
copyFrameLinkByName: false,
|
||||
disableDoubleClickTextEditing: false,
|
||||
folder: "Excalidraw",
|
||||
cropFolder: "",
|
||||
@@ -314,7 +315,8 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
|
||||
showSecondOrderLinks: true,
|
||||
focusOnFileTab: true,
|
||||
openInMainWorkspace: true,
|
||||
showLinkBrackets: true,
|
||||
showLinkBrackets: false,
|
||||
syncElementLinkWithText: false,
|
||||
allowCtrlClick: true,
|
||||
forceWrap: false,
|
||||
pageTransclusionCharLimit: 200,
|
||||
@@ -376,6 +378,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
|
||||
taskboneEnabled: false,
|
||||
taskboneAPIkey: "",
|
||||
pinnedScripts: [],
|
||||
sidepanelTabs: [],
|
||||
customPens: [
|
||||
{...PENS["default"]},
|
||||
{...PENS["highlighter"]},
|
||||
@@ -426,10 +429,10 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
|
||||
startupScriptPath: "",
|
||||
aiEnabled: true,
|
||||
openAIAPIToken: "",
|
||||
openAIDefaultTextModel: "gpt-3.5-turbo-1106",
|
||||
openAIDefaultTextModel: "gpt-5-mini",
|
||||
openAIDefaultTextModelMaxTokens: 4096,
|
||||
openAIDefaultVisionModel: "gpt-4o",
|
||||
openAIDefaultImageGenerationModel: "dall-e-3",
|
||||
openAIDefaultVisionModel: "gpt-5-mini",
|
||||
openAIDefaultImageGenerationModel: "gpt-image-1",
|
||||
openAIURL: "https://api.openai.com/v1/chat/completions",
|
||||
openAIImageGenerationURL: "https://api.openai.com/v1/images/generations",
|
||||
openAIImageEditsURL: "https://api.openai.com/v1/images/edits",
|
||||
@@ -1814,6 +1817,18 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
|
||||
(el) => (el.innerHTML = t("LINKS_DESC")),
|
||||
);
|
||||
|
||||
new Setting(detailsEl)
|
||||
.setName(t("ELEMENT_LINK_SYNC_NAME"))
|
||||
.setDesc(fragWithHTML(t("ELEMENT_LINK_SYNC_DESC")))
|
||||
.addToggle((toggle) =>
|
||||
toggle
|
||||
.setValue(this.plugin.settings.syncElementLinkWithText)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.syncElementLinkWithText = value;
|
||||
this.applySettingsUpdate();
|
||||
}),
|
||||
);
|
||||
|
||||
new Setting(detailsEl)
|
||||
.setName(t("SECOND_ORDER_LINKS_NAME"))
|
||||
.setDesc(fragWithHTML(t("SECOND_ORDER_LINKS_DESC")))
|
||||
@@ -1874,6 +1889,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
new Setting(detailsEl)
|
||||
.setName(t("LINK_PREFIX_NAME"))
|
||||
.setDesc(fragWithHTML(t("LINK_PREFIX_DESC")))
|
||||
|
||||
+26
-10
@@ -37,6 +37,7 @@ export default {
|
||||
CONVERT_FILE_KEEP_EXT: "*.excalidraw => *.excalidraw.md",
|
||||
CONVERT_FILE_REPLACE_EXT: "*.excalidraw => *.md (Logseq compatibility)",
|
||||
DOWNLOAD_LIBRARY: "Export stencil library as an *.excalidrawlib file",
|
||||
OPEN_SIDEPANEL: "Open Excalidraw Sidepanel",
|
||||
OPEN_EXISTING_NEW_PANE: "Open existing drawing - IN A NEW PANE",
|
||||
OPEN_EXISTING_ACTIVE_PANE:
|
||||
"Open existing drawing - IN THE CURRENT ACTIVE PANE",
|
||||
@@ -63,6 +64,7 @@ export default {
|
||||
MARKER_FRAME_TITLE_SHOW: "Show Marker Frame Titles",
|
||||
MARKER_FRAME_TITLE_HIDE: "Hide Marker Frame Titles",
|
||||
COPY_ELEMENT_LINK: "Copy [[link]] for selected element(s)",
|
||||
FRAME_WITH_NAME: "Copy frame link by name",
|
||||
COPY_DRAWING_LINK: "Copy ![[embed link]] for this drawing",
|
||||
INSERT_LINK_TO_ELEMENT:
|
||||
`Copy [[link]] for selected element to clipboard. ${labelCTRL()}+CLICK to copy 'group=' link. ${labelSHIFT()}+CLICK to copy an 'area=' link.`,
|
||||
@@ -91,6 +93,8 @@ export default {
|
||||
CONVERT_CARD_TO_FILE: "Move back-of-note card to File",
|
||||
ERROR_TRY_AGAIN: "Please try again.",
|
||||
PASTE_CODEBLOCK: "Paste code block",
|
||||
INVERT_IMAGES_IN_DARK_MODE: "Invert image(s) in dark mode",
|
||||
DO_NOT_INVERT_IMAGES_IN_DARK_MODE: "Do not invert image(s) in dark mode",
|
||||
INSERT_LATEX:
|
||||
`Insert LaTeX formula (e.g. \\binom{n}{k} = \\frac{n!}{k!(n-k)!}).`,
|
||||
ENTER_LATEX: "Enter a valid LaTeX expression",
|
||||
@@ -153,6 +157,7 @@ export default {
|
||||
OPEN_AS_MD: "Open as Markdown",
|
||||
EXPORT_IMAGE: `Export Image`,
|
||||
OPEN_LINK: "Open selected text as link\n(SHIFT+CLICK to open in a new pane)",
|
||||
EXCALIDRAW_SIDEPANEL: "Excalidraw Sidepanel",
|
||||
EXPORT_EXCALIDRAW: "Export to an .Excalidraw file",
|
||||
LINK_BUTTON_CLICK_NO_TEXT:
|
||||
"Select an element that contains an internal or external link.\n",
|
||||
@@ -312,17 +317,16 @@ export default {
|
||||
AI_OPENAI_DEFAULT_MODEL_DESC:
|
||||
"The default AI model to use when generating text. This is a freetext field, so you can enter any valid OpenAI model name. " +
|
||||
"Find out more about the available models on the <a href='https://platform.openai.com/docs/models'>OpenAI website</a>.",
|
||||
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "Enter your default AI model here. e.g.: gpt-3.5-turbo-1106",
|
||||
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "Enter your default AI model here. e.g.: gpt-5-mini",
|
||||
AI_OPENAI_DEFAULT_MAX_TOKENS_NAME: "Max tokens",
|
||||
AI_OPENAI_DEFAULT_MAX_TOKENS_DESC:
|
||||
"Maximum number of tokens to generate in the API response. Set to 0 to omit the max_tokens field (useful for models that don't support this parameter, such as GPT-5).",
|
||||
AI_OPENAI_DEFAULT_IMAGE_MODEL_NAME: "Default Image Generation AI model",
|
||||
AI_OPENAI_DEFAULT_IMAGE_MODEL_DESC:
|
||||
"The default AI model to use when generating images. Image editing and variations are only supported by dall-e-2 at this time by OpenAI, " +
|
||||
"for this reason dall-e-2 will automatically be used in such cases regardless of this setting.<br>" +
|
||||
"The default AI model to use when generating images. Image editing and variations are only supported by dall-e-2 and gpt-image-1 at this time by OpenAI.<br>" +
|
||||
"This is a freetext field, so you can enter any valid OpenAI model name. " +
|
||||
"Find out more about the available models on the <a href='https://platform.openai.com/docs/models'>OpenAI website</a>.",
|
||||
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "Enter your default Image Generation AI model here e.g.: dall-e-3",
|
||||
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "Enter your default Image Generation AI model here e.g.: gpt-image-1",
|
||||
AI_OPENAI_DEFAULT_VISION_MODEL_NAME: "Default AI vision model",
|
||||
AI_OPENAI_DEFAULT_VISION_MODEL_DESC:
|
||||
"The default AI vision model to use when generating text from images. This is a freetext field, so you can enter any valid OpenAI model name. " +
|
||||
@@ -332,7 +336,7 @@ export default {
|
||||
"The default OpenAI API URL. This is a freetext field, so you can enter any valid OpenAI API compatible URL. " +
|
||||
"Excalidraw will use this URL when posting API requests to OpenAI. I am not doing any error handling on this field, so make sure you enter a valid URL and only change this if you know what you are doing. ",
|
||||
AI_OPENAI_DEFAULT_IMAGE_API_URL_NAME: "OpenAI Image Generation API URL",
|
||||
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "Enter your default AI vision model here. e.g.: gpt-4o",
|
||||
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "Enter your default AI vision model here. e.g.: gpt-5-mini",
|
||||
SAVING_HEAD: "Saving",
|
||||
SAVING_DESC: "In the 'Saving' section of Excalidraw Settings, you can configure how your drawings are saved. This includes options for compressing Excalidraw JSON in Markdown, setting autosave intervals for both desktop and mobile, defining filename formats, and choosing whether to use the .excalidraw.md or .md file extension. ",
|
||||
COMPRESS_NAME: "Compress Excalidraw JSON in Markdown",
|
||||
@@ -509,8 +513,7 @@ export default {
|
||||
"<b><u>Toggle ON:</u></b>Change grid color to match the canvas color<br><b><u>Toggle OFF:</u></b>Use the color below as the grid color",
|
||||
GRID_COLOR_NAME: "Grid color",
|
||||
GRID_OPACITY_NAME: "Grid opacity",
|
||||
GRID_OPACITY_DESC: "Grid opacity will also control the opacity of the binding box when binding an arrow to an element.<br>" +
|
||||
"Set the opacity of the grid. 0 is transparent, 100 is opaque.",
|
||||
GRID_OPACITY_DESC: "Sets the opacity of the grid. 0 is transparent, 100 is opaque.",
|
||||
GRID_DIRECTION_NAME: "Grid direction",
|
||||
GRID_DIRECTION_DESC: "The first toggle shows/hides the horizontal grid, the second toggle shows/hides the vertical grid.",
|
||||
GRID_HORIZONTAL: "Render horizontal grid",
|
||||
@@ -541,7 +544,8 @@ export default {
|
||||
LONG_PRESS_MOBILE_NAME: "Long press to open mobile",
|
||||
LONG_PRESS_MOBILE_DESC: "Long press delay in milliseconds to open an Excalidraw Drawing embedded in a Markdown file. ",
|
||||
DOUBLE_CLICK_LINK_OPEN_VIEW_MODE: "Allow double-click to open links in view mode",
|
||||
|
||||
ELEMENT_LINK_SYNC_NAME: "Sync text-element link with text",
|
||||
ELEMENT_LINK_SYNC_DESC: "When enabled, Excalidraw matches pre-2.19.0 behavior: the first link in the text body is always copied to the element link field. SVG/PNG exports only keep links when the element link field holds a single link (not links inside the text body). Turn this ON if you rely on text-body links and want the element link to always mirror the first one. Turn it OFF if you manage the element link separately: for metadata like tags, inline link ontologies, or multiple links, e.g., dataview-style notes like '(reminds me of:: [[link]]) #noteToSelf'.",
|
||||
FOCUS_ON_EXISTING_TAB_NAME: "Focus on Existing Tab",
|
||||
FOCUS_ON_EXISTING_TAB_DESC: "When opening a link, Excalidraw will focus on the existing tab if the file is already open. " +
|
||||
"Enabling this setting overrides 'Reuse Adjacent Pane' when the file is already open except for the 'Open the back-of-the-note of the selected excalidraw image' command palette action.",
|
||||
@@ -564,6 +568,12 @@ export default {
|
||||
"In PREVIEW mode, when parsing Text Elements, place brackets around links. " +
|
||||
"You can override this setting for a specific drawing by adding <code>"
|
||||
}${FRONTMATTER_KEYS["link-brackets"].name}: true/false</code> to the file's frontmatter.`,
|
||||
/*LINK_DETECTION_NAME: "Do not auto-create element link from text",
|
||||
LINK_DETECTION_DESC: "By default, Excalidraw will automatically create an element link when you type or paste a valid " +
|
||||
"[[Obsidian link]] or a (web link) into a Text Element. This link overrides whatever element link you may have set previously. " +
|
||||
"Even if you delete the element link, if the text element contains a valid link, Excalidraw will recreate the element link. " +
|
||||
"If you turn this setting on, Excalidraw will not auto-create element links from text. You can still manually set element links " +
|
||||
`Links in the text will still be navigable when you ${labelCTRL()} + CLICK the element.`,*/
|
||||
LINK_PREFIX_NAME: "Link prefix",
|
||||
LINK_PREFIX_DESC: `${
|
||||
"In PREVIEW mode, if the Text Element contains a link, precede the text with these characters. " +
|
||||
@@ -1210,8 +1220,8 @@ export default {
|
||||
UIFM_SECTION_HEAD: "Select section heading",
|
||||
UIFM_ANCHOR: "Anchor to 100% of original size",
|
||||
UIFM_ANCHOR_DESC: "This is a pro feature, use it only if you understand how it works. If enabled even if you change the size of the imported image in Excalidraw, the next time you open the drawing this image will pop back to 100% size. This is useful when embedding an atomic Excalidraw idea into another note and preserving relative sizing of text and icons.",
|
||||
UIFM_BTN_EMBEDDABLE: "as Embeddable",
|
||||
UIFM_BTN_PDF: "as Pdf",
|
||||
UIFM_BTN_EMBEDDABLE: "PDF as Embeddable",
|
||||
UIFM_BTN_PDF: "PDF as Image",
|
||||
UIFM_BTN_IMAGE: "as Image",
|
||||
|
||||
//ReleaseNotes.ts
|
||||
@@ -1247,4 +1257,10 @@ export default {
|
||||
VERSION_MISMATCH_DISABLE_DESC: "You can re-enable this under: Settings → Excalidraw → Basic → Warn about incomplete plugin updates.",
|
||||
VERSION_MISMATCH_REDOWNLOAD: "Re-download plugin",
|
||||
VERSION_MISMATCH_IGNORE: "Ignore",
|
||||
|
||||
//InlineLinkSuggester.ts
|
||||
INLINE_HINT: "Type [[ to search and insert a link",
|
||||
|
||||
//SuggestionModal.ts
|
||||
SUGGESTION_NOMATCH: "No matches found",
|
||||
};
|
||||
+37
-22
@@ -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,13 +30,14 @@ 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:
|
||||
"打开已有的绘图 - 于当前面板",
|
||||
@@ -63,6 +64,7 @@ export default {
|
||||
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]] 链接`,
|
||||
@@ -153,6 +155,7 @@ export default {
|
||||
OPEN_AS_MD: "打开为 Markdown",
|
||||
EXPORT_IMAGE: `导出为图片`,
|
||||
OPEN_LINK: "打开所选元素里的链接 \n(按住 Shift 在新面板打开)",
|
||||
EXCALIDRAW_SIDEPANEL: "Excalidraw 侧边面板",
|
||||
EXPORT_EXCALIDRAW: "导出为 .excalidraw 文件(旧版绘图文件格式)",
|
||||
LINK_BUTTON_CLICK_NO_TEXT:
|
||||
"请选择一个包含内部或外部链接的元素。\n",
|
||||
@@ -295,7 +298,7 @@ export default {
|
||||
SCRIPT_FOLDER_DESC:
|
||||
"此文件夹用于存放 Excalidraw 自动化脚本。" +
|
||||
"您可以在 Obsidian 命令面板中执行这些脚本," +
|
||||
"还可以为喜欢的脚本分配快捷键,就像为其他 Obsidian 命令分配快捷键一样。<br>" +
|
||||
"还可以为喜欢的脚本分配热键,就像为其他 Obsidian 命令分配热键一样。<br>" +
|
||||
"该项不能设为仓库根目录。",
|
||||
AI_HEAD: "AI(实验性)",
|
||||
AI_DESC: `OpenAI GPT API 的设置。` +
|
||||
@@ -312,17 +315,16 @@ 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-3.5-turbo-1106",
|
||||
AI_OPENAI_DEFAULT_MODEL_PLACEHOLDER: "gpt-5-mini",
|
||||
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 模型," +
|
||||
"因为目前只有该模型支持 Image editing and variations。" +
|
||||
"使用哪个 AI 模型来生成图片。图生图目前只有 dall-e-2 和 gpt-image-1 模型支持 Image editing and variations。" +
|
||||
"请填写有效的 OpenAI 模型名称。" +
|
||||
"您可访问 <a href='https://platform.openai.com/docs/models'>OpenAI 网站</a> 了解更多模型信息。",
|
||||
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "dall-e-3",
|
||||
AI_OPENAI_DEFAULT_IMAGE_MODEL_PLACEHOLDER: "gpt-image-1",
|
||||
AI_OPENAI_DEFAULT_VISION_MODEL_NAME: "默认的 AI 视觉模型",
|
||||
AI_OPENAI_DEFAULT_VISION_MODEL_DESC:
|
||||
"根据文本生成图片时,使用哪个 AI 视觉模型。请填写有效的 OpenAI 模型名称。" +
|
||||
@@ -332,7 +334,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-4o",
|
||||
AI_OPENAI_DEFAULT_VISION_MODEL_PLACEHOLDER: "输入默认 AI 模型名称,如 gpt-5-mini",
|
||||
SAVING_HEAD: "保存",
|
||||
SAVING_DESC: "包括:压缩,自动保存的时间间隔,文件的命名格式和扩展名等。",
|
||||
COMPRESS_NAME: "压缩 Excalidraw JSON",
|
||||
@@ -508,9 +510,8 @@ 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: "渲染水平网格",
|
||||
@@ -541,7 +542,8 @@ 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 将会聚焦到现有的标签页上。" +
|
||||
"启用该项时,如果文件已打开,将覆盖“在相邻面板中打开”,但“打开所选绘图的背景笔记”命令面板操作除外。",
|
||||
@@ -564,6 +566,12 @@ 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>" +
|
||||
@@ -585,9 +593,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:
|
||||
@@ -679,7 +687,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>" +
|
||||
@@ -711,7 +719,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:
|
||||
@@ -923,9 +931,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",
|
||||
@@ -1017,18 +1025,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
|
||||
@@ -1134,6 +1142,7 @@ export default {
|
||||
EXPORTDIALOG_BACKGROUND: "背景",
|
||||
EXPORTDIALOG_BACKGROUND_TRANSPARENT: "透明",
|
||||
EXPORTDIALOG_BACKGROUND_USE_COLOR: "使用场景颜色",
|
||||
EXPORTDIALOG_INCLUDE_INTERNAL_LINKS: "导出内部链接为 SVG/PDF?",
|
||||
// Selection
|
||||
EXPORTDIALOG_SELECTED_ELEMENTS: "导出",
|
||||
EXPORTDIALOG_SELECTED_ALL: "整个场景",
|
||||
@@ -1246,4 +1255,10 @@ export default {
|
||||
VERSION_MISMATCH_DISABLE_DESC: "可在以下位置重新启用:设置 → Excalidraw → 基本 → 警告插件更新不完整",
|
||||
VERSION_MISMATCH_REDOWNLOAD: "重新下载插件",
|
||||
VERSION_MISMATCH_IGNORE: "忽略",
|
||||
|
||||
//InlineLinkSuggester.ts
|
||||
INLINE_HINT: "输入 [[ 以搜索并插入链接",
|
||||
|
||||
//SuggestionModal.ts
|
||||
SUGGESTION_NOMATCH: "未找到匹配结果",
|
||||
};
|
||||
+29
-13
@@ -37,6 +37,7 @@ export default {
|
||||
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:
|
||||
"開啟已有的繪圖 - 於當前面板",
|
||||
@@ -63,6 +64,7 @@ export default {
|
||||
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]] 連結`,
|
||||
@@ -153,6 +155,7 @@ export default {
|
||||
OPEN_AS_MD: "開啟為 Markdown",
|
||||
EXPORT_IMAGE: `匯出為圖片`,
|
||||
OPEN_LINK: "開啟所選元素裡的連結 \n(按住 Shift 在新面板開啟)",
|
||||
EXCALIDRAW_SIDEPANEL: "Excalidraw 側邊面板",
|
||||
EXPORT_EXCALIDRAW: "匯出為 .excalidraw 檔案(舊版繪圖檔案格式)",
|
||||
LINK_BUTTON_CLICK_NO_TEXT:
|
||||
"請選擇一個包含內部或外部連結的元素。\n",
|
||||
@@ -315,7 +318,7 @@ export default {
|
||||
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 模型," +
|
||||
@@ -508,9 +511,8 @@ 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: "渲染水平網格",
|
||||
@@ -541,7 +543,8 @@ 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 將會聚焦到現有的標籤頁上。" +
|
||||
"啟用該項時,如果檔案已開啟,將覆蓋“在相鄰面板中開啟”,但“開啟所選繪圖的背景筆記”命令面板操作除外。",
|
||||
@@ -564,6 +567,12 @@ 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>" +
|
||||
@@ -585,9 +594,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:
|
||||
@@ -692,7 +701,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 格式的預覽圖",
|
||||
@@ -923,9 +932,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",
|
||||
@@ -1017,15 +1026,15 @@ 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: "使元素的縮放等級等於當前繪圖的縮放等級",
|
||||
@@ -1134,6 +1143,7 @@ export default {
|
||||
EXPORTDIALOG_BACKGROUND: "背景",
|
||||
EXPORTDIALOG_BACKGROUND_TRANSPARENT: "透明",
|
||||
EXPORTDIALOG_BACKGROUND_USE_COLOR: "使用場景顏色",
|
||||
EXPORTDIALOG_INCLUDE_INTERNAL_LINKS: "匯出內部連結為 SVG/PDF?",
|
||||
// Selection
|
||||
EXPORTDIALOG_SELECTED_ELEMENTS: "匯出",
|
||||
EXPORTDIALOG_SELECTED_ALL: "整個場景",
|
||||
@@ -1246,4 +1256,10 @@ export default {
|
||||
VERSION_MISMATCH_DISABLE_DESC: "可在以下位置重新啟用:設定 → Excalidraw → 基本 → 警告外掛更新不完整",
|
||||
VERSION_MISMATCH_REDOWNLOAD: "重新下載外掛",
|
||||
VERSION_MISMATCH_IGNORE: "忽略",
|
||||
|
||||
//InlineLinkSuggester.ts
|
||||
INLINE_HINT: "輸入 [[ 以搜尋並插入連結",
|
||||
|
||||
//SuggestionModal.ts
|
||||
SUGGESTION_NOMATCH: "未找到匹配結果",
|
||||
};
|
||||
@@ -0,0 +1,127 @@
|
||||
import ExcalidrawView from "src/view/ExcalidrawView";
|
||||
import { getViewColorPalette } from "src/utils/excalidrawViewUtils";
|
||||
|
||||
type PaletteName = "canvasBackground"|"elementBackground"|"elementStroke";
|
||||
|
||||
const GRID_COLUMNS = 5;
|
||||
const CELL_SIZE = 32;
|
||||
const CELL_GAP = 8;
|
||||
const POPUP_PADDING = 12;
|
||||
const MAX_HEIGHT = 260;
|
||||
|
||||
const getColors = (palette: PaletteName, view?: ExcalidrawView, includeSceneColors: boolean = false): string[] => {
|
||||
const raw = getViewColorPalette(palette, view, includeSceneColors) ?? [];
|
||||
const flattened: string[] = [];
|
||||
|
||||
raw.forEach((entry: any) => {
|
||||
if (Array.isArray(entry)) {
|
||||
entry.forEach((color) => {
|
||||
if (typeof color === "string" && color) {
|
||||
flattened.push(color);
|
||||
}
|
||||
});
|
||||
} else if (typeof entry === "string" && entry) {
|
||||
flattened.push(entry);
|
||||
}
|
||||
});
|
||||
|
||||
return flattened;
|
||||
};
|
||||
|
||||
const positionPopup = (popup: HTMLElement, anchor: HTMLElement) => {
|
||||
const rect = anchor.getBoundingClientRect();
|
||||
const { innerWidth, innerHeight } = window;
|
||||
const popupWidth = popup.offsetWidth || (GRID_COLUMNS * (CELL_SIZE + CELL_GAP)) + POPUP_PADDING * 2;
|
||||
const popupHeight = popup.offsetHeight || MAX_HEIGHT + POPUP_PADDING * 2;
|
||||
|
||||
let left = rect.left;
|
||||
let top = rect.bottom + 8;
|
||||
|
||||
if (left + popupWidth > innerWidth - 8) {
|
||||
left = Math.max(8, innerWidth - popupWidth - 8);
|
||||
}
|
||||
|
||||
if (top + popupHeight > innerHeight - 8) {
|
||||
top = Math.max(8, rect.top - popupHeight - 8);
|
||||
}
|
||||
|
||||
popup.style.left = `${left}px`;
|
||||
popup.style.top = `${top}px`;
|
||||
};
|
||||
|
||||
const attachOutsideHandlers = (
|
||||
overlay: HTMLElement,
|
||||
popup: HTMLElement,
|
||||
resolve: (color: string | null) => void,
|
||||
) => {
|
||||
const stopPropagation = (evt: Event) => evt.stopPropagation();
|
||||
let cleanup: (color: string | null) => void;
|
||||
|
||||
const onKeyDown = (evt: KeyboardEvent) => {
|
||||
if (evt.key === "Escape") {
|
||||
evt.stopPropagation();
|
||||
cleanup(null);
|
||||
}
|
||||
};
|
||||
|
||||
const onOverlayClick = () => cleanup(null);
|
||||
|
||||
cleanup = (color: string | null) => {
|
||||
document.removeEventListener("keydown", onKeyDown, true);
|
||||
overlay.removeEventListener("click", onOverlayClick);
|
||||
popup.removeEventListener("click", stopPropagation);
|
||||
overlay.remove();
|
||||
resolve(color);
|
||||
};
|
||||
|
||||
document.addEventListener("keydown", onKeyDown, true);
|
||||
overlay.addEventListener("click", onOverlayClick);
|
||||
popup.addEventListener("click", stopPropagation);
|
||||
|
||||
return cleanup;
|
||||
};
|
||||
|
||||
export const showColorPicker = async (
|
||||
palette: PaletteName,
|
||||
anchorElement: HTMLElement,
|
||||
view?: ExcalidrawView,
|
||||
includeSceneColors: boolean = false,
|
||||
): Promise<string | null> => {
|
||||
const colors = getColors(palette, view, includeSceneColors);
|
||||
|
||||
if (!colors.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const overlay = document.createElement("div");
|
||||
overlay.classList.add("excalidraw-colorpicker-overlay");
|
||||
|
||||
const popup = document.createElement("div");
|
||||
popup.classList.add("excalidraw-colorpicker-popup");
|
||||
|
||||
const grid = document.createElement("div");
|
||||
grid.classList.add("excalidraw-colorpicker-grid");
|
||||
grid.style.gridTemplateColumns = `repeat(${GRID_COLUMNS}, ${CELL_SIZE}px)`;
|
||||
grid.style.gap = `${CELL_GAP}px`;
|
||||
grid.style.maxHeight = `${MAX_HEIGHT}px`;
|
||||
|
||||
colors.forEach((color) => {
|
||||
const swatch = document.createElement("button");
|
||||
swatch.type = "button";
|
||||
swatch.ariaLabel = color;
|
||||
swatch.classList.add("excalidraw-colorpicker-swatch");
|
||||
swatch.style.backgroundColor = color;
|
||||
swatch.addEventListener("click", () => cleanup(color));
|
||||
grid.appendChild(swatch);
|
||||
});
|
||||
|
||||
popup.appendChild(grid);
|
||||
overlay.appendChild(popup);
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
positionPopup(popup, anchorElement);
|
||||
|
||||
const cleanup = attachOutsideHandlers(overlay, popup, resolve);
|
||||
});
|
||||
};
|
||||
@@ -37,6 +37,7 @@ export class EmbeddableSettings extends Modal {
|
||||
private isLocalURI: boolean;
|
||||
private mdCustomData: EmbeddableMDCustomProps;
|
||||
private onKeyDown: (ev: KeyboardEvent) => void;
|
||||
private listenerHost: Document | null = null;
|
||||
|
||||
constructor(
|
||||
private plugin: ExcalidrawPlugin,
|
||||
@@ -72,7 +73,10 @@ export class EmbeddableSettings extends Modal {
|
||||
}
|
||||
|
||||
onClose() {
|
||||
this.containerEl.removeEventListener("keydown",this.onKeyDown);
|
||||
if(this.listenerHost && this.onKeyDown) {
|
||||
this.listenerHost.removeEventListener("keydown",this.onKeyDown);
|
||||
this.listenerHost = null;
|
||||
}
|
||||
this.plugin = null;
|
||||
this.view = null;
|
||||
this.file = null;
|
||||
@@ -166,7 +170,11 @@ export class EmbeddableSettings extends Modal {
|
||||
}
|
||||
|
||||
this.onKeyDown = onKeyDown;
|
||||
this.containerEl.ownerDocument.addEventListener("keydown",onKeyDown);
|
||||
const ownerDoc = this.containerEl.ownerDocument;
|
||||
if(ownerDoc) {
|
||||
this.listenerHost = ownerDoc;
|
||||
ownerDoc.addEventListener("keydown",onKeyDown);
|
||||
}
|
||||
}
|
||||
|
||||
private async applySettings() {
|
||||
|
||||
@@ -1,5 +1,68 @@
|
||||
import { App, Modal } from "obsidian";
|
||||
|
||||
function getClientPoint(e: PointerEvent | TouchEvent) {
|
||||
if (e.type.startsWith("touch")) {
|
||||
const t = (e as TouchEvent).touches[0] ?? (e as TouchEvent).changedTouches[0];
|
||||
return t ? { x: t.clientX, y: t.clientY } : null;
|
||||
}
|
||||
const p = e as PointerEvent;
|
||||
return { x: p.clientX, y: p.clientY };
|
||||
}
|
||||
|
||||
function pointInRect(pt: { x: number; y: number }, r: DOMRect, padding = 1): boolean {
|
||||
return (
|
||||
pt.x >= r.left - padding &&
|
||||
pt.x <= r.right + padding &&
|
||||
pt.y >= r.top - padding &&
|
||||
pt.y <= r.bottom + padding
|
||||
);
|
||||
}
|
||||
|
||||
function isPointOnText(e: PointerEvent | TouchEvent, doc: Document): boolean {
|
||||
const pt = getClientPoint(e);
|
||||
if (!pt) return false;
|
||||
|
||||
let offsetNode: Node | null = null;
|
||||
let offset: number | null = null;
|
||||
|
||||
// Chromium/Firefox-ish
|
||||
const caretPos = (doc as any).caretPositionFromPoint?.(pt.x, pt.y);
|
||||
if (caretPos?.offsetNode) {
|
||||
offsetNode = caretPos.offsetNode;
|
||||
offset = typeof caretPos.offset === "number" ? caretPos.offset : null;
|
||||
} else {
|
||||
// Safari/WebKit
|
||||
const caretRange = (doc as any).caretRangeFromPoint?.(pt.x, pt.y);
|
||||
if (caretRange?.startContainer) {
|
||||
offsetNode = caretRange.startContainer;
|
||||
offset = typeof caretRange.startOffset === "number" ? caretRange.startOffset : null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!offsetNode || offsetNode.nodeType !== Node.TEXT_NODE || offset == null) return false;
|
||||
if (!offsetNode.textContent?.trim()) return false;
|
||||
|
||||
const textNode = offsetNode as Text;
|
||||
const len = textNode.data.length;
|
||||
const at = Math.max(0, Math.min(offset, len));
|
||||
|
||||
const range = doc.createRange();
|
||||
if (at < len) {
|
||||
range.setStart(textNode, at);
|
||||
range.setEnd(textNode, at + 1);
|
||||
} else if (at > 0) {
|
||||
range.setStart(textNode, at - 1);
|
||||
range.setEnd(textNode, at);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
const rects = Array.from(range.getClientRects());
|
||||
if (rects.length === 0) return false;
|
||||
|
||||
return rects.some((r) => pointInRect(pt, r, 1));
|
||||
}
|
||||
|
||||
export class FloatingModal extends Modal {
|
||||
private dragging = false;
|
||||
private offsetX = 0;
|
||||
@@ -12,10 +75,11 @@ export class FloatingModal extends Modal {
|
||||
private previousActive: HTMLElement | null = null; // stores element focused before opening
|
||||
private escListener: (e: KeyboardEvent) => void;
|
||||
private modalKeydownStopHandler: (e: KeyboardEvent) => void; // store handler so we can remove it
|
||||
private ownerWindow: Window = window;
|
||||
private ownerDocument: Document = document;
|
||||
|
||||
constructor(app: App) {
|
||||
super(app);
|
||||
|
||||
// Initialize event handlers with proper binding
|
||||
this.pointerDownHandler = this.handlePointerDown.bind(this);
|
||||
this.pointerMoveHandler = this.handlePointerMove.bind(this);
|
||||
@@ -34,6 +98,7 @@ export class FloatingModal extends Modal {
|
||||
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
|
||||
) {
|
||||
@@ -55,11 +120,11 @@ export class FloatingModal extends Modal {
|
||||
modalEl.style.height = "fit-content";
|
||||
|
||||
// Add touch-specific event listeners
|
||||
document.addEventListener("touchmove", this.pointerMoveHandler as (e: TouchEvent) => void, {
|
||||
this.ownerDocument.addEventListener("touchmove", this.pointerMoveHandler as (e: TouchEvent) => void, {
|
||||
passive: false,
|
||||
});
|
||||
document.addEventListener("touchend", this.pointerUpHandler);
|
||||
document.addEventListener("touchcancel", this.pointerUpHandler);
|
||||
this.ownerDocument.addEventListener("touchend", this.pointerUpHandler);
|
||||
this.ownerDocument.addEventListener("touchcancel", this.pointerUpHandler);
|
||||
} else {
|
||||
// Handle pointer events
|
||||
this.dragging = true;
|
||||
@@ -69,8 +134,8 @@ export class FloatingModal extends Modal {
|
||||
this.offsetY = pointerEvent.clientY - modalEl.getBoundingClientRect().top;
|
||||
|
||||
// Add pointer-specific event listeners
|
||||
document.addEventListener("pointermove", this.pointerMoveHandler as (e: PointerEvent) => void);
|
||||
document.addEventListener("pointerup", this.pointerUpHandler);
|
||||
this.ownerDocument.addEventListener("pointermove", this.pointerMoveHandler as (e: PointerEvent) => void);
|
||||
this.ownerDocument.addEventListener("pointerup", this.pointerUpHandler);
|
||||
// Capture the pointer to ensure we get events even when outside the target
|
||||
target.setPointerCapture(pointerEvent.pointerId);
|
||||
}
|
||||
@@ -108,16 +173,15 @@ export class FloatingModal extends Modal {
|
||||
private handlePointerUp(): void {
|
||||
this.dragging = false;
|
||||
// Remove all event listeners
|
||||
document.removeEventListener("pointermove", this.pointerMoveHandler as (e: PointerEvent) => void);
|
||||
document.removeEventListener("pointerup", this.pointerUpHandler);
|
||||
document.removeEventListener("touchmove", this.pointerMoveHandler as (e: TouchEvent) => void);
|
||||
document.removeEventListener("touchend", this.pointerUpHandler);
|
||||
document.removeEventListener("touchcancel", this.pointerUpHandler);
|
||||
this.ownerDocument.removeEventListener("pointermove", this.pointerMoveHandler as (e: PointerEvent) => void);
|
||||
this.ownerDocument.removeEventListener("pointerup", this.pointerUpHandler);
|
||||
this.ownerDocument.removeEventListener("touchmove", this.pointerMoveHandler as (e: TouchEvent) => void);
|
||||
this.ownerDocument.removeEventListener("touchend", this.pointerUpHandler);
|
||||
this.ownerDocument.removeEventListener("touchcancel", this.pointerUpHandler);
|
||||
}
|
||||
|
||||
private handleEscKey(e: KeyboardEvent) {
|
||||
if (e.key === "Escape") {
|
||||
// Optionally stop propagation if you do not want other handlers firing
|
||||
e.stopPropagation();
|
||||
this.close();
|
||||
}
|
||||
@@ -125,9 +189,11 @@ export class FloatingModal extends Modal {
|
||||
|
||||
open(): void {
|
||||
super.open();
|
||||
this.ownerDocument = this.modalEl.ownerDocument ?? document;
|
||||
this.ownerWindow = this.ownerDocument.defaultView ?? window;
|
||||
// NEW: capture previously focused element & release Obsidian modal key trapping
|
||||
if (this.disableKeyCapture) {
|
||||
this.previousActive = document.activeElement as HTMLElement | null;
|
||||
this.previousActive = this.ownerDocument.activeElement as HTMLElement | null;
|
||||
try {
|
||||
// @ts-ignore pop modal's key scope so keys are not intercepted
|
||||
this.app.keymap.popScope(this.scope);
|
||||
@@ -152,13 +218,13 @@ export class FloatingModal extends Modal {
|
||||
|
||||
// Center the modal initially
|
||||
const rect = modalEl.getBoundingClientRect();
|
||||
const centerX = window.innerWidth / 2 - rect.width / 2;
|
||||
const centerY = window.innerHeight / 2 - rect.height / 2;
|
||||
const centerX = this.ownerWindow.innerWidth / 2 - rect.width / 2;
|
||||
const centerY = this.ownerWindow.innerHeight / 2 - rect.height / 2;
|
||||
|
||||
modalEl.style.left = `${centerX}px`;
|
||||
modalEl.style.top = `${centerY}px`;
|
||||
modalEl.style.transform = "none";
|
||||
const modalStyle = window.getComputedStyle(modalEl);
|
||||
const modalStyle = this.ownerWindow.getComputedStyle(modalEl);
|
||||
modalEl.style.borderBottomLeftRadius = modalStyle.borderTopLeftRadius;
|
||||
modalEl.style.borderBottomRightRadius = modalStyle.borderTopRightRadius;
|
||||
|
||||
@@ -179,7 +245,7 @@ export class FloatingModal extends Modal {
|
||||
modalEl.addEventListener("keydown", this.modalKeydownStopHandler, { capture: true });
|
||||
}
|
||||
// Add ESC listener (capture to run before underlying workspace)
|
||||
document.addEventListener("keydown", this.escListener, { capture: true });
|
||||
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");
|
||||
@@ -192,7 +258,7 @@ export class FloatingModal extends Modal {
|
||||
|
||||
close(): void {
|
||||
// Optional: restore previous focus if body ended up focused
|
||||
if (this.disableKeyCapture && this.previousActive?.isConnected && document.activeElement === document.body) {
|
||||
if (this.disableKeyCapture && this.previousActive?.isConnected && this.ownerDocument.activeElement === this.ownerDocument.body) {
|
||||
try { this.previousActive.focus({ preventScroll: true }); } catch {}
|
||||
}
|
||||
const { modalEl } = this;
|
||||
@@ -205,7 +271,7 @@ export class FloatingModal extends Modal {
|
||||
}
|
||||
// Remove any remaining document event listeners
|
||||
this.handlePointerUp();
|
||||
document.removeEventListener("keydown", this.escListener, { capture: true });
|
||||
this.ownerDocument.removeEventListener("keydown", this.escListener, { capture: true });
|
||||
|
||||
super.close();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { FuzzyMatch, FuzzySuggestModal, setIcon } from "obsidian";
|
||||
import { AUDIO_TYPES, CODE_TYPES, ICON_NAME, IMAGE_TYPES, REG_LINKINDEX_INVALIDCHARS, VIDEO_TYPES } from "../../constants/constants";
|
||||
import { FuzzyMatch, FuzzySuggestModal } from "obsidian";
|
||||
import { t } from "../../lang/helpers";
|
||||
import ExcalidrawPlugin from "src/core/main";
|
||||
import { getLink } from "src/utils/fileUtils";
|
||||
import { LinkSuggestion } from "src/types/types";
|
||||
import { getLinkSuggestionsFiltered, getSortedLinkMatches, renderLinkSuggestion } from "src/shared/Suggesters/LinkSuggesterUtils";
|
||||
|
||||
|
||||
export class InsertLinkDialog extends FuzzySuggestModal<LinkSuggestion> {
|
||||
@@ -32,13 +32,7 @@ export class InsertLinkDialog extends FuzzySuggestModal<LinkSuggestion> {
|
||||
|
||||
getItems(): LinkSuggestion[] {
|
||||
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/422
|
||||
return (
|
||||
this.app.metadataCache
|
||||
//@ts-ignore
|
||||
.getLinkSuggestions()
|
||||
//@ts-ignore
|
||||
.filter((x) => !x.path.match(REG_LINKINDEX_INVALIDCHARS))
|
||||
);
|
||||
return getLinkSuggestionsFiltered(this.app);
|
||||
}
|
||||
|
||||
getItemText(item: LinkSuggestion): string {
|
||||
@@ -59,62 +53,11 @@ export class InsertLinkDialog extends FuzzySuggestModal<LinkSuggestion> {
|
||||
}
|
||||
|
||||
renderSuggestion(result: FuzzyMatch<LinkSuggestion>, itemEl: HTMLElement) {
|
||||
const { item, match: matches } = result || {};
|
||||
itemEl.addClass("mod-complex");
|
||||
const contentEl = itemEl.createDiv("suggestion-content");
|
||||
const auxEl = itemEl.createDiv("suggestion-aux");
|
||||
const titleEl = contentEl.createDiv("suggestion-title");
|
||||
const noteEl = contentEl.createDiv("suggestion-note");
|
||||
renderLinkSuggestion(this.plugin, result, itemEl, this.emptyStateText);
|
||||
}
|
||||
|
||||
if (!item) {
|
||||
titleEl.setText(this.emptyStateText);
|
||||
itemEl.addClass("is-selected");
|
||||
return;
|
||||
}
|
||||
|
||||
const path = item.file?.path ?? item.path;
|
||||
|
||||
const pathLength = path.length - (item.file?.name.length ?? 0);
|
||||
const matchElements = matches.matches.map((m) => {
|
||||
return createSpan("suggestion-highlight");
|
||||
});
|
||||
const itemText = this.getItemText(item);
|
||||
for (let i = pathLength; i < itemText.length; i++) {
|
||||
const match = matches.matches.find((m) => m[0] === i);
|
||||
if (match) {
|
||||
const element = matchElements[matches.matches.indexOf(match)];
|
||||
titleEl.appendChild(element);
|
||||
element.appendText(itemText.substring(match[0], match[1]));
|
||||
|
||||
i += match[1] - match[0] - 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
titleEl.appendText(itemText[i]);
|
||||
}
|
||||
noteEl.setText(path);
|
||||
|
||||
if(!item.file) {
|
||||
setIcon(auxEl, "ghost");
|
||||
} else if(this.plugin.isExcalidrawFile(item.file)) {
|
||||
setIcon(auxEl, ICON_NAME);
|
||||
} else if (item.file.extension === "md") {
|
||||
setIcon(auxEl, "square-pen");
|
||||
} else if (IMAGE_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "image");
|
||||
} else if (VIDEO_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "monitor-play");
|
||||
} else if (AUDIO_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "file-audio");
|
||||
} else if (CODE_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "file-code");
|
||||
} else if (item.file.extension === "canvas") {
|
||||
setIcon(auxEl, "layout-dashboard");
|
||||
} else if (item.file.extension === "pdf") {
|
||||
setIcon(auxEl, "book-open-text");
|
||||
} else {
|
||||
auxEl.setText(item.file.extension);
|
||||
}
|
||||
getSuggestions(query: string): FuzzyMatch<LinkSuggestion>[] {
|
||||
return getSortedLinkMatches(query, this.getItems());
|
||||
}
|
||||
|
||||
onClose(): void {
|
||||
|
||||
@@ -20,6 +20,7 @@ export class InsertPDFModal extends Modal {
|
||||
private lockAfterImport: boolean = true;
|
||||
private pagesToImport:number[] = [];
|
||||
private pageDimensions: {width: number, height: number} = {width: 0, height: 0};
|
||||
private pageDimensionsByPage: Map<number, {width: number; height: number}> = new Map();
|
||||
private importScale = 0.3;
|
||||
private imageSizeMessage: HTMLElement;
|
||||
private pdfDoc: any;
|
||||
@@ -63,6 +64,7 @@ export class InsertPDFModal extends Modal {
|
||||
this.pdfDoc.destroy();
|
||||
this.pdfDoc = null;
|
||||
}
|
||||
this.pageDimensionsByPage.clear();
|
||||
this.plugin = null;
|
||||
this.view = null;
|
||||
this.app = null;
|
||||
@@ -70,23 +72,44 @@ export class InsertPDFModal extends Modal {
|
||||
this.setImageSizeMessage = null;
|
||||
}
|
||||
|
||||
private async getPDFPageDimensions (pdfDoc: any) {
|
||||
try {
|
||||
const scale = this.plugin.settings.pdfScale;
|
||||
const canvas = createEl("canvas");
|
||||
const page = await pdfDoc.getPage(1);
|
||||
// Set scale
|
||||
const viewport = page.getViewport({ scale });
|
||||
this.pageDimensions.height = viewport.height;
|
||||
this.pageDimensions.width = viewport.width;
|
||||
|
||||
//https://github.com/excalidraw/excalidraw/issues/4036
|
||||
canvas.width = 0;
|
||||
canvas.height = 0;
|
||||
this.setImageSizeMessage();
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
private async loadPageDimensions(pages?: number[]) {
|
||||
if(!this.pdfDoc) return;
|
||||
const scale = this.plugin.settings.pdfScale;
|
||||
const pagesToLoad = pages && pages.length > 0 ? [...new Set(pages)] : [1];
|
||||
for (const pageNum of pagesToLoad) {
|
||||
if(this.pageDimensionsByPage.has(pageNum)) continue;
|
||||
try {
|
||||
const page = await this.pdfDoc.getPage(pageNum);
|
||||
const viewport = page.getViewport({ scale });
|
||||
this.pageDimensionsByPage.set(pageNum, { width: viewport.width, height: viewport.height });
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
this.pageDimensions = this.getMaxSelectedPageDimensions();
|
||||
this.setImageSizeMessage();
|
||||
}
|
||||
|
||||
private getMaxSelectedPageDimensions() {
|
||||
let width = 0;
|
||||
let height = 0;
|
||||
const pages = this.pagesToImport.length > 0
|
||||
? this.pagesToImport
|
||||
: Array.from(this.pageDimensionsByPage.keys());
|
||||
pages.forEach((p) => {
|
||||
const dims = this.pageDimensionsByPage.get(p);
|
||||
if(!dims) return;
|
||||
width = Math.max(width, dims.width);
|
||||
height = Math.max(height, dims.height);
|
||||
});
|
||||
if(width === 0 || height === 0) {
|
||||
const first = this.pageDimensionsByPage.values().next().value;
|
||||
if(first) {
|
||||
width = first.width;
|
||||
height = first.height;
|
||||
}
|
||||
}
|
||||
return { width, height };
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +141,11 @@ export class InsertPDFModal extends Modal {
|
||||
return this.pagesToImport;
|
||||
}
|
||||
|
||||
private setImageSizeMessage = () => this.imageSizeMessage.innerText = `${Math.round(this.pageDimensions.width*this.importScale)} x ${Math.round(this.pageDimensions.height*this.importScale)}`;
|
||||
private setImageSizeMessage = () => {
|
||||
if(!this.imageSizeMessage) return;
|
||||
const dims = this.getMaxSelectedPageDimensions();
|
||||
this.imageSizeMessage.innerText = `${Math.round(dims.width*this.importScale)} x ${Math.round(dims.height*this.importScale)}`;
|
||||
};
|
||||
|
||||
async createForm() {
|
||||
await this.plugin.loadSettings();
|
||||
@@ -136,7 +163,7 @@ export class InsertPDFModal extends Modal {
|
||||
|
||||
|
||||
let numPagesMessage: HTMLParagraphElement;
|
||||
let numPages: number;
|
||||
let numPages: number = 0;
|
||||
let importButton: ButtonComponent;
|
||||
let importMessage: HTMLElement;
|
||||
|
||||
@@ -174,8 +201,15 @@ export class InsertPDFModal extends Modal {
|
||||
let pageRangesTextComponent: TextComponent
|
||||
let importPagesMessage: HTMLParagraphElement;
|
||||
|
||||
const rangeOnChange = (value:string) => {
|
||||
const rangeOnChange = async (value:string) => {
|
||||
const pages = this.createPageListFromString(value);
|
||||
if(this.pdfDoc && pages.length > 0) {
|
||||
await this.loadPageDimensions(pages);
|
||||
} else {
|
||||
this.pageDimensionsByPage.clear();
|
||||
this.pageDimensions = {width: 0, height: 0};
|
||||
this.setImageSizeMessage();
|
||||
}
|
||||
if(pages.length > 15) {
|
||||
importPagesMessage.innerHTML = `You are importing <b>${pages.length}</b> pages. ⚠️ This may take a while. ⚠️`;
|
||||
} else {
|
||||
@@ -187,6 +221,10 @@ export class InsertPDFModal extends Modal {
|
||||
const setFile = async (file: TFile) => {
|
||||
if(this.pdfDoc) await this.pdfDoc.destroy();
|
||||
this.pdfDoc = null;
|
||||
this.pageDimensionsByPage.clear();
|
||||
this.pageDimensions = {width: 0, height: 0};
|
||||
numPages = 0;
|
||||
this.setImageSizeMessage();
|
||||
|
||||
if(file) {
|
||||
this.pdfDoc = await getPDFDoc(file);
|
||||
@@ -194,14 +232,16 @@ export class InsertPDFModal extends Modal {
|
||||
if(this.pdfDoc) {
|
||||
numPages = this.pdfDoc.numPages;
|
||||
pageRangesTextComponent.setValue(`1-${numPages}`);
|
||||
rangeOnChange(`1-${numPages}`);
|
||||
await rangeOnChange(`1-${numPages}`);
|
||||
importButtonMessages();
|
||||
numPagesMessages();
|
||||
this.getPDFPageDimensions(this.pdfDoc);
|
||||
} else {
|
||||
importButton.setDisabled(true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
importButtonMessages();
|
||||
numPagesMessages();
|
||||
}
|
||||
}
|
||||
|
||||
const search = new TextComponent(ce);
|
||||
@@ -225,7 +265,7 @@ export class InsertPDFModal extends Modal {
|
||||
pageRangesTextComponent = text;
|
||||
text
|
||||
.setValue("")
|
||||
.onChange((value) => rangeOnChange(value))
|
||||
.onChange(async (value) => { await rangeOnChange(value); })
|
||||
text.inputEl.style.width = "100%";
|
||||
})
|
||||
importPagesMessage = ce.createEl("p", {text: ""});
|
||||
@@ -382,9 +422,10 @@ export class InsertPDFModal extends Modal {
|
||||
el.innerText = ` ${this.gapSize.toString()}`;
|
||||
});
|
||||
|
||||
const initialDims = this.getMaxSelectedPageDimensions();
|
||||
const importSizeSetting = new Setting(ce)
|
||||
.setName("Imported page size")
|
||||
.setDesc(`${this.pageDimensions.width*this.importScale} x ${this.pageDimensions.height*this.importScale}`)
|
||||
.setDesc(`${Math.round(initialDims.width*this.importScale)} x ${Math.round(initialDims.height*this.importScale)}`)
|
||||
.addSlider(slider => slider
|
||||
.setLimits(0.1, 1.5, 0.1)
|
||||
.setValue(this.importScale)
|
||||
@@ -395,6 +436,7 @@ export class InsertPDFModal extends Modal {
|
||||
}))
|
||||
|
||||
this.imageSizeMessage = importSizeSetting.descEl;
|
||||
this.setImageSizeMessage();
|
||||
|
||||
const actionButton = new Setting(ce)
|
||||
.setDesc("Select a document first")
|
||||
@@ -406,13 +448,22 @@ export class InsertPDFModal extends Modal {
|
||||
const ea = getEA(this.view) as ExcalidrawAutomate;
|
||||
let column = 0;
|
||||
let row = 0;
|
||||
const imgWidth = Math.round(this.pageDimensions.width*this.importScale);
|
||||
const imgHeight = Math.round(this.pageDimensions.height*this.importScale);
|
||||
await this.loadPageDimensions(this.pagesToImport);
|
||||
const maxPageDimensions = this.getMaxSelectedPageDimensions();
|
||||
const cellWidth = Math.round(maxPageDimensions.width*this.importScale);
|
||||
const cellHeight = Math.round(maxPageDimensions.height*this.importScale);
|
||||
if(cellWidth === 0 || cellHeight === 0) {
|
||||
importMessage.innerText = t("IPM_SELECT_PAGES_TO_IMPORT");
|
||||
return;
|
||||
}
|
||||
for(let i = 0; i < this.pagesToImport.length; i++) {
|
||||
const page = this.pagesToImport[i];
|
||||
importMessage.innerText = `Importing page ${page} (${i+1} of ${this.pagesToImport.length})`;
|
||||
const topX = Math.round(this.pageDimensions.width*this.importScale*column + this.gapSize*column);
|
||||
const topY = Math.round(this.pageDimensions.height*this.importScale*row + this.gapSize*row);
|
||||
const dims = this.pageDimensionsByPage.get(page) ?? maxPageDimensions;
|
||||
const imgWidth = Math.round(dims.width*this.importScale);
|
||||
const imgHeight = Math.round(dims.height*this.importScale);
|
||||
const topX = Math.round(cellWidth*column + this.gapSize*column);
|
||||
const topY = Math.round(cellHeight*row + this.gapSize*row);
|
||||
|
||||
ea.style.strokeColor = this.borderBox ? "#000000" : "transparent";
|
||||
const boxID = ea.addRect(
|
||||
|
||||
+180
-51
@@ -17,9 +17,182 @@ I build this plugin in my free time, as a labor of love. Curious about the philo
|
||||
|
||||
<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.20.0":`
|
||||
## New
|
||||
- Dark theme from Excalidraw.com [#10578](https://github.com/excalidraw/excalidraw/pull/10578) (including correct emoji rendering in dark mode 😍).
|
||||
- New image context-menu option (right-click an image) to control whether that image inverts in dark mode
|
||||
- Default behavior: SVG-based images (including LaTeX, Mermaid, and nested Excalidraw images) invert in dark mode; bitmap images (PNG/JPG) do not.
|
||||
- New from Excalidraw.com: chat-style interface for Mermaid TextToDiagrams (requires an OpenAI API key configured in Excalidraw plugin settings). [#10530](https://github.com/excalidraw/excalidraw/pull/10530)
|
||||
- Breaking change: the legacy “force SVG” option for Mermaid diagrams is no longer supported. If a diagram can be rendered as Excalidraw, it will be; otherwise, an SVG will be used.
|
||||
- Moved the Shade Master script to use the new Sidepanel (just like MindMap Builder).
|
||||
|
||||
## Fixed
|
||||
- In full-screen mode on phones, a large area at the top of the screen was left unused. Also fixed an issue where the Obsidian Mobile navigation bar could overlap the Excalidraw toolbar.
|
||||
- The link indicator in the top-right corner would remain visible even when an element was set to transparent [#2625](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2625)
|
||||
- Importing PDFs with mixed page sizes could produce distorted pages [#2578](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2578)
|
||||
- Some PDFs failed to load when importing PDFs as images (notably documents using JPEG2000-compressed images). Also improved handling of certain color profiles and cases where text rendered with missing/incorrect glyphs.
|
||||
- A long-standing export issue: when exporting in a theme different from the current view (e.g., viewing in dark mode but exporting in light mode), nested Excalidraw images containing bitmap images could export with inverted colors.
|
||||
`,
|
||||
"2.19.2":`
|
||||
## Fixed
|
||||
- Minor fixes to the link autocomplete functionality:
|
||||
- Link suggester "eats up text" [#2603](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2603)
|
||||
- "!" triggers the link suggester prematurely
|
||||
- "\[\[" will now be auto-completed to "\[\[]]". Note, this is not available in MindMap Builder currently.
|
||||
|
||||
## New
|
||||
- When a persistent Excalidraw script is updated via the script store, it will now automatically reload so the new script takes effect immediately.
|
||||
|
||||
`,
|
||||
"2.19.1":`
|
||||
## Fixed
|
||||
- Excalidraw pointer offset issue on Obsidian Mobile 1.11.4 [#2607](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2607)
|
||||
|
||||
## New
|
||||
- Inline autocomplete link suggester now supports Heading sections and block references.
|
||||
- Escaped "\\\\[" will now be rendered as "[" in text elements.
|
||||
- Scaling the LaTeX element when the formula is updated. [#2604](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2604) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
|
||||
|
||||
## New in ExcalidrawAutomate
|
||||
- Added PDF++ image link support to the \`addImage()\` function.
|
||||
|
||||
`,
|
||||
"2.19.0":`
|
||||
<div class="excalidraw-videoWrapper">
|
||||
<a href="https://www.youtube.com/watch?v=qY66yoobaX4" target="_blank"><img src ="https://i.ytimg.com/vi/qY66yoobaX4/maxresdefault.jpg" style="width:100%;"></a>
|
||||
</div>
|
||||
|
||||
## New
|
||||
- 🚀🎉🍾 Added **inline link autocomplete** to text element editing and element link editing. Simply start typing "[[" as you would in a normal markdown document.
|
||||
- ‼️ removed add link button element-link editor on desktop
|
||||
- ‼️ removed add link from context menu on desktop
|
||||
- ‼️ added new setting under "Links, transclusion and TODOs" **Sync text-element link with text**
|
||||
- The default behavior is OFF, because it feels more natural to manage the element link separately.
|
||||
- When enabled (ON), Excalidraw matches pre-2.19.0 behavior: the first link in the text body is always copied to the element link field. SVG/PNG exports only keep links when the element link field holds a single link (not links inside the text body). Turn this ON if you rely on text-body links and want the element link to always mirror the first one. Turn it OFF if you manage the element link separately: for metadata like tags, inline link ontologies, or multiple links, e.g., dataview-style notes like '(reminds me of:: [[link]]) #noteToSelf'.
|
||||
- LaTeX formula is saved to \`element.customData.latex\`. This can be helpful for various automation use cases.
|
||||
- Implemented Color Picker in Custom Pen Settings to pick from the current view's color palette.
|
||||
- Updated the **Scribble Helper** script with the new Color Picker to select the text color.
|
||||
- Updated the **Shade Maser** script with the new Color Picker to select the shading color.
|
||||
- **Mindmap Builder**
|
||||
- Uses new sidepanel, persistent across different drawings and autostarts with Obsidian.
|
||||
- You can now configure hotkeys
|
||||
- Allows editing node text in place
|
||||
- You can define your own color palette for branches
|
||||
- Improved auto-layout algorithm to work better with larger subtrees
|
||||
- Includes inline link suggester
|
||||
- Image and Embeddable nodes
|
||||
|
||||
## Fixed
|
||||
- Floating modal used by Excalidraw scripts did not work correctly in Obisidian popout windows.
|
||||
- In onPaste if \`imageElement.customData.latex\` is present, it will treat the pasted images as a LaTeX formula, even if copied from Excalidraw.com or another Obsidian Vault.
|
||||
|
||||
## New & fixed in ExcalidrawAutomate
|
||||
- \`ea.toClipboard()\` will now include the DataURL for included images from \`ea.imagesDict\`
|
||||
- Implemented Excalidraw Sidepanel API for ExcalidrawAutomate. Scripts can now create custom Obsidian sidepanel tabs in the Excalidraw Sidepanel.
|
||||
- New Command Palette action: "Open Excalidraw Sidepanel" will toggle the sidepanel visibility.
|
||||
- The demo script making full use of the new sidepanel API is [Mindmap Builder](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Mindmap%20Builder.md).
|
||||
- [ExcalidrawAutomate full library for LLM training.md](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/refs/heads/master/docs/AITrainingData/ExcalidrawAutomate%20full%20library%20for%20LLM%20training.md) includes all necessary training information to use sidepanels.
|
||||
- Added palette popover helper \`showColorPicker()\` (also used in Pen Settings and Mindmap Builder) to pick from the current view's canvas/element palettes.
|
||||
- Added inline link suggester helper \`attachInlineLinkSuggester()\` returning a KeyBlocker interface so host scripts can suppress their own keydown handlers while the suggester is active.
|
||||
|
||||
New functions in ExcalidrawAutomate. See also [SidepanelTab](https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/src/types/sidepanelTabTypes.ts) type definition.
|
||||
|
||||
\`\`\`ts
|
||||
sidepanelTab: ExcalidrawSidepanelTab | null;
|
||||
checkForActiveSidepanelTabForScript(scriptName?: string): ExcalidrawSidepanelTab | null;
|
||||
createSidepanelTab(title: string, persist?: boolean, reveal?: boolean): Promise<ExcalidrawSidepanelTab | null>;
|
||||
getSidepanelLeaf(): WorkspaceLeaf | null;
|
||||
toggleSidepanelView(): void;
|
||||
persistSidepanelTab(): ExcalidrawSidepanelTab | null;
|
||||
attachInlineLinkSuggester(inputEl: HTMLInputElement, widthWrapper?: HTMLElement): KeyBlocker;
|
||||
getViewColorPalette(palette: "canvasBackground"|"elementBackground"|"elementStroke"): (string[] | string)[];
|
||||
showColorPicker(anchorElement: HTMLElement, palette: "canvasBackground"|"elementBackground"|"elementStroke", includeSceneColors: boolean = true): Promise<string | null>;
|
||||
\`\`\`
|
||||
|
||||
- **setView() improvements**
|
||||
- Calling \`setView()\` now picks a sensible target automatically:
|
||||
- It prefers the **currently active Excalidraw view**.
|
||||
- If no active Excalidraw view is found (e.g., the user is focused on a different tab like the File Explorer/sidebar), it will fall back to the **last active Excalidraw view (as long as it is still available)** — typically the drawing the user came from.
|
||||
- **New selector**: \`"auto"\` (equivalent to calling \`setView()\`).
|
||||
- Useful when you also want to reveal/focus the view: \`setView("auto", true)\`.
|
||||
- **Deprecated selectors**: \`"active"\` and \`"first"\` are deprecated and kept only for backward compatibility.
|
||||
- Recommended usage is either \`setView()\`, \`setView("auto")\`, or \`setView(excalidrawView)\` (explicitly target a specific view).
|
||||
|
||||
\`\`\`ts
|
||||
setView(view?: ExcalidrawView | "auto" | "first" | "active" | null, show: boolean = false)
|
||||
\`\`\`
|
||||
`,
|
||||
"2.18.3":`
|
||||
<div class="excalidraw-videoWrapper">
|
||||
<a href="https://www.youtube.com/watch?v=dZguonMP2KU" target="_blank"><img src ="https://i.ytimg.com/vi/dZguonMP2KU/maxresdefault.jpg" style="width:100%;"></a>
|
||||
</div>
|
||||
|
||||
## New
|
||||
- Added Mindmap Builder script to the store.
|
||||
- LaTeX Suit Integration by [@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
|
||||
- Added Linear Calendar Generator script to the store. 🙏 [@iwanhoogendoorn](https://github.com/iwanhoogendoorn)
|
||||
|
||||
## Fixed
|
||||
- YouTube video embeds working on iOS [#2569](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2569)
|
||||
- Stroke color setting for Embeddedables (markdown notes, websites) is missing after 2.17.0 update [#2580](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2580)
|
||||
- Context menu paste pastes in image twice [#10542](https://github.com/excalidraw/excalidraw/issues/10542)
|
||||
|
||||
## New in ExcalidrawAutomate
|
||||
- Added 3 new helper functions for working with Script Engine settings (safe during initialization when \`scriptEngineSettings[activeScript]\` is \`undefined\` / \`null\`):
|
||||
- \`setScriptSettingValue(key: string, value: ScriptSettingValue): void\`
|
||||
- \`getScriptSettingValue(key: string, defaultValue: ScriptSettingValue): ScriptSettingValue\`
|
||||
- \`saveScriptSettings(): Promise<void>\`
|
||||
|
||||
- Updated \`addArrow()\` to support the new Excalidraw binding options:
|
||||
- \`startBindMode?: "inside" | "orbit"\`
|
||||
- \`endBindMode?: "inside" | "orbit"\`
|
||||
- \`startFixedPoint?: [number, number]\`
|
||||
- \`endFixedPoint?: [number, number]\`
|
||||
- \`elbowed?: boolean\`
|
||||
|
||||
\`\`\`ts
|
||||
/**
|
||||
* Returns an object describing the bound text element.
|
||||
* If a text element is provided:
|
||||
* - returns { eaElement } if the element is in ea.elementsDict
|
||||
* - else (if searchInView is true) returns { sceneElement } if found in the targetView scene
|
||||
* If a container element is provided, searches for the bound text element:
|
||||
* - returns { eaElement } if found in ea.elementsDict
|
||||
* - else (if searchInView is true) returns { sceneElement } if found in the targetView scene
|
||||
* If not found, returns {}.
|
||||
* Does not add the text element to elementsDict.
|
||||
* @param element
|
||||
* @param searchInView - If true, searches in the targetView elements if not found in elementsDict.
|
||||
* @returns Object containing either eaElement or sceneElement or empty if not found.
|
||||
*/
|
||||
getBoundTextElement(element: ExcalidrawElement, searchInView: boolean = false): {
|
||||
eaElement?: Mutable<ExcalidrawTextElement>,
|
||||
sceneElement?: ExcalidrawTextElement
|
||||
};
|
||||
\`\`\`
|
||||
`,
|
||||
"2.18.2":`
|
||||
## Fixed
|
||||
- Stroke palette menu for embedded notes is gone after 2.17 update [#2580](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2580)
|
||||
- Cannot link to group [#2579](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2579)
|
||||
|
||||
`,
|
||||
"2.18.1":`
|
||||
## New
|
||||
- Improved the **Copy [[link]] for selected elements** context-menu action:
|
||||
- Added an optional checkbox to append the \`|100%\` anchor to the copied link.
|
||||
- Added an option to copy by **frame name** (instead of frame ID) when the frame is named.
|
||||
|
||||
## Fixed
|
||||
- Prevented unnecessary \`data.json\` saves each time a drawing is opened. [#2562](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2562)
|
||||
- Fixed angle snapping when a line passes over an object.
|
||||
- Fixed hover preview when referencing a frame by name in an image reference.
|
||||
- Fixed “Back of note” card insertion breaking LaTeX equations in existing cards. [#2296](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2296) 🙏[@TravisLEBLANC1](https://github.com/TravisLEBLANC1)
|
||||
- Adjusted hover-preview sizing to more closely match embeds. [#2525](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2575) 🙏[parkero](https://github.com/parkero)
|
||||
`,
|
||||
"2.18.0":`
|
||||
## New from Excalidraw.com
|
||||
- New arrow behavior allows binding arrows to the inside of Shapes. 🙏[mtolmacs](https://github.com/mtolmacs), [dwelle](https://github.com/dwelle) [#9670](https://github.com/excalidraw/excalidraw/pull/9670)
|
||||
- 🔥🔥🔥 New arrow behavior allows binding arrows to the inside of shapes and image! 🙏[mtolmacs](https://github.com/mtolmacs), [dwelle](https://github.com/dwelle) [#9670](https://github.com/excalidraw/excalidraw/pull/9670)
|
||||
|
||||
## New
|
||||
- New option in the Export Dialog to **include/exclude internal links** when exporting to SVG or PDF.
|
||||
@@ -28,6 +201,12 @@ I build this plugin in my free time, as a labor of love. Curious about the philo
|
||||
- By default, internal links are included in exports.
|
||||
- Use the new document property: \`export-internal-links: false\` to disable exporting internal links on a per-drawing basis.
|
||||
|
||||
## Fixed
|
||||
- Memory leak issues
|
||||
- Potential fix to Backspace and CTRL+V stopping working in text elements after extended use of Excalidraw.
|
||||
- Improved detection of on-screen keyboard on mobile devices. (issue reported on [Discord](https://discord.com/channels/1026825302900494357/1444652800360316959))
|
||||
- Insert any file, insert LaTeX and some other dialogs got hidden behind the on-screen keyboard on mobile devices. Dialogs appear at the top of the screen now on mobile devices.
|
||||
|
||||
## New in ExcalidrawAutomate
|
||||
- **createSVG()** now exposes convertMarkdownLinksToObsidianURLs and includeInternalLinks parameters.
|
||||
\`\`\`ts
|
||||
@@ -198,54 +377,4 @@ public getViewCenterPosition(): {x:number, y:number};
|
||||
):ExcalidrawElement[]
|
||||
\`\`\`
|
||||
`,
|
||||
"2.14.3":`
|
||||
<div class="excalidraw-videoWrapper">
|
||||
<a href="https://www.youtube.com/watch?v=29EWeglRm7s" target="_blank"><img src ="https://i.ytimg.com/vi/29EWeglRm7s/maxresdefault.jpg" style="width:100%;"></a>
|
||||
</div>
|
||||
|
||||
Updated the Printable Layout Wizard script with the option to exclude empty pages.
|
||||
|
||||
## Fixed
|
||||
- If a frame is locked, elements created over the frame or dragged over the frame should not be auto-added to the frame. [#9850](https://github.com/excalidraw/excalidraw/issues/9850)
|
||||
|
||||
## Fixed in ExcalidrawAutomate
|
||||
- Not all AppState properties were being correctly copied to the template when creating a new drawing with ea.create() [#2440](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2440)
|
||||
`,
|
||||
"2.14.2":`
|
||||
## Fixed
|
||||
- Converting Markdown to Excalidraw ("Back of note"/"Convert markdown to ExcaliDrawing") no longer appends T00:00:00.000Z to an existing date frontmatter field and handles merging of lists such as tags intelligently [#2414](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2414)
|
||||
- Multi‑point line creation on touchscreens (tap–tap–tap) produced a horizontal line after using a pen. Fixed. [#9840](https://github.com/excalidraw/excalidraw/pull/9840#issuecomment-3165319266)
|
||||
|
||||
## New
|
||||
- Zoom settings (Settings → Excalidraw → Appearance and Behavior → Zoom) [#2434](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2434):
|
||||
- Zoom increment (default 5%) to fine‑tune mouse wheel / gesture precision.
|
||||
- Minimum zoom (default 10%) controls how far you can zoom out (below 10% may be unstable—use with caution).
|
||||
- Maximum zoom (default 3000%) defines the upper zoom limit.
|
||||
- Palm Guard script (in script store): Mobile-friendly drawing mode for stylus users. Enters fullscreen, hides UI, shows a draggable minimal toolbar (toggle + exit) to prevent accidental palm taps; single tap to exit. Inspired by [#2409](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2409)
|
||||
|
||||
<div class="excalidraw-videoWrapper">
|
||||
<a href="https://www.youtube.com/watch?v=A_udjVjgWN0" target="_blank"><img src ="https://i.ytimg.com/vi/A_udjVjgWN0/maxresdefault.jpg" style="width:100%;"></a>
|
||||
</div>
|
||||
|
||||
## ExcalidrawAutomate
|
||||
- Improved \`FloatingModal\` behavior. Floating Modal now does not trap keyboard events, the header element does not block "X" button in the top right corner, all four corners are rounded on Mobile Devices.
|
||||
|
||||
`,
|
||||
"2.14.1":`
|
||||
## Fixed
|
||||
- Excalidraw broke Obsidian's UI in Arabic, Persian, and Hebrew due to LTR, RTL conflict. [#2423](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2423)
|
||||
- Styling issues impacting native Obsidian search/replace dialogs. [#2420](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2420)
|
||||
- Now using native Obsidian attachment location function. 🙏 [mnaoumov](https://github.com/mnaoumov) [#2421](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2421), potentially fixes [#179](https://github.com/RainCat1998/obsidian-custom-attachment-location/issues/179) of the Obsidian Custom Attachment Location plugin issue.
|
||||
|
||||
## New
|
||||
- New frontmatter option \`excalidraw-embed-md\`. When set to \`true\`, embedding the drawing into a markdown note will render the "back of the note" (its markdown content) instead of rendering it as an image.
|
||||
- If you want to always display the drawing as an image, even when \`excalidraw-embed-md\` is enabled, use the special embed syntax: \`![[drawing#^as-image]]\`. Here, \`as-image\` is a phantom block reference that forces image rendering.
|
||||
- Added Spanish translation by [@Joakim31](https://github.com/Joakim31) [#2425](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2425)
|
||||
- Incremental minor updates from the main [Excalidraw project](https://github.com/excalidraw/excalidraw).
|
||||
`,
|
||||
"2.14.0":`
|
||||
## A Big "Small" Update
|
||||
- Added search to Excalidraw Settings, plus added a link to access the public NotebookLM workbook pre-loaded with everything about the plugin
|
||||
- New Taiwan-idiomatic Traditional Chinese translation by [@rlan](https://github.com/rlan) [#2413](https://github.com/zsviczian/obsidian-excalidraw-plugin/pull/2413)
|
||||
`,
|
||||
};
|
||||
@@ -9,6 +9,7 @@ import { getExcalidrawViews } from "src/utils/obsidianUtils";
|
||||
import { PENS } from "src/utils/pens";
|
||||
import { fragWithHTML } from "src/utils/utils";
|
||||
import { __values } from "tslib";
|
||||
import { showColorPicker } from "./ColorPicker";
|
||||
|
||||
const EASINGFUNCTIONS: Record<string,string> = {
|
||||
linear: "linear",
|
||||
@@ -55,7 +56,6 @@ export class PenSettingsModal extends Modal {
|
||||
) {
|
||||
super(plugin.app);
|
||||
this.api = view.excalidrawAPI;
|
||||
|
||||
}
|
||||
|
||||
onOpen(): void {
|
||||
@@ -157,6 +157,7 @@ export class PenSettingsModal extends Modal {
|
||||
let scSetting: Setting;
|
||||
let sccpComponent: ColorComponent;
|
||||
let sctComponent: TextComponent;
|
||||
let strokeUseCurrentToggle: ToggleComponent;
|
||||
let strokeSetting: Setting;
|
||||
let [sHex, sOpacity] = hexColor(ps.strokeColor);
|
||||
let sChangeBounce:boolean = false;
|
||||
@@ -164,7 +165,8 @@ export class PenSettingsModal extends Modal {
|
||||
strokeSetting = new Setting(ce)
|
||||
.setName(fragWithHTML(!Boolean(ps.strokeColor) ? "Stroke color: <b>Current</b>" : "Stroke color: <b>Preset color</b>"))
|
||||
.setDesc(fragWithHTML("Use <b>current</b> stroke color of the canvas, or set a specific <b>preset color</b> for the pen"))
|
||||
.addToggle(toggle =>
|
||||
.addToggle(toggle => {
|
||||
strokeUseCurrentToggle = toggle;
|
||||
toggle
|
||||
.setValue(!Boolean(ps.strokeColor))
|
||||
.onChange(value=> {
|
||||
@@ -181,8 +183,8 @@ export class PenSettingsModal extends Modal {
|
||||
}
|
||||
ps.strokeColor = sctComponent.getValue();
|
||||
}
|
||||
})
|
||||
)
|
||||
});
|
||||
})
|
||||
|
||||
scSetting = new Setting(ce)
|
||||
.setName("Select stroke color")
|
||||
@@ -225,8 +227,22 @@ export class PenSettingsModal extends Modal {
|
||||
ps.strokeColor = value + sOpacity;
|
||||
sctComponent.setValue(value + sOpacity);
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
.addButton(button => {
|
||||
button
|
||||
.setIcon("swatch-book")
|
||||
.onClick(async () => {
|
||||
const selected = await showColorPicker("elementStroke", button.buttonEl, this.view, true);
|
||||
if(!selected) {return;}
|
||||
strokeUseCurrentToggle?.setValue(false);
|
||||
sChangeBounce = true;
|
||||
[sHex, sOpacity] = hexColor(selected);
|
||||
ps.strokeColor = selected;
|
||||
sctComponent.setValue(selected);
|
||||
if(sHex) {sccpComponent.setValue(sHex);}
|
||||
});
|
||||
})
|
||||
|
||||
scSetting.settingEl.style.display = !Boolean(ps.strokeColor) ? "none" : "";
|
||||
|
||||
@@ -236,13 +252,15 @@ export class PenSettingsModal extends Modal {
|
||||
let bgcpComponent: ColorComponent;
|
||||
let bgctComponent: TextComponent;
|
||||
let bgtComponent: ToggleComponent;
|
||||
let bgUseCurrentToggle: ToggleComponent;
|
||||
let fsSetting: Setting;
|
||||
let [bgHex, bgOpacity] = hexColor(ps.backgroundColor);
|
||||
|
||||
bgSetting = new Setting(ce)
|
||||
.setName(fragWithHTML(!Boolean(ps.backgroundColor) ? "Background color: <b>Current</b>" : "Background color: <b>Preset color</b>"))
|
||||
.setDesc(fragWithHTML("Toggle to use the <b>current background color</b> of the canvas; or a <b>preset color</b>"))
|
||||
.addToggle(toggle =>
|
||||
.addToggle(toggle => {
|
||||
bgUseCurrentToggle = toggle;
|
||||
toggle
|
||||
.setValue(!Boolean(ps.backgroundColor))
|
||||
.onChange(value=> {
|
||||
@@ -260,8 +278,8 @@ export class PenSettingsModal extends Modal {
|
||||
}
|
||||
bgtComponent.setValue(false);
|
||||
}
|
||||
})
|
||||
)
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
bgctSetting = new Setting(ce)
|
||||
@@ -325,6 +343,21 @@ export class PenSettingsModal extends Modal {
|
||||
bgctComponent.setValue(value+bgOpacity)
|
||||
})
|
||||
})
|
||||
.addButton(button => {
|
||||
button
|
||||
.setIcon("swatch-book")
|
||||
.onClick(async () => {
|
||||
const selected = await showColorPicker("elementBackground", button.buttonEl, this.view, true);
|
||||
if(!selected) {return;}
|
||||
bgUseCurrentToggle?.setValue(false);
|
||||
bgtComponent?.setValue(false);
|
||||
bgChangeBounce = true;
|
||||
[bgHex, bgOpacity] = hexColor(selected);
|
||||
ps.backgroundColor = selected;
|
||||
bgctComponent.setValue(selected);
|
||||
if(bgHex) {bgcpComponent.setValue(bgHex);}
|
||||
});
|
||||
})
|
||||
|
||||
bgcSetting.settingEl.style.display = (!Boolean(ps.backgroundColor) || ps.backgroundColor==="transparent") ? "none" : "";
|
||||
|
||||
|
||||
+233
-51
@@ -8,6 +8,7 @@ import {
|
||||
TFile,
|
||||
Notice,
|
||||
TextAreaComponent,
|
||||
getIcon,
|
||||
} from "obsidian";
|
||||
import ExcalidrawView from "../../view/ExcalidrawView";
|
||||
import ExcalidrawPlugin from "../../core/main";
|
||||
@@ -23,6 +24,11 @@ import { REGEX_LINK, REGEX_TAGS } from "../ExcalidrawData";
|
||||
import { ScriptEngine } from "../Scripts";
|
||||
import { openExternalLink, openTagSearch, parseObsidianLink } from "src/utils/excalidrawViewUtils";
|
||||
import { ButtonDefinition } from "src/types/promptTypes";
|
||||
import { EditorView, keymap } from "@codemirror/view";
|
||||
import { history } from "@codemirror/commands";
|
||||
import { parser } from "./math-only";
|
||||
import { LRLanguage } from "@codemirror/language";
|
||||
import { editorLivePreviewField } from "obsidian";
|
||||
|
||||
export class Prompt extends Modal {
|
||||
private promptEl: HTMLInputElement;
|
||||
@@ -79,6 +85,149 @@ export class Prompt extends Modal {
|
||||
}
|
||||
}
|
||||
|
||||
export class LaTexPrompt extends Modal {
|
||||
public waitForClose : Promise<string>;
|
||||
private promptEl: HTMLInputElement;
|
||||
private resolvePromise: (input: string) => void;
|
||||
private rejectPromise: (reason?: any) => void;
|
||||
private editorView : EditorView;
|
||||
private latexsSuitePlugin : any;
|
||||
|
||||
protected constructor(
|
||||
app: App,
|
||||
private prompt_text: string,
|
||||
private default_value?: string,
|
||||
) {
|
||||
super(app);
|
||||
this.titleEl.setText(this.prompt_text);
|
||||
this.contentEl.addClass("excalidraw-LatexPrompt");
|
||||
this.latexsSuitePlugin = app.plugins.plugins["obsidian-latex-suite"];
|
||||
const mainContentContainer: HTMLDivElement = this.contentEl.createDiv();
|
||||
this.display(default_value, mainContentContainer);
|
||||
this.waitForClose = new Promise<string>((resolve, reject) => {
|
||||
this.resolvePromise = resolve;
|
||||
this.rejectPromise = reject;
|
||||
});
|
||||
this.editorView.focus();
|
||||
}
|
||||
|
||||
public static Prompt(app: App,
|
||||
prompt_text?: string,
|
||||
default_value?: string,
|
||||
): Promise<string>{
|
||||
const latexprompt = new LaTexPrompt(app, prompt_text, default_value);
|
||||
|
||||
return latexprompt.waitForClose;
|
||||
}
|
||||
|
||||
private display(value : string, container : HTMLDivElement) {
|
||||
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});
|
||||
const extensions = [
|
||||
language,
|
||||
keymap.of([{
|
||||
key:"Mod-Enter",
|
||||
run : () => {this.submitCallback(); return true;}
|
||||
}]),
|
||||
history(),
|
||||
editorLivePreviewField.init(() => false),
|
||||
... this.latexsSuitePlugin.editorExtensions
|
||||
];
|
||||
|
||||
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`);
|
||||
const actionButtonContainer: HTMLDivElement = buttonBarContainer.createDiv();
|
||||
|
||||
this.createButton(
|
||||
actionButtonContainer,
|
||||
"",
|
||||
this.submitCallback.bind(this),
|
||||
t("PROMPT_BUTTON_OK") ?? "",
|
||||
undefined,
|
||||
"check"
|
||||
).setCta().buttonEl.style.marginRight = "0";
|
||||
this.createButton(
|
||||
actionButtonContainer,
|
||||
"",
|
||||
this.cancelCallback.bind(this),
|
||||
t("PROMPT_BUTTON_CANCEL"),
|
||||
undefined,
|
||||
"x"
|
||||
);
|
||||
this.open();
|
||||
}
|
||||
|
||||
private createButton(container: HTMLElement,
|
||||
text: string,
|
||||
callback: (evt: MouseEvent) => any,
|
||||
tooltip: string = "",
|
||||
margin: string = "5px",
|
||||
iconId?:string,
|
||||
){
|
||||
const btn = new ButtonComponent(container);
|
||||
btn.buttonEl.style.padding = "0.5em";
|
||||
btn.buttonEl.style.marginLeft = margin;
|
||||
btn.setTooltip(tooltip);
|
||||
|
||||
if (iconId) {
|
||||
btn.setIcon(iconId);
|
||||
} else {
|
||||
btn.setButtonText(text);
|
||||
}
|
||||
|
||||
btn.onClick(callback);
|
||||
return btn;
|
||||
}
|
||||
|
||||
private submitCallback(){
|
||||
const res = this.editorView.state.doc.toString();
|
||||
if (res.trim().length == 0) {
|
||||
this.rejectPromise("empty latex");
|
||||
} else {
|
||||
this.resolvePromise(res);
|
||||
}
|
||||
this.close();
|
||||
}
|
||||
|
||||
private cancelCallback(){
|
||||
this.rejectPromise("Canceled input");
|
||||
this.close();
|
||||
}
|
||||
|
||||
onOpen(): void {
|
||||
super.onOpen();
|
||||
this.editorView.focus();
|
||||
}
|
||||
|
||||
onClose(): void {
|
||||
this.contentEl.empty();
|
||||
this.editorView.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
export class GenericInputPrompt extends Modal {
|
||||
public waitForClose: Promise<string>;
|
||||
private view: ExcalidrawView;
|
||||
@@ -101,6 +250,26 @@ export class GenericInputPrompt extends Modal {
|
||||
private draggable: boolean = false;
|
||||
private cleanupDragListeners: (() => void) | null = null;
|
||||
|
||||
// Add event handler instance properties
|
||||
private handleKeyDown = (evt: KeyboardEvent) => {
|
||||
if ((evt.key === "Enter" && this.lines === 1) || (isWinCTRLorMacCMD(evt) && evt.key === "Enter")) {
|
||||
evt.preventDefault();
|
||||
this.submit();
|
||||
}
|
||||
if (this.displayEditorButtons && evt.key === "k" && isWinCTRLorMacCMD(evt)) {
|
||||
evt.preventDefault();
|
||||
this.linkBtnClickCallback();
|
||||
}
|
||||
};
|
||||
|
||||
private handleCheckCaret = () => {
|
||||
//timer is implemented because on iPad with pencil the button click generates an event on the textarea
|
||||
this.selectionUpdateTimer = this.view.ownerWindow.setTimeout(() => {
|
||||
this.selectionStart = this.inputComponent.inputEl.selectionStart;
|
||||
this.selectionEnd = this.inputComponent.inputEl.selectionEnd;
|
||||
}, 30);
|
||||
};
|
||||
|
||||
public static Prompt(
|
||||
view: ExcalidrawView,
|
||||
plugin: ExcalidrawPlugin,
|
||||
@@ -141,7 +310,7 @@ export class GenericInputPrompt extends Modal {
|
||||
private header: string,
|
||||
placeholder?: string,
|
||||
value?: string,
|
||||
buttons?: { caption: string; action: Function }[],
|
||||
buttons?: ButtonDefinition[],
|
||||
lines?: number,
|
||||
displayEditorButtons?: boolean,
|
||||
customComponents?: (container: HTMLElement) => void,
|
||||
@@ -226,25 +395,15 @@ export class GenericInputPrompt extends Modal {
|
||||
.setValue(value ?? "")
|
||||
.onChange((value) => (this.input = value));
|
||||
|
||||
let i = 0;
|
||||
|
||||
const checkcaret = () => {
|
||||
//timer is implemented because on iPad with pencil the button click generates an event on the textarea
|
||||
this.selectionUpdateTimer = this.view.ownerWindow.setTimeout(() => {
|
||||
this.selectionStart = this.inputComponent.inputEl.selectionStart;
|
||||
this.selectionEnd = this.inputComponent.inputEl.selectionEnd;
|
||||
}, 30);
|
||||
}
|
||||
|
||||
textComponent.inputEl.addEventListener("keydown", this.keyDownCallback.bind(this));
|
||||
textComponent.inputEl.addEventListener('keyup', checkcaret.bind(this)); // Every character written
|
||||
textComponent.inputEl.addEventListener('pointerup', checkcaret.bind(this)); // Click down
|
||||
textComponent.inputEl.addEventListener('touchend', checkcaret.bind(this)); // Click down
|
||||
textComponent.inputEl.addEventListener('input', checkcaret.bind(this)); // Other input events
|
||||
textComponent.inputEl.addEventListener('paste', checkcaret.bind(this)); // Clipboard actions
|
||||
textComponent.inputEl.addEventListener('cut', checkcaret.bind(this));
|
||||
textComponent.inputEl.addEventListener('select', checkcaret.bind(this)); // Some browsers support this event
|
||||
textComponent.inputEl.addEventListener('selectionchange', checkcaret.bind(this));// Some browsers support this event
|
||||
textComponent.inputEl.addEventListener("keydown", this.handleKeyDown);
|
||||
textComponent.inputEl.addEventListener('keyup', this.handleCheckCaret);
|
||||
textComponent.inputEl.addEventListener('pointerup', this.handleCheckCaret);
|
||||
textComponent.inputEl.addEventListener('touchend', this.handleCheckCaret);
|
||||
textComponent.inputEl.addEventListener('input', this.handleCheckCaret);
|
||||
textComponent.inputEl.addEventListener('paste', this.handleCheckCaret);
|
||||
textComponent.inputEl.addEventListener('cut', this.handleCheckCaret);
|
||||
textComponent.inputEl.addEventListener('select', this.handleCheckCaret);
|
||||
textComponent.inputEl.addEventListener('selectionchange', this.handleCheckCaret);
|
||||
|
||||
return textComponent;
|
||||
}
|
||||
@@ -255,12 +414,20 @@ export class GenericInputPrompt extends Modal {
|
||||
callback: (evt: MouseEvent) => any,
|
||||
tooltip: string = "",
|
||||
margin: string = "5px",
|
||||
iconId?:string,
|
||||
) {
|
||||
const btn = new ButtonComponent(container);
|
||||
btn.buttonEl.style.padding = "0.5em";
|
||||
btn.buttonEl.style.marginLeft = margin;
|
||||
btn.setTooltip(tooltip);
|
||||
btn.setButtonText(text).onClick(callback);
|
||||
|
||||
if (iconId) {
|
||||
btn.setIcon(iconId);
|
||||
} else {
|
||||
btn.setButtonText(text);
|
||||
}
|
||||
|
||||
btn.onClick(callback);
|
||||
return btn;
|
||||
}
|
||||
|
||||
@@ -276,13 +443,17 @@ export class GenericInputPrompt extends Modal {
|
||||
const btn = new ButtonComponent(actionButtonContainer);
|
||||
btn.buttonEl.style.marginLeft="5px";
|
||||
if(button.tooltip) btn.setTooltip(button.tooltip);
|
||||
btn.setButtonText(button.caption).onClick((evt: MouseEvent) => {
|
||||
const res = button.action(this.input);
|
||||
if (res) {
|
||||
this.input = res;
|
||||
}
|
||||
this.submit();
|
||||
});
|
||||
button.iconId
|
||||
? btn.setIcon(button.iconId)
|
||||
: btn.setButtonText(button.caption);
|
||||
button.tooltip && btn.setTooltip(button.tooltip);
|
||||
btn.onClick((evt: MouseEvent) => {
|
||||
const res = button.action(this.input);
|
||||
if (res) {
|
||||
this.input = res;
|
||||
}
|
||||
this.submit();
|
||||
});
|
||||
b = b ?? btn;
|
||||
}
|
||||
if (b) {
|
||||
@@ -292,20 +463,32 @@ export class GenericInputPrompt extends Modal {
|
||||
} else {
|
||||
this.createButton(
|
||||
actionButtonContainer,
|
||||
"✅",
|
||||
"",
|
||||
this.submitClickCallback.bind(this),
|
||||
t("PROMPT_BUTTON_OK") ?? "",
|
||||
"5px",
|
||||
"check",
|
||||
).setCta().buttonEl.style.marginRight = "0";
|
||||
}
|
||||
this.createButton(actionButtonContainer, "❌", this.cancelClickCallback.bind(this), t("PROMPT_BUTTON_CANCEL"));
|
||||
|
||||
this.createButton(
|
||||
actionButtonContainer,
|
||||
"",
|
||||
this.cancelClickCallback.bind(this),
|
||||
t("PROMPT_BUTTON_CANCEL"),
|
||||
"5px",
|
||||
"x",
|
||||
);
|
||||
|
||||
if(this.displayEditorButtons) {
|
||||
this.createButton(editorButtonContainer, "⏎", ()=>this.insertStringBtnClickCallback("\n"), t("PROMPT_BUTTON_INSERT_LINE"), "0");
|
||||
this.createButton(editorButtonContainer, "⌫", this.delBtnClickCallback.bind(this), "Delete");
|
||||
this.createButton(editorButtonContainer, "⎵", ()=>this.insertStringBtnClickCallback(" "), t("PROMPT_BUTTON_INSERT_SPACE"));
|
||||
this.createButton(editorButtonContainer, "§", this.specialCharsBtnClickCallback.bind(this), t("PROMPT_BUTTON_SPECIAL_CHARS"));
|
||||
this.createButton(editorButtonContainer, "", ()=>this.insertStringBtnClickCallback("\n"), t("PROMPT_BUTTON_INSERT_LINE"), "0", "corner-down-left");
|
||||
this.createButton(editorButtonContainer, "", this.delBtnClickCallback.bind(this), "Delete", "5px", "delete");
|
||||
this.createButton(editorButtonContainer, "", ()=>this.insertStringBtnClickCallback(" "), t("PROMPT_BUTTON_INSERT_SPACE"), "5px", "space");
|
||||
this.createButton(editorButtonContainer, "", this.specialCharsBtnClickCallback.bind(this), t("PROMPT_BUTTON_SPECIAL_CHARS"), "5px", "at-sign");
|
||||
if(this.view) {
|
||||
this.createButton(editorButtonContainer, "🔗", this.linkBtnClickCallback.bind(this), t("PROMPT_BUTTON_INSERT_LINK"));
|
||||
this.createButton(editorButtonContainer, "", this.linkBtnClickCallback.bind(this), t("PROMPT_BUTTON_INSERT_LINK"), "5px", "link");
|
||||
}
|
||||
this.createButton(editorButtonContainer, "🔠", this.uppercaseBtnClickCallback.bind(this), t("PROMPT_BUTTON_UPPERCASE"));
|
||||
this.createButton(editorButtonContainer, "", this.uppercaseBtnClickCallback.bind(this), t("PROMPT_BUTTON_UPPERCASE"), "5px", "arrow-big-up");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,17 +555,6 @@ export class GenericInputPrompt extends Modal {
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
private keyDownCallback = (evt: KeyboardEvent) => {
|
||||
if ((evt.key === "Enter" && this.lines === 1) || (isWinCTRLorMacCMD(evt) && evt.key === "Enter")) {
|
||||
evt.preventDefault();
|
||||
this.submit();
|
||||
}
|
||||
if (this.displayEditorButtons && evt.key === "k" && isWinCTRLorMacCMD(evt)) {
|
||||
evt.preventDefault();
|
||||
this.linkBtnClickCallback();
|
||||
}
|
||||
};
|
||||
|
||||
private submit() {
|
||||
this.didSubmit = true;
|
||||
this.close();
|
||||
@@ -401,10 +573,18 @@ export class GenericInputPrompt extends Modal {
|
||||
}
|
||||
|
||||
private removeInputListener() {
|
||||
this.inputComponent?.inputEl?.removeEventListener(
|
||||
"keydown",
|
||||
this.keyDownCallback,
|
||||
);
|
||||
if (!this.inputComponent?.inputEl) return;
|
||||
|
||||
const inputEl = this.inputComponent.inputEl;
|
||||
inputEl.removeEventListener("keydown", this.handleKeyDown);
|
||||
inputEl.removeEventListener('keyup', this.handleCheckCaret);
|
||||
inputEl.removeEventListener('pointerup', this.handleCheckCaret);
|
||||
inputEl.removeEventListener('touchend', this.handleCheckCaret);
|
||||
inputEl.removeEventListener('input', this.handleCheckCaret);
|
||||
inputEl.removeEventListener('paste', this.handleCheckCaret);
|
||||
inputEl.removeEventListener('cut', this.handleCheckCaret);
|
||||
inputEl.removeEventListener('select', this.handleCheckCaret);
|
||||
inputEl.removeEventListener('selectionchange', this.handleCheckCaret);
|
||||
}
|
||||
|
||||
private specialCharsBtnClickCallback = (evt: MouseEvent) => {
|
||||
@@ -477,6 +657,8 @@ export class GenericInputPrompt extends Modal {
|
||||
|
||||
onOpen() {
|
||||
super.onOpen();
|
||||
this.modalEl.classList.add("excalidraw-modal");
|
||||
this.containerEl.classList.add("excalidraw-modal");
|
||||
this.inputComponent.inputEl.focus();
|
||||
this.inputComponent.inputEl.select();
|
||||
|
||||
|
||||
@@ -202,6 +202,22 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
desc: "Get single element from ExcalidrawAutomate elementsDict",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "getBoundTextElement",
|
||||
code:
|
||||
"getBoundTextElement(element: ExcalidrawElement, searchInView?: boolean): { eaElement?: Mutable<ExcalidrawTextElement>; sceneElement?: ExcalidrawTextElement; };",
|
||||
desc:
|
||||
"Returns an object describing the bound text element.\n" +
|
||||
"If a text element is provided:\n" +
|
||||
" - returns { eaElement } if the element is in ea.elementsDict\n" +
|
||||
" - else (if searchInView is true) returns { sceneElement } if found in the targetView scene\n" +
|
||||
"If a container element is provided, searches for the bound text element:\n" +
|
||||
" - returns { eaElement } if found in ea.elementsDict\n" +
|
||||
" - else (if searchInView is true) returns { sceneElement } if found in the targetView scene\n" +
|
||||
"If not found, returns {}.\n" +
|
||||
"Does not add the text element to elementsDict.",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "create",
|
||||
code: 'async create(params?: {filename?: string, foldername?: string, templatePath?: string, onNewPane?: boolean, silent?: boolean, frontmatterKeys?: {},}): Promise<string>;',
|
||||
@@ -388,26 +404,39 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
},
|
||||
{
|
||||
field: "addArrow",
|
||||
code: "addArrow(points: [[x: number, y: number]], formatting?: { startArrowHead?: string; endArrowHead?: string; startObjectId?: string; endObjectId?: string;}, id?:string): string;",
|
||||
desc: `valid values for startArrowHead and endArrowHead are: "arrow"|"bar"|"circle"|"circle_outline"|"triangle"|"triangle_outline"|"diamond"|"diamond_outline"|null`,
|
||||
code:
|
||||
'addArrow(points: [x: number, y: number][], formatting?: { startArrowHead?: string; endArrowHead?: string; startObjectId?: string; endObjectId?: string; startBindMode?: string; endBindMode?: string; startFixedPoint?: [number, number]; endFixedPoint?: [number, number]; elbowed?: boolean}, id?: string): string;',
|
||||
desc:
|
||||
"Adds an arrow element.\n" +
|
||||
'Arrowheads: "arrow"|"bar"|"circle"|"circle_outline"|"triangle"|"triangle_outline"|"diamond"|"diamond_outline"|null.\n' +
|
||||
'Bindings: "inside" | "outside" Sets startObjectId/endObjectId to bind the arrow ends to shapes. Bind mode: "orbit" (default) or "inside".\n' +
|
||||
"Fixed point: [xRatio,yRatio] in 0..1 (percentage of bound element width/height) to bind to a specific point on the element. In case of orbit mode, the orbit will happen around this immaginary point.\n" +
|
||||
"Elbowed: true will create an elbowed arrow.",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "addImage",
|
||||
code: "async addImage(opts: {topX: number, topY: number, imageFile: TFile|string, scale?: boolean, anchor?: boolean, colorMap?: ColorMap}): Promise<string>;",
|
||||
desc: "imageFile may be a TFile or a string that contains a hyperlink.\n"+
|
||||
"imageFile may also be an obsidian filepath including a reference eg.: 'path/my.pdf#page=3'\n"+
|
||||
"Set scale to false if you want to embed the image at 100% of its original size. Default is true which will insert a scaled image.\n"+
|
||||
"anchor will only be evaluated if scale is false. anchor true will add |100% to the end of the filename, resulting in an image that will always pop back to 100% when the source file is updated or when the Excalidraw file is reopened.\n"+
|
||||
"colorMap is only used for SVG images and nested Excalidraw images. See the Shade Master script and the Deconstruct Selected Elements script for examples using colorMap.\n"+
|
||||
desc: "imageFile may be a TFile or a string that contains a hyperlink.\n" +
|
||||
"imageFile may also be an obsidian filepath including a reference eg.: 'path/my.pdf#page=3'\n" +
|
||||
"Set scale to false if you want to embed the image at 100% of its original size. Default is true which will insert a scaled image.\n" +
|
||||
"anchor will only be evaluated if scale is false. anchor true will add |100% to the end of the filename, resulting in an image that will always pop back to 100% when the source file is updated or when the Excalidraw file is reopened.\n" +
|
||||
"colorMap is only used for SVG images and nested Excalidraw images. See the Shade Master script and the Deconstruct Selected Elements script for examples using colorMap.\n" +
|
||||
"type ColorMap = { [color: string]: string; }",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "addEmbeddable",
|
||||
code: "addEmbeddable(topX: number, topY: number, width: number, height: number, url?: string, file?: TFile, embeddableCustomData?: EmbeddableMDCustomProps): string;",
|
||||
desc: "Adds an iframe/webview (depending on content and platform) to the drawing. If url is not null then the iframe/webview will be loaded from the url. The url maybe a markdown link to an note in the Vault or a weblink. " +
|
||||
"If url is null then the iframe/webview will be loaded from the file. Both the url and the file may not be null.<br>" + EMBEDDABLE_MDCUSTOMPROPS,
|
||||
desc: "Adds an embeddable component (technically an iframe or webview depending on content and platform) to the drawing. If url is not null then the embeddable will be loaded from the url. The url maybe a markdown link to an note in the Vault or a weblink. " +
|
||||
"If url is null then the embeddable will be loaded from the file. Both the url and the file may not be null.<br>" + EMBEDDABLE_MDCUSTOMPROPS,
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "addIFrame",
|
||||
code: "addIFrame(topX: number, topY: number, width: number, height: number, url?: string, file?: TFile, html?: string): string;",
|
||||
desc: "If the url or file attribute is provided then the iframe will insert an embeddable component (technically calling ea.addEmbeddable() in the background with the same parameters). The function is depricated in that case use addEmbeddable instead. \n" +
|
||||
"If the html attribute is provided, then the function will create an 'iframe' element with the provided html content.",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
@@ -469,9 +498,18 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
},
|
||||
{
|
||||
field: "setView",
|
||||
code: 'setView(view: ExcalidrawView | "first" | "active"): ExcalidrawView;',
|
||||
desc: null,
|
||||
after: "",
|
||||
code: 'setView(view?: ExcalidrawView | "auto" | "first" | "active" | null, show: boolean = false): ExcalidrawView;',
|
||||
desc: "Sets the target view for EA. All the view operations and the access to Excalidraw API will be performed on this view. " +
|
||||
"Typically you will use setView() (to pick a sensible default) or setView(excalidrawView) (to explicitly target a specific view).\n" +
|
||||
'"auto" is equivalent to calling setView() and can read nicer when you want to show the view (e.g. setView("auto", true)).\n' +
|
||||
'"active" and "first" are deprecated and are kept for backward compatibility.\n' +
|
||||
'If view is null or undefined (or "auto"), EA will pick a sensible default: first the currently active Excalidraw view (if any), otherwise the last active Excalidraw view (if it is still available), otherwise the "first" Excalidraw view in the workspace.\n' +
|
||||
"If show is true, the view will be brought to front and focused.\n" +
|
||||
'If "first" is provided, the target will be the first Excalidraw view returned by Obsidian\'s workspace leaf collection (i.e., the first item in getExcalidrawViews()). ' +
|
||||
"This ordering is managed by Obsidian and does not necessarily match what a user would consider the “first” view; from a user's perspective it may appear random.\n" +
|
||||
'If "active" is provided, the currently active Excalidraw view in the workspace will be used. If that is not available, then the last active Excalidraw view will be used.\n' +
|
||||
"The function returns the ExcalidrawView that was set as targetView.",
|
||||
after: '("auto",true);',
|
||||
},
|
||||
{
|
||||
field: "getExcalidrawAPI",
|
||||
@@ -523,7 +561,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
desc: 'Updates the color map of an SVG image element in the view. If a ColorMap is provided, it will be used directly. If an SVGColorInfo is provided, it will be converted to a ColorMap. The view will be marked as dirty (i.e. will be saved at next scheduled time) and the image will be reset using the color map.\n'+
|
||||
'See "Shade Master" scritp in Script Library for an example of using this function.\n\n' +
|
||||
'type SVGColorInfo = Map<string, { mappedTo: string; fill: boolean; stroke: boolean; }>\n' +
|
||||
'type ColorMap = { [color: string]: string; }',
|
||||
'type ColorMap = { [color: string]: string; invertInDarkMode?: boolean; }',
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
@@ -531,7 +569,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
code: "getColorMapForImageElement(el: ExcalidrawElement): ColorMap",
|
||||
desc: 'Retrieves the color map for an image element. The color map contains information about the mapping of colors used in the image. If the element already has a color map, it will be returned. The colorMap does not include all colors in the image, only those that have been mapped.\n' +
|
||||
'See "Shade Master" scritp in Script Library for an example of using this function.\n\n' +
|
||||
'type ColorMap = { [color: string]: string; }',
|
||||
'type ColorMap = { [color: string]: string; invertInDarkMode?: boolean; }',
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
@@ -679,6 +717,37 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
desc: `Sets script settings.\nSee for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}`,
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "setScriptSettingValue",
|
||||
code: "setScriptSettingValue(key: string, value: ScriptSettingValue): void;",
|
||||
desc:
|
||||
`Sets a single Script Engine setting value for the active script (in-memory).\n` +
|
||||
`Use saveScriptSettings() to persist changes.\n` +
|
||||
`Handles initialization when scriptEngineSettings[activeScript] is undefined/null.\n` +
|
||||
`See for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}\n\n` +
|
||||
`type ScriptSettingValue = { value?: string; hidden?: boolean; description?: string; valueset?: string[]; height?: number; };`,
|
||||
after: `("myKey", { value: "" });`,
|
||||
},
|
||||
{
|
||||
field: "getScriptSettingValue",
|
||||
code: "getScriptSettingValue(key: string, defaultValue: ScriptSettingValue): ScriptSettingValue;",
|
||||
desc:
|
||||
`Gets a single Script Engine setting value for the active script.\n` +
|
||||
`Returns defaultValue if the key does not exist (or if activeScript is not set).\n` +
|
||||
`Handles initialization when scriptEngineSettings[activeScript] is undefined/null.\n` +
|
||||
`See for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}\n\n` +
|
||||
`type ScriptSettingValue = { value?: string; hidden?: boolean; description?: string; valueset?: string[]; height?: number; };`,
|
||||
after: `("myKey", { value: "" });`,
|
||||
},
|
||||
{
|
||||
field: "saveScriptSettings",
|
||||
code: "async saveScriptSettings(): Promise<void>;",
|
||||
desc:
|
||||
`Persists Script Engine settings to disk (plugin settings).\n` +
|
||||
`Useful after calling setScriptSettingValue().\n` +
|
||||
`See for more details: ${hyperlink("https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html","Script Engine Help")}`,
|
||||
after: "()",
|
||||
},
|
||||
{
|
||||
field: "openFileInNewOrAdjacentLeaf",
|
||||
code: "openFileInNewOrAdjacentLeaf(file: TFile): WorkspaceLeaf;",
|
||||
@@ -776,6 +845,25 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
"colorNameToHex to convert the color name to a HEX color.",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "getViewColorPalette",
|
||||
code: "getViewColorPalette(palette: \"canvasBackground\"|\"elementBackground\"|\"elementStroke\"): (string[] | string)[];",
|
||||
desc: "Returns the current view's palette for canvas background, element background, or element stroke colors. Falls back to the default palette when no view is loaded or the palette is unavailable.",
|
||||
after: "(\"elementStroke\");",
|
||||
},
|
||||
{
|
||||
field: "showColorPicker",
|
||||
code: "async showColorPicker(anchorElement: HTMLElement, palette: \"canvasBackground\"|\"elementBackground\"|\"elementStroke\", includeSceneColors: boolean = true): Promise<string | null>;",
|
||||
desc: "Opens a palette popover anchored to the provided element and resolves with the selected color; returns null when dismissed.\n\n" +
|
||||
"Example Usage:\n" +
|
||||
'const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");\n' +
|
||||
"if(selected) {" +
|
||||
'console.log("User selected color: " + selected);' +
|
||||
"} else {" +
|
||||
'console.log("User cancelled color selection");' +
|
||||
"}",
|
||||
after: "(buttonEl, \"elementStroke\");",
|
||||
},
|
||||
{
|
||||
field: "obsidian",
|
||||
code: "obsidian",
|
||||
@@ -839,6 +927,47 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
desc: "@returns the center position of the current view in Excalidraw coordinates",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "checkForActiveSidepanelTabForScript",
|
||||
code: "checkForActiveSidepanelTabForScript(scriptName?: string): ExcalidrawSidepanelTab | null;",
|
||||
desc: "Returns the active sidepanel tab for the given script, or null if none exists. " +
|
||||
"If scriptName is omitted the function checks ea.activeScript. " +
|
||||
"At most one sidepanel tab may be open per script. " +
|
||||
"The returned ExcalidrawSidepanelTab may be hosted by a different ExcalidrawAutomate instance — compare sidepanelTab.getHostEA() === ea to determine ownership. " +
|
||||
"Useful to detect or reuse an existing tab instead of creating a new one.",
|
||||
after: '("MyScript");'
|
||||
},
|
||||
{
|
||||
field: "createSidepanelTab",
|
||||
code: "async createSidepanelTab(title: string, persist: boolean = false, reveal: boolean = true,): Promise<ExcalidrawSidepanelTab | null>;",
|
||||
desc: "Creates this EA instance's sidepanel tab; use the returned ExcalidrawSidepanelTab (setContent/setTitle, onOpen/onClose/onFocus, contentEl) to build the UI and lifecycle hooks.\n"+
|
||||
"In case the script wants to replace the sidepanel tab it created earlier, call closeSidepanelTab() first, then createSidepanelTab() again.",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "getSidepanelLeaf",
|
||||
code: "getSidepanelLeaf(): WorkspaceLeaf | null;",
|
||||
desc: "Returns the WorkspaceLeaf hosting the Excalidraw sidepanel view, or null if the sidepanel is not present.",
|
||||
after: "();"
|
||||
},
|
||||
{
|
||||
field: "toggleSidepanelView",
|
||||
code: "toggleSidepanelView(): void;",
|
||||
desc: "Toggles the Excalidraw sidepanel visibility when the sidepanel is hosted in the left or right workspace split. If the sidepanel is not attached to a left/right sidebar, no action is taken.",
|
||||
after: "();"
|
||||
},
|
||||
{
|
||||
field: "persistSidepanelTab",
|
||||
code: "persistSidepanelTab(): ExcalidrawSidepanelTab | null;",
|
||||
desc: "Pins the active script's sidepanel tab so it persists across Obsidian restarts and returns it.",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "attachInlineLinkSuggester",
|
||||
code: "attachInlineLinkSuggester(inputEl: HTMLInputElement, widthWrapper?: HTMLElement): KeyBlocker;",
|
||||
desc: "Attaches an inline [[link]] suggester to an input. Optionally align width to a wrapper element. Returns a KeyBlocker so host scripts can skip their own keydown handlers while the suggester is active via isBlockingKeys(); call close() on the returned suggester to detach.",
|
||||
after: "",
|
||||
},
|
||||
{
|
||||
field: "getleaf",
|
||||
code: "getLeaf(origo: WorkspaceLeaf, targetPane?: PaneTarget): WorkspaceLeaf;",
|
||||
@@ -951,7 +1080,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [
|
||||
export const EXCALIDRAW_SCRIPTENGINE_INFO: SuggesterInfo[] = [
|
||||
{
|
||||
field: "inputPrompt",
|
||||
code: "inputPrompt: (opts: {header: string, placeholder?: string, value?: string, buttons?: {caption:string, tooltip?:string, action:Function}[], lines?: number, displayEditorButtons?: boolean, customComponents?: (container: HTMLElement) => void, blockPointerInputOutsideModal?: boolean, controlsOnTop?: boolean});",
|
||||
code: "inputPrompt: (opts: {header: string, placeholder?: string, value?: string, buttons?: {caption:string, tooltip?:string, iconId?: string, action:Function}[], lines?: number, displayEditorButtons?: boolean, customComponents?: (container: HTMLElement) => void, blockPointerInputOutsideModal?: boolean, controlsOnTop?: boolean});",
|
||||
desc:
|
||||
"Opens a prompt that asks for an input.\nReturns a string with the input.\nYou need to await the result of inputPrompt.\n" +
|
||||
"Editor buttons are text editing buttons like delete, enter, allcaps - these are only displayed if lines is greater than 1 \n" +
|
||||
@@ -959,6 +1088,7 @@ export const EXCALIDRAW_SCRIPTENGINE_INFO: SuggesterInfo[] = [
|
||||
"blockPointerInputOutsideModal will block pointer input outside the modal. This is useful if you want to prevent the user accidently closing the modal or interacting with the excalidraw canvas while the prompt is open.\n" +
|
||||
"controlsOnTop when set to true will move all the buttons to the top of the modal, leaving the text area at the bottom. This feature was developed for Scribble Helper script to avoid your palm pressing buttons while scribbling.\n"+
|
||||
"buttons.action(input: string) => string\nThe button action function will receive the actual input string. If action returns null, input will be unchanged. If action returns a string, input will receive that value when the promise is resolved. " +
|
||||
"iconId is the lucide.dev icon name. If iconId is provided caption will be ignored, simply submit \"\" as caption in that case. \n" +
|
||||
"example:\n<code>let fileType = '';\nconst filename = await utils.inputPrompt (\n 'Filename',\n '',\n '',\n, [\n {\n caption: 'Markdown',\n action: ()=>{fileType='md';return;}\n },\n {\n caption: 'Excalidraw',\n action: ()=>{fileType='ex';return;}\n }\n ]\n);</code>",
|
||||
after: `({\n header: "",\n placeholder: undefined, //string\n value: undefined, //string\n buttons: [{ //optional, may leave undefined\n caption: "", //string\n tooltip: undefined, //string\n action: (input)=>{} //Function\n }],\n lines: undefined, //number\n displayEditorButtons: undefined, //boolean\n customComponents: undefined, //(container: HTMLElement) => void\n blockPointerInputOutsideModal: undefined, //boolean\n controlsOnTop: undefined, //boolean\n draggable: undefined, //boolean\n});`,
|
||||
},
|
||||
|
||||
@@ -61,7 +61,10 @@ export class UniversalInsertFileModal extends Modal {
|
||||
}
|
||||
|
||||
onOpen(): void {
|
||||
const modalEl = this.modalEl;
|
||||
modalEl.classList.add("excalidraw-modal");
|
||||
this.containerEl.classList.add("excalidraw-release");
|
||||
this.containerEl.classList.add("excalidraw-modal");
|
||||
this.titleEl.setText(t("UIFM_TITLE"));
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
import { ExcalidrawTextElement } from "@zsviczian/excalidraw/types/element/src/types";
|
||||
import { Notice } from "obsidian";
|
||||
import { t } from "src/lang/helpers";
|
||||
import { ScriptEngine } from "../Scripts";
|
||||
import ExcalidrawView from "src/view/ExcalidrawView";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param view - ExcalidrawView instance
|
||||
* @param prefix - defines the default button.
|
||||
* @returns
|
||||
*/
|
||||
export async function copyLinkToSelectedElementToClipboard(view: ExcalidrawView, prefix: string) {
|
||||
const elements = view.getViewSelectedElements();
|
||||
if (elements.length < 1) {
|
||||
new Notice(t("INSERT_LINK_TO_ELEMENT_ERROR"));
|
||||
return;
|
||||
}
|
||||
|
||||
let elementId: string = undefined;
|
||||
|
||||
if (elements.length === 2) {
|
||||
const textEl = elements.filter((el) => el.type === "text");
|
||||
if (textEl.length === 1 && (textEl[0] as ExcalidrawTextElement).containerId) {
|
||||
const container = elements.filter(
|
||||
(el) => el.boundElements && el.boundElements.some((be) => be.type === "text"),
|
||||
);
|
||||
if (container.length === 1) {
|
||||
elementId = textEl[0].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!elementId) {
|
||||
elementId =
|
||||
elements.length === 1
|
||||
? elements[0].id
|
||||
: view.plugin.ea.getLargestElement(elements).id;
|
||||
}
|
||||
|
||||
const frames = elements.filter((el) => el.type === "frame");
|
||||
const hasFrame = frames.length === 1;
|
||||
const hasMarkerFrame = hasFrame && (frames[0] as any).frameRole === "marker";
|
||||
const hasGroup = elements.some((el) => el.groupIds && el.groupIds.length > 0);
|
||||
|
||||
// Feature 1: UIFM_ANCHOR checkbox (persisted)
|
||||
let anchorTo100 = Boolean(view.plugin.settings.copyLinkToElemenetAnchorTo100);
|
||||
|
||||
// Feature 2: frame link by name (persisted)
|
||||
let copyFrameLinkByName = Boolean(view.plugin.settings.copyFrameLinkByName);
|
||||
|
||||
const frameNameRaw = hasFrame ? (frames[0] as any)?.name : undefined;
|
||||
const frameName = typeof frameNameRaw === "string" ? frameNameRaw.trim() : "";
|
||||
const frameNameIsValid =
|
||||
hasFrame && frameName.length > 0 && /[\p{L}\p{N}_ -]+/u.test(frameName);
|
||||
|
||||
const getFrameTarget = () =>
|
||||
frameNameIsValid && copyFrameLinkByName ? frameName : frames[0].id;
|
||||
|
||||
let cancelled = true;
|
||||
|
||||
const button = {
|
||||
area: {
|
||||
caption: "Area",
|
||||
action: () => {
|
||||
cancelled = false;
|
||||
prefix = "area=";
|
||||
return;
|
||||
}
|
||||
},
|
||||
link: {
|
||||
caption: "Link",
|
||||
action: () => {
|
||||
cancelled = false;
|
||||
prefix = "";
|
||||
return;
|
||||
} },
|
||||
group: {
|
||||
caption: "Group",
|
||||
action: () => {
|
||||
cancelled = false;
|
||||
prefix = "group=";
|
||||
return;
|
||||
}
|
||||
},
|
||||
frame: {
|
||||
caption: "Frame",
|
||||
action: () => {
|
||||
cancelled = false;
|
||||
prefix = "frame=";
|
||||
elementId = getFrameTarget();
|
||||
return;
|
||||
},
|
||||
},
|
||||
clippedframe: {
|
||||
caption: "Clipped Frame",
|
||||
action: () => {
|
||||
cancelled = false;
|
||||
prefix = "clippedframe=";
|
||||
elementId = getFrameTarget();
|
||||
return;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
let buttons = [];
|
||||
switch (prefix) {
|
||||
case "area=":
|
||||
buttons = [
|
||||
button.area,
|
||||
button.link,
|
||||
...(hasGroup ? [button.group] : []),
|
||||
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
|
||||
...(hasFrame ? [button.frame] : []),
|
||||
];
|
||||
break;
|
||||
case "group=":
|
||||
buttons = [
|
||||
...(hasGroup ? [button.group] : []),
|
||||
button.link,
|
||||
button.area,
|
||||
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
|
||||
...(hasFrame ? [button.frame] : []),
|
||||
];
|
||||
break;
|
||||
case "frame=":
|
||||
buttons = [
|
||||
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
|
||||
...(hasFrame ? [button.frame] : []),
|
||||
...(hasGroup ? [button.group] : []),
|
||||
button.link,
|
||||
button.area,
|
||||
];
|
||||
break;
|
||||
case "clippedframe=":
|
||||
buttons = [
|
||||
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
|
||||
...(hasFrame ? [button.frame] : []),
|
||||
...(hasGroup ? [button.group] : []),
|
||||
button.link,
|
||||
button.area,
|
||||
];
|
||||
break;
|
||||
default:
|
||||
buttons = [
|
||||
button.link,
|
||||
button.area,
|
||||
button.group,
|
||||
...(hasFrame && !hasMarkerFrame ? [button.clippedframe] : []),
|
||||
...(hasFrame ? [button.frame] : []),
|
||||
];
|
||||
}
|
||||
|
||||
let alias: string;
|
||||
try {
|
||||
alias = await ScriptEngine.inputPrompt(
|
||||
view,
|
||||
view.plugin,
|
||||
view.app,
|
||||
"Set link alias",
|
||||
"Leave empty if you do not want to set an alias",
|
||||
"",
|
||||
buttons,
|
||||
undefined,
|
||||
undefined,
|
||||
(container: HTMLElement) => {
|
||||
const wrapper = container.createDiv?.("excalidraw-prompt-checkboxes") ?? container;
|
||||
const ownerDoc = wrapper.ownerDocument ?? document;
|
||||
|
||||
const anchorRow = ownerDoc.createElement("label");
|
||||
anchorRow.style.display = "flex";
|
||||
anchorRow.style.alignItems = "center";
|
||||
anchorRow.style.gap = "8px";
|
||||
anchorRow.style.marginTop = "8px";
|
||||
|
||||
const anchorCb = ownerDoc.createElement("input");
|
||||
anchorCb.type = "checkbox";
|
||||
anchorCb.checked = anchorTo100;
|
||||
anchorCb.setAttribute("aria-label", t("UIFM_ANCHOR_DESC"));
|
||||
anchorCb.addEventListener("change", () => {
|
||||
anchorTo100 = anchorCb.checked;
|
||||
});
|
||||
|
||||
const anchorText = ownerDoc.createElement("span");
|
||||
anchorText.textContent = t("UIFM_ANCHOR");
|
||||
|
||||
anchorRow.appendChild(anchorCb);
|
||||
anchorRow.appendChild(anchorText);
|
||||
wrapper.appendChild(anchorRow);
|
||||
|
||||
if (frameNameIsValid) {
|
||||
const frameRow = ownerDoc.createElement("label");
|
||||
frameRow.style.display = "flex";
|
||||
frameRow.style.alignItems = "center";
|
||||
frameRow.style.gap = "8px";
|
||||
frameRow.style.marginTop = "8px";
|
||||
|
||||
const frameCb = ownerDoc.createElement("input");
|
||||
frameCb.type = "checkbox";
|
||||
frameCb.checked = copyFrameLinkByName;
|
||||
frameCb.setAttribute("aria-label", t("FRAME_WITH_NAME"));
|
||||
frameCb.addEventListener("change", () => {
|
||||
copyFrameLinkByName = frameCb.checked;
|
||||
});
|
||||
|
||||
const frameText = ownerDoc.createElement("span");
|
||||
frameText.textContent = t("FRAME_WITH_NAME");
|
||||
|
||||
frameRow.appendChild(frameCb);
|
||||
frameRow.appendChild(frameText);
|
||||
wrapper.appendChild(frameRow);
|
||||
}
|
||||
},
|
||||
);
|
||||
} finally {
|
||||
const changed =
|
||||
view.plugin.settings.copyLinkToElemenetAnchorTo100 !== anchorTo100 ||
|
||||
view.plugin.settings.copyFrameLinkByName !== copyFrameLinkByName;
|
||||
|
||||
if (changed) {
|
||||
await view.plugin.loadSettings();
|
||||
view.plugin.settings.copyLinkToElemenetAnchorTo100 = anchorTo100;
|
||||
view.plugin.settings.copyFrameLinkByName = copyFrameLinkByName;
|
||||
await view.plugin.saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
if (cancelled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((alias === "" || alias == null) && anchorTo100) {
|
||||
alias = "100%";
|
||||
}
|
||||
|
||||
navigator.clipboard.writeText(
|
||||
`${prefix.length > 0 ? "!" : ""}[[${view.file.path}#^${prefix}${elementId}${alias ? `|${alias}` : ``}]]`,
|
||||
);
|
||||
new Notice(t("INSERT_LINK_TO_ELEMENT_READY"));
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
||||
/*
|
||||
Obsidian uses a slightly modified version of the hypermd parser for math blocks
|
||||
found at https://github.com/laobubu/HyperMD/blob/071ce236605bb7693efa6d4b829c39413a3d37fb/src/mode/hypermd.ts#L329-L336
|
||||
where spaces are replaced with `_` and the mathlevel of 1|2 is replaced with `math-block` for display math and nothing for inline math
|
||||
create from the following grammar (where we remove the upper-cases):
|
||||
@top Document { Formatting_formatting-math_formatting-math-begin_keyword_math_math-block Math Formatting_formatting-math_formatting-math-end_keyword_math_math- }
|
||||
|
||||
Formatting_formatting-math_formatting-math-begin_keyword_math_math-block { "" }
|
||||
Math { any* }
|
||||
Formatting_formatting-math_formatting-math-end_keyword_math_math- { "" }
|
||||
|
||||
@tokens {
|
||||
any { _ }
|
||||
}
|
||||
*/
|
||||
import {LRParser} from "@lezer/lr"
|
||||
export const parser = LRParser.deserialize({
|
||||
version: 14,
|
||||
states: "zOOOO?MrOOQOPOOOOOO'#Ca'#CaOYOPO'#C_OOOO?MtOOOOO-E6_-E6_QOOOOO",
|
||||
stateData: "b~OVQOURP~OVQOURX~O",
|
||||
goto: "fUPPVY]`RPORSPRUSQRPRTR",
|
||||
nodeNames: "⚠ Document formatting_formatting-math_formatting-math-begin_keyword_math_math-block math formatting_formatting-math_formatting-math-end_keyword_math_math-",
|
||||
maxTerm: 7,
|
||||
skippedNodes: [0],
|
||||
repeatNodeCount: 1,
|
||||
tokenData: "i~RRO;'S[;'S;=`a;=`O[~aOV~~fPV~;=`<%l[",
|
||||
tokenizers: [0],
|
||||
topRules: {"Document":[0,1]},
|
||||
tokenPrec: 0
|
||||
})
|
||||
@@ -155,7 +155,7 @@ export class EmbeddedFile {
|
||||
}
|
||||
|
||||
get hasSeparateDarkAndLightVersion(): boolean {
|
||||
return this.isSVGwithBitmap || (this.file && this.file.extension.toLowerCase() === "pdf");
|
||||
return this.isSVGwithBitmap;
|
||||
}
|
||||
|
||||
public resetImage(hostPath: string, imgPath: string) {
|
||||
@@ -670,7 +670,7 @@ export class EmbeddedFilesLoader {
|
||||
created: data.created,
|
||||
size: data.size,
|
||||
hasSVGwithBitmap: false,
|
||||
shouldScale: true
|
||||
shouldScale: true,
|
||||
};
|
||||
files[batch].push(fileData);
|
||||
}
|
||||
@@ -688,8 +688,7 @@ export class EmbeddedFilesLoader {
|
||||
const data = getMermaidText(element);
|
||||
const result = await mermaidToExcalidraw(
|
||||
data,
|
||||
{ themeVariables: { fontSize: "20" } },
|
||||
true
|
||||
{ themeVariables: { fontSize: "20" } }
|
||||
);
|
||||
if(!result) {
|
||||
return;
|
||||
@@ -742,6 +741,10 @@ export class EmbeddedFilesLoader {
|
||||
}
|
||||
|
||||
const addFilesTimer = setInterval(() => {
|
||||
if (this.terminate) {
|
||||
clearInterval(addFilesTimer);
|
||||
return;
|
||||
}
|
||||
if(files[batch].length === 0) {
|
||||
return;
|
||||
}
|
||||
@@ -757,7 +760,9 @@ export class EmbeddedFilesLoader {
|
||||
|
||||
const iterator = loadIterator.bind(this)();
|
||||
const concurency = this.plugin.settings.renderingConcurrency;
|
||||
await new PromisePool(iterator, concurency).all();
|
||||
if (!this.terminate) {
|
||||
await new PromisePool(iterator, concurency).all();
|
||||
}
|
||||
|
||||
clearInterval(addFilesTimer);
|
||||
|
||||
@@ -884,26 +889,6 @@ export class EmbeddedFilesLoader {
|
||||
|
||||
const canvas = await renderPage(pageNum);
|
||||
if(canvas) {
|
||||
// NEW: invert colors for dark theme (keep alpha unchanged)
|
||||
if (this.isDark) {
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (ctx) {
|
||||
try {
|
||||
const img = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
||||
const data = img.data;
|
||||
for (let i = 0; i < data.length; i += 4) {
|
||||
data[i] = 255 - data[i]; // R
|
||||
data[i + 1] = 255 - data[i+1]; // G
|
||||
data[i + 2] = 255 - data[i+2]; // B
|
||||
// alpha channel (data[i+3]) remains unchanged
|
||||
}
|
||||
ctx.putImageData(img, 0, 0);
|
||||
} catch (e) {
|
||||
// If reading pixel data fails, silently fallback to non-inverted
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const result: [DataURL,Size, PDFPageViewProps] = [`data:image/png;base64,${await new Promise((resolve, reject) => {
|
||||
canvas.toBlob(async (blob) => {
|
||||
const dataURL = await blobToBase64(blob);
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
DEVICE,
|
||||
mermaidToExcalidraw,
|
||||
refreshTextDimensions,
|
||||
getFontFamilyString,
|
||||
} from "src/constants/constants";
|
||||
import { blobToBase64, checkAndCreateFolder, getDrawingFilename, getExcalidrawEmbeddedFilesFiletree, getListOfTemplateFiles, getNewUniqueFilepath, splitFolderAndFilename } from "src/utils/fileUtils";
|
||||
import {
|
||||
@@ -43,6 +44,7 @@ import {
|
||||
addAppendUpdateCustomData,
|
||||
getSVG,
|
||||
} from "src/utils/utils";
|
||||
import { InlineLinkSuggester } from "./Suggesters/InlineLinkSuggester";
|
||||
import { getAttachmentsFolderAndFilePath, getExcalidrawViews, getLeaf, getNewOrAdjacentLeaf, isObsidianThemeDark, mergeMarkdownFiles, openLeaf } from "src/utils/obsidianUtils";
|
||||
import { AppState, BinaryFileData, DataURL, ExcalidrawImperativeAPI, SceneData } from "@zsviczian/excalidraw/types/excalidraw/types";
|
||||
import { EmbeddedFile, EmbeddedFilesLoader } from "./EmbeddedFileLoader";
|
||||
@@ -76,21 +78,26 @@ import {
|
||||
extractCodeBlocks as _extractCodeBlocks,
|
||||
} from "../utils/AIUtils";
|
||||
import { EXCALIDRAW_AUTOMATE_INFO, EXCALIDRAW_SCRIPTENGINE_INFO } from "./Dialogs/SuggesterInfo";
|
||||
import { addBackOfTheNoteCard, sceneRemoveInternalLinks } from "../utils/excalidrawViewUtils";
|
||||
import { showColorPicker } from "./Dialogs/ColorPicker";
|
||||
import { addBackOfTheNoteCard, getViewColorPalette, sceneRemoveInternalLinks } from "../utils/excalidrawViewUtils";
|
||||
import { log } from "../utils/debugHelper";
|
||||
import { ExcalidrawLib } from "../types/excalidrawLib";
|
||||
import { GlobalPoint } from "@zsviczian/excalidraw/types/math/src/types";
|
||||
import { AddImageOptions, ImageInfo, SVGColorInfo } from "src/types/excalidrawAutomateTypes";
|
||||
import { _measureText, cloneElement, createPNG, createSVG, errorMessage, filterColorMap, getEmbeddedFileForImageElment, getFontFamily, getLineBox, getTemplate, isColorStringTransparent, isSVGColorInfo, mergeColorMapIntoSVGColorInfo, normalizeLinePoints, repositionElementsToCursor, svgColorInfoToColorMap, updateOrAddSVGColorInfo, verifyMinimumPluginVersion } from "src/utils/excalidrawAutomateUtils";
|
||||
import { AddImageOptions, ImageInfo, KeyBlocker, ScriptSettingValue, SVGColorInfo } from "src/types/excalidrawAutomateTypes";
|
||||
import { _measureText, cloneElement, createPNG, createSVG, ensureActiveScriptSettingsObject, errorMessage, filterColorMap, getEmbeddedFileForImageElment, getLastActiveExcalidrawView, getLineBox, getTemplate, isColorStringTransparent, isSVGColorInfo, mergeColorMapIntoSVGColorInfo, normalizeBindMode, normalizeFixedPoint, normalizeLinePoints, repositionElementsToCursor, svgColorInfoToColorMap, updateOrAddSVGColorInfo, verifyMinimumPluginVersion } from "src/utils/excalidrawAutomateUtils";
|
||||
import { exportToPDF, getMarginValue, getPageDimensions } from "src/utils/exportUtils";
|
||||
import { PageDimensions, PageOrientation, PageSize, PDFExportScale, PDFPageProperties, ExportSettings} from "src/types/exportUtilTypes";
|
||||
import { FrameRenderingOptions } from "src/types/utilTypes";
|
||||
import { CaptureUpdateAction } from "src/constants/constants";
|
||||
import { AutoexportConfig } from "src/types/excalidrawViewTypes";
|
||||
import { FloatingModal } from "./Dialogs/FloatingModal";
|
||||
import { ExcalidrawSidepanelView } from "src/view/sidepanel/Sidepanel";
|
||||
import { ExcalidrawSidepanelTab } from "src/view/sidepanel/SidepanelTab";
|
||||
import { patchMobileView } from "src/utils/customEmbeddableUtils";
|
||||
import { ObsidianCanvasNode } from "src/view/managers/CanvasNodeFactory";
|
||||
import { AIRequest } from "src/types/AIUtilTypes";
|
||||
import { getAspectRatio } from "src/utils/YoutTubeUtils";
|
||||
import { getPDFCropRect } from "src/utils/PDFUtils";
|
||||
|
||||
extendPlugins([
|
||||
HarmonyPlugin,
|
||||
@@ -542,6 +549,7 @@ export class ExcalidrawAutomate {
|
||||
gridSize: number;
|
||||
};
|
||||
colorPalette: {};
|
||||
sidepanelTab: ExcalidrawSidepanelTab | null = null;
|
||||
|
||||
constructor(plugin: ExcalidrawPlugin, view?: ExcalidrawView) {
|
||||
this.plugin = plugin;
|
||||
@@ -549,6 +557,119 @@ export class ExcalidrawAutomate {
|
||||
this.targetView = view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the active sidepanel tab for a script, if one exists.
|
||||
* If scriptName is omitted the function checks ea.activeScript.
|
||||
* At most one sidepanel tab may be open per script. If a tab exists this
|
||||
* returns the corresponding ExcalidrawSidepanelTab; otherwise it returns
|
||||
* undefined.
|
||||
* The returned tab may be hosted by a different ExcalidrawAutomate instance.
|
||||
* To determine whether the tab belongs to the current ea instance compare:
|
||||
* sidepanelTab.getHostEA() === ea.
|
||||
* In this case the script may wish to reuse the existing tab rather than create a new one.
|
||||
* @param scriptName - Optional script name to query. Defaults to ea.activeScript.
|
||||
* @returns The ExcalidrawSidepanelTab for the script, or undefined if none exists.
|
||||
*/
|
||||
public checkForActiveSidepanelTabForScript(scriptName?: string): ExcalidrawSidepanelTab | null {
|
||||
scriptName = scriptName ?? this.activeScript;
|
||||
if (!scriptName) {
|
||||
return null;
|
||||
}
|
||||
const spView = ExcalidrawSidepanelView.getExisting(false);
|
||||
if (!spView) {
|
||||
return null;
|
||||
}
|
||||
return spView.getTabByScript(scriptName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new sidepanel tab associated with this ExcalidrawAutomate instance.
|
||||
* If a sidepanel tab already exists for this instance, it will be closed first.
|
||||
* @param title - The title of the sidepanel tab.
|
||||
* @param options
|
||||
* @returns
|
||||
*/
|
||||
public async createSidepanelTab(
|
||||
title: string,
|
||||
persist: boolean = false,
|
||||
reveal: boolean = true,
|
||||
): Promise<ExcalidrawSidepanelTab | null> {
|
||||
if (this.sidepanelTab) {
|
||||
this.sidepanelTab.close();
|
||||
}
|
||||
const scriptName = this.activeScript ?? nanoid(); //random name if no active script
|
||||
const spView = await ExcalidrawSidepanelView.getOrCreate(this.plugin, reveal);
|
||||
if (!spView) {
|
||||
errorMessage("Unable to open sidepanel", "createSidepanelTab()");
|
||||
return null;
|
||||
}
|
||||
const tab = await spView.createTab({ title, scriptName, hostEA: this });
|
||||
this.sidepanelTab = tab;
|
||||
if (persist && this.activeScript) {
|
||||
this.persistSidepanelTab();
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the WorkspaceLeaf hosting the Excalidraw sidepanel view.
|
||||
* @returns {WorkspaceLeaf | null} The sidepanel leaf or null if not found.
|
||||
*/
|
||||
public getSidepanelLeaf(): WorkspaceLeaf | null {
|
||||
return ExcalidrawSidepanelView.getExisting(false)?.leaf ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the visibility of the Excalidraw sidepanel view.
|
||||
* If the sidepanel is not in a leaf attached to the left or right split, no action is taken.
|
||||
*/
|
||||
public toggleSidepanelView(): void {
|
||||
const leaf = this.getSidepanelLeaf();
|
||||
if (leaf) {
|
||||
const root = leaf.getRoot();
|
||||
if (root === this.plugin.app.workspace.leftSplit) {
|
||||
this.plugin.app.workspace.leftSplit.toggle();
|
||||
return;
|
||||
}
|
||||
if (root === this.plugin.app.workspace.rightSplit) {
|
||||
this.plugin.app.workspace.rightSplit.toggle();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pins the active script's sidepanel tab to be persistent across Obsidian restarts.
|
||||
* @param options
|
||||
* @returns {Promise<ExcalidrawSidepanelTab | null>} The persisted sidepanel tab or null on error.
|
||||
*/
|
||||
public persistSidepanelTab(): ExcalidrawSidepanelTab | null {
|
||||
if (!this.activeScript && !this.sidepanelTab) {
|
||||
errorMessage("No active script and sidepanel tab to persist", "persistSidepanelTab()");
|
||||
return null;
|
||||
}
|
||||
const spView = ExcalidrawSidepanelView.getExisting();
|
||||
if (!spView) {
|
||||
return;
|
||||
}
|
||||
spView.markTabPersistent(this.sidepanelTab);
|
||||
return this.sidepanelTab;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attaches an inline link suggester to the provided input element. The suggester reacts to
|
||||
* "[[" typing, offers vault link choices (including aliases and unresolved links), and inserts
|
||||
* the selected link using relative linktext when the active Excalidraw view is known.
|
||||
* @param {HTMLInputElement} inputEl - The input element to enhance.
|
||||
* @param {HTMLElement} [widthWrapper] - Optional element to determine suggester width.
|
||||
* @returns {KeyBlocker} The suggester instance; call close() to detach; call .isBlockingKeys() to check if suggester dropdown is open.
|
||||
*/
|
||||
public attachInlineLinkSuggester(inputEl: HTMLInputElement, widthWrapper?: HTMLElement): KeyBlocker {
|
||||
const getSourcePath = () => this.targetView?.file?.path;
|
||||
return new InlineLinkSuggester(this.plugin.app, this.plugin, inputEl, getSourcePath, widthWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last recorded pointer position on the Excalidraw canvas.
|
||||
* @returns {{x:number, y:number}} The last recorded pointer position.
|
||||
@@ -653,20 +774,8 @@ export class ExcalidrawAutomate {
|
||||
* @returns {string} The font family string.
|
||||
*/
|
||||
setFontFamily(val: number):string {
|
||||
switch (val) {
|
||||
case 1:
|
||||
this.style.fontFamily = 4;
|
||||
return getFontFamily(4);
|
||||
case 2:
|
||||
this.style.fontFamily = 2;
|
||||
return getFontFamily(2);
|
||||
case 3:
|
||||
this.style.fontFamily = 3;
|
||||
return getFontFamily(3);
|
||||
default:
|
||||
this.style.fontFamily = 1;
|
||||
return getFontFamily(1);
|
||||
}
|
||||
this.style.fontFamily = val;
|
||||
return getFontFamilyString({fontFamily:val})
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -714,10 +823,29 @@ export class ExcalidrawAutomate {
|
||||
: null;
|
||||
let elements = template ? template.elements : [];
|
||||
elements = elements.concat(this.getElements());
|
||||
|
||||
const files: Record<FileId, {mimeType: MimeType; id: FileId; dataURL: DataURL; created: number}> = {
|
||||
...(template?.files ?? {}),
|
||||
};
|
||||
|
||||
Object.keys(this.imagesDict).forEach((key: FileId) => {
|
||||
const item = this.imagesDict[key];
|
||||
if (!item?.dataURL || !item?.mimeType) {
|
||||
return;
|
||||
}
|
||||
files[key] = {
|
||||
mimeType: item.mimeType,
|
||||
id: key,
|
||||
dataURL: item.dataURL,
|
||||
created: item.created ?? Date.now(),
|
||||
};
|
||||
});
|
||||
|
||||
navigator.clipboard.writeText(
|
||||
JSON.stringify({
|
||||
type: "excalidraw/clipboard",
|
||||
elements,
|
||||
files,
|
||||
}),
|
||||
);
|
||||
};
|
||||
@@ -765,6 +893,59 @@ export class ExcalidrawAutomate {
|
||||
return this.elementsDict[id];
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns an object describing the bound text element.
|
||||
* If a text element is provided:
|
||||
* - returns { eaElement } if the element is in ea.elementsDict
|
||||
* - else (if searchInView is true) returns { sceneElement } if found in the targetView scene
|
||||
* If a container element is provided, searches for the bound text element:
|
||||
* - returns { eaElement } if found in ea.elementsDict
|
||||
* - else (if searchInView is true) returns { sceneElement } if found in the targetView scene
|
||||
* If not found, returns {}.
|
||||
* Does not add the text element to elementsDict.
|
||||
* @param element
|
||||
* @param searchInView - If true, searches in the targetView elements if not found in elementsDict.
|
||||
* @returns Object containing either eaElement or sceneElement or empty if not found.
|
||||
*/
|
||||
getBoundTextElement(element: ExcalidrawElement, searchInView: boolean = false): {
|
||||
eaElement?: Mutable<ExcalidrawTextElement>,
|
||||
sceneElement?: ExcalidrawTextElement
|
||||
} {
|
||||
if (!element) {
|
||||
return {};
|
||||
}
|
||||
if(element.type === "text") {
|
||||
if(element.id in this.elementsDict) {
|
||||
return {eaElement: element as Mutable<ExcalidrawTextElement>};
|
||||
}
|
||||
|
||||
if (searchInView && this.targetView && this.targetView._loaded) {
|
||||
const viewElements = this.getViewElements();
|
||||
const ve = viewElements.find((e) => e.id === element.id);
|
||||
if(ve) {
|
||||
return {
|
||||
sceneElement: ve as ExcalidrawTextElement
|
||||
};
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
const boundElement = element.boundElements?.find((be) => be.type === "text");
|
||||
if (!boundElement) {
|
||||
return {};
|
||||
}
|
||||
let textElement = this.elementsDict[boundElement.id] as Mutable<ExcalidrawTextElement>;
|
||||
if (textElement) {
|
||||
return {eaElement: textElement};
|
||||
}
|
||||
if (!textElement && searchInView && this.targetView && this.targetView._loaded) {
|
||||
const viewElements = this.getViewElements();
|
||||
const ve = viewElements.find((e) => e.id === boundElement.id);
|
||||
return {sceneElement: ve as ExcalidrawTextElement};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a drawing and saves it to the specified filename.
|
||||
* @param {Object} [params] - Parameters for creating the drawing.
|
||||
@@ -1364,12 +1545,13 @@ export class ExcalidrawAutomate {
|
||||
link,
|
||||
locked: false,
|
||||
frameId: null as string,
|
||||
hasTextLink: eltype === "text" && link ? true : false,
|
||||
...scale ? {scale} : {},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated. Use addEmbeddable() instead.
|
||||
* Use addEmbeddable() instead, unless you specifically need to pass HTML content and create a custom iframe.
|
||||
* Retained for backward compatibility.
|
||||
* @param {number} topX - The x-coordinate of the top-left corner.
|
||||
* @param {number} topY - The y-coordinate of the top-left corner.
|
||||
@@ -1377,19 +1559,41 @@ export class ExcalidrawAutomate {
|
||||
* @param {number} height - The height of the iframe.
|
||||
* @param {string} [url] - The URL of the iframe.
|
||||
* @param {TFile} [file] - The file associated with the iframe.
|
||||
* @param {string} [html] - The HTML content for the iframe.
|
||||
* @returns {string} The ID of the added iframe element.
|
||||
*/
|
||||
addIFrame(topX: number, topY: number, width: number, height: number, url?: string, file?: TFile): string {
|
||||
addIFrame(topX: number, topY: number, width: number, height: number, url?: string, file?: TFile, html?: string): string {
|
||||
if(html) {
|
||||
const id = nanoid();
|
||||
this.elementsDict[id] = this.boxedElement(
|
||||
id,
|
||||
"iframe",
|
||||
topX,
|
||||
topY,
|
||||
width,
|
||||
height,
|
||||
null,
|
||||
[1,1],
|
||||
);
|
||||
this.elementsDict[id].customData = {
|
||||
generationData: { status: "done", html },
|
||||
};
|
||||
return id;
|
||||
}
|
||||
return this.addEmbeddable(topX, topY, width, height, url, file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an embeddable element to the ExcalidrawAutomate instance.
|
||||
* In case of urls, if the width and or height is set to 0 ExcalidrawAutomate will attempt to determine the dimensions based on the aspect ratio of the content.
|
||||
* If both width and height are set to 0 the default size for youtube and vimeo embeddables (560x315) will be used. YouTube shorts will have a default size of 315x560.
|
||||
* If only the width or height is set to 0 the other dimension will be calculated based on the aspect ratio of the content.
|
||||
* If the calculated width is less than 560 or the calculated height is less than 315 the element will be scaled down proportionally, setting element.scale accordingly.
|
||||
* @param {number} topX - The x-coordinate of the top-left corner.
|
||||
* @param {number} topY - The y-coordinate of the top-left corner.
|
||||
* @param {number} width - The width of the embeddable element.
|
||||
* @param {number} height - The height of the embeddable element.
|
||||
* @param {string} [url] - The URL of the embeddable element.
|
||||
* @param {string} [url] - The URL of the embeddable element. The URL may be a dataURL as well (however such elements are not supported by Excalidraw.com).
|
||||
* @param {TFile} [file] - The file associated with the embeddable element.
|
||||
* @param {EmbeddableMDCustomProps} [embeddableCustomData] - Custom properties for the embeddable element.
|
||||
* @returns {string} The ID of the added embeddable element.
|
||||
@@ -1413,6 +1617,30 @@ export class ExcalidrawAutomate {
|
||||
return null;
|
||||
}
|
||||
|
||||
let scale: [number, number] = [1,1];
|
||||
|
||||
if (url) {
|
||||
let { w, h } = getAspectRatio(url);
|
||||
if (h > w) {
|
||||
//swap width and height for portrait oriented content
|
||||
[w, h] = [h, w];
|
||||
}
|
||||
if (width === 0 && height === 0) {
|
||||
width = 560;
|
||||
height = 560 * (h / w);
|
||||
} else if (height === 0) {
|
||||
height = width * (h / w);
|
||||
if (width < 560) {
|
||||
scale = [width / 560, width / 560];
|
||||
}
|
||||
} else if (width === 0) {
|
||||
width = height * (w / h);
|
||||
if (height < 315) {
|
||||
scale = [height / 315, height / 315];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const id = nanoid();
|
||||
this.elementsDict[id] = this.boxedElement(
|
||||
id,
|
||||
@@ -1428,7 +1656,7 @@ export class ExcalidrawAutomate {
|
||||
false, //file.extension === "md", //changed this to false because embedable link navigation in ExcaliBrain
|
||||
)
|
||||
}]]` : "",
|
||||
[1,1],
|
||||
scale,
|
||||
);
|
||||
this.elementsDict[id].customData = {mdProps: embeddableCustomData ?? this.plugin.settings.embeddableMarkdownDefaults};
|
||||
return id;
|
||||
@@ -1796,6 +2024,17 @@ export class ExcalidrawAutomate {
|
||||
* @param {"arrow"|"bar"|"circle"|"circle_outline"|"triangle"|"triangle_outline"|"diamond"|"diamond_outline"|null} [formatting.endArrowHead] - The end arrowhead type.
|
||||
* @param {string} [formatting.startObjectId] - The ID of the start object.
|
||||
* @param {string} [formatting.endObjectId] - The ID of the end object.
|
||||
* BindMode Determines whether the arrow remains outside the shape or is allowed to
|
||||
* go all the way inside the shape up to the exact fixed point.
|
||||
* @param {"inside" | "orbit"} [formatting.startBindMode] - The binding mode for the start object.
|
||||
* @param {"inside" | "orbit"} [formatting.endBindMode] - The binding mode for the end object.
|
||||
* FixedPoint represents the fixed point binding information in form of a vertical and
|
||||
* horizontal ratio (i.e. a percentage value in the 0.0-1.0 range). This ratio
|
||||
* gives the user selected fixed point by multiplying the bound element width
|
||||
* with fixedPoint[0] and the bound element height with fixedPoint[1] to get the
|
||||
* bound element-local point coordinate.
|
||||
* @param {[number, number]} [formatting.startFixedPoint] - The fixed point for the start object.
|
||||
* @param {[number, number]} [formatting.endFixedPoint] - The fixed point for the end object.
|
||||
* @param {string} [id] - The ID of the arrow element.
|
||||
* @returns {string} The ID of the added arrow element.
|
||||
*/
|
||||
@@ -1806,32 +2045,40 @@ export class ExcalidrawAutomate {
|
||||
endArrowHead?: "arrow"|"bar"|"circle"|"circle_outline"|"triangle"|"triangle_outline"|"diamond"|"diamond_outline"|null;
|
||||
startObjectId?: string;
|
||||
endObjectId?: string;
|
||||
startBindMode?: "inside" | "orbit";
|
||||
endBindMode?: "inside" | "orbit";
|
||||
startFixedPoint?: [number, number];
|
||||
endFixedPoint?: [number, number];
|
||||
elbowed?: boolean;
|
||||
},
|
||||
id?: string,
|
||||
): string {
|
||||
const startFixedPoint = normalizeFixedPoint(formatting?.startFixedPoint);
|
||||
const endFixedPoint = normalizeFixedPoint(formatting?.endFixedPoint);
|
||||
const startMode = normalizeBindMode(formatting?.startBindMode);
|
||||
const endMode = normalizeBindMode(formatting?.endBindMode);
|
||||
const box = getLineBox(points);
|
||||
const elbowed = formatting?.elbowed ?? false;
|
||||
const startElement = formatting?.startObjectId
|
||||
? this.getElement(formatting.startObjectId) as Mutable<ExcalidrawBindableElement>
|
||||
: null;
|
||||
const endElement = formatting?.endObjectId
|
||||
? this.getElement(formatting.endObjectId) as Mutable<ExcalidrawBindableElement>
|
||||
: null;
|
||||
id = id ?? nanoid();
|
||||
const startPoint = points[0] as GlobalPoint;
|
||||
const endPoint = points[points.length - 1] as GlobalPoint;
|
||||
const elementsMap = arrayToMap(this.getElements());
|
||||
this.elementsDict[id] = {
|
||||
points: normalizeLinePoints(points),
|
||||
elbowed,
|
||||
lastCommittedPoint: null,
|
||||
startBinding: {
|
||||
elementId: formatting?.startObjectId,
|
||||
mode: "orbit",
|
||||
fixedPoint: [
|
||||
1,
|
||||
1
|
||||
],
|
||||
mode: startMode,
|
||||
fixedPoint: startFixedPoint,
|
||||
},
|
||||
endBinding: {
|
||||
elementId: formatting?.endObjectId,
|
||||
mode: "orbit",
|
||||
fixedPoint: [
|
||||
0,
|
||||
0
|
||||
],
|
||||
mode: endMode,
|
||||
fixedPoint: endFixedPoint,
|
||||
},
|
||||
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/388
|
||||
startArrowhead:
|
||||
@@ -1844,20 +2091,20 @@ export class ExcalidrawAutomate {
|
||||
: this.style.endArrowHead,
|
||||
...this.boxedElement(id, "arrow", points[0][0], points[0][1], box.w, box.h),
|
||||
};
|
||||
if (formatting?.startObjectId) {
|
||||
if (!this.elementsDict[formatting.startObjectId].boundElements) {
|
||||
this.elementsDict[formatting.startObjectId].boundElements = [];
|
||||
if (startElement) {
|
||||
if (!startElement.boundElements) {
|
||||
startElement.boundElements = [];
|
||||
}
|
||||
this.elementsDict[formatting.startObjectId].boundElements.push({
|
||||
(startElement.boundElements as Mutable<ExcalidrawElement["boundElements"]>).push({
|
||||
type: "arrow",
|
||||
id,
|
||||
});
|
||||
}
|
||||
if (formatting?.endObjectId) {
|
||||
if (!this.elementsDict[formatting.endObjectId].boundElements) {
|
||||
this.elementsDict[formatting.endObjectId].boundElements = [];
|
||||
if (endElement) {
|
||||
if (!endElement.boundElements) {
|
||||
endElement.boundElements = [];
|
||||
}
|
||||
this.elementsDict[formatting.endObjectId].boundElements.push({
|
||||
(endElement.boundElements as Mutable<ExcalidrawElement["boundElements"]>).push({
|
||||
type: "arrow",
|
||||
id,
|
||||
});
|
||||
@@ -1942,33 +2189,39 @@ export class ExcalidrawAutomate {
|
||||
colorMap = topXOrOpts.colorMap;
|
||||
}
|
||||
|
||||
const pdfLinkRegex = /^[^#]*#page=\d*(&\w*=[^&]+){0,}&rect=\d*,\d*,\d*,\d*/;
|
||||
const originalLink = typeof imageFile === "string" ? imageFile : null;
|
||||
const imageFileForLoader = originalLink && pdfLinkRegex.test(originalLink)
|
||||
? originalLink.split("&rect=")[0]
|
||||
: imageFile;
|
||||
|
||||
const id = nanoid();
|
||||
const loader = new EmbeddedFilesLoader(
|
||||
this.plugin,
|
||||
this.canvas.theme === "dark",
|
||||
);
|
||||
const image = (typeof imageFile === "string")
|
||||
? await loader.getObsidianImage(new EmbeddedFile(this.plugin, "", imageFile),0)
|
||||
: await loader.getObsidianImage(imageFile,0);
|
||||
const image = (typeof imageFileForLoader === "string")
|
||||
? await loader.getObsidianImage(new EmbeddedFile(this.plugin, "", imageFileForLoader),0)
|
||||
: await loader.getObsidianImage(imageFileForLoader,0);
|
||||
|
||||
if (!image) {
|
||||
return null;
|
||||
}
|
||||
const fileId = typeof imageFile === "string"
|
||||
const fileId = typeof imageFileForLoader === "string"
|
||||
? image.fileId
|
||||
: imageFile.extension === "md" || imageFile.extension.toLowerCase() === "pdf" ? fileid() as FileId : image.fileId;
|
||||
: imageFileForLoader.extension === "md" || imageFileForLoader.extension.toLowerCase() === "pdf" ? fileid() as FileId : image.fileId;
|
||||
this.imagesDict[fileId] = {
|
||||
mimeType: image.mimeType,
|
||||
id: fileId,
|
||||
dataURL: image.dataURL,
|
||||
created: image.created,
|
||||
isHyperLink: typeof imageFile === "string",
|
||||
hyperlink: typeof imageFile === "string"
|
||||
? imageFile
|
||||
isHyperLink: typeof imageFileForLoader === "string",
|
||||
hyperlink: typeof imageFileForLoader === "string"
|
||||
? imageFileForLoader
|
||||
: null,
|
||||
file: typeof imageFile === "string"
|
||||
file: typeof imageFileForLoader === "string"
|
||||
? null
|
||||
: imageFile.path + (scale || !anchor ? "":"|100%"),
|
||||
: imageFileForLoader.path + (scale || !anchor ? "":"|100%"),
|
||||
hasSVGwithBitmap: image.hasSVGwithBitmap,
|
||||
latex: null,
|
||||
size: { //must have the natural size here (e.g. for PDF cropping)
|
||||
@@ -1996,6 +2249,22 @@ export class ExcalidrawAutomate {
|
||||
newEl.fileId = fileId;
|
||||
newEl.scale = [1, 1];
|
||||
newEl.crop = null;
|
||||
if(originalLink && pdfLinkRegex.test(originalLink)) {
|
||||
const fd = this.imagesDict[fileId];
|
||||
newEl.crop = getPDFCropRect({
|
||||
scale: this.plugin.settings.pdfScale,
|
||||
link: originalLink,
|
||||
naturalHeight: fd.size.height,
|
||||
naturalWidth: fd.size.width,
|
||||
pdfPageViewProps: fd.pdfPageViewProps,
|
||||
});
|
||||
addAppendUpdateCustomData(newEl, {pdfPageViewProps: fd.pdfPageViewProps});
|
||||
if(newEl.crop) {
|
||||
newEl.width = newEl.crop.width/this.plugin.settings.pdfScale;
|
||||
newEl.height = newEl.crop.height/this.plugin.settings.pdfScale;
|
||||
}
|
||||
newEl.link = `[[${originalLink}]]`;
|
||||
}
|
||||
if(!scale && anchor) {
|
||||
newEl.customData = {isAnchored: true}
|
||||
};
|
||||
@@ -2007,9 +2276,14 @@ export 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.
|
||||
*/
|
||||
async addLaTex(topX: number, topY: number, tex: string): Promise<string> {
|
||||
async addLaTex(topX: number, topY: number, tex: string, scaleX: number = 1, scaleY: number = 1): Promise<string> {
|
||||
if (!tex || !scaleX || !scaleY){
|
||||
return null;
|
||||
}
|
||||
const id = nanoid();
|
||||
const image = await tex2dataURL(tex, 4, this.plugin);
|
||||
if (!image) {
|
||||
@@ -2029,11 +2303,12 @@ export class ExcalidrawAutomate {
|
||||
"image",
|
||||
topX,
|
||||
topY,
|
||||
image.size.width,
|
||||
image.size.height,
|
||||
image.size.width * Math.abs(scaleX),
|
||||
image.size.height * Math.abs(scaleY),
|
||||
);
|
||||
this.elementsDict[id].fileId = image.fileId;
|
||||
this.elementsDict[id].scale = [1, 1];
|
||||
this.addAppendUpdateCustomData(id, {latex: tex});
|
||||
this.elementsDict[id].scale = [Math.sign(scaleX), Math.sign(scaleY)];
|
||||
return id;
|
||||
};
|
||||
|
||||
@@ -2223,6 +2498,7 @@ export class ExcalidrawAutomate {
|
||||
* Clears elementsDict and imagesDict, and resets all style values to default.
|
||||
*/
|
||||
reset():void {
|
||||
this.sidepanelTab?.close();
|
||||
this.clear();
|
||||
this.activeScript = null;
|
||||
this.style = {
|
||||
@@ -2257,35 +2533,72 @@ export class ExcalidrawAutomate {
|
||||
isExcalidrawFile(f: TFile): boolean {
|
||||
return this.plugin.isExcalidrawFile(f);
|
||||
};
|
||||
|
||||
targetView: ExcalidrawView = null; //the view currently edited
|
||||
/**
|
||||
* Sets the target view for EA. All the view operations and the access to Excalidraw API will be performed on this view.
|
||||
* If view is null or undefined, the function will first try setView("active"), then setView("first").
|
||||
* @param {ExcalidrawView | "first" | "active"} [view] - The view to set as target.
|
||||
* @returns {ExcalidrawView} The target view.
|
||||
* Sets the target view for EA. All view operations and all access to the Excalidraw API
|
||||
* will be performed on this view.
|
||||
*
|
||||
* Typical usage:
|
||||
* - `setView()` to pick a sensible default automatically
|
||||
* - `setView(excalidrawView)` to explicitly target a specific view
|
||||
*
|
||||
* Selectors:
|
||||
* - If `view` is `null` or `undefined` (or `"auto"`), EA will pick a sensible default:
|
||||
* 1) the currently active Excalidraw view (if any),
|
||||
* 2) otherwise the last active Excalidraw view (if it is still available),
|
||||
* 3) otherwise the `"first"` Excalidraw view in the workspace.
|
||||
* - If `show` is `true`, the view will be revealed (brought to front) and focused.
|
||||
*
|
||||
* Deprecated selectors (kept for backward compatibility):
|
||||
* - If `"active"` is provided, the currently active Excalidraw view will be used. If no
|
||||
* active Excalidraw view is available, the last active Excalidraw view will be used.
|
||||
* - If `"first"` is provided, the target will be the first Excalidraw view returned by
|
||||
* Obsidian's workspace leaf collection (i.e., the first item in the current
|
||||
* `getExcalidrawViews()` result). **This ordering is managed by Obsidian and does not
|
||||
* necessarily match what a user would consider the “first”/“leftmost”/“topmost” view;
|
||||
* from a user's perspective it may appear effectively random.**
|
||||
*
|
||||
* @param {ExcalidrawView | "auto" | "first" | "active" | null | undefined} [view] - The view (or selector) to set as target.
|
||||
* @param {boolean} [show=false] - Whether to reveal/focus the target view.
|
||||
* @returns {ExcalidrawView} The ExcalidrawView that was set as `targetView` (or `null` if none found).
|
||||
*/
|
||||
setView(view?: ExcalidrawView | "first" | "active"): ExcalidrawView {
|
||||
if(!view) {
|
||||
const v = this.plugin.app.workspace.getActiveViewOfType(ExcalidrawView);
|
||||
if (v instanceof ExcalidrawView) {
|
||||
this.targetView = v;
|
||||
}
|
||||
else {
|
||||
this.targetView = getExcalidrawViews(this.plugin.app)[0];
|
||||
}
|
||||
}
|
||||
if (view == "active") {
|
||||
const v = this.plugin.app.workspace.getActiveViewOfType(ExcalidrawView);
|
||||
if (!(v instanceof ExcalidrawView)) {
|
||||
setView(view?: ExcalidrawView | "auto" | "first" | "active" | null, show: boolean = false): ExcalidrawView {
|
||||
const app = this.plugin.app;
|
||||
const workspace = app.workspace;
|
||||
const setView = () => {
|
||||
if(!view || view === "auto") {
|
||||
view = workspace.getActiveViewOfType(ExcalidrawView);
|
||||
if (view instanceof ExcalidrawView) {
|
||||
this.targetView = view;
|
||||
return;
|
||||
}
|
||||
view = getLastActiveExcalidrawView(this.plugin);
|
||||
this.targetView = view ?? getExcalidrawViews(this.plugin.app)[0];
|
||||
return;
|
||||
}
|
||||
this.targetView = v;
|
||||
if (view == "active") {
|
||||
view = workspace.getActiveViewOfType(ExcalidrawView);
|
||||
if (view instanceof ExcalidrawView) {
|
||||
this.targetView = view;
|
||||
return;
|
||||
}
|
||||
this.targetView = getLastActiveExcalidrawView(this.plugin);
|
||||
return;
|
||||
}
|
||||
if (view == "first") {
|
||||
this.targetView = getExcalidrawViews(this.plugin.app)[0];
|
||||
return;
|
||||
}
|
||||
if (view instanceof ExcalidrawView) {
|
||||
this.targetView = view;
|
||||
}
|
||||
}
|
||||
if (view == "first") {
|
||||
this.targetView = getExcalidrawViews(this.plugin.app)[0];
|
||||
}
|
||||
if (view instanceof ExcalidrawView) {
|
||||
this.targetView = view;
|
||||
setView();
|
||||
if(show && this.targetView) {
|
||||
this.plugin.app.workspace.revealLeaf(
|
||||
this.targetView.leaf,
|
||||
);
|
||||
}
|
||||
return this.targetView;
|
||||
};
|
||||
@@ -3309,6 +3622,23 @@ export class ExcalidrawAutomate {
|
||||
await this.plugin.saveSettings();
|
||||
};
|
||||
|
||||
public setScriptSettingValue(key: string, value: ScriptSettingValue): void {
|
||||
const settings = ensureActiveScriptSettingsObject(this);
|
||||
if (!settings) return;
|
||||
settings[key] = value;
|
||||
}
|
||||
|
||||
public getScriptSettingValue(key: string, defaultValue: ScriptSettingValue): ScriptSettingValue {
|
||||
const settings = ensureActiveScriptSettingsObject(this);
|
||||
if (!settings) return defaultValue;
|
||||
return settings[key] ?? defaultValue;
|
||||
}
|
||||
|
||||
public async saveScriptSettings(): Promise<void> {
|
||||
ensureActiveScriptSettingsObject(this);
|
||||
await this.plugin.saveSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a file in a new workspace leaf or reuses an existing adjacent leaf depending on Excalidraw Plugin Settings.
|
||||
* @param {TFile} file - The file to open.
|
||||
@@ -3486,6 +3816,7 @@ export class ExcalidrawAutomate {
|
||||
|
||||
/**
|
||||
* Moves the specified element to a specific position in the z-index.
|
||||
* * Operates directly on the Excalidraw Scene in targetView, not through ExcalidrawAutomate elements.
|
||||
* @param {number} elementId - The ID of the element to move.
|
||||
* @param {number} newZIndex - The new z-index position for the element.
|
||||
*/
|
||||
@@ -3600,6 +3931,37 @@ export class ExcalidrawAutomate {
|
||||
return cm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color palette for scene. If no palette is found, returns default Excalidraw color palette.
|
||||
* @param {("canvasBackground"|"elementBackground"|"elementStroke")} palette - The palette type.
|
||||
* @returns {([string, string, string, string, string][] | string[])} The color palette.
|
||||
*/
|
||||
getViewColorPalette(palette: "canvasBackground"|"elementBackground"|"elementStroke"): (string[] | string)[] {
|
||||
return getViewColorPalette(palette, this.targetView);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a palette popover anchored to the provided element and resolves with the selected color.
|
||||
* @param {HTMLElement} anchorElement - The element to anchor the popover to.
|
||||
* @param {"canvasBackground"|"elementBackground"|"elementStroke"} palette - Which palette to show.
|
||||
* @param {boolean} [includeSceneColors=true] - Whether to include scene stroke/background colors in the palette.
|
||||
* @returns {Promise<string|null>} Selected color or null if cancelled.
|
||||
* example usage:
|
||||
* const selected = await ea.showColorPicker(button.buttonEl, "elementStroke");
|
||||
* if(selected) {
|
||||
* console.log("User selected color: " + selected);
|
||||
* } else {
|
||||
* console.log("User cancelled color selection");
|
||||
* }
|
||||
*/
|
||||
public async showColorPicker(
|
||||
anchorElement: HTMLElement,
|
||||
palette: "canvasBackground"|"elementBackground"|"elementStroke",
|
||||
includeSceneColors: boolean = true,
|
||||
): Promise<string | null> {
|
||||
return showColorPicker(palette, anchorElement, this.targetView, includeSceneColors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the PolyBool class from https://github.com/velipso/polybooljs.
|
||||
* @returns {PolyBool} The PolyBool class.
|
||||
@@ -3629,6 +3991,7 @@ export class ExcalidrawAutomate {
|
||||
* Destroys the ExcalidrawAutomate instance, clearing all references and data.
|
||||
*/
|
||||
destroy(): void {
|
||||
this.sidepanelTab?.close();
|
||||
this.targetView = null;
|
||||
this.plugin = null;
|
||||
this.elementsDict = {};
|
||||
|
||||
@@ -940,7 +940,7 @@ export class ExcalidrawData {
|
||||
raw: text,
|
||||
parsed: parseRes.parsed,
|
||||
});
|
||||
if (parseRes.link) {
|
||||
if (parseRes.link && this.plugin.settings.syncElementLinkWithText) {
|
||||
textEl.link = parseRes.link;
|
||||
}
|
||||
//this will set the rawText field of text elements imported from files before 1.3.14, and from other instances of Excalidraw
|
||||
@@ -1130,7 +1130,6 @@ export class ExcalidrawData {
|
||||
return (
|
||||
el.type !== "text" &&
|
||||
el.link &&
|
||||
//el.link.startsWith("[[") &&
|
||||
!this.elementLinks.has(el.id)
|
||||
);
|
||||
});
|
||||
@@ -1212,7 +1211,6 @@ export class ExcalidrawData {
|
||||
el.type !== "text" &&
|
||||
el.id === key &&
|
||||
el.link, //&&
|
||||
//el.link.startsWith("[["),
|
||||
);
|
||||
if (el.length === 0) {
|
||||
this.elementLinks.delete(key); //if no longer in the scene, delete the text element
|
||||
@@ -1350,6 +1348,7 @@ export class ExcalidrawData {
|
||||
position = parts.value.index + parts.value[0].length;
|
||||
}
|
||||
outString += text.substring(position, text.length);
|
||||
outString = this.unescapeSquareBrackets(outString);
|
||||
if (linkIcon) {
|
||||
outString = this.linkPrefix + outString;
|
||||
}
|
||||
@@ -1370,6 +1369,10 @@ export class ExcalidrawData {
|
||||
: text;
|
||||
}
|
||||
|
||||
private unescapeSquareBrackets(text: string): string {
|
||||
return text?.replaceAll(/\\\[/g, "[") ?? text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does a quick parse of the raw text. Returns the parsed string if raw text does not include a transclusion.
|
||||
* Return null if raw text includes a transclusion.
|
||||
@@ -1427,6 +1430,7 @@ export class ExcalidrawData {
|
||||
position = parts.value.index + parts.value[0].length;
|
||||
}
|
||||
outString += text.substring(position, text.length);
|
||||
outString = this.unescapeSquareBrackets(outString);
|
||||
if (linkIcon) {
|
||||
outString = this.linkPrefix + outString;
|
||||
}
|
||||
@@ -1442,6 +1446,7 @@ export class ExcalidrawData {
|
||||
*/
|
||||
disableCompression: boolean = false;
|
||||
generateMDBase(deletedElements: ExcalidrawElement[] = []) {
|
||||
const syncTextLinks = this.plugin.settings.syncElementLinkWithText;
|
||||
let outString = this.textElementCommentedOut ? "%%\n" : "";
|
||||
outString += `# Excalidraw Data\n\n## Text Elements\n`;
|
||||
if (this.plugin.settings.addDummyTextElement) {
|
||||
@@ -1452,7 +1457,7 @@ export class ExcalidrawData {
|
||||
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/566
|
||||
const element = this.scene.elements.filter((el:any)=>el.id===key);
|
||||
let elementString = this.textElements.get(key).raw;
|
||||
if(element && element.length===1 && element[0].link && element[0].rawText === element[0].originalText) {
|
||||
if(element && element.length===1 && element[0].link && (!syncTextLinks || element[0].rawText === element[0].originalText)) {
|
||||
//if(element[0].link.match(/^\[\[[^\]]*]]$/g)) { //apply this only to markdown links
|
||||
textElementLinks.set(key, element[0].link);
|
||||
//elementString = `%%***>>>text element-link:${element[0].link}<<<***%%` + elementString;
|
||||
|
||||
@@ -55,6 +55,7 @@ class ImageCache {
|
||||
this.db = null;
|
||||
this.plugin = null;
|
||||
this.app = null;
|
||||
this.obsidanURLCache.forEach((url) => URL.revokeObjectURL(url));
|
||||
this.obsidanURLCache.clear();
|
||||
this.obsidanURLCache = null;
|
||||
}
|
||||
@@ -179,6 +180,10 @@ class ImageCache {
|
||||
const fileExists = files.some((f: TFile) => f.path === filepath);
|
||||
const file = fileExists ? files.find((f: TFile) => f.path === filepath) : null;
|
||||
if (isLegacyKey || !file || (file && (file.stat.mtime > cursor.value.mtime)) || (!cursor.value.blob && !cursor.value.svg)) {
|
||||
if(this.obsidanURLCache.has(key)) {
|
||||
URL.revokeObjectURL(this.obsidanURLCache.get(key));
|
||||
this.obsidanURLCache.delete(key);
|
||||
}
|
||||
deletePromises.push(
|
||||
new Promise<void>((innerResolve, innerReject) => {
|
||||
const deleteRequest = store.delete(cursor.primaryKey);
|
||||
@@ -368,6 +373,9 @@ class ImageCache {
|
||||
const key = getKey(key_);
|
||||
store.put(data, key);
|
||||
if(!Boolean(svg)) {
|
||||
if(this.obsidanURLCache.has(key) && this.obsidanURLCache.get(key) !== obsidianURL) {
|
||||
URL.revokeObjectURL(this.obsidanURLCache.get(key));
|
||||
}
|
||||
this.obsidanURLCache.set(key, obsidianURL);
|
||||
}
|
||||
}
|
||||
@@ -406,6 +414,9 @@ class ImageCache {
|
||||
return; // Database not initialized yet
|
||||
}
|
||||
|
||||
this.obsidanURLCache.forEach((url) => URL.revokeObjectURL(url));
|
||||
this.obsidanURLCache.clear();
|
||||
|
||||
return this.clear(this.cacheStoreName, "Image cache was cleared");
|
||||
}
|
||||
|
||||
|
||||
+19
-8
@@ -14,7 +14,7 @@ import { splitFolderAndFilename } from "../utils/fileUtils";
|
||||
import { getEA } from "src/core";
|
||||
import { ExcalidrawAutomate } from "../shared/ExcalidrawAutomate";
|
||||
import { WeakArray } from "./WeakArray";
|
||||
import { getExcalidrawViews } from "../utils/obsidianUtils";
|
||||
import { getExcalidrawViews, stripYamlFrontmatter } from "../utils/obsidianUtils";
|
||||
import { ButtonDefinition, InputPromptOptions } from "src/types/promptTypes";
|
||||
|
||||
export type ScriptIconMap = {
|
||||
@@ -42,7 +42,12 @@ export class ScriptEngine {
|
||||
this.eaInstances.forEach((ea) => {
|
||||
if (ea.targetView === view) {
|
||||
eas.add(ea);
|
||||
ea.destroy();
|
||||
if(ea.sidepanelTab) {
|
||||
ea.targetView = null;
|
||||
ea.sidepanelTab.onExcalidrawViewClosed();
|
||||
} else {
|
||||
ea.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.eaInstances.removeObjects(eas);
|
||||
@@ -180,6 +185,13 @@ export class ScriptEngine {
|
||||
return basename;
|
||||
}
|
||||
|
||||
public getScriptFileByName(scriptName: string): TFile | null {
|
||||
return (
|
||||
this.getListofScripts()?.find((file) => this.getScriptName(file) === scriptName) ??
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
async addScriptIconToMap(scriptPath: string, name: string) {
|
||||
const svgFilePath = getIMGFilename(scriptPath, "svg");
|
||||
const file = this.app.vault.getAbstractFileByPath(svgFilePath);
|
||||
@@ -211,9 +223,8 @@ export class ScriptEngine {
|
||||
const view = this.app.workspace.getActiveViewOfType(ExcalidrawView);
|
||||
if (view) {
|
||||
(async()=>{
|
||||
const script = await this.app.vault.read(f);
|
||||
const script = stripYamlFrontmatter(await this.app.vault.read(f));
|
||||
if(script) {
|
||||
//remove YAML frontmatter if present
|
||||
this.executeScript(view, script, scriptName,f);
|
||||
}
|
||||
})()
|
||||
@@ -250,17 +261,17 @@ export class ScriptEngine {
|
||||
delete this.app.commands.commands[commandId];
|
||||
}
|
||||
|
||||
async executeScript(view: ExcalidrawView, script: string, title: string, file: TFile) {
|
||||
if (!view || !script || !title) {
|
||||
async executeScript(view: ExcalidrawView = undefined, script: string, title: string, file: TFile) {
|
||||
if (!script || !title) {
|
||||
return;
|
||||
}
|
||||
//addresses the situation when after paste text element IDs are not updated to 8 characters
|
||||
//linked to onPaste save issue with the false parameter
|
||||
if(view.getScene().elements.some(el=>!el.isDeleted && el.type === "text" && el.id.length > 8)) {
|
||||
if(view && view.getScene().elements.some(el=>!el.isDeleted && el.type === "text" && el.id.length > 8)) {
|
||||
await view.save(false, true);
|
||||
}
|
||||
|
||||
script = script.replace(/^---.*?---\n/gs, "");
|
||||
script = stripYamlFrontmatter(script);
|
||||
const ea = getEA(view);
|
||||
this.eaInstances.push(ea);
|
||||
ea.activeScript = title;
|
||||
|
||||
@@ -17,6 +17,8 @@ export class FileSuggestionModal extends SuggestionModal<LinkSuggestion> {
|
||||
cache: CachedMetadata;
|
||||
filesAndAliases: LinkSuggestion[];
|
||||
file: TFile;
|
||||
private handleGetFile: () => void;
|
||||
|
||||
constructor(app: App, input: TextComponent, items: TFile[], private plugin: ExcalidrawPlugin) {
|
||||
const filesAndAliases = [];
|
||||
for (const file of items) {
|
||||
@@ -36,7 +38,11 @@ export class FileSuggestionModal extends SuggestionModal<LinkSuggestion> {
|
||||
this.text = input;
|
||||
this.suggestEl.style.maxWidth = "100%";
|
||||
this.suggestEl.style.width = `${input.inputEl.clientWidth}px`;
|
||||
this.inputEl.addEventListener("input", () => this.getFile());
|
||||
|
||||
// Pre-bind the handler
|
||||
this.handleGetFile = this.getFile.bind(this);
|
||||
this.inputEl.addEventListener("input", this.handleGetFile);
|
||||
|
||||
this.setPlaceholder(t("SELECT_FILE_TO_INSERT"));
|
||||
this.emptyStateText = t("NO_MATCH");
|
||||
}
|
||||
@@ -139,4 +145,9 @@ export class FileSuggestionModal extends SuggestionModal<LinkSuggestion> {
|
||||
getItems() {
|
||||
return this.filesAndAliases;
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.inputEl.removeEventListener("input", this.handleGetFile);
|
||||
super.close();
|
||||
}
|
||||
}
|
||||
@@ -12,12 +12,16 @@ export class FolderSuggestionModal extends SuggestionModal<TFolder> {
|
||||
cache: CachedMetadata;
|
||||
folders: TFolder[];
|
||||
folder: TFolder;
|
||||
private handleGetFolder: () => void;
|
||||
|
||||
constructor(app: App, input: TextComponent, items: TFolder[]) {
|
||||
super(app, input.inputEl, items);
|
||||
this.folders = [...items];
|
||||
this.text = input;
|
||||
|
||||
this.inputEl.addEventListener("input", () => this.getFolder());
|
||||
// Pre-bind the handler
|
||||
this.handleGetFolder = this.getFolder.bind(this);
|
||||
this.inputEl.addEventListener("input", this.handleGetFolder);
|
||||
}
|
||||
getFolder() {
|
||||
const v = this.inputEl.value;
|
||||
@@ -32,6 +36,10 @@ export class FolderSuggestionModal extends SuggestionModal<TFolder> {
|
||||
|
||||
this.onInputChanged();
|
||||
}
|
||||
close(): void {
|
||||
this.inputEl.removeEventListener("input", this.handleGetFolder);
|
||||
super.close();
|
||||
}
|
||||
getItemText(item: TFolder) {
|
||||
return item.path;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,535 @@
|
||||
import { App, FuzzyMatch, TFile } from "obsidian";
|
||||
import { SuggestionModal } from "./SuggestionModal";
|
||||
import { LinkSuggestion } from "src/types/types";
|
||||
import ExcalidrawPlugin from "src/core/main";
|
||||
import {
|
||||
getLinkSuggestionsFiltered,
|
||||
getSortedLinkMatches,
|
||||
renderHeadingSuggestionRow,
|
||||
renderLinkSuggestion,
|
||||
renderParagraphSuggestionRow,
|
||||
fuzzyMatchTextItems,
|
||||
fuzzyMatchParagraphsWithId,
|
||||
} from "src/shared/Suggesters/LinkSuggesterUtils";
|
||||
import { KeyBlocker } from "src/types/excalidrawAutomateTypes";
|
||||
import { t } from "src/lang/helpers";
|
||||
import { nanoid } from "src/constants/constants";
|
||||
import { sleep } from "src/utils/utils";
|
||||
|
||||
type HeadingSuggestion = {
|
||||
kind: "heading";
|
||||
heading: string;
|
||||
level: number;
|
||||
anchor: string;
|
||||
file: TFile;
|
||||
};
|
||||
|
||||
type ParagraphSuggestion = {
|
||||
kind: "paragraph";
|
||||
text: string;
|
||||
id?: string;
|
||||
file: TFile;
|
||||
node: any;
|
||||
};
|
||||
|
||||
type InlineSuggestion = LinkSuggestion | HeadingSuggestion | ParagraphSuggestion;
|
||||
|
||||
/**
|
||||
* Inline link suggester that attaches to a specific input element.
|
||||
*/
|
||||
export class InlineLinkSuggester extends SuggestionModal<InlineSuggestion> implements KeyBlocker {
|
||||
private readonly getSourcePath: () => string | undefined;
|
||||
private readonly plugin: ExcalidrawPlugin;
|
||||
private readonly widthHost: HTMLElement;
|
||||
private readonly hasCustomWidthHost: boolean;
|
||||
private readonly handleBracketKeyDown: (event: KeyboardEvent) => void;
|
||||
private block = false;
|
||||
private activeOpen = -1;
|
||||
private activeClose = -1;
|
||||
private caretPos = 0;
|
||||
private activeAlias: string | null = null;
|
||||
private activeSearchTerm = "";
|
||||
private activeFile: TFile | null = null;
|
||||
private mode: "file" | "heading" | "block" | null = null;
|
||||
private headingItems: HeadingSuggestion[] = [];
|
||||
private paragraphItems: ParagraphSuggestion[] = [];
|
||||
|
||||
constructor(
|
||||
app: App,
|
||||
plugin: ExcalidrawPlugin,
|
||||
inputEl: HTMLInputElement | HTMLTextAreaElement,
|
||||
getSourcePath: () => string | undefined,
|
||||
widthWrapper?: HTMLElement,
|
||||
surpessPlaceholder: boolean = false,
|
||||
collisionBoundary?: HTMLElement,
|
||||
) {
|
||||
const items = getLinkSuggestionsFiltered(app);
|
||||
super(app, inputEl, items, collisionBoundary);
|
||||
this.plugin = plugin;
|
||||
this.getSourcePath = getSourcePath;
|
||||
this.widthHost = widthWrapper ?? inputEl;
|
||||
this.hasCustomWidthHost = Boolean(widthWrapper);
|
||||
this.handleBracketKeyDown = (event: KeyboardEvent) => this.onBracketKeyDown(event);
|
||||
this.limit = 20;
|
||||
if (!surpessPlaceholder) {
|
||||
this.setPlaceholder(t("INLINE_HINT"));
|
||||
}
|
||||
this.emptyStateText = "No match";
|
||||
this.syncWidth();
|
||||
this.inputEl.addEventListener("keydown", this.handleBracketKeyDown);
|
||||
}
|
||||
|
||||
public isBlockingKeys() {
|
||||
return this.block;
|
||||
}
|
||||
|
||||
private onBracketKeyDown(event: KeyboardEvent) {
|
||||
if (event.key !== "[" || event.metaKey || event.ctrlKey || event.defaultPrevented || event.isComposing) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectionStart = this.inputEl.selectionStart;
|
||||
const selectionEnd = this.inputEl.selectionEnd;
|
||||
if (selectionStart === null || selectionEnd === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const hasSelection = selectionStart !== selectionEnd;
|
||||
const value = this.inputEl.value;
|
||||
const before = value.substring(0, selectionStart);
|
||||
const selected = value.substring(selectionStart, selectionEnd);
|
||||
const after = value.substring(selectionEnd);
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
const insertion = hasSelection ? `[${selected}]` : "[]";
|
||||
const cursorPos = selectionStart + 1 + (hasSelection ? selected.length : 0);
|
||||
this.inputEl.value = `${before}${insertion}${after}`;
|
||||
this.inputEl.setSelectionRange(cursorPos, cursorPos);
|
||||
this.dispatchInputChange();
|
||||
}
|
||||
|
||||
getItems(): InlineSuggestion[] {
|
||||
return getLinkSuggestionsFiltered(this.app) as InlineSuggestion[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep the suggestion dropdown aligned to the provided width host (input or wrapper).
|
||||
*/
|
||||
private syncWidth() {
|
||||
const hostRect = this.widthHost?.getBoundingClientRect();
|
||||
const width = hostRect?.width ?? this.widthHost?.clientWidth;
|
||||
|
||||
if (width && this.hasCustomWidthHost) {
|
||||
this.suggestEl.style.width = `${width}px`;
|
||||
this.suggestEl.style.maxWidth = `${width}px`;
|
||||
this.suggestEl.style.minWidth = `${width}px`;
|
||||
return;
|
||||
}
|
||||
|
||||
const minWidth = Math.max(width || this.inputEl.clientWidth || this.inputEl.getBoundingClientRect().width, 450);
|
||||
if (!minWidth) {
|
||||
return;
|
||||
}
|
||||
|
||||
const anchorRect = hostRect ?? this.inputEl.getBoundingClientRect();
|
||||
let availableWidth = this.collisionBoundary
|
||||
? this.collisionBoundary.innerWidth - 16 //SuggestionModal padding
|
||||
: Math.max(0, window.innerWidth - anchorRect.left - 16);
|
||||
|
||||
if (!this.hasCustomWidthHost) {
|
||||
availableWidth = minWidth <= 450
|
||||
? Math.min(availableWidth, 450)
|
||||
: Math.min(availableWidth, minWidth);
|
||||
}
|
||||
|
||||
const clampedMinWidth = Math.min(minWidth, availableWidth);
|
||||
|
||||
this.suggestEl.style.width = "";
|
||||
this.suggestEl.style.minWidth = `${clampedMinWidth}px`;
|
||||
this.suggestEl.style.maxWidth = `${availableWidth}px`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refreshes the suggestion data (e.g. when vault changes) without recreating the instance.
|
||||
*/
|
||||
public refreshItems() {
|
||||
this.items = getLinkSuggestionsFiltered(this.app) as InlineSuggestion[];
|
||||
}
|
||||
|
||||
modifyInput(input: string): string {
|
||||
return input;
|
||||
}
|
||||
|
||||
async onInputChanged(): Promise<void> {
|
||||
const inputStr = this.modifyInput(this.inputEl.value);
|
||||
this.caretPos = this.inputEl.selectionStart ?? inputStr.length;
|
||||
|
||||
if ((this.inputEl.selectionEnd ?? this.caretPos) - (this.inputEl.selectionStart ?? 0) > 0) {
|
||||
this.resetSuggestions();
|
||||
return;
|
||||
}
|
||||
|
||||
const active = this.findActiveLink(inputStr, this.caretPos);
|
||||
if (!active) {
|
||||
this.resetSuggestions();
|
||||
return;
|
||||
}
|
||||
|
||||
this.activeOpen = active.open;
|
||||
this.activeClose = active.close;
|
||||
|
||||
const context = this.parseLinkContext(inputStr, this.caretPos, active.open, active.close);
|
||||
this.activeAlias = context.alias;
|
||||
this.activeSearchTerm = context.searchTerm;
|
||||
this.activeFile = context.file;
|
||||
this.mode = context.mode;
|
||||
|
||||
if (context.inAlias) {
|
||||
this.resetSuggestions();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.mode === "heading") {
|
||||
await this.loadHeadings(this.activeFile);
|
||||
} else if (this.mode === "block") {
|
||||
await this.loadParagraphs(this.activeFile);
|
||||
} else {
|
||||
this.headingItems = [];
|
||||
this.paragraphItems = [];
|
||||
}
|
||||
|
||||
this.block = true;
|
||||
await super.onInputChanged();
|
||||
}
|
||||
|
||||
getSuggestions(query: string): FuzzyMatch<InlineSuggestion>[] {
|
||||
if (this.activeOpen === -1) return [];
|
||||
|
||||
if (this.mode === "heading") {
|
||||
return fuzzyMatchTextItems(this.activeSearchTerm ?? "", this.headingItems, (h) => h.heading);
|
||||
}
|
||||
|
||||
if (this.mode === "block") {
|
||||
return fuzzyMatchParagraphsWithId(this.activeSearchTerm ?? "", this.paragraphItems);
|
||||
}
|
||||
|
||||
const term = this.activeSearchTerm ?? "";
|
||||
return getSortedLinkMatches(term, this.items as LinkSuggestion[]);
|
||||
}
|
||||
|
||||
private isHeading(item: InlineSuggestion): item is HeadingSuggestion {
|
||||
return (item as HeadingSuggestion)?.kind === "heading";
|
||||
}
|
||||
|
||||
private isParagraph(item: InlineSuggestion): item is ParagraphSuggestion {
|
||||
return (item as ParagraphSuggestion)?.kind === "paragraph";
|
||||
}
|
||||
|
||||
getItemText(item: InlineSuggestion): string {
|
||||
if (this.isHeading(item)) {
|
||||
return item.heading;
|
||||
}
|
||||
if (this.isParagraph(item)) {
|
||||
return item.text;
|
||||
}
|
||||
return (item as LinkSuggestion).path + ((item as LinkSuggestion).alias ? `|${(item as LinkSuggestion).alias}` : "");
|
||||
}
|
||||
|
||||
async onChooseItem(item: InlineSuggestion | undefined): Promise<void> {
|
||||
if (!item) return;
|
||||
|
||||
if (this.isHeading(item)) {
|
||||
const linktext = this.app.metadataCache.fileToLinktext(
|
||||
item.file,
|
||||
this.getSourcePath() ?? "",
|
||||
true,
|
||||
);
|
||||
const aliasSuffix = this.activeAlias !== null ? `|${this.activeAlias}` : "";
|
||||
this.insertLink(`[[${linktext}#${item.anchor}${aliasSuffix}]]`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isParagraph(item)) {
|
||||
const id = await this.ensureParagraphHasId(item);
|
||||
if (!id) return;
|
||||
const linktext = this.app.metadataCache.fileToLinktext(
|
||||
item.file,
|
||||
this.getSourcePath() ?? "",
|
||||
true,
|
||||
);
|
||||
const aliasSuffix = this.activeAlias !== null ? `|${this.activeAlias}` : "";
|
||||
this.insertLink(`[[${linktext}#^${id}${aliasSuffix}]]`);
|
||||
return;
|
||||
}
|
||||
|
||||
const linkString = this.buildLink(item as LinkSuggestion);
|
||||
this.insertLink(linkString);
|
||||
}
|
||||
|
||||
async selectSuggestion(value: FuzzyMatch<InlineSuggestion>, evt: MouseEvent | KeyboardEvent) {
|
||||
evt?.preventDefault?.();
|
||||
evt?.stopPropagation?.();
|
||||
await this.onChooseItem(value?.item);
|
||||
}
|
||||
|
||||
open(): void {
|
||||
this.block = true;
|
||||
this.syncWidth();
|
||||
this.suggestEl.style.pointerEvents = "all";
|
||||
super.open();
|
||||
}
|
||||
|
||||
renderSuggestion(result: FuzzyMatch<InlineSuggestion>, itemEl: HTMLElement) {
|
||||
const { item } = result || {};
|
||||
|
||||
if (this.isHeading(item as InlineSuggestion)) {
|
||||
const note = item
|
||||
? this.app.metadataCache.fileToLinktext((item as HeadingSuggestion).file, this.getSourcePath() ?? "", true)
|
||||
: "";
|
||||
renderHeadingSuggestionRow(result as FuzzyMatch<HeadingSuggestion>, note, itemEl);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isParagraph(item as InlineSuggestion)) {
|
||||
const note = item
|
||||
? this.app.metadataCache.fileToLinktext((item as ParagraphSuggestion).file, this.getSourcePath() ?? "", true)
|
||||
: "";
|
||||
renderParagraphSuggestionRow(result as FuzzyMatch<ParagraphSuggestion>, note, itemEl);
|
||||
return;
|
||||
}
|
||||
|
||||
renderLinkSuggestion(this.plugin, result as FuzzyMatch<LinkSuggestion>, itemEl, this.emptyStateText);
|
||||
}
|
||||
|
||||
private buildLink(item: LinkSuggestion): string {
|
||||
const sourcePath = this.getSourcePath();
|
||||
const aliasFromContext = this.activeAlias;
|
||||
const aliasSuffix = aliasFromContext !== null
|
||||
? `|${aliasFromContext}`
|
||||
: item.alias
|
||||
? `|${item.alias}`
|
||||
: "";
|
||||
if (item.file) {
|
||||
const linktext = this.app.metadataCache.fileToLinktext(
|
||||
item.file,
|
||||
sourcePath ?? "",
|
||||
true,
|
||||
);
|
||||
return `[[${linktext}${aliasSuffix}]]`;
|
||||
}
|
||||
// unresolved/ghost
|
||||
return `[[${item.path}${aliasSuffix}]]`;
|
||||
}
|
||||
|
||||
private insertLink(link: string) {
|
||||
const cursor = this.inputEl.selectionStart ?? this.inputEl.value.length;
|
||||
const start = this.activeOpen >= 0 ? this.activeOpen : this.inputEl.value.lastIndexOf("[[", cursor);
|
||||
if (start === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nextOpen = this.inputEl.value.indexOf("[[", start + 2);
|
||||
const fallbackClose = this.inputEl.value.indexOf("]]", start + 2);
|
||||
const closeBelongsToLink = this.activeClose >= 0
|
||||
? true
|
||||
: fallbackClose !== -1 && (nextOpen === -1 || fallbackClose < nextOpen);
|
||||
const effectiveClose = this.activeClose >= 0 ? this.activeClose : closeBelongsToLink ? fallbackClose : -1;
|
||||
// If no valid closing brackets are present for this link (e.g. another [[ appears first),
|
||||
// only replace up to the current cursor to avoid swallowing subsequent text.
|
||||
const end = effectiveClose >= 0 ? effectiveClose + 2 : cursor;
|
||||
|
||||
const prefix = this.inputEl.value.substring(0, start);
|
||||
const suffix = this.inputEl.value.substring(end);
|
||||
this.inputEl.value = prefix + link + suffix;
|
||||
this.dispatchInputChange();
|
||||
const newPos = start + link.length;
|
||||
this.inputEl.setSelectionRange(newPos, newPos);
|
||||
this.close();
|
||||
}
|
||||
|
||||
private resetSuggestions() {
|
||||
this.suggester.setSuggestions([]);
|
||||
if (this.popper?.deref()) {
|
||||
this.popper.deref().destroy();
|
||||
}
|
||||
this.suggestEl.detach();
|
||||
this.activeOpen = -1;
|
||||
this.activeClose = -1;
|
||||
this.activeAlias = null;
|
||||
this.activeSearchTerm = "";
|
||||
this.activeFile = null;
|
||||
this.mode = null;
|
||||
this.headingItems = [];
|
||||
this.paragraphItems = [];
|
||||
setTimeout(() => {
|
||||
this.block = false;
|
||||
});
|
||||
}
|
||||
|
||||
private parseLinkContext(value: string, caret: number, open: number, close: number) {
|
||||
const activeInfo = this.extractActiveInfo(value, caret, open, close);
|
||||
const closeIndex = close >= 0 ? close : value.length;
|
||||
const linkText = value.substring(open + 2, closeIndex);
|
||||
const pipeIndex = linkText.indexOf("|");
|
||||
const linkWithoutAlias = pipeIndex >= 0 ? linkText.substring(0, pipeIndex) : linkText;
|
||||
const hashIndex = linkWithoutAlias.indexOf("#");
|
||||
const caretInLink = Math.max(0, Math.min(caret - (open + 2), linkText.length));
|
||||
const inSubpath = hashIndex >= 0 && caretInLink > hashIndex;
|
||||
const isBlockMode = inSubpath && linkWithoutAlias.charAt(hashIndex + 1) === "^";
|
||||
const basePath = hashIndex >= 0 ? linkWithoutAlias.substring(0, hashIndex) : linkWithoutAlias;
|
||||
const subpathTerm = inSubpath
|
||||
? linkWithoutAlias.substring(hashIndex + (isBlockMode ? 2 : 1), caretInLink)
|
||||
: "";
|
||||
const file = basePath
|
||||
? this.app.metadataCache.getFirstLinkpathDest(basePath, this.getSourcePath() ?? "")
|
||||
: null;
|
||||
|
||||
const mode = file && file.extension === "md" && inSubpath ? (isBlockMode ? "block" : "heading") : "file";
|
||||
const searchTerm = mode === "file" ? activeInfo.searchTerm : subpathTerm;
|
||||
|
||||
return {
|
||||
alias: activeInfo.alias,
|
||||
inAlias: activeInfo.inAlias,
|
||||
searchTerm,
|
||||
file: mode === "file" ? null : file,
|
||||
mode,
|
||||
} as const;
|
||||
}
|
||||
|
||||
private async loadHeadings(file: TFile | null) {
|
||||
if (!file || file.extension !== "md") {
|
||||
this.headingItems = [];
|
||||
return;
|
||||
}
|
||||
|
||||
const cache = await this.app.metadataCache.blockCache.getForFile({ isCancelled: () => false }, file);
|
||||
const blocks = cache?.blocks ?? [];
|
||||
this.headingItems = blocks
|
||||
.filter((b: any) => b.display && b.node?.type === "heading")
|
||||
.map((b: any) => ({
|
||||
kind: "heading",
|
||||
heading: this.cleanHeading(b.display),
|
||||
anchor: this.cleanHeading(b.display),
|
||||
level: b.node?.depth ?? b.node?.level ?? 1,
|
||||
file,
|
||||
}));
|
||||
}
|
||||
|
||||
private async loadParagraphs(file: TFile | null) {
|
||||
if (!file || file.extension !== "md") {
|
||||
this.paragraphItems = [];
|
||||
return;
|
||||
}
|
||||
|
||||
const cache = await this.app.metadataCache.blockCache.getForFile({ isCancelled: () => false }, file);
|
||||
const blocks = cache?.blocks ?? [];
|
||||
this.paragraphItems = blocks
|
||||
.filter((b: any) =>
|
||||
b.display &&
|
||||
b.node &&
|
||||
(b.node.type === "paragraph" ||
|
||||
b.node.type === "blockquote" ||
|
||||
b.node.type === "listItem" ||
|
||||
b.node.type === "table" ||
|
||||
b.node.type === "callout"),
|
||||
)
|
||||
.map((b: any) => ({
|
||||
kind: "paragraph",
|
||||
text: b.display.trim(),
|
||||
id: b.node?.id,
|
||||
node: b.node,
|
||||
file,
|
||||
}));
|
||||
}
|
||||
|
||||
private cleanHeading(display: string): string {
|
||||
return display.replace(/^#+\s*/, "").trim();
|
||||
}
|
||||
|
||||
private async ensureParagraphHasId(item: ParagraphSuggestion): Promise<string | null> {
|
||||
if (item.id) return item.id;
|
||||
const offset = item.node?.position?.end?.offset;
|
||||
if (!offset) return null;
|
||||
const fileContents = await this.plugin.app.vault.cachedRead(item.file);
|
||||
const newId = nanoid();
|
||||
await this.plugin.app.vault.modify(
|
||||
item.file,
|
||||
`${fileContents.slice(0, offset)} ^${newId}${fileContents.slice(offset)}`,
|
||||
);
|
||||
await sleep(200);
|
||||
item.id = newId;
|
||||
return newId;
|
||||
}
|
||||
|
||||
// Keep listeners so the suggester can trigger multiple times in the same input session.
|
||||
close(): void {
|
||||
this.app.keymap.popScope(this.scope);
|
||||
this.suggester.setSuggestions([]);
|
||||
if (this.popper?.deref()) {
|
||||
this.popper.deref().destroy();
|
||||
}
|
||||
this.suggestEl.detach();
|
||||
this.shouldNotOpen = false;
|
||||
setTimeout(() => {
|
||||
this.block = false;
|
||||
});
|
||||
}
|
||||
|
||||
onEscape(): void {
|
||||
this.close();
|
||||
this.shouldNotOpen = false;
|
||||
}
|
||||
|
||||
private findActiveLink(value: string, pos: number): {open: number; close: number} | null {
|
||||
let searchFrom = 0;
|
||||
let candidate: {open: number; close: number} | null = null;
|
||||
while (true) {
|
||||
const open = value.indexOf("[[", searchFrom);
|
||||
if (open === -1 || open > pos) break;
|
||||
const nextOpen = value.indexOf("[[", open + 2);
|
||||
const closeCandidate = value.indexOf("]]", open + 2);
|
||||
const closeBelongsToLink = closeCandidate !== -1 && (nextOpen === -1 || closeCandidate < nextOpen);
|
||||
const close = closeBelongsToLink ? closeCandidate : -1;
|
||||
const caretInsideBrackets = pos > open + 1 && (close === -1 || pos <= close);
|
||||
if (caretInsideBrackets) {
|
||||
candidate = { open, close };
|
||||
break;
|
||||
}
|
||||
if (close !== -1) {
|
||||
searchFrom = close + 2;
|
||||
} else if (nextOpen !== -1) {
|
||||
searchFrom = nextOpen + 2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
|
||||
private extractActiveInfo(value: string, caret: number, open: number, close: number): {alias: string | null; inAlias: boolean; searchTerm: string} {
|
||||
const closeIndex = close >= 0 ? close : value.length;
|
||||
const linkText = value.substring(open + 2, closeIndex);
|
||||
const caretInLink = Math.max(0, Math.min(caret - (open + 2), linkText.length));
|
||||
const pipeIndex = linkText.indexOf("|");
|
||||
const alias = pipeIndex >= 0 ? linkText.substring(pipeIndex + 1) : null;
|
||||
const inAlias = pipeIndex >= 0 && caretInLink > pipeIndex;
|
||||
|
||||
const linkPart = pipeIndex >= 0 ? linkText.substring(0, pipeIndex) : linkText;
|
||||
const caretInLinkPart = Math.min(caretInLink, linkPart.length);
|
||||
const rawTerm = linkPart.substring(0, caretInLinkPart);
|
||||
const searchTerm = rawTerm.replace(/^.*[\\/]/, "");
|
||||
|
||||
return { alias, inAlias, searchTerm };
|
||||
}
|
||||
|
||||
private dispatchInputChange() {
|
||||
const eventInit = { bubbles: true, composed: true, cancelable: true };
|
||||
const inputEvt = typeof InputEvent !== "undefined"
|
||||
? new InputEvent("input", eventInit as InputEventInit)
|
||||
: new Event("input", eventInit);
|
||||
this.inputEl.dispatchEvent(inputEvt);
|
||||
const changeEvt = new Event("change", eventInit);
|
||||
this.inputEl.dispatchEvent(changeEvt);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
import { App, FuzzyMatch, prepareFuzzySearch, setIcon } from "obsidian";
|
||||
import { LinkSuggestion } from "src/types/types";
|
||||
import {
|
||||
AUDIO_TYPES,
|
||||
CODE_TYPES,
|
||||
ICON_NAME,
|
||||
IMAGE_TYPES,
|
||||
REG_LINKINDEX_INVALIDCHARS,
|
||||
VIDEO_TYPES,
|
||||
} from "src/constants/constants";
|
||||
import ExcalidrawPlugin from "src/core/main";
|
||||
|
||||
/**
|
||||
* Returns Obsidian link suggestions (files, aliases, unresolved) filtered for invalid characters.
|
||||
*/
|
||||
export const getLinkSuggestionsFiltered = (app: App): LinkSuggestion[] => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore Obsidian internal helper
|
||||
const suggestions = app.metadataCache.getLinkSuggestions?.();
|
||||
if (!suggestions) return [];
|
||||
const filtered = suggestions.filter((x: LinkSuggestion) => !x.path.match(REG_LINKINDEX_INVALIDCHARS));
|
||||
|
||||
const now = Date.now();
|
||||
const weekMs = 7 * 24 * 60 * 60 * 1000;
|
||||
|
||||
const isRecent = (s: LinkSuggestion) => !!s.file && now - s.file.stat.mtime <= weekMs;
|
||||
|
||||
return filtered.sort((a: LinkSuggestion, b: LinkSuggestion) => {
|
||||
const aRecent = isRecent(a);
|
||||
const bRecent = isRecent(b);
|
||||
|
||||
if (aRecent !== bRecent) {
|
||||
return aRecent ? -1 : 1; // recent first
|
||||
}
|
||||
|
||||
if (aRecent && bRecent && a.file && b.file && a.file.stat.mtime !== b.file.stat.mtime) {
|
||||
return b.file.stat.mtime - a.file.stat.mtime; // newer recent first
|
||||
}
|
||||
|
||||
const aKey = `${a.path}${a.alias ?? ""}`.toLowerCase();
|
||||
const bKey = `${b.path}${b.alias ?? ""}`.toLowerCase();
|
||||
return aKey.localeCompare(bKey);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns fuzzy matches sorted by fuzzy score, then recency, then name for stability.
|
||||
*/
|
||||
export const getSortedLinkMatches = (
|
||||
term: string,
|
||||
items: LinkSuggestion[],
|
||||
): FuzzyMatch<LinkSuggestion>[] => {
|
||||
const search = prepareFuzzySearch(term);
|
||||
const matches = items
|
||||
.map((item) => {
|
||||
const target = `${item.path}${item.alias ? `|${item.alias}` : ""}`;
|
||||
const matchFull = search(target);
|
||||
|
||||
if (!item.alias) {
|
||||
return matchFull ? { item, match: matchFull } : null;
|
||||
}
|
||||
|
||||
// Also search alias alone; if better, shift ranges to alias segment in the full string
|
||||
const matchAliasOnly = search(item.alias);
|
||||
let best = matchFull;
|
||||
|
||||
if (matchAliasOnly && (!best || matchAliasOnly.score > best.score)) {
|
||||
const aliasOffset = item.path.length + 1; // position where alias starts in "path|alias"
|
||||
const shiftedMatches = matchAliasOnly.matches.map(([from, to]) => [from + aliasOffset, to + aliasOffset]) as [number, number][];
|
||||
best = { ...matchAliasOnly, matches: shiftedMatches } as typeof matchAliasOnly;
|
||||
}
|
||||
|
||||
return best ? { item, match: best } : null;
|
||||
})
|
||||
.filter(Boolean) as FuzzyMatch<LinkSuggestion>[];
|
||||
|
||||
const now = Date.now();
|
||||
const weekMs = 7 * 24 * 60 * 60 * 1000;
|
||||
const isRecent = (s: LinkSuggestion) => !!s.file && now - s.file.stat.mtime <= weekMs;
|
||||
|
||||
return matches.sort((a, b) => {
|
||||
const aScore = a?.match?.score ?? 0;
|
||||
const bScore = b?.match?.score ?? 0;
|
||||
if (aScore !== bScore) return bScore - aScore;
|
||||
|
||||
const aRecent = isRecent(a.item);
|
||||
const bRecent = isRecent(b.item);
|
||||
if (aRecent !== bRecent) return aRecent ? -1 : 1; // recent first
|
||||
|
||||
if (aRecent && bRecent && a.item.file && b.item.file && a.item.file.stat.mtime !== b.item.file.stat.mtime) {
|
||||
return b.item.file.stat.mtime - a.item.file.stat.mtime; // newer recent first
|
||||
}
|
||||
|
||||
const aKey = `${a.item.path}${a.item.alias ?? ""}`.toLowerCase();
|
||||
const bKey = `${b.item.path}${b.item.alias ?? ""}`.toLowerCase();
|
||||
return aKey.localeCompare(bKey);
|
||||
});
|
||||
};
|
||||
|
||||
const renderTextWithHighlights = (titleEl: HTMLElement, text: string, matches: [number, number][]) => {
|
||||
if (!matches?.length) {
|
||||
titleEl.setText(text);
|
||||
return;
|
||||
}
|
||||
const sorted = [...matches].sort((a, b) => a[0] - b[0]);
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
const match = sorted.find((m) => m[0] === i);
|
||||
if (match) {
|
||||
const span = createSpan("suggestion-highlight");
|
||||
span.appendText(text.substring(match[0], match[1]));
|
||||
titleEl.appendChild(span);
|
||||
i = match[1] - 1;
|
||||
continue;
|
||||
}
|
||||
titleEl.appendText(text[i]);
|
||||
}
|
||||
};
|
||||
|
||||
export const fuzzyMatchTextItems = <T>(
|
||||
term: string,
|
||||
items: T[],
|
||||
getText: (item: T) => string,
|
||||
): FuzzyMatch<T>[] => {
|
||||
const search = prepareFuzzySearch(term ?? "");
|
||||
return items
|
||||
.map((item) => {
|
||||
const match = search(getText(item));
|
||||
return match ? { item, match } : null;
|
||||
})
|
||||
.filter(Boolean) as FuzzyMatch<T>[];
|
||||
};
|
||||
|
||||
export const fuzzyMatchParagraphsWithId = <T extends { id?: string; text: string }>(
|
||||
term: string,
|
||||
items: T[],
|
||||
): FuzzyMatch<T>[] => {
|
||||
const search = prepareFuzzySearch(term ?? "");
|
||||
const needle = term?.trim().replace(/^\^/, "").toLowerCase();
|
||||
return items
|
||||
.map((item) => {
|
||||
const display = `${item.id ? `^${item.id} ` : ""}${item.text}`;
|
||||
const match = search(display);
|
||||
if (!match) return null;
|
||||
if (item.id && needle) {
|
||||
const idLower = item.id.toLowerCase();
|
||||
if (idLower === needle) {
|
||||
match.score = Number.MAX_SAFE_INTEGER; // strongest priority for exact id
|
||||
} else if (idLower.includes(needle)) {
|
||||
match.score = match.score + 1000; // strong priority if id contains term
|
||||
}
|
||||
}
|
||||
return { item, match } as FuzzyMatch<T>;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.sort((a, b) => (b.match?.score ?? 0) - (a.match?.score ?? 0)) as FuzzyMatch<T>[];
|
||||
};
|
||||
|
||||
export const renderHeadingSuggestionRow = (
|
||||
result: FuzzyMatch<{ heading: string; level?: number }>,
|
||||
note: string,
|
||||
itemEl: HTMLElement,
|
||||
) => {
|
||||
const { item, match } = result || {};
|
||||
itemEl.addClass("suggestion-item");
|
||||
itemEl.addClass("mod-complex");
|
||||
const contentEl = itemEl.createDiv("suggestion-content");
|
||||
const titleEl = contentEl.createDiv("suggestion-title");
|
||||
if (!item) {
|
||||
titleEl.setText("No match");
|
||||
itemEl.addClass("is-selected");
|
||||
return;
|
||||
}
|
||||
renderTextWithHighlights(titleEl, item.heading, match?.matches ?? []);
|
||||
const noteEl = contentEl.createDiv("suggestion-note");
|
||||
noteEl.setText(note ?? "");
|
||||
const auxEl = itemEl.createDiv("suggestion-aux");
|
||||
const flair = auxEl.createSpan("suggestion-flair");
|
||||
flair.setText(`H${item.level ?? 1}`);
|
||||
};
|
||||
|
||||
export const renderParagraphSuggestionRow = (
|
||||
result: FuzzyMatch<{ text: string; id?: string }>,
|
||||
note: string,
|
||||
itemEl: HTMLElement,
|
||||
) => {
|
||||
const { item, match } = result || {};
|
||||
itemEl.addClass("suggestion-item");
|
||||
itemEl.addClass("mod-complex");
|
||||
const contentEl = itemEl.createDiv("suggestion-content");
|
||||
const titleEl = contentEl.createDiv("suggestion-title");
|
||||
if (!item) {
|
||||
titleEl.setText("No match");
|
||||
itemEl.addClass("is-selected");
|
||||
return;
|
||||
}
|
||||
const display = `${item.id ? `^${item.id} ` : ""}${item.text}`;
|
||||
renderTextWithHighlights(titleEl, display, match?.matches ?? []);
|
||||
const noteEl = contentEl.createDiv("suggestion-note");
|
||||
noteEl.setText(note ?? "");
|
||||
if (item.id) {
|
||||
const auxEl = itemEl.createDiv("suggestion-aux");
|
||||
const flair = auxEl.createSpan("suggestion-flair");
|
||||
flair.setText(`^${item.id}`);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Standard rendering for link suggestions with icons and highlights.
|
||||
*/
|
||||
export const renderLinkSuggestion = (
|
||||
plugin: ExcalidrawPlugin,
|
||||
result: FuzzyMatch<LinkSuggestion>,
|
||||
itemEl: HTMLElement,
|
||||
emptyStateText: string,
|
||||
) => {
|
||||
const { item, match: matches } = result || {};
|
||||
itemEl.addClass("mod-complex");
|
||||
const contentEl = itemEl.createDiv("suggestion-content");
|
||||
const auxEl = itemEl.createDiv("suggestion-aux");
|
||||
const titleEl = contentEl.createDiv("suggestion-title");
|
||||
const noteEl = contentEl.createDiv("suggestion-note");
|
||||
|
||||
if (!item) {
|
||||
titleEl.setText(emptyStateText);
|
||||
itemEl.addClass("is-selected");
|
||||
return;
|
||||
}
|
||||
|
||||
const path = item.file?.path ?? item.path;
|
||||
// For unresolved (ghost) files, highlight the full path. For resolved files, skip folder prefixes.
|
||||
const pathLength = item.file ? path.length - (item.file?.name.length ?? 0) : 0;
|
||||
const matchElements = matches.matches.map(() => createSpan("suggestion-highlight"));
|
||||
const itemText = item.path + (item.alias ? `|${item.alias}` : "");
|
||||
for (let i = pathLength; i < itemText.length; i++) {
|
||||
const match = matches.matches.find((m) => m[0] === i);
|
||||
if (match) {
|
||||
const element = matchElements[matches.matches.indexOf(match)];
|
||||
titleEl.appendChild(element);
|
||||
element.appendText(itemText.substring(match[0], match[1]));
|
||||
i += match[1] - match[0] - 1;
|
||||
continue;
|
||||
}
|
||||
titleEl.appendText(itemText[i]);
|
||||
}
|
||||
noteEl.setText(path);
|
||||
|
||||
if (!item.file) {
|
||||
setIcon(auxEl, "ghost");
|
||||
} else if (plugin.isExcalidrawFile(item.file)) {
|
||||
setIcon(auxEl, ICON_NAME);
|
||||
} else if (item.file.extension === "md") {
|
||||
setIcon(auxEl, "square-pen");
|
||||
} else if (IMAGE_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "image");
|
||||
} else if (VIDEO_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "monitor-play");
|
||||
} else if (AUDIO_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "file-audio");
|
||||
} else if (CODE_TYPES.includes(item.file.extension)) {
|
||||
setIcon(auxEl, "file-code");
|
||||
} else if (item.file.extension === "canvas") {
|
||||
setIcon(auxEl, "layout-dashboard");
|
||||
} else if (item.file.extension === "pdf") {
|
||||
setIcon(auxEl, "book-open-text");
|
||||
} else {
|
||||
auxEl.setText(item.file.extension);
|
||||
}
|
||||
};
|
||||
@@ -16,13 +16,16 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
files: TFile[];
|
||||
text: TextComponent;
|
||||
cache: CachedMetadata;
|
||||
private handleGetFile: () => void;
|
||||
|
||||
constructor(app: App, input: TextComponent, items: TFile[]) {
|
||||
super(app, input.inputEl, items);
|
||||
this.files = [...items];
|
||||
this.text = input;
|
||||
//this.getFile();
|
||||
|
||||
this.inputEl.addEventListener("input", this.getFile.bind(this));
|
||||
// Pre-bind the handler
|
||||
this.handleGetFile = this.getFile.bind(this);
|
||||
this.inputEl.addEventListener("input", this.handleGetFile);
|
||||
}
|
||||
|
||||
getFile() {
|
||||
@@ -40,6 +43,12 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
}
|
||||
this.onInputChanged();
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.inputEl.removeEventListener("input", this.handleGetFile);
|
||||
super.close();
|
||||
}
|
||||
|
||||
getItemText(item: TFile | HeadingCache | BlockCache) {
|
||||
if (item instanceof TFile) {
|
||||
return item.path;
|
||||
@@ -51,6 +60,7 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
return (<BlockCache>item).id;
|
||||
}
|
||||
}
|
||||
|
||||
onChooseItem(item: TFile | HeadingCache | BlockCache) {
|
||||
if (item instanceof TFile) {
|
||||
this.text.setValue(item.basename);
|
||||
@@ -64,6 +74,7 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
this.text.setValue(`${this.file.basename}^${(<BlockCache>item).id}`);
|
||||
}
|
||||
}
|
||||
|
||||
selectSuggestion({ item }: FuzzyMatch<TFile | BlockCache | HeadingCache>) {
|
||||
let link: string;
|
||||
if (item instanceof TFile) {
|
||||
@@ -79,6 +90,7 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
|
||||
this.close();
|
||||
}
|
||||
|
||||
renderSuggestion(
|
||||
result: FuzzyMatch<TFile | BlockCache | HeadingCache>,
|
||||
el: HTMLElement,
|
||||
@@ -131,6 +143,7 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
content.setText((<BlockCache>item).id);
|
||||
}
|
||||
}
|
||||
|
||||
get headings() {
|
||||
if (!this.file) {
|
||||
return [];
|
||||
@@ -140,6 +153,7 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
}
|
||||
return this.cache.headings || [];
|
||||
}
|
||||
|
||||
get blocks() {
|
||||
if (!this.file) {
|
||||
return [];
|
||||
@@ -149,6 +163,7 @@ export class PathSuggestionModal extends SuggestionModal<
|
||||
}
|
||||
return Object.values(this.cache.blocks || {}) || [];
|
||||
}
|
||||
|
||||
getItems() {
|
||||
const v = this.inputEl.value;
|
||||
if (/#/.test(v)) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from "obsidian";
|
||||
import { createPopper, Instance as PopperInstance } from "@popperjs/core";
|
||||
import { Suggester } from "./Suggester";
|
||||
import { t } from "src/lang/helpers";
|
||||
|
||||
export abstract class SuggestionModal<T> extends FuzzySuggestModal<T> {
|
||||
items: T[] = [];
|
||||
@@ -16,27 +17,39 @@ export abstract class SuggestionModal<T> extends FuzzySuggestModal<T> {
|
||||
suggester: Suggester<FuzzyMatch<T>>;
|
||||
suggestEl: HTMLDivElement;
|
||||
promptEl: HTMLDivElement;
|
||||
emptyStateText: string = "No match found";
|
||||
emptyStateText: string = t("SUGGESTION_NOMATCH");
|
||||
limit: number = 100;
|
||||
shouldNotOpen: boolean;
|
||||
constructor(app: App, inputEl: HTMLInputElement, items: T[]) {
|
||||
|
||||
// Pre-bound event handlers
|
||||
private handleInput: () => void;
|
||||
private handleFocus: () => void;
|
||||
private handleBlur: () => void;
|
||||
private handleMouseDown: (event: MouseEvent) => void;
|
||||
public readonly collisionBoundary?: HTMLElement;
|
||||
|
||||
constructor(app: App, inputEl: HTMLInputElement | HTMLTextAreaElement, items: T[], collisionBoundary?: HTMLElement) {
|
||||
super(app);
|
||||
this.inputEl = inputEl;
|
||||
this.inputEl = inputEl as HTMLInputElement;
|
||||
this.items = items;
|
||||
this.collisionBoundary = collisionBoundary;
|
||||
|
||||
// Pre-bind event handlers
|
||||
this.handleInput = this.onInputChanged.bind(this);
|
||||
this.handleFocus = this.onFocus.bind(this);
|
||||
this.handleBlur = this.close.bind(this);
|
||||
this.handleMouseDown = (event: MouseEvent) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
this.suggestEl = createDiv("suggestion-container");
|
||||
this.contentEl = this.suggestEl.createDiv("suggestion");
|
||||
this.suggester = new Suggester(this, this.contentEl, this.scope);
|
||||
this.scope.register([], "Escape", this.onEscape.bind(this));
|
||||
this.inputEl.addEventListener("input", this.onInputChanged.bind(this));
|
||||
this.inputEl.addEventListener("focus", this.onFocus.bind(this));
|
||||
this.inputEl.addEventListener("blur", this.close.bind(this));
|
||||
this.suggestEl.on(
|
||||
"mousedown",
|
||||
".suggestion-container",
|
||||
(event: MouseEvent) => {
|
||||
event.preventDefault();
|
||||
},
|
||||
);
|
||||
this.inputEl.addEventListener("input", this.handleInput);
|
||||
this.inputEl.addEventListener("focus", this.handleFocus);
|
||||
this.inputEl.addEventListener("blur", this.handleBlur);
|
||||
this.suggestEl.on("mousedown", ".suggestion-container", this.handleMouseDown);
|
||||
}
|
||||
|
||||
empty() {
|
||||
@@ -74,24 +87,37 @@ export abstract class SuggestionModal<T> extends FuzzySuggestModal<T> {
|
||||
open(): void {
|
||||
// TODO: Figure out a better way to do this. Idea from Periodic Notes plugin
|
||||
this.app.keymap.pushScope(this.scope);
|
||||
this.inputEl.ownerDocument.body.appendChild(this.suggestEl);
|
||||
this.popper = new WeakRef(createPopper(this.inputEl, this.suggestEl, {
|
||||
placement: "bottom-start",
|
||||
modifiers: [
|
||||
{
|
||||
name: "offset",
|
||||
options: {
|
||||
offset: [0, 10],
|
||||
//setTimeout(() => {
|
||||
const modal = this.inputEl.closest(".modal");
|
||||
const modalContainer =
|
||||
(this.inputEl.closest(".modal-container") as HTMLElement) ??
|
||||
(modal?.parentElement?.matches(".modal-container")
|
||||
? (modal.parentElement as HTMLElement)
|
||||
: null);
|
||||
|
||||
const host = modalContainer ?? this.inputEl.ownerDocument.body;
|
||||
|
||||
host.appendChild(this.suggestEl);
|
||||
|
||||
const boundary = this.collisionBoundary ?? host;
|
||||
|
||||
this.popper = new WeakRef(createPopper(this.inputEl, this.suggestEl, {
|
||||
placement: "bottom-start",
|
||||
strategy: host.matches(".modal-container") ? "absolute" : "fixed",
|
||||
modifiers: [
|
||||
{ name: "offset", options: { offset: [0, 10] } },
|
||||
{ name: "flip", options: { fallbackPlacements: ["top"] } },
|
||||
{ name:
|
||||
"preventOverflow",
|
||||
options: {
|
||||
boundary,
|
||||
altBoundary: true,
|
||||
padding: { left: 8, right: 8 },
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "flip",
|
||||
options: {
|
||||
fallbackPlacements: ["top"],
|
||||
},
|
||||
},
|
||||
],
|
||||
}));
|
||||
],
|
||||
}));
|
||||
//},50);
|
||||
}
|
||||
|
||||
onEscape(): void {
|
||||
@@ -106,9 +132,9 @@ export abstract class SuggestionModal<T> extends FuzzySuggestModal<T> {
|
||||
if (this.popper?.deref()) {
|
||||
this.popper.deref().destroy();
|
||||
}
|
||||
this.inputEl.removeEventListener("input", this.onInputChanged.bind(this));
|
||||
this.inputEl.removeEventListener("focus", this.onFocus.bind(this));
|
||||
this.inputEl.removeEventListener("blur", this.close.bind(this));
|
||||
this.inputEl.removeEventListener("input", this.handleInput);
|
||||
this.inputEl.removeEventListener("focus", this.handleFocus);
|
||||
this.inputEl.removeEventListener("blur", this.handleBlur);
|
||||
this.suggestEl.detach();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,23 @@ export type SVGColorInfo = Map<string, {
|
||||
stroke: boolean;
|
||||
}>;
|
||||
|
||||
export type ScriptSettingValue = {
|
||||
value?:string | number | boolean,
|
||||
hidden?: boolean,
|
||||
description?: string,
|
||||
valueset?: string[],
|
||||
height?: number, //height of textarea in Plugin Settings if type is string
|
||||
};
|
||||
|
||||
/**
|
||||
* Marker for UI helpers (e.g., suggesters) that, while active, should signal
|
||||
* host scripts to ignore or block their own keydown handlers.
|
||||
*/
|
||||
export interface KeyBlocker {
|
||||
isBlockingKeys(): boolean;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
export type ImageInfo = {
|
||||
mimeType: MimeType,
|
||||
id: FileId,
|
||||
@@ -31,4 +48,4 @@ export interface AddImageOptions {
|
||||
scale?: boolean;
|
||||
anchor?: boolean;
|
||||
colorMap?: ColorMap;
|
||||
}
|
||||
}
|
||||
Vendored
+21
-13
@@ -1,8 +1,8 @@
|
||||
import { RestoredDataState } from "@zsviczian/excalidraw/types/excalidraw/data/restore";
|
||||
import { ImportedDataState } from "@zsviczian/excalidraw/types/excalidraw/data/types";
|
||||
import { BoundingBox } from "@zsviczian/excalidraw/types/element/src";
|
||||
import { ElementsMap, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFrameLikeElement, ExcalidrawTextContainer, ExcalidrawTextElement, FontFamilyValues, FontString, NonDeleted, NonDeletedExcalidrawElement, OrderedExcalidrawElement, Theme } from "@zsviczian/excalidraw/types/element/src/types";
|
||||
import { FontMetadata } from "@zsviczian/excalidraw/types/common/src";
|
||||
import { ElementsMap, ElementsMapOrArray, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFrameLikeElement, ExcalidrawTextContainer, ExcalidrawTextElement, FontFamilyValues, FontString, NonDeleted, NonDeletedExcalidrawElement, OrderedExcalidrawElement, Theme } from "@zsviczian/excalidraw/types/element/src/types";
|
||||
import { CombineBrandsIfNeeded, FontMetadata } from "@zsviczian/excalidraw/types/common/src";
|
||||
import { AppState, BinaryFiles, DataURL, GenerateDiagramToCode, Zoom } from "@zsviczian/excalidraw/types/excalidraw/types";
|
||||
import { Mutable } from "@zsviczian/excalidraw/types/common/src/utility-types";
|
||||
import { GlobalPoint } from "@zsviczian/excalidraw/types/math/src/types";
|
||||
@@ -67,12 +67,18 @@ declare namespace ExcalidrawLib {
|
||||
) => { width: number; height: number; scale?: number };
|
||||
};
|
||||
|
||||
function restore(
|
||||
data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null,
|
||||
localAppState: Partial<AppState> | null | undefined,
|
||||
localElements: readonly ExcalidrawElement[] | null | undefined,
|
||||
elementsConfig?: { refreshDimensions?: boolean; repairBindings?: boolean },
|
||||
): RestoredDataState;
|
||||
function restoreElements <T extends ExcalidrawElement>(
|
||||
targetElements: readonly T[] | undefined | null,
|
||||
/** used for additional context (e.g. repairing arrow bindings) */
|
||||
existingElements: Readonly<ElementsMapOrArray> | null | undefined,
|
||||
opts?:
|
||||
| {
|
||||
refreshDimensions?: boolean;
|
||||
repairBindings?: boolean;
|
||||
deleteInvisibleElements?: boolean;
|
||||
}
|
||||
| undefined,
|
||||
) : CombineBrandsIfNeeded<T, OrderedExcalidrawElement>;
|
||||
|
||||
function exportToSvg(opts: Omit<ExportOpts, "getDimensions"> & {
|
||||
elements: ExcalidrawElement[];
|
||||
@@ -191,22 +197,23 @@ declare namespace ExcalidrawLib {
|
||||
|
||||
function getEmbedLink (link: string | null | undefined): EmbeddedLink;
|
||||
|
||||
function mermaidToExcalidraw(
|
||||
const mermaidToExcalidraw: typeof import("@zsviczian/excalidraw/types/excalidraw/components/TTDDialog/MermaidToExcalidrawLib").mermaidToExcalidraw;
|
||||
|
||||
/*function mermaidToExcalidraw(
|
||||
mermaidDefinition: string,
|
||||
opts: MermaidConfig,
|
||||
forceSVG?: boolean,
|
||||
): Promise<{
|
||||
elements?: ExcalidrawElement[];
|
||||
files?: any;
|
||||
error?: string;
|
||||
} | undefined>;
|
||||
} | undefined>;*/
|
||||
|
||||
var getSceneVersion: any;
|
||||
var Excalidraw: any;
|
||||
var MainMenu: any;
|
||||
var WelcomeScreen: any;
|
||||
var TTDDialogTrigger: any;
|
||||
var TTDDialog: any;
|
||||
var TTDDialogTrigger: typeof import("@zsviczian/excalidraw").TTDDialogTrigger;
|
||||
var TTDDialog: typeof import("@zsviczian/excalidraw").TTDDialog;
|
||||
var DiagramToCodePlugin: (props: {
|
||||
generate: GenerateDiagramToCode;
|
||||
}) => any;
|
||||
@@ -226,5 +233,6 @@ declare namespace ExcalidrawLib {
|
||||
function loadMermaid(): Promise<any>;
|
||||
function syncInvalidIndices(elements: readonly ExcalidrawElement[]): OrderedExcalidrawElement[];
|
||||
function syncMovedIndices(elements: readonly ExcalidrawElement[], movedElements: ElementsMap): OrderedExcalidrawElement[];
|
||||
function getDefaultColorPalette(): [string, string, string, string, string][];
|
||||
}
|
||||
|
||||
@@ -67,4 +67,5 @@ export interface ViewSemaphores {
|
||||
saving: boolean;
|
||||
hoverSleep: boolean; //flag with timer to prevent hover preview from being triggered dozens of times
|
||||
wheelTimeout:number; //used to avoid hover preview while zooming
|
||||
shouldSaveImportedImage: boolean; //forceSave after image import via the Excalidraw Image Tool or by way of paste
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export type ButtonDefinition = { caption: string; tooltip?:string; action: Function };
|
||||
export type ButtonDefinition = { caption: string; tooltip?:string; action: Function, iconId?: string };
|
||||
|
||||
export interface InputPromptOptions {
|
||||
header: string,
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
|
||||
import type ExcalidrawView from "src/view/ExcalidrawView";
|
||||
|
||||
/**
|
||||
* SidepanelTab defines the public surface of a sidepanel tab as exposed to scripts.
|
||||
* Tabs are lightweight modal-like containers with their own DOM (title/content) that the host sidepanel activates, focuses, and closes.
|
||||
* Typical flow for scripts:
|
||||
* 1) Create the tab via ea.createSidepanelTab(title, persist=false, reveal=true). Note the sidepanelTab is immediately created even if not revealed.
|
||||
* If the sidepanel tab is the first in the sidepanel, then onOpen will not be called becase the tab is already open/active.
|
||||
* Reveal simply opens the obisidan sidepanel and the Excalidraw sidepanel view which already displays the active tab.
|
||||
* 2) Render UI into `contentEl` or use `setContent(...)` / `setTitle(...)`.
|
||||
* 3) Implement lifecycle hooks: `onOpen` (only runs when the user changes tabs in the Excalidraw sidepanel), `onFocus(view)` (runs on host focus changes), `onClose`/`setCloseCallback` (cleanup), `onExcalidrawViewClosed` (canvas closed).
|
||||
* Use `onWindowMigrated(win)` to reattach any window-bound event handlers if the sidepanel moves between the main workspace and a popout window (the DOM is reparented during this migration). The `win` argument is the new Window hosting the sidepanel DOM.
|
||||
* 4) Use `setDisabled`, `focus`, `close`, `reset`, and persistence helpers (from host) as needed.
|
||||
* 5) Use ea.sidepanelTab.open() to show the sidepanel tab associated with the script.
|
||||
* 6) When the sidepanel is nolonger required the script should call ea.sidepanelTab.close() to close the tab and trigger cleanup.
|
||||
* The sidpanel associated with an ea script is available on ea.sidepanelTab. Persisted tabs are restored on Obsidian startup, such that scripts associated with the persisted tabs are
|
||||
* loaded and executed on Excalidraw startup, and the scripts are in turn responsible for recreating their sidepanel tabs via ea.createSidepanelTab as per their normal script initiation sequence.
|
||||
* This description is intentionally explicit so an LLM can generate sidepanel-aware script code without inspecting the implementation.
|
||||
*/
|
||||
|
||||
export interface SidepanelTab {
|
||||
/** Unique tab identifier used by the host sidepanel. */
|
||||
readonly id: string;
|
||||
/** Optional script name backing this tab (used for persistence and lookup). */
|
||||
readonly scriptName?: string;
|
||||
/** Current title shown in the sidepanel selector. */
|
||||
readonly title: string;
|
||||
/** Root container element for the tab (same as modalEl). */
|
||||
readonly containerEl: HTMLDivElement;
|
||||
/** Wrapper element for the tab. */
|
||||
readonly modalEl: HTMLDivElement;
|
||||
/** Content element where scripts render their UI. */
|
||||
readonly contentEl: HTMLDivElement;
|
||||
/** Title element whose text mirrors `title`. */
|
||||
readonly titleEl: HTMLDivElement;
|
||||
/**
|
||||
* Focus hook fired when the host marks this tab active; set by scripts.
|
||||
* Because sidpanel tabs may outlive their associated Excalidraw views on focus is designed to notify scripts of the most recently active view.
|
||||
* The script can verify if the view has changed by comparing against ea.targetView (ea.targetView === view means no change).
|
||||
* The script is responsible for calling ea.setView(view) if it wishes to bind to the new view.
|
||||
* The script may also wish to call ea.clear() or ea.reset() to discard state associated with the prior view.
|
||||
* In case the script performs view specific actions it should update its UI in onFocus when the received view !== ea.targetView.
|
||||
* @param view The most recently active ExcalidrawView, or null if no ExcalidrawViews are present in the workspace.
|
||||
*/
|
||||
onFocus: (view: ExcalidrawView | null) => void;
|
||||
/** Hook fired when the associated Excalidraw view closes; set by ScriptEngine. */
|
||||
onExcalidrawViewClosed: () => void;
|
||||
/** Hook fired when the sidepanel's DOM is migrated to another window (e.g., into or out of a popout) so scripts can rebind listeners. */
|
||||
onWindowMigrated: (win: Window) => void;
|
||||
/** Clears all children from the content element. */
|
||||
clear(): void;
|
||||
/** Sets the tab title and updates host UI; returns the tab for chaining. */
|
||||
setTitle(title: string): this;
|
||||
/** Replaces tab content with text or a fragment; returns the tab for chaining. */
|
||||
setContent(content: string | DocumentFragment): this;
|
||||
/** Activates this tab within the host sidepanel. */
|
||||
focus(): void;
|
||||
/** Marks the tab open, activates it, and triggers `onOpen`. */
|
||||
open(): void;
|
||||
/** Runs close handlers then asks the host to remove the tab. */
|
||||
close(): void;
|
||||
/** Lifecycle hook called when the tab is opened/activated. */
|
||||
onOpen(): Promise<void> | void;
|
||||
/** Lifecycle hook called once when the tab closes. */
|
||||
onClose(): void;
|
||||
/** Toggles pointer interactivity and opacity; returns the tab for chaining. */
|
||||
setDisabled(disabled: boolean): this;
|
||||
/** Returns the ExcalidrawAutomate instance associated with the sidepanel tab */
|
||||
getHostEA(): ExcalidrawAutomate;
|
||||
/** Returns whether the tab is currently visible in the UI */
|
||||
isVisible(): boolean;
|
||||
}
|
||||
@@ -7,11 +7,12 @@ const handleImageEditPrompt = async (request: AIRequest) : Promise<RequestUrlRes
|
||||
const {
|
||||
openAIAPIToken,
|
||||
openAIImageEditsURL,
|
||||
openAIDefaultImageGenerationModel,
|
||||
} = plugin.settings;
|
||||
const { image, text, imageGenerationProperties} = request;
|
||||
|
||||
const body = new FormData();
|
||||
body.append("model", "dall-e-2");
|
||||
body.append("model", openAIDefaultImageGenerationModel);
|
||||
text.trim() !== "" && body.append("prompt", text);
|
||||
|
||||
if (image) {
|
||||
@@ -21,7 +22,7 @@ const handleImageEditPrompt = async (request: AIRequest) : Promise<RequestUrlRes
|
||||
|
||||
if (imageGenerationProperties.mask) {
|
||||
const maskBlob = await fetch(imageGenerationProperties.mask).then((res) => res.blob());
|
||||
body.append('mask', maskBlob, 'masik.png');
|
||||
body.append('mask', maskBlob, 'mask.png');
|
||||
}
|
||||
|
||||
imageGenerationProperties.size && body.append("size", imageGenerationProperties.size);
|
||||
|
||||
@@ -1,10 +1,36 @@
|
||||
const REG_YOUTUBE = /^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|.*&t=|\?start=|.*&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/;
|
||||
const REG_VIMEO = /^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/;
|
||||
|
||||
export const isVimeo = (url: string): boolean => {
|
||||
return Boolean(
|
||||
url.match(REG_VIMEO)
|
||||
);
|
||||
}
|
||||
|
||||
export const isYouTube = (url: string): boolean => {
|
||||
return Boolean(
|
||||
url.match(REG_YOUTUBE)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export const getAspectRatio = (url: string): { w: number; h: number } => {
|
||||
const normalizedUrl = url.toLowerCase();
|
||||
|
||||
if (isYouTube(url)) {
|
||||
const isShorts = normalizedUrl.includes("shorts/");
|
||||
return isShorts ? { w: 9, h: 16 } : { w: 16, h: 9 };
|
||||
}
|
||||
|
||||
if (isVimeo(url)) {
|
||||
return { w: 16, h: 9 };
|
||||
}
|
||||
|
||||
return { w: 1, h: 1 };
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getYouTubeStartAt = (url: string): string => {
|
||||
const ytLink = url.match(REG_YOUTUBE);
|
||||
if (ytLink?.[2]) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ExcalidrawImperativeAPI } from "@zsviczian/excalidraw/types/excalidraw/types";
|
||||
import { ColorMaster } from "@zsviczian/colormaster";
|
||||
import CM, { ColorMaster } from "@zsviczian/colormaster";
|
||||
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
|
||||
import ExcalidrawView from "src/view/ExcalidrawView";
|
||||
import { DynamicStyle } from "src/types/types";
|
||||
@@ -190,4 +190,43 @@ export const setDynamicStyle = (
|
||||
color = null;
|
||||
dynamicStyle = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const colorsCache: Map<string,string> = new Map();
|
||||
|
||||
export function getHighlightColor(
|
||||
ea: ExcalidrawAutomate,
|
||||
bgColor: string,
|
||||
opacity:number = 1
|
||||
): string {
|
||||
bgColor = bgColor==="transparent" ? "#ffffff": bgColor;
|
||||
|
||||
let contrastedRGBA = colorsCache.get(bgColor);
|
||||
if(!contrastedRGBA) {
|
||||
const bg = ea.getCM(bgColor);
|
||||
const bgMix = ea.getCM(bgColor);
|
||||
const isDark = bg.isDark();
|
||||
|
||||
const step = 15;
|
||||
const candidates = [
|
||||
CM((isDark ? bg.lighterBy(step) : bg.darkerBy(step)).stringHEX()),
|
||||
CM((isDark ? bg.lighterBy(step) : bg.darkerBy(step)).stringHEX()),
|
||||
isDark ? bg.lighterBy(step) : bg.darkerBy(step),
|
||||
// Vibrancy boost by mixing toward the opposite theme color
|
||||
bgMix.mix({color: ea.getCM(isDark ? "#ffffff" : "#000000"), ratio:0.35}),
|
||||
ea.getCM(isDark ? "#ffffff" : "#000000"),
|
||||
ea.getCM(isDark ? "#000000" : "#ffffff"),
|
||||
];
|
||||
|
||||
const desiredContrast = 2.5;
|
||||
const contrasted = candidates.find(color =>
|
||||
color.contrast({bgColor, ratio:false}) as number >= desiredContrast) ??
|
||||
candidates.reduce((best, color) =>
|
||||
(color.contrast({bgColor, ratio: false}) > best.contrast({bgColor, ratio:false}) ? color : best)
|
||||
);
|
||||
contrastedRGBA = `rgba(${Math.round(contrasted.red)
|
||||
},${Math.round(contrasted.green)},${Math.round(contrasted.blue)}`;
|
||||
colorsCache.set(bgColor,contrastedRGBA);
|
||||
}
|
||||
return `${contrastedRGBA},${opacity})`;
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
|
||||
import { DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
|
||||
import { BinaryFileData, DataURL } from "@zsviczian/excalidraw/types/excalidraw/types";
|
||||
import ExcalidrawPlugin from "src/core/main";
|
||||
import {
|
||||
ExcalidrawElement,
|
||||
ExcalidrawImageElement,
|
||||
FileId,
|
||||
FixedPoint,
|
||||
} from "@zsviczian/excalidraw/types/element/src/types";
|
||||
import { normalizePath, TFile } from "obsidian";
|
||||
|
||||
@@ -12,7 +13,7 @@ import ExcalidrawView, { getTextMode } from "src/view/ExcalidrawView";
|
||||
import {
|
||||
GITHUB_RELEASES,
|
||||
getCommonBoundingBox,
|
||||
restore,
|
||||
restoreElements,
|
||||
REG_LINKINDEX_INVALIDCHARS,
|
||||
THEME_FILTER,
|
||||
EXCALIDRAW_PLUGIN,
|
||||
@@ -30,7 +31,7 @@ import {
|
||||
isVersionNewerThanOther,
|
||||
scaleLoadedImage,
|
||||
} from "src/utils/utils";
|
||||
import { GenericInputPrompt, NewFileActions } from "src/shared/Dialogs/Prompt";
|
||||
import { GenericInputPrompt, LaTexPrompt, NewFileActions } from "src/shared/Dialogs/Prompt";
|
||||
import { t } from "src/lang/helpers";
|
||||
import { Mutable } from "@zsviczian/excalidraw/types/common/src/utility-types";
|
||||
import {
|
||||
@@ -38,7 +39,7 @@ import {
|
||||
extractCodeBlocks as _extractCodeBlocks,
|
||||
} from "../utils/AIUtils";
|
||||
import { EmbeddedFilesLoader } from "src/shared/EmbeddedFileLoader";
|
||||
import { SVGColorInfo } from "src/types/excalidrawAutomateTypes";
|
||||
import { ScriptSettingValue, SVGColorInfo } from "src/types/excalidrawAutomateTypes";
|
||||
import { ExcalidrawData, getExcalidrawMarkdownHeaderSection, REG_LINKINDEX_HYPERLINK, REGEX_LINK } from "src/shared/ExcalidrawData";
|
||||
import { getFrameBasedOnFrameNameOrId, sceneRemoveInternalLinks } from "./excalidrawViewUtils";
|
||||
import { ScriptEngine } from "src/shared/Scripts";
|
||||
@@ -190,10 +191,6 @@ export function getLineBox(
|
||||
};
|
||||
}
|
||||
|
||||
export function getFontFamily(id: number):string {
|
||||
return getFontFamilyString({fontFamily:id})
|
||||
}
|
||||
|
||||
export function _measureText(
|
||||
newText: string,
|
||||
fontSize: number,
|
||||
@@ -210,7 +207,7 @@ export function _measureText(
|
||||
}
|
||||
const metrics = measureText(
|
||||
newText,
|
||||
`${fontSize.toString()}px ${getFontFamily(fontFamily)}` as any,
|
||||
`${fontSize.toString()}px ${getFontFamilyString({fontFamily})}` as any,
|
||||
lineHeight
|
||||
);
|
||||
return { w: metrics.width, h: metrics.height };
|
||||
@@ -397,6 +394,7 @@ export async function createPNG(
|
||||
depth: number,
|
||||
padding?: number,
|
||||
imagesDict?: any,
|
||||
overrideFiles?: Record<ExcalidrawElement["id"], BinaryFileData>,
|
||||
): Promise<Blob> {
|
||||
if (!loader) {
|
||||
loader = new EmbeddedFilesLoader(plugin);
|
||||
@@ -438,6 +436,7 @@ export async function createPNG(
|
||||
},
|
||||
padding,
|
||||
scale,
|
||||
overrideFiles,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -513,6 +512,7 @@ export async function createSVG(
|
||||
imagesDict?: any,
|
||||
convertMarkdownLinksToObsidianURLs: boolean = false,
|
||||
includeInternalLinks: boolean = true,
|
||||
overrideFiles?: Record<ExcalidrawElement["id"], BinaryFileData>,
|
||||
): Promise<SVGSVGElement> {
|
||||
if (!loader) {
|
||||
loader = new EmbeddedFilesLoader(plugin);
|
||||
@@ -563,6 +563,7 @@ export async function createSVG(
|
||||
},
|
||||
padding,
|
||||
null,
|
||||
overrideFiles,
|
||||
);
|
||||
|
||||
if (withTheme && theme === "dark") addFilterToForeignObjects(svg);
|
||||
@@ -650,24 +651,44 @@ export function repositionElementsToCursor(
|
||||
element.y = element.y + offsetY;
|
||||
});
|
||||
|
||||
return restore({elements}, null, null).elements;
|
||||
return restoreElements(elements, null, {refreshDimensions: true, repairBindings: true});
|
||||
}
|
||||
|
||||
export const insertLaTeXToView = (view: ExcalidrawView, center: boolean = false) => {
|
||||
const app = view.plugin.app;
|
||||
const ea = getEA(view) as ExcalidrawAutomate;
|
||||
GenericInputPrompt.Prompt(
|
||||
view,
|
||||
view.plugin,
|
||||
app,
|
||||
t("ENTER_LATEX"),
|
||||
"\\color{red}\\oint_S {E_n dA = \\frac{1}{{\\varepsilon _0 }}} Q_{inside}",
|
||||
view.plugin.settings.latexBoilerplate,
|
||||
undefined,
|
||||
3
|
||||
const isLatexSuitAvailable = !!app.plugins.plugins["obsidian-latex-suite"];
|
||||
(isLatexSuitAvailable
|
||||
? LaTexPrompt.Prompt(app, t("ENTER_LATEX"), view.plugin.settings.latexBoilerplate)
|
||||
: GenericInputPrompt.Prompt(
|
||||
view,
|
||||
view.plugin,
|
||||
app,
|
||||
t("ENTER_LATEX"),
|
||||
"\\color{red}\\oint_S {E_n dA = \\frac{1}{{\\varepsilon _0 }}} Q_{inside}",
|
||||
view.plugin.settings.latexBoilerplate,
|
||||
undefined,
|
||||
3
|
||||
)
|
||||
).then(async (formula: string) => {
|
||||
const lastLatexEl = ea.getViewElements()
|
||||
.filter((el) => el.type === "image" && view.excalidrawData.hasEquation(el.fileId))
|
||||
.reduce(
|
||||
(maxel, curr) => (!maxel || curr.updated > maxel.updated) ? curr : maxel,
|
||||
undefined
|
||||
) as ExcalidrawImageElement;
|
||||
let scaleX = 1;
|
||||
let scaleY = 1;
|
||||
if (lastLatexEl) {
|
||||
const equation = view.excalidrawData.getEquation(lastLatexEl.fileId);
|
||||
const dataurl = await ea.tex2dataURL(equation.latex);
|
||||
if (dataurl.size.width > 0 && dataurl.size.height > 0) {
|
||||
scaleX = lastLatexEl.width/dataurl.size.width;
|
||||
scaleY = lastLatexEl.height/dataurl.size.height;
|
||||
}
|
||||
}
|
||||
if (formula) {
|
||||
const id = await ea.addLaTex(0, 0, formula);
|
||||
const id = await ea.addLaTex(0, 0, formula, scaleX, scaleY);
|
||||
if(center) {
|
||||
const el = ea.getElement(id);
|
||||
let {width, height} = el;
|
||||
@@ -679,7 +700,7 @@ export const insertLaTeXToView = (view: ExcalidrawView, center: boolean = false)
|
||||
ea.selectElementsInView([id]);
|
||||
}
|
||||
ea.destroy();
|
||||
});
|
||||
}, () => {});
|
||||
};
|
||||
|
||||
export const search = async (view: ExcalidrawView) => {
|
||||
@@ -845,11 +866,90 @@ export const cloneElement = (el: ExcalidrawElement):any => {
|
||||
}
|
||||
|
||||
export const verifyMinimumPluginVersion = (requiredVersion: string): boolean => {
|
||||
return PLUGIN_VERSION === requiredVersion || isVersionNewerThanOther(PLUGIN_VERSION,requiredVersion);
|
||||
return PLUGIN_VERSION.split("-")[0] === requiredVersion || isVersionNewerThanOther(PLUGIN_VERSION.split("-")[0],requiredVersion);
|
||||
}
|
||||
|
||||
export const getBoundTextElementId = (container: ExcalidrawElement | null) => {
|
||||
return container?.boundElements?.length
|
||||
? container?.boundElements?.find((ele) => ele.type === "text")?.id || null
|
||||
: null;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* FixedPoint represents the fixed point binding information in form of a vertical and
|
||||
* horizontal ratio (i.e. a percentage value in the 0.0-1.0 range). This ratio
|
||||
* gives the user selected fixed point by multiplying the bound element width
|
||||
* with fixedPoint[0] and the bound element height with fixedPoint[1] to get the
|
||||
* bound element-local point coordinate.
|
||||
*/
|
||||
export const normalizeFixedPoint = <T extends FixedPoint | null | undefined>(
|
||||
fixedPoint: T,
|
||||
): T extends null ? null : FixedPoint => {
|
||||
if (!fixedPoint) {
|
||||
return [0.50001, 0.5001] as any as T extends null ? null : FixedPoint;
|
||||
}
|
||||
if (fixedPoint[0] < 0 || fixedPoint[0] > 1) {
|
||||
fixedPoint[0] = 0.5001;
|
||||
}
|
||||
if (fixedPoint[1] < 0 || fixedPoint[1] > 1) {
|
||||
fixedPoint[1] = 0.5001;
|
||||
}
|
||||
// Do not allow a precise 0.5 for fixed point ratio
|
||||
// to avoid jumping arrow heading due to floating point imprecision
|
||||
if (
|
||||
fixedPoint &&
|
||||
(Math.abs(fixedPoint[0] - 0.5) < 0.0001 ||
|
||||
Math.abs(fixedPoint[1] - 0.5) < 0.0001)
|
||||
) {
|
||||
return fixedPoint.map((ratio) =>
|
||||
Math.abs(ratio - 0.5) < 0.0001 ? 0.5001 : ratio,
|
||||
) as T extends null ? null : FixedPoint;
|
||||
}
|
||||
return fixedPoint as any as T extends null ? null : FixedPoint;
|
||||
};
|
||||
|
||||
export const normalizeBindMode = (bindMode?: string): "orbit" | "inside" => {
|
||||
if (!bindMode || (bindMode !== "orbit" && bindMode !== "inside")) {
|
||||
return "orbit";
|
||||
}
|
||||
return bindMode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Ensures that plugin.settings.scriptEngineSettings and the active script's settings object exist.
|
||||
* Handles undefined/null during initialization.
|
||||
*
|
||||
* Note: kept in utils (not as an EA private method) so it won't be exposed on window.ExcalidrawAutomate.
|
||||
*/
|
||||
export function ensureActiveScriptSettingsObject(
|
||||
ea: ExcalidrawAutomate
|
||||
): Record<string, ScriptSettingValue> | null {
|
||||
const activeScript = ea?.activeScript;
|
||||
const plugin = ea?.plugin;
|
||||
|
||||
if (!activeScript || !plugin?.settings) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Ensure the top-level container exists
|
||||
if (!plugin.settings.scriptEngineSettings || typeof plugin.settings.scriptEngineSettings !== "object") {
|
||||
plugin.settings.scriptEngineSettings = {};
|
||||
}
|
||||
|
||||
// Ensure the per-script settings object exists (handle null/undefined)
|
||||
const current = plugin.settings.scriptEngineSettings[activeScript];
|
||||
if (!current || typeof current !== "object") {
|
||||
plugin.settings.scriptEngineSettings[activeScript] = {};
|
||||
}
|
||||
|
||||
return plugin.settings.scriptEngineSettings[activeScript] as Record<string, ScriptSettingValue>;
|
||||
}
|
||||
|
||||
export function getLastActiveExcalidrawView(plugin: ExcalidrawPlugin): ExcalidrawView | null {
|
||||
const leaf = plugin.app.workspace.getLeafById(plugin.lastActiveExcalidrawLeafID);
|
||||
if(leaf && leaf.view instanceof ExcalidrawView) {
|
||||
return leaf.view as ExcalidrawView;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -20,6 +20,7 @@ export function updateElementIdsInScene(
|
||||
if(elementToChange.boundElements?.length>0) {
|
||||
elementToChange.boundElements.forEach( binding => {
|
||||
const boundEl = sceneElements.find(el=>el.id === binding.id) as unknown as Mutable<ExcalidrawElement>;
|
||||
if(!boundEl) return;
|
||||
boundEl.boundElements?.filter(x=>x.id === elementToChange.id).forEach( x => {
|
||||
(x.id as Mutable<string>) = newID;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import { MAX_IMAGE_SIZE, IMAGE_TYPES, ANIMATED_IMAGE_TYPES, MD_EX_SECTIONS, AUDIO_TYPES, CARD_WIDTH, CARD_HEIGHT } from "src/constants/constants";
|
||||
import { MAX_IMAGE_SIZE, IMAGE_TYPES, ANIMATED_IMAGE_TYPES, MD_EX_SECTIONS, AUDIO_TYPES, CARD_WIDTH, CARD_HEIGHT, getDefaultColorPalette, DEVICE } from "src/constants/constants";
|
||||
import { App, Modal, Notice, TFile } from "obsidian";
|
||||
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
|
||||
import { REGEX_LINK, REG_LINKINDEX_HYPERLINK, getExcalidrawMarkdownHeaderSection, REGEX_TAGS, getExcalidrawMarkdownHeader } from "../shared/ExcalidrawData";
|
||||
@@ -271,12 +271,11 @@ export async function addBackOfTheNoteCard(
|
||||
const shouldRemoveTrailingHashtag = Boolean(hastag);
|
||||
view.data = data.replace(
|
||||
header,
|
||||
(shouldRemoveTrailingHashtag
|
||||
() => (shouldRemoveTrailingHashtag
|
||||
? header.substring(0,header.length-hastag[0].length)
|
||||
: header) +
|
||||
`\n# ${title}\n\n${cardBody ? cardBody+"\n\n" : ""}${
|
||||
shouldAddHashtag || shouldRemoveTrailingHashtag ? "#\n" : ""}`);
|
||||
|
||||
await view.forceSave(true);
|
||||
let watchdog = 0;
|
||||
await sleep(200);
|
||||
@@ -529,4 +528,110 @@ export function onLoadMessages(plugin: ExcalidrawPlugin, scene: {elements: Excal
|
||||
new Notice(t("DRAWING_HAS_BACK_OF_THE_CARD"));
|
||||
}*/
|
||||
});
|
||||
}
|
||||
|
||||
export function getViewColorPalette(
|
||||
palette: "canvasBackground"|"elementBackground"|"elementStroke",
|
||||
view?: ExcalidrawView,
|
||||
includeSceneColors: boolean = false,
|
||||
): (string[] | string)[] {
|
||||
if (!view) {
|
||||
return getDefaultColorPalette() as (string[] | string)[];
|
||||
}
|
||||
|
||||
const api = view.excalidrawAPI as ExcalidrawImperativeAPI;
|
||||
const {colorPalette} = api.getAppState();
|
||||
if (!colorPalette || !colorPalette.hasOwnProperty(palette)) {
|
||||
return getDefaultColorPalette() as (string[] | string)[];
|
||||
}
|
||||
|
||||
const basePalette = colorPalette[palette];
|
||||
|
||||
if (!Array.isArray(basePalette)) {
|
||||
return [basePalette];
|
||||
}
|
||||
|
||||
const cmFactory = view.hookServer?.getCM?.bind(view.hookServer) ?? view.plugin.ea.getCM.bind(view.plugin.ea);
|
||||
const getLightness = (color: string): number => {
|
||||
const cm = cmFactory?.(color);
|
||||
const value = (cm as any)?.lightness;
|
||||
return typeof value === "number" ? value : Number.POSITIVE_INFINITY;
|
||||
};
|
||||
const normalize = (color: string): string => {
|
||||
if (!color) {return color;}
|
||||
if (color.toLowerCase() === "transparent") {return "transparent";}
|
||||
const cm = cmFactory?.(color);
|
||||
if (cm && typeof (cm as any).stringHEX === "function") {
|
||||
try {
|
||||
const alpha = (cm as any).alpha;
|
||||
const includeAlpha = typeof alpha === "number" ? alpha !== 1 : true;
|
||||
return (cm as any).stringHEX({alpha: includeAlpha}).toLowerCase();
|
||||
} catch {
|
||||
// fall through to string coercion
|
||||
}
|
||||
}
|
||||
if (cm && typeof (cm as any).toString === "function") {
|
||||
return (cm as any).toString().toLowerCase();
|
||||
}
|
||||
return color.toLowerCase();
|
||||
};
|
||||
|
||||
const groups = basePalette
|
||||
.filter((entry) => Array.isArray(entry))
|
||||
.map((entry) => (entry as string[]).slice().sort((a, b) => getLightness(b) - getLightness(a)));
|
||||
const singles = basePalette.filter((entry) => typeof entry === "string") as string[];
|
||||
const groupColors = groups
|
||||
.flatMap((entry) => entry as string[])
|
||||
.filter(Boolean)
|
||||
.map((c) => normalize(c));
|
||||
const groupColorSet = new Set(groupColors);
|
||||
|
||||
const seenSingles = new Set<string>();
|
||||
const filteredSingles = singles.filter((entry) => {
|
||||
const norm = normalize(entry);
|
||||
if (!norm) {return false;}
|
||||
if (groupColorSet.has(norm)) {return false;}
|
||||
if (seenSingles.has(norm)) {return false;}
|
||||
seenSingles.add(norm);
|
||||
return true;
|
||||
});
|
||||
|
||||
if (!includeSceneColors || !["elementBackground", "elementStroke"].includes(palette)) {
|
||||
return [...groups, ...filteredSingles];
|
||||
}
|
||||
|
||||
const flattenPalette = (pal: any[]): string[] => pal
|
||||
.flatMap((entry: any) => Array.isArray(entry) ? entry : [entry])
|
||||
.filter((color: any): color is string => typeof color === "string" && Boolean(color));
|
||||
|
||||
const paletteColors = flattenPalette(basePalette).map((c) => normalize(c));
|
||||
const extraColors = new Set<string>(filteredSingles.filter((c) => c.toLowerCase() !== "transparent"));
|
||||
|
||||
view.getViewElements().forEach((el) => {
|
||||
const color = (palette === "elementStroke" ? el.strokeColor : (el as any).backgroundColor) as string;
|
||||
if (!color || normalize(color) === "transparent") {return;}
|
||||
if (paletteColors.includes(normalize(color))) {return;}
|
||||
extraColors.add(color);
|
||||
});
|
||||
|
||||
if (!extraColors.size) {
|
||||
return [...groups];
|
||||
}
|
||||
|
||||
const sortedExtras = cmFactory
|
||||
? Array.from(extraColors).sort((a, b) => getLightness(b) - getLightness(a))
|
||||
: Array.from(extraColors);
|
||||
|
||||
return [...groups, ...sortedExtras];
|
||||
}
|
||||
|
||||
//!Temporary hack
|
||||
//https://discord.com/channels/686053708261228577/817515900349448202/1031101635784613968
|
||||
export const setMobileNavbarPosition = (dock:boolean) => {
|
||||
if (DEVICE.isMobile && dock) {
|
||||
const navbar = document.querySelector("body>.app-container>.mobile-navbar");
|
||||
if(navbar && navbar instanceof HTMLDivElement) {
|
||||
navbar.style.position= dock ? "relative" : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
-1
@@ -305,7 +305,22 @@ export const arrayBufferToBase64 = (arrayBuffer: ArrayBuffer): string => {
|
||||
|
||||
export const getPDFDoc = async (f: TFile): Promise<any> => {
|
||||
if(typeof window.pdfjsLib === "undefined") await loadPdfJs();
|
||||
return await window.pdfjsLib.getDocument(EXCALIDRAW_PLUGIN.app.vault.getResourcePath(f)).promise;
|
||||
|
||||
const pdfjs = window.pdfjsLib;
|
||||
const url = EXCALIDRAW_PLUGIN.app.vault.getResourcePath(f);
|
||||
|
||||
const workerSrc = pdfjs.GlobalWorkerOptions.workerSrc as string;
|
||||
const workerDir = workerSrc?.replace(/pdf\.worker(\.min)?\.m?js$/, "");
|
||||
const wasmUrl = workerDir ? `${workerDir}wasm/` : undefined;
|
||||
|
||||
return await pdfjs.getDocument({
|
||||
url,
|
||||
wasmUrl,
|
||||
cMapUrl: "/lib/pdfjs/cmaps/",
|
||||
cMapPacked: true,
|
||||
standardFontDataUrl: "/lib/pdfjs/standard_fonts/",
|
||||
iccUrl: "/lib/pdfjs/iccs/",
|
||||
}).promise;
|
||||
}
|
||||
|
||||
export const readLocalFile = async (filePath:string): Promise<string> => {
|
||||
|
||||
@@ -512,4 +512,9 @@ export function getAudioElementHeight(): number {
|
||||
}
|
||||
|
||||
return Math.round(height);
|
||||
}
|
||||
|
||||
export function stripYamlFrontmatter(text: string): string {
|
||||
if (!text) return text;
|
||||
return text.replace(/^---\s*\r?\n[\s\S]*?\r?\n---\s*\r?\n?/, "");
|
||||
}
|
||||
+48
-19
@@ -343,6 +343,7 @@ export async function getSVG (
|
||||
exportSettings: ExportSettings,
|
||||
padding: number,
|
||||
srcFile: TFile|null, //if set, will replace markdown links with obsidian links
|
||||
overrideFiles?: Record<ExcalidrawElement["id"], BinaryFileData>,
|
||||
): Promise<SVGSVGElement> {
|
||||
let elements:ExcalidrawElement[] = scene.elements;
|
||||
if(elements.some(el => el.type === "embeddable")) {
|
||||
@@ -359,10 +360,13 @@ export async function getSVG (
|
||||
})
|
||||
: elements;
|
||||
|
||||
const baseFiles = scene.files ?? {};
|
||||
const files = overrideFiles ? { ...baseFiles, ...overrideFiles } : baseFiles;
|
||||
|
||||
try {
|
||||
let svg: SVGSVGElement;
|
||||
if(exportSettings.isMask) {
|
||||
const cropObject = new CropImage(elements, scene.files);
|
||||
const cropObject = new CropImage(elements, files);
|
||||
svg = await cropObject.getCroppedSVG();
|
||||
cropObject.destroy();
|
||||
} else {
|
||||
@@ -378,7 +382,7 @@ export async function getSVG (
|
||||
? {frameRendering: exportSettings.frameRendering}
|
||||
: {},
|
||||
},
|
||||
files: scene.files,
|
||||
files,
|
||||
exportPadding: exportSettings.frameRendering?.enabled ? 0 : padding,
|
||||
exportingFrame: null,
|
||||
renderEmbeddables: true,
|
||||
@@ -415,10 +419,14 @@ export async function getPNG (
|
||||
exportSettings: ExportSettings,
|
||||
padding: number,
|
||||
scale: number = 1,
|
||||
overrideFiles?: Record<ExcalidrawElement["id"], BinaryFileData>,
|
||||
): Promise<Blob> {
|
||||
try {
|
||||
const baseFiles = scene.files ?? {};
|
||||
const files = overrideFiles ? { ...baseFiles, ...overrideFiles } : baseFiles;
|
||||
|
||||
if(exportSettings.isMask) {
|
||||
const cropObject = new CropImage(scene.elements, scene.files);
|
||||
const cropObject = new CropImage(scene.elements, files);
|
||||
const blob = await cropObject.getCroppedPNG();
|
||||
cropObject.destroy();
|
||||
return blob;
|
||||
@@ -436,7 +444,7 @@ export async function getPNG (
|
||||
? {frameRendering: exportSettings.frameRendering}
|
||||
: {},
|
||||
},
|
||||
files: filterFiles(scene.files),
|
||||
files: filterFiles(files),
|
||||
exportPadding: exportSettings.frameRendering?.enabled ? 0 : padding,
|
||||
mimeType: "image/png",
|
||||
getDimensions: (width: number, height: number) => ({
|
||||
@@ -578,7 +586,14 @@ export function scaleLoadedImage (
|
||||
el.crop = null;
|
||||
}
|
||||
}
|
||||
} else if(maintainArea) {
|
||||
}else if (el?.customData?.latexscale) { // scale latex
|
||||
const scale = el?.customData?.latexscale;
|
||||
dirty = true;
|
||||
const elNewHeight = imgHeight * scale.scaleY;
|
||||
const elNewWidth = imgWidth * scale.scaleX;
|
||||
el.height = elNewHeight;
|
||||
el.width = elNewWidth;
|
||||
}else if(maintainArea) {
|
||||
const elAspectRatio = elWidth / elHeight;
|
||||
if (imgAspectRatio !== elAspectRatio) {
|
||||
dirty = true;
|
||||
@@ -1219,23 +1234,37 @@ export class PromisePool<T> {
|
||||
}
|
||||
|
||||
public all() {
|
||||
const listener = (event: { data: { result: void | [number, T] } }) => {
|
||||
if (event.data.result) {
|
||||
// by default pool does not return the results, so we are gathering them manually
|
||||
// with the correct call order (represented by the index in the tuple)
|
||||
const [index, value] = event.data.result;
|
||||
this.entries[index] = value;
|
||||
try {
|
||||
if (!this.pool) {
|
||||
return Promise.resolve(Object.values(this.entries));
|
||||
}
|
||||
};
|
||||
|
||||
this.pool.addEventListener("fulfilled", listener);
|
||||
const listener = (event: { data: { result: void | [number, T] } }) => {
|
||||
if (event.data.result) {
|
||||
// by default pool does not return the results, so we are gathering them manually
|
||||
// with the correct call order (represented by the index in the tuple)
|
||||
const [index, value] = event.data.result;
|
||||
this.entries[index] = value;
|
||||
}
|
||||
};
|
||||
|
||||
return this.pool.start().then(() => {
|
||||
setTimeout(() => {
|
||||
this.pool.removeEventListener("fulfilled", listener);
|
||||
});
|
||||
this.pool.addEventListener("fulfilled", listener);
|
||||
|
||||
return Object.values(this.entries);
|
||||
});
|
||||
return Promise.resolve(this.pool.start()).then(
|
||||
() => {
|
||||
setTimeout(() => {
|
||||
this.pool?.removeEventListener("fulfilled", listener);
|
||||
});
|
||||
return Object.values(this.entries);
|
||||
},
|
||||
() => {
|
||||
this.pool?.removeEventListener("fulfilled", listener);
|
||||
// return partial results if the pool was aborted/destroyed
|
||||
return Object.values(this.entries);
|
||||
},
|
||||
);
|
||||
} catch (_error) {
|
||||
return Promise.resolve(Object.values(this.entries));
|
||||
}
|
||||
}
|
||||
}
|
||||
+519
-216
File diff suppressed because it is too large.
Load diff
@@ -542,6 +542,8 @@ function RenderObsidianView(
|
||||
try { mobilePatchCleanupRef.current?.(); } catch {}
|
||||
mobilePatchCleanupRef.current = null;
|
||||
|
||||
view.updateEmbeddableLeafRef(element.id);
|
||||
|
||||
if(!leafRef.current) {
|
||||
return;
|
||||
}
|
||||
@@ -549,7 +551,7 @@ function RenderObsidianView(
|
||||
leafRef.current.leaf?.detach();
|
||||
leafRef.current = null;
|
||||
}; //cleanup on unmount
|
||||
}, [linkText, subpath, containerRef]);
|
||||
}, [linkText, subpath, containerRef, element.id, file.path]);
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
//Set colors of the canvas node
|
||||
|
||||
@@ -57,7 +57,9 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
onRightEdge: boolean = false;
|
||||
onBottomEdge: boolean = false;
|
||||
public containerRef: React.RefObject<HTMLDivElement>;
|
||||
private view: ExcalidrawView;
|
||||
private getView(): ExcalidrawView | null {
|
||||
return this.props.view?.deref() ?? null;
|
||||
}
|
||||
|
||||
componentWillUnmount(): void {
|
||||
if (this.containerRef.current) {
|
||||
@@ -65,14 +67,11 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
}
|
||||
this.setState({ scriptIconMap: null });
|
||||
this.containerRef = null;
|
||||
this.view = null;
|
||||
}
|
||||
|
||||
constructor(props: PanelProps) {
|
||||
super(props);
|
||||
this.view = props.view.deref();
|
||||
const react = this.view.packages.react;
|
||||
|
||||
const react = this.getView()?.packages.react;
|
||||
this.containerRef = react.createRef();
|
||||
this.state = {
|
||||
visible: props.visible,
|
||||
@@ -209,84 +208,103 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
}
|
||||
|
||||
actionOpenScriptInstallDialog() {
|
||||
new ScriptInstallPrompt(this.view.plugin).open();
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
new ScriptInstallPrompt(view.plugin).open()
|
||||
}
|
||||
|
||||
actionOpenReleaseNotes() {
|
||||
new ReleaseNotes(
|
||||
this.view.app,
|
||||
this.view.plugin,
|
||||
PLUGIN_VERSION,
|
||||
).open();
|
||||
const view = this.getView();
|
||||
if (!view) return
|
||||
new ReleaseNotes(view.app, view.plugin, PLUGIN_VERSION).open();
|
||||
}
|
||||
|
||||
actionConvertExcalidrawToMD() {
|
||||
this.view.convertExcalidrawToMD();
|
||||
this.getView()?.convertExcalidrawToMD();
|
||||
}
|
||||
|
||||
actionToggleViewMode() {
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
if (this.state.isPreviewMode) {
|
||||
this.view.changeTextMode(TextMode.raw);
|
||||
view.changeTextMode(TextMode.raw);
|
||||
} else {
|
||||
this.view.changeTextMode(TextMode.parsed);
|
||||
view.changeTextMode(TextMode.parsed);
|
||||
}
|
||||
}
|
||||
|
||||
actionToggleTrayMode() {
|
||||
const uiModeSettings = new UIModeSettings(this.view.plugin);
|
||||
uiModeSettings.open();
|
||||
const plugin = this.getView()?.plugin;
|
||||
if (!plugin) return;
|
||||
new UIModeSettings(plugin).open();
|
||||
}
|
||||
|
||||
actionToggleFullscreen() {
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
if (this.state.isFullscreen) {
|
||||
this.view.exitFullscreen();
|
||||
view.exitFullscreen();
|
||||
} else {
|
||||
this.view.gotoFullscreen();
|
||||
view.gotoFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
actionSearch() {
|
||||
search(this.view);
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
search(view);
|
||||
}
|
||||
|
||||
actionOCR(e:React.MouseEvent<HTMLButtonElement, MouseEvent>) {
|
||||
if(!this.view.plugin.settings.taskboneEnabled) {
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
if(!plugin.settings.taskboneEnabled) {
|
||||
new Notice("Taskbone OCR is not enabled. Please go to plugins settings to enable it.",4000);
|
||||
return;
|
||||
}
|
||||
this.view.plugin.taskbone.getTextForView(this.view, {forceReScan: isWinCTRLorMacCMD(e)});
|
||||
plugin.taskbone.getTextForView(view, {forceReScan: isWinCTRLorMacCMD(e)});
|
||||
}
|
||||
|
||||
actionOpenLink(e:React.MouseEvent<HTMLButtonElement, MouseEvent>) {
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
const event = new MouseEvent("click", {
|
||||
ctrlKey: e.ctrlKey || !(DEVICE.isIOS || DEVICE.isMacOS),
|
||||
metaKey: e.metaKey || (DEVICE.isIOS || DEVICE.isMacOS),
|
||||
shiftKey: e.shiftKey,
|
||||
altKey: e.altKey,
|
||||
});
|
||||
this.view.handleLinkClick(event, true);
|
||||
view.handleLinkClick(event, true);
|
||||
}
|
||||
|
||||
actionOpenLinkProperties() {
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
const event = new MouseEvent("click", {
|
||||
ctrlKey: true,
|
||||
metaKey: true,
|
||||
shiftKey: false,
|
||||
altKey: false,
|
||||
});
|
||||
this.view.handleLinkClick(event);
|
||||
view.handleLinkClick(event);
|
||||
}
|
||||
|
||||
actionForceSave() {
|
||||
this.view.forceSave();
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
view.forceSave();
|
||||
}
|
||||
|
||||
actionExportLibrary() {
|
||||
this.view.plugin.exportLibrary();
|
||||
const plugin = this.getView()?.plugin;
|
||||
if (!plugin) return;
|
||||
plugin.exportLibrary();
|
||||
}
|
||||
|
||||
actionExportImage() {
|
||||
const view = this.view;
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
if(!view.exportDialog) {
|
||||
view.exportDialog = new ExportDialog(view.plugin, view,view.file);
|
||||
view.exportDialog.createForm();
|
||||
@@ -295,69 +313,91 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
}
|
||||
|
||||
actionOpenAsMarkdown() {
|
||||
this.view.openAsMarkdown();
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
view.openAsMarkdown();
|
||||
}
|
||||
|
||||
actionLinkToElement(e:React.MouseEvent<HTMLButtonElement, MouseEvent>) {
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
if(isWinALTorMacOPT(e)) {
|
||||
openExternalLink("https://youtu.be/yZQoJg2RCKI", this.view.app);
|
||||
openExternalLink("https://youtu.be/yZQoJg2RCKI", view.app);
|
||||
return;
|
||||
}
|
||||
this.view.copyLinkToSelectedElementToClipboard(
|
||||
view.copyLinkToSelectedElementToClipboard(
|
||||
isWinCTRLorMacCMD(e) ? "group=" : (isSHIFT(e) ? "area=" : "")
|
||||
);
|
||||
}
|
||||
|
||||
actionAddAnyFile() {
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
this.props.centerPointer();
|
||||
const insertFileModal = new UniversalInsertFileModal(this.view.plugin, this.view);
|
||||
const insertFileModal = new UniversalInsertFileModal(plugin, view);
|
||||
insertFileModal.open();
|
||||
}
|
||||
|
||||
actionInsertImage() {
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
this.props.centerPointer();
|
||||
this.view.plugin.insertImageDialog.start(
|
||||
this.view,
|
||||
);
|
||||
plugin.insertImageDialog.start(view);
|
||||
}
|
||||
|
||||
actionInsertPDF() {
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
this.props.centerPointer();
|
||||
const insertPDFModal = new InsertPDFModal(this.view.plugin, this.view);
|
||||
const insertPDFModal = new InsertPDFModal(plugin, view);
|
||||
insertPDFModal.open();
|
||||
}
|
||||
|
||||
actionInsertMarkdown() {
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
this.props.centerPointer();
|
||||
this.view.plugin.insertMDDialog.start(
|
||||
this.view,
|
||||
);
|
||||
plugin.insertMDDialog.start(view);
|
||||
}
|
||||
|
||||
actionInsertBackOfNote() {
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
this.props.centerPointer();
|
||||
this.view.insertBackOfTheNoteCard();
|
||||
view.insertBackOfTheNoteCard();
|
||||
}
|
||||
|
||||
actionInsertLaTeX(e:React.MouseEvent<HTMLButtonElement, MouseEvent>) {
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
if(isWinALTorMacOPT(e)) {
|
||||
openExternalLink("https://youtu.be/r08wk-58DPk", this.view.app);
|
||||
openExternalLink("https://youtu.be/r08wk-58DPk", view.app);
|
||||
return;
|
||||
}
|
||||
this.props.centerPointer();
|
||||
insertLaTeXToView(this.view);
|
||||
insertLaTeXToView(view);
|
||||
}
|
||||
|
||||
actionInsertLink() {
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
this.props.centerPointer();
|
||||
this.view.plugin.insertLinkDialog.start(
|
||||
this.view.file.path,
|
||||
(text: string, fontFamily?: 1 | 2 | 3 | 4, save?: boolean) => this.view.addText (text, fontFamily, save),
|
||||
plugin.insertLinkDialog.start(
|
||||
view.file.path,
|
||||
(text: string, fontFamily?: 1 | 2 | 3 | 4, save?: boolean) => view.addText (text, fontFamily, save),
|
||||
);
|
||||
}
|
||||
|
||||
actionImportSVG(e:React.MouseEvent<HTMLButtonElement, MouseEvent>) {
|
||||
this.view.plugin.importSVGDialog.start(this.view);
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
plugin.importSVGDialog.start(view);
|
||||
}
|
||||
|
||||
actionCropImage(e:React.MouseEvent<HTMLButtonElement, MouseEvent>) {
|
||||
@@ -366,8 +406,9 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
}
|
||||
|
||||
async actionRunScript(key: string) {
|
||||
const view = this.view;
|
||||
const plugin = view.plugin;
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
const f = plugin.app.vault.getAbstractFileByPath(key);
|
||||
if (f && f instanceof TFile) {
|
||||
plugin.scriptEngine.executeScript(
|
||||
@@ -380,9 +421,10 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
}
|
||||
|
||||
async actionPinScript(key: string, scriptName: string) {
|
||||
const view = this.view;
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return;
|
||||
const api = view.excalidrawAPI as ExcalidrawImperativeAPI;
|
||||
const plugin = view.plugin;
|
||||
await plugin.loadSettings();
|
||||
const index = plugin.settings.pinnedScripts.indexOf(key)
|
||||
if(index > -1) {
|
||||
@@ -412,27 +454,30 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
}
|
||||
|
||||
private islandOnPointerDown(event: React.PointerEvent) {
|
||||
const onDrag = (e: PointerEvent) => {
|
||||
e.preventDefault();
|
||||
this.pos1 = this.pos3 - e.clientX;
|
||||
this.pos2 = this.pos4 - e.clientY;
|
||||
this.pos3 = e.clientX;
|
||||
this.pos4 = e.clientY;
|
||||
this.updatePosition(this.pos2, this.pos1);
|
||||
};
|
||||
const view = this.getView();
|
||||
if (!view) return;
|
||||
|
||||
const onPointerUp = () => {
|
||||
this.view.ownerDocument?.removeEventListener("pointerup", onPointerUp);
|
||||
this.view.ownerDocument?.removeEventListener("pointermove", onDrag);
|
||||
};
|
||||
|
||||
event.preventDefault();
|
||||
this.penDownX = this.pos3 = event.clientX;
|
||||
this.penDownY = this.pos4 = event.clientY;
|
||||
this.view.ownerDocument.addEventListener("pointerup", onPointerUp);
|
||||
this.view.ownerDocument.addEventListener("pointermove", onDrag);
|
||||
const onDrag = (e: PointerEvent) => {
|
||||
e.preventDefault();
|
||||
this.pos1 = this.pos3 - e.clientX;
|
||||
this.pos2 = this.pos4 - e.clientY;
|
||||
this.pos3 = e.clientX;
|
||||
this.pos4 = e.clientY;
|
||||
this.updatePosition(this.pos2, this.pos1);
|
||||
};
|
||||
|
||||
const onPointerUp = () => {
|
||||
view.ownerDocument?.removeEventListener("pointerup", onPointerUp);
|
||||
view.ownerDocument?.removeEventListener("pointermove", onDrag);
|
||||
};
|
||||
|
||||
event.preventDefault();
|
||||
this.penDownX = this.pos3 = event.clientX;
|
||||
this.penDownY = this.pos4 = event.clientY;
|
||||
view.ownerDocument.addEventListener("pointerup", onPointerUp);
|
||||
view.ownerDocument.addEventListener("pointermove", onDrag);
|
||||
};
|
||||
|
||||
render() {
|
||||
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.render,"ToolsPanel.render()");
|
||||
return (
|
||||
@@ -688,11 +733,16 @@ export class ToolsPanel extends React.Component<PanelProps, PanelState> {
|
||||
return "";
|
||||
}
|
||||
|
||||
if(!this.view.plugin._loaded) {
|
||||
const view = this.getView();
|
||||
const plugin = view?.plugin;
|
||||
if (!view || !plugin) return null;
|
||||
|
||||
|
||||
if(!plugin._loaded) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const downloadedScriptsRoot = `${this.view.plugin.settings.scriptFolderPath}/${SCRIPT_INSTALL_FOLDER}/`;
|
||||
const downloadedScriptsRoot = `${plugin.settings.scriptFolderPath}/${SCRIPT_INSTALL_FOLDER}/`;
|
||||
|
||||
const filterCondition = (key: string): boolean =>
|
||||
isDownloaded
|
||||
|
||||
@@ -0,0 +1,546 @@
|
||||
import { ItemView, WorkspaceLeaf, type EventRef, setIcon } from "obsidian";
|
||||
import { ICON_NAME, VIEW_TYPE_SIDEPANEL } from "src/constants/constants";
|
||||
import ExcalidrawPlugin from "src/core/main";
|
||||
import { t } from "src/lang/helpers";
|
||||
import type { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
|
||||
import { getLastActiveExcalidrawView } from "src/utils/excalidrawAutomateUtils";
|
||||
import type ExcalidrawView from "src/view/ExcalidrawView";
|
||||
import { ExcalidrawSidepanelTab } from "./SidepanelTab";
|
||||
|
||||
type TabCreationConfig = {
|
||||
title: string;
|
||||
scriptName?: string;
|
||||
reuseExisting?: boolean;
|
||||
hostEA?: ExcalidrawAutomate;
|
||||
};
|
||||
|
||||
export class ExcalidrawSidepanelView extends ItemView {
|
||||
private static singleton: ExcalidrawSidepanelView | null = null;
|
||||
private static restoreSilent = false;
|
||||
|
||||
/**
|
||||
* Returns the singleton sidepanel view if it exists, optionally revealing the leaf unless restoration is running silently.
|
||||
*/
|
||||
public static getExisting(reveal: boolean = true): ExcalidrawSidepanelView | null {
|
||||
const spView = ExcalidrawSidepanelView.singleton;
|
||||
if (spView && reveal && !ExcalidrawSidepanelView.restoreSilent) {
|
||||
spView.plugin.app.workspace.revealLeaf(spView.leaf);
|
||||
}
|
||||
return spView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures a sidepanel view exists (creating it if needed), optionally revealing it, and waits until DOM is ready.
|
||||
*/
|
||||
public static async getOrCreate(plugin: ExcalidrawPlugin, reveal: boolean = true): Promise<ExcalidrawSidepanelView | null> {
|
||||
const effectiveReveal = reveal && !ExcalidrawSidepanelView.restoreSilent;
|
||||
let leaf = plugin.app.workspace.getLeavesOfType(VIEW_TYPE_SIDEPANEL)[0];
|
||||
if (!leaf) {
|
||||
leaf = plugin.app.workspace.getRightLeaf(false);
|
||||
if (!leaf) {
|
||||
return null;
|
||||
}
|
||||
await leaf.setViewState({ type: VIEW_TYPE_SIDEPANEL, active: effectiveReveal });
|
||||
}
|
||||
let spView = leaf.view;
|
||||
if (!(spView instanceof ExcalidrawSidepanelView)) {
|
||||
// Obsidian startup sequence. Leaves constructors are not called until they are revealed.
|
||||
// So when getOrCreate is called from a script, we may have a leaf of the right type but with a generic ItemView.
|
||||
await leaf.setViewState({ type: VIEW_TYPE_SIDEPANEL, active: true });
|
||||
spView = leaf.view;
|
||||
if (!(spView instanceof ExcalidrawSidepanelView)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (effectiveReveal) {
|
||||
plugin.app.workspace.revealLeaf(leaf);
|
||||
}
|
||||
await spView.waitUntilReady();
|
||||
return spView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up singleton references and detaches sidepanel leaves when the plugin unloads.
|
||||
*/
|
||||
public static onPluginUnload(plugin: ExcalidrawPlugin) {
|
||||
ExcalidrawSidepanelView.singleton = null;
|
||||
plugin.app.workspace.detachLeavesOfType(VIEW_TYPE_SIDEPANEL);
|
||||
}
|
||||
|
||||
private tabs = new Map<string, ExcalidrawSidepanelTab>();
|
||||
private scriptTabs = new Map<string, ExcalidrawSidepanelTab>();
|
||||
private tabHosts = new Map<string, ExcalidrawAutomate>();
|
||||
private tabOptions = new Map<string, HTMLOptionElement>();
|
||||
private persistedScripts = new Map<string, { title: string }>();
|
||||
private activeTabId: string | null = null;
|
||||
private selectEl: HTMLSelectElement | null = null;
|
||||
private closeButtonEl: HTMLButtonElement | null = null;
|
||||
private bodyEl: HTMLDivElement | null = null;
|
||||
private emptyStateEl: HTMLDivElement | null = null;
|
||||
private readyPromise: Promise<void>;
|
||||
private resolveReady: (() => void) | null = null;
|
||||
private restorePromise: Promise<void> | null = null;
|
||||
private leafChangeRef: EventRef | null = null;
|
||||
private windowMigrationCleanup: (() => void) | null = null;
|
||||
|
||||
constructor(leaf: WorkspaceLeaf, private plugin: ExcalidrawPlugin) {
|
||||
super(leaf);
|
||||
(plugin.settings.sidepanelTabs ?? [])
|
||||
.filter((entry) => !!entry)
|
||||
.forEach((entry) => {
|
||||
let scriptName = "";
|
||||
let title = "";
|
||||
try {
|
||||
const parsed = JSON.parse(entry);
|
||||
scriptName = parsed?.script ?? parsed?.name ?? "";
|
||||
title = parsed?.title ?? scriptName;
|
||||
} catch (e) {
|
||||
if (entry.includes("::")) {
|
||||
const [namePart, ...rest] = entry.split("::");
|
||||
scriptName = namePart;
|
||||
title = rest.join("::") || namePart;
|
||||
} else {
|
||||
scriptName = entry;
|
||||
title = entry;
|
||||
}
|
||||
}
|
||||
if (scriptName) {
|
||||
this.persistedScripts.set(scriptName, { title: title || scriptName });
|
||||
}
|
||||
});
|
||||
this.readyPromise = new Promise((resolve) => {
|
||||
this.resolveReady = resolve;
|
||||
});
|
||||
}
|
||||
|
||||
getViewType(): string {
|
||||
return VIEW_TYPE_SIDEPANEL;
|
||||
}
|
||||
|
||||
getDisplayText(): string {
|
||||
return t("EXCALIDRAW_SIDEPANEL") ?? "Excalidraw Sidepanel";
|
||||
}
|
||||
|
||||
getIcon(): string {
|
||||
return ICON_NAME;
|
||||
}
|
||||
|
||||
protected async onOpen() {
|
||||
await super.onOpen();
|
||||
const hasWindowMigrationAPI = typeof this.containerEl.onWindowMigrated === "function";
|
||||
if (hasWindowMigrationAPI) {
|
||||
this.windowMigrationCleanup = this.containerEl.onWindowMigrated((win: Window) => {
|
||||
this.notifyTabsWindowMigrated(win);
|
||||
});
|
||||
}
|
||||
ExcalidrawSidepanelView.singleton = this;
|
||||
this.containerEl.empty();
|
||||
this.containerEl.addClass("excalidraw-sidepanel-container");
|
||||
const wrapper = this.containerEl.createDiv({ cls: "excalidraw-sidepanel" });
|
||||
const controls = wrapper.createDiv({ cls: "excalidraw-sidepanel__controls" });
|
||||
this.selectEl = controls.createEl("select", { cls: "excalidraw-sidepanel__select" });
|
||||
this.selectEl.addEventListener("change", () => {
|
||||
const targetId = this.selectEl?.value ?? null;
|
||||
const tab = targetId ? this.tabs.get(targetId) ?? null : null;
|
||||
this.setActiveTab(tab ?? null);
|
||||
});
|
||||
this.closeButtonEl = controls.createEl("button", {
|
||||
cls: "excalidraw-sidepanel__close-button",
|
||||
attr: { type: "button", "aria-label": "Close sidepanel tab" },
|
||||
});
|
||||
setIcon(this.closeButtonEl, "x");
|
||||
this.closeButtonEl.addEventListener("click", () => {
|
||||
if (!this.activeTabId) {
|
||||
return;
|
||||
}
|
||||
const active = this.tabs.get(this.activeTabId);
|
||||
if (active) {
|
||||
this.removeTab(active);
|
||||
}
|
||||
});
|
||||
this.bodyEl = wrapper.createDiv({ cls: "excalidraw-sidepanel__body" });
|
||||
this.emptyStateEl = this.bodyEl.createDiv({ cls: "excalidraw-sidepanel__empty" });
|
||||
this.emptyStateEl.setText("Excalidraw sidepanel is empty. Run a panel-enabled Excalidraw script to add a panel.");
|
||||
this.selectEl.disabled = true;
|
||||
this.closeButtonEl.disabled = true;
|
||||
this.leafChangeRef = this.app.workspace.on("active-leaf-change", (leaf) => {
|
||||
if (leaf === this.leaf) {
|
||||
this.triggerActiveTabFocus();
|
||||
}
|
||||
});
|
||||
this.resolveReady?.();
|
||||
this.resolveReady = null;
|
||||
void this.restorePersistedTabs();
|
||||
this.updateEmptyStateVisibility();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down listeners, destroys tabs, and clears UI references when the sidepanel closes.
|
||||
*/
|
||||
protected async onClose() {
|
||||
await super.onClose();
|
||||
if (this.windowMigrationCleanup) {
|
||||
this.windowMigrationCleanup();
|
||||
this.windowMigrationCleanup = null;
|
||||
}
|
||||
if (this.leafChangeRef) {
|
||||
this.app.workspace.offref(this.leafChangeRef);
|
||||
this.leafChangeRef = null;
|
||||
}
|
||||
this.tabs.forEach((tab) => {
|
||||
tab.notifyWillClose();
|
||||
const hostEA = this.tabHosts.get(tab.id);
|
||||
if (hostEA && hostEA.sidepanelTab === tab) {
|
||||
hostEA.sidepanelTab = null;
|
||||
}
|
||||
this.tabHosts.delete(tab.id);
|
||||
tab.destroy();
|
||||
});
|
||||
this.tabs.clear();
|
||||
this.scriptTabs.clear();
|
||||
this.tabOptions.clear();
|
||||
this.tabHosts.clear();
|
||||
this.activeTabId = null;
|
||||
this.selectEl = null;
|
||||
this.closeButtonEl = null;
|
||||
this.bodyEl = null;
|
||||
this.emptyStateEl = null;
|
||||
this.containerEl.onWindowMigrated = null;
|
||||
if (ExcalidrawSidepanelView.singleton === this) {
|
||||
ExcalidrawSidepanelView.singleton = null;
|
||||
}
|
||||
}
|
||||
|
||||
public async waitUntilReady(): Promise<void> {
|
||||
await this.readyPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or reuses a tab based on script identity and returns the active tab instance.
|
||||
*/
|
||||
public async createTab(config: TabCreationConfig = { title: "unknown" }): Promise<ExcalidrawSidepanelTab> {
|
||||
await this.waitUntilReady();
|
||||
const scriptName = config.scriptName;
|
||||
const reuse = config.reuseExisting !== false;
|
||||
if (scriptName && reuse) {
|
||||
const existing = this.scriptTabs.get(scriptName);
|
||||
if (existing) {
|
||||
existing.reset(config.title);
|
||||
this.setActiveTab(existing);
|
||||
if (config.hostEA) {
|
||||
this.tabHosts.set(existing.id, config.hostEA);
|
||||
}
|
||||
return existing;
|
||||
}
|
||||
}
|
||||
const tab = this.createTabInternal(config.title, config.hostEA, scriptName);
|
||||
if (config.hostEA) {
|
||||
this.tabHosts.set(tab.id, config.hostEA);
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks a tab as persistent so its script is restored across sessions.
|
||||
*/
|
||||
public markTabPersistent(tab: ExcalidrawSidepanelTab) {
|
||||
const scriptName = tab.scriptName;
|
||||
if (!scriptName) {
|
||||
return;
|
||||
}
|
||||
this.scriptTabs.set(scriptName, tab);
|
||||
const title = tab.title;
|
||||
const existing = this.persistedScripts.get(scriptName);
|
||||
if (!existing || existing.title !== title) {
|
||||
this.persistedScripts.set(scriptName, { title });
|
||||
this.savePersistentScripts();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes persistence metadata for a script-backed tab.
|
||||
*/
|
||||
public unmarkTabPersistent(scriptName?: string) {
|
||||
if (!scriptName) {
|
||||
return;
|
||||
}
|
||||
if (this.persistedScripts.delete(scriptName)) {
|
||||
this.savePersistentScripts();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a tab from the UI and state, running close hooks and updating active selection.
|
||||
*/
|
||||
public removeTab(tab: ExcalidrawSidepanelTab) {
|
||||
tab.notifyWillClose();
|
||||
this.tabs.delete(tab.id);
|
||||
this.removeTabOption(tab);
|
||||
const scriptName = tab.scriptName;
|
||||
if (scriptName && this.scriptTabs.get(scriptName) === tab) {
|
||||
this.scriptTabs.delete(scriptName);
|
||||
this.unmarkTabPersistent(scriptName);
|
||||
}
|
||||
const hostEA = this.tabHosts.get(tab.id);
|
||||
if (hostEA && hostEA.sidepanelTab === tab) {
|
||||
hostEA.sidepanelTab = null;
|
||||
}
|
||||
this.tabHosts.delete(tab.id);
|
||||
tab.destroy();
|
||||
if (this.activeTabId === tab.id) {
|
||||
this.activeTabId = null;
|
||||
const next = this.tabs.values().next().value as ExcalidrawSidepanelTab | undefined;
|
||||
this.setActiveTab(next ?? null);
|
||||
}
|
||||
this.updateEmptyStateVisibility();
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates the given tab (or clears active selection) and syncs UI controls.
|
||||
*/
|
||||
public setActiveTab(tab: ExcalidrawSidepanelTab | null) {
|
||||
this.activeTabId = tab?.id ?? null;
|
||||
this.tabs.forEach((candidate) => candidate.setActive(candidate === tab));
|
||||
if (this.selectEl) {
|
||||
this.selectEl.value = tab?.id ?? "";
|
||||
}
|
||||
this.updateEmptyStateVisibility();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a tab by its backing script name if present.
|
||||
*/
|
||||
public getTabByScript(scriptName: string): ExcalidrawSidepanelTab | null {
|
||||
return this.scriptTabs.get(scriptName) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a script has been marked for persistent restoration.
|
||||
*/
|
||||
public hasPersistentScript(scriptName: string): boolean {
|
||||
return this.persistedScripts.has(scriptName);
|
||||
}
|
||||
|
||||
private createTabInternal(
|
||||
title: string,
|
||||
ea: ExcalidrawAutomate,
|
||||
scriptName?: string,
|
||||
): ExcalidrawSidepanelTab {
|
||||
if (!this.bodyEl) {
|
||||
throw new Error("Sidepanel DOM is not ready");
|
||||
}
|
||||
const tab = new ExcalidrawSidepanelTab(
|
||||
title,
|
||||
{
|
||||
activate: (target) => this.setActiveTab(target),
|
||||
close: (target) => this.removeTab(target),
|
||||
updateTitle: (target) => this.updateTabOptionTitle(target),
|
||||
plugin: this.plugin,
|
||||
ea,
|
||||
//@ts-ignore
|
||||
isVisible: () => this.leaf.isVisible?.(),
|
||||
reveal: () => this.reveal(),
|
||||
},
|
||||
{ bodyEl: this.bodyEl },
|
||||
scriptName,
|
||||
);
|
||||
if (scriptName) {
|
||||
this.scriptTabs.set(scriptName, tab);
|
||||
}
|
||||
this.tabs.set(tab.id, tab);
|
||||
this.addTabOption(tab);
|
||||
this.setActiveTab(tab);
|
||||
return tab;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores persisted tabs on startup without revealing the panel, executing scripts to rebuild content.
|
||||
*/
|
||||
private async restorePersistedTabs(): Promise<void> {
|
||||
if (this.restorePromise) {
|
||||
return this.restorePromise;
|
||||
}
|
||||
this.restorePromise = (async () => {
|
||||
if (!this.persistedScripts.size) {
|
||||
return;
|
||||
}
|
||||
ExcalidrawSidepanelView.restoreSilent = true;
|
||||
await this.plugin.awaitInit();
|
||||
try {
|
||||
for (const [scriptName, meta] of Array.from(this.persistedScripts.entries())) {
|
||||
if (!scriptName) {
|
||||
continue;
|
||||
}
|
||||
await this.runScriptByName(scriptName, meta.title);
|
||||
}
|
||||
} finally {
|
||||
ExcalidrawSidepanelView.restoreSilent = false;
|
||||
}
|
||||
})();
|
||||
return this.restorePromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-runs the script backing an existing tab, typically after the script file was updated.
|
||||
*/
|
||||
public async restartTabForScript(scriptName: string): Promise<void> {
|
||||
await this.waitUntilReady();
|
||||
if (!scriptName) {
|
||||
return;
|
||||
}
|
||||
const tab = this.getTabByScript(scriptName);
|
||||
if (!tab) {
|
||||
return;
|
||||
}
|
||||
|
||||
const title = tab.title;
|
||||
const wasPersisted = this.persistedScripts.has(scriptName);
|
||||
|
||||
// Fully terminate the existing tab and its EA host before rerunning the script
|
||||
// to avoid scripts early-exiting when they detect an already active tab.
|
||||
this.removeTab(tab);
|
||||
|
||||
const previousSilent = ExcalidrawSidepanelView.restoreSilent;
|
||||
ExcalidrawSidepanelView.restoreSilent = true;
|
||||
try {
|
||||
await this.runScriptByName(scriptName, title);
|
||||
const restarted = this.getTabByScript(scriptName);
|
||||
if (wasPersisted && restarted) {
|
||||
this.markTabPersistent(restarted);
|
||||
}
|
||||
} finally {
|
||||
ExcalidrawSidepanelView.restoreSilent = previousSilent;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a script by name to reconstruct its sidepanel tab, updating title if needed.
|
||||
*/
|
||||
private async runScriptByName(scriptName: string, title: string) {
|
||||
const scriptEngine = this.plugin.scriptEngine;
|
||||
if (!scriptEngine) {
|
||||
return;
|
||||
}
|
||||
const file = scriptEngine.getScriptFileByName(scriptName);
|
||||
if (!file) {
|
||||
console.warn(`Excalidraw: could not restore sidepanel script '${scriptName}' because the file was not found.`);
|
||||
this.persistedScripts.delete(scriptName);
|
||||
this.savePersistentScripts();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const script = await this.plugin.app.vault.read(file);
|
||||
await scriptEngine.executeScript(undefined, script, scriptName, file);
|
||||
const restoredTab = this.scriptTabs.get(scriptName);
|
||||
if (restoredTab) {
|
||||
restoredTab.setTitle(title);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Excalidraw: error while restoring sidepanel script '${scriptName}'`, error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists current set of script tabs to plugin settings.
|
||||
*/
|
||||
private savePersistentScripts() {
|
||||
this.plugin.settings.sidepanelTabs = Array.from(this.persistedScripts.entries()).map(([script, meta]) =>
|
||||
JSON.stringify({ script, title: meta.title ?? script }),
|
||||
);
|
||||
void this.plugin.saveSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers focus handlers for the active tab using the last active Excalidraw view.
|
||||
*/
|
||||
private triggerActiveTabFocus(view = getLastActiveExcalidrawView(this.plugin)) {
|
||||
if (!this.activeTabId) {
|
||||
return;
|
||||
}
|
||||
const active = this.tabs.get(this.activeTabId);
|
||||
if (active) {
|
||||
active.handleFocus(view ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
private notifyTabsWindowMigrated(win: Window) {
|
||||
this.tabs.forEach((tab) => tab.handleWindowMigration(win));
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears references to a view from hosted ExcalidrawAutomate instances and notifies their tabs.
|
||||
*/
|
||||
public removeViewEAs(view: ExcalidrawView) {
|
||||
this.tabHosts.forEach((hostEA, tabId) => {
|
||||
if (!hostEA || hostEA.targetView !== view) {
|
||||
return;
|
||||
}
|
||||
hostEA.targetView = null;
|
||||
const tab = this.tabs.get(tabId);
|
||||
tab?.onExcalidrawViewClosed();
|
||||
});
|
||||
}
|
||||
|
||||
private addTabOption(tab: ExcalidrawSidepanelTab) {
|
||||
if (!this.selectEl) {
|
||||
return;
|
||||
}
|
||||
const option = this.selectEl.createEl("option", { value: tab.id, text: tab.title });
|
||||
this.tabOptions.set(tab.id, option);
|
||||
this.selectEl.disabled = false;
|
||||
if (this.closeButtonEl) {
|
||||
this.closeButtonEl.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the select option corresponding to a tab and disables controls when empty.
|
||||
*/
|
||||
private removeTabOption(tab: ExcalidrawSidepanelTab) {
|
||||
const option = this.tabOptions.get(tab.id);
|
||||
if (option) {
|
||||
option.remove();
|
||||
this.tabOptions.delete(tab.id);
|
||||
}
|
||||
if (!this.tabOptions.size && this.selectEl) {
|
||||
this.selectEl.disabled = true;
|
||||
this.selectEl.value = "";
|
||||
}
|
||||
if (!this.tabOptions.size && this.closeButtonEl) {
|
||||
this.closeButtonEl.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Syncs the select option label with the tab title.
|
||||
*/
|
||||
private updateTabOptionTitle(tab: ExcalidrawSidepanelTab) {
|
||||
const option = this.tabOptions.get(tab.id);
|
||||
if (option) {
|
||||
option.text = tab.title;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows empty-state messaging and disables controls when no tabs exist.
|
||||
*/
|
||||
private updateEmptyStateVisibility() {
|
||||
const hasTabs = this.tabs.size > 0;
|
||||
if (this.emptyStateEl) {
|
||||
this.emptyStateEl.style.display = hasTabs ? "none" : "";
|
||||
}
|
||||
if (this.closeButtonEl) {
|
||||
this.closeButtonEl.disabled = !hasTabs;
|
||||
}
|
||||
if (this.selectEl) {
|
||||
this.selectEl.disabled = !hasTabs;
|
||||
if (!hasTabs) {
|
||||
this.selectEl.value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public reveal(): void {
|
||||
this.app.workspace.revealLeaf(this.leaf);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
import type { CloseableComponent } from "obsidian";
|
||||
import type ExcalidrawPlugin from "src/core/main";
|
||||
import { getLastActiveExcalidrawView } from "src/utils/excalidrawAutomateUtils";
|
||||
import type { SidepanelTab as SidepanelTabType } from "src/types/sidepanelTabTypes";
|
||||
import ExcalidrawView from "src/view/ExcalidrawView";
|
||||
import { ExcalidrawAutomate } from "src/shared/ExcalidrawAutomate";
|
||||
|
||||
type HostCallbacks = {
|
||||
activate: (tab: ExcalidrawSidepanelTab) => void;
|
||||
isVisible: () => boolean;
|
||||
close: (tab: ExcalidrawSidepanelTab) => void;
|
||||
updateTitle?: (tab: ExcalidrawSidepanelTab) => void;
|
||||
reveal: () => void;
|
||||
plugin: ExcalidrawPlugin;
|
||||
ea: ExcalidrawAutomate;
|
||||
};
|
||||
|
||||
type Containers = {
|
||||
bodyEl: HTMLElement;
|
||||
};
|
||||
|
||||
let tabCounter = 0;
|
||||
|
||||
export class ExcalidrawSidepanelTab implements CloseableComponent, SidepanelTabType {
|
||||
readonly id: string;
|
||||
private _scriptName?: string;
|
||||
private _title: string;
|
||||
readonly containerEl: HTMLDivElement;
|
||||
readonly modalEl: HTMLDivElement;
|
||||
readonly contentEl: HTMLDivElement;
|
||||
readonly titleEl: HTMLDivElement;
|
||||
private isClosed = false;
|
||||
private isActive = false;
|
||||
public onFocus: (view: ExcalidrawView | null) => void = () => {};
|
||||
public onWindowMigrated: (win: Window) => void = () => {};
|
||||
|
||||
/**
|
||||
* Called by ScriptEngine when the Excalidraw view associated with the ExcalidrawAutomate object for this sidepanel tab is closed and ea.targetView becomes null.
|
||||
*/
|
||||
public onExcalidrawViewClosed: () => void = () => {};
|
||||
|
||||
/**
|
||||
* Creates a sidepanel tab instance bound to a host view and container elements.
|
||||
* The tab manages its own DOM nodes (label + content) and delegates lifecycle events back to the host.
|
||||
*/
|
||||
constructor(
|
||||
title: string,
|
||||
private host: HostCallbacks,
|
||||
private containers: Containers,
|
||||
scriptName?: string,
|
||||
) {
|
||||
this._scriptName = scriptName;
|
||||
this._title = title;
|
||||
this.id = `excalidraw-sidepanel-tab-${++tabCounter}`;
|
||||
this.modalEl = this.containers.bodyEl.createDiv({ cls: "excalidraw-sidepanel-tab" });
|
||||
this.modalEl.id = this.id;
|
||||
this.containerEl = this.modalEl;
|
||||
this.titleEl = this.modalEl.createDiv({ cls: "excalidraw-sidepanel-tab__label" });
|
||||
this.contentEl = this.modalEl.createDiv({ cls: "excalidraw-sidepanel-tab__content" });
|
||||
this.setTitle(title);
|
||||
}
|
||||
|
||||
public get scriptName(): string | undefined {
|
||||
return this._scriptName;
|
||||
}
|
||||
|
||||
public get title(): string {
|
||||
return this._title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigns a script name used for persistence and lookup without altering the title.
|
||||
* This is used by ExcalidrawSidpanel when creating or restoring tabs.
|
||||
* Not intended for public use by EA scripts.
|
||||
*/
|
||||
public setScriptName(scriptName?: string) {
|
||||
this._scriptName = scriptName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all child nodes from the content container.
|
||||
*/
|
||||
public clear() {
|
||||
this.contentEl.empty();
|
||||
}
|
||||
|
||||
public reset(title: string) {
|
||||
this.setTitle(title);
|
||||
this.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the tab title label and notifies the host to refresh any UI affordances.
|
||||
*/
|
||||
public setTitle(title: string) {
|
||||
this._title = title;
|
||||
this.titleEl.setText(title);
|
||||
this.host.updateTitle?.(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the tab content with the provided text or fragment.
|
||||
*/
|
||||
public setContent(content: string | DocumentFragment) {
|
||||
this.clear();
|
||||
if (typeof content === "string") {
|
||||
this.contentEl.setText(content);
|
||||
} else {
|
||||
this.contentEl.append(content);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates the tab within the host sidepanel.
|
||||
*/
|
||||
public focus() {
|
||||
this.host.activate(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks the tab as open/active and triggers its onOpen lifecycle hook.
|
||||
*/
|
||||
public open() {
|
||||
this.isClosed = false;
|
||||
this.host.activate(this);
|
||||
void this.onOpen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the tab via host, firing close handlers first.
|
||||
*/
|
||||
public close() {
|
||||
this.runCloseHandlers();
|
||||
this.host.close(this);
|
||||
}
|
||||
|
||||
public onOpen(): Promise<void> | void {}
|
||||
|
||||
public onClose(): void {}
|
||||
|
||||
/**
|
||||
* Flags the tab as active/inactive and triggers focus/onOpen when becoming active.
|
||||
* This function is called by ExcalidrawSidepanel when the tab's active state changes.
|
||||
* Not intended for public use by EA scripts.
|
||||
*/
|
||||
public setActive(active: boolean) {
|
||||
const becameActive = active && !this.isActive;
|
||||
this.isActive = active;
|
||||
this.modalEl.toggleClass("is-active", active);
|
||||
if (becameActive) {
|
||||
const view = this.getLastActiveView();
|
||||
void this.onOpen();
|
||||
this.runFocusHandlers(view);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Signals the tab will close soon and runs close handlers once.
|
||||
* This function is called by ExcalidrawSidepanel when the user attempts to close the tab.
|
||||
* Not intended for public use by EA scripts.
|
||||
*/
|
||||
public notifyWillClose() {
|
||||
this.runCloseHandlers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes focus handlers with the provided or last active Excalidraw view.
|
||||
* This is called by ExcalidrawSidepanel when the tab gains focus.
|
||||
* Not intended for public use by EA scripts.
|
||||
*/
|
||||
public handleFocus(view?: ExcalidrawView | null) {
|
||||
this.runFocusHandlers(view);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies scripts that the tab's DOM migrated to a different Obsidian window.
|
||||
*/
|
||||
public handleWindowMigration(win: Window) {
|
||||
if (this.isClosed) {
|
||||
return;
|
||||
}
|
||||
this.onWindowMigrated(win);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes DOM nodes and releases references.
|
||||
* This is called by ExcalidrawSidepanel when the tab is being destroyed.
|
||||
* Not intended for public use by EA scripts.
|
||||
*/
|
||||
public destroy() {
|
||||
this.modalEl?.remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles pointer interactivity and visual opacity for the tab content.
|
||||
*/
|
||||
public setDisabled(disabled: boolean) {
|
||||
this.contentEl.style.pointerEvents = disabled ? "none" : "";
|
||||
this.contentEl.style.opacity = disabled ? "0.5" : "";
|
||||
return this;
|
||||
}
|
||||
|
||||
private runCloseHandlers() {
|
||||
if (this.isClosed) {
|
||||
return;
|
||||
}
|
||||
this.isClosed = true;
|
||||
this.onClose();
|
||||
}
|
||||
|
||||
private runFocusHandlers(view?: ExcalidrawView | null) {
|
||||
if (this.isClosed) {
|
||||
return;
|
||||
}
|
||||
this.onFocus(view ?? this.getLastActiveView());
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the last active Excalidraw view from the plugin host.
|
||||
*/
|
||||
private getLastActiveView(): ExcalidrawView | null {
|
||||
return getLastActiveExcalidrawView(this.host.plugin) ?? null;
|
||||
}
|
||||
|
||||
public getHostEA(): ExcalidrawAutomate {
|
||||
return this.host.ea;
|
||||
}
|
||||
|
||||
public isVisible(): boolean {
|
||||
return this.host.isVisible();
|
||||
}
|
||||
|
||||
public reveal(): void {
|
||||
if (!this.isActive) {
|
||||
this.open();
|
||||
}
|
||||
this.host.reveal();
|
||||
}
|
||||
|
||||
}
|
||||
+180
@@ -261,6 +261,40 @@ li[data-testid] {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.excalidraw-colorpicker-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: transparent;
|
||||
z-index: 9998;
|
||||
}
|
||||
|
||||
.excalidraw-colorpicker-popup {
|
||||
position: absolute;
|
||||
padding: 12px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 8px 24px rgba(0,0,0,0.25);
|
||||
background-color: var(--background-primary);
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
z-index: 9999;
|
||||
scrollbar-gutter: stable both-edges;
|
||||
}
|
||||
|
||||
.excalidraw-colorpicker-grid {
|
||||
display: grid;
|
||||
overflow-y: auto;
|
||||
padding-right: 4px;
|
||||
max-height: 260px;
|
||||
}
|
||||
|
||||
.excalidraw-colorpicker-swatch {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--interactive-accent-hover);
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
textarea.excalidraw-wysiwyg {
|
||||
border: none;
|
||||
outline: none;
|
||||
@@ -397,6 +431,137 @@ div.excalidraw-draginfo {
|
||||
position: absolute !important;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.35rem 0.5rem;
|
||||
border-bottom: 1px solid var(--divider-color, var(--background-modifier-border));
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__select {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__close-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.6rem;
|
||||
border: 1px solid var(--divider-color, var(--background-modifier-border));
|
||||
border-radius: 0.55rem;
|
||||
background: var(--background-primary);
|
||||
color: var(--text-normal);
|
||||
padding: 0;
|
||||
transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__close-button:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__close-button:hover:not(:disabled) {
|
||||
background: var(--background-modifier-hover);
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__empty {
|
||||
padding: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel__body {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab.is-active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__label {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__content {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.25rem 0.55rem;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__button.is-active {
|
||||
background: var(--background-primary-alt, var(--background-secondary));
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__button:hover {
|
||||
background: var(--background-primary-alt, var(--background-secondary));
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__icon {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__icon.is-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__close {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
display: inline-flex;
|
||||
padding: 0.1rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__close:hover {
|
||||
background: var(--background-modifier-hover);
|
||||
}
|
||||
|
||||
.excalidraw-sidepanel-tab__close.is-hidden {
|
||||
display: none;
|
||||
}
|
||||
/*Arrow Picker Popover Overflow*/
|
||||
/*
|
||||
.excalidraw .selected-shape-actions .Island.App-menu__left,
|
||||
@@ -714,6 +879,13 @@ textarea.excalidraw-wysiwyg, .excalidraw input {
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
|
||||
.is-mobile .modal-container.excalidraw-modal .modal.excalidraw-modal {
|
||||
align-self: flex-start;
|
||||
transform: none !important;
|
||||
margin-top: calc(var(--safe-area-inset-top) + var(--header-height) + var(--size-4-2));
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.excalidraw .picker-content {
|
||||
grid-gap: 0.2rem !important;
|
||||
}
|
||||
@@ -919,3 +1091,11 @@ textarea.excalidraw-wysiwyg, .excalidraw input {
|
||||
.excalidraw .ToolIcon.ToolIcon__penMode {
|
||||
height:fit-content
|
||||
}
|
||||
|
||||
.excalidraw-LatexPrompt .cm-content {
|
||||
caret-color: var(--caret-color);
|
||||
}
|
||||
|
||||
.excalidraw-LatexPrompt .cm-editor {
|
||||
margin-top: 90px;
|
||||
}
|
||||
Reference in new issue
Block a user