Compare commits

...

6 Commits

Author SHA1 Message Date
Zsolt Viczian
b0bb5a00fb migrated old color functions to CM 2022-09-03 13:06:35 +02:00
Zsolt Viczian
1aac4ffdf3 added colormaster 2022-09-02 18:16:44 +02:00
Zsolt Viczian
64fd43abb8 Merge branch 'master' of https://github.com/zsviczian/obsidian-excalidraw-plugin 2022-08-28 13:06:04 +02:00
Zsolt Viczian
31ae51a421 1.7.18 2022-08-28 13:05:58 +02:00
zsviczian
0d879b7a7e Merge pull request #771 from axelson/fix-spelling
Fix spelling of embed
2022-08-28 09:40:28 +02:00
Jason Axelson
d8166bbf8c Fix spelling of embed 2022-08-27 08:17:07 -10:00
9 changed files with 2308 additions and 2328 deletions

View File

@@ -21,11 +21,12 @@ Please upgrade to Obsidian v0.12.19 or higher to get the latest release.
# Key features
- The plugin aims to integrate Excalidraw seamlessly into Obsidian including Command Palette actions, File Explorer features, Option Menu commands, and the Ribbon Button.
- The plugin integrates Excalidraw seamlessly into Obsidian including Command Palette actions, File Explorer features, Option Menu commands, and the Ribbon Button.
- <kbd>CTRL/CMD+Click</kbd> on the ribbon button, or in the file explorer to create / open drawings in a new pane.
- Settings will allow you to customize Excalidraw to your needs:
- Default folder for new drawings and define custom filename pattern for new drawings.
- Template for new drawings. The template will restore stroke properties. This means you can set up defaults in your template for stroke color, stroke width, opacity, font family, font size, fill style, stroke style, etc. This also applies to ExcalidrawAutomate.
- Via the template you can customize the color palette used by Excalidraw. Switch to Markdown view. Scroll down to the bottom of the file and find `"AppState": {`. Find `"customColorPalette": {` at the end of the AppState section. You may specify the 3 palettes used in Excalidraw by adding any or all of the following 3 variables: `"canvasBackground":[], "elementBackground":[], "elementStroke": []`. Add a comma separated list of valid HTML colors (e.g. `#FF0000` for red) in the array for each of the variables. See my videos above for further help.
- If portability is important to you: Auto-export SVG and/or PNG files including keep-in-sync feature so you can embed SVG/PNG into your documents instead of embedding excalidraw files. You can override export settings for an individual file by adding the `excalidraw-autoexport` frontmatter key. Valid values for this key are `none`, `both`, `png` and `svg`.
- Specify the default width of embedded drawings.
- Compatibility features to auto-export and keep in sync markdown excalidraw files and legacy .excalidraw files.
@@ -76,7 +77,7 @@ Please upgrade to Obsidian v0.12.19 or higher to get the latest release.
- Frontmatter tags to customize image export at a file level [519](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/519). If these keys are present they will override the default excalidraw embed and export settings.
- `excalidraw-export-transparent: true`: true == Transparent / false == with background.
- `excalidraw-export-dark`: true == Dark mode / false == light mode.
- `excalidraw-export-svgpadding`: This only affects export to SVG. Specify the export padding for the image
- `excalidraw-export-padding`: Specify the export padding for the image
- `excalidraw-export-pngscale`: This only affects export to PNG. Specify the export scale for the image. The typical range is between 0.5 and 5, but you can experiment with other values as well.
- Embed complete markdown files into your drawings
- Drag from the desired file from the Obsidian file explorer and hold down <kbd>CTRL/CMD</kbd> while dropping the file onto the canvas.

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "1.7.17",
"version": "1.7.18",
"minAppVersion": "0.15.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",

View File

@@ -25,7 +25,8 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "^5.0.1",
"roughjs": "^4.5.2"
"roughjs": "^4.5.2",
"colormaster": "1.2.1"
},
"devDependencies": {
"@babel/core": "^7.16.12",

File diff suppressed because it is too large Load Diff

View File

@@ -702,7 +702,6 @@ export class ExcalidrawData {
* @returns {boolean} - true if there were changes
*/
private findNewTextElementsInScene(selectedElementIds: {[key: string]: boolean} = {}): boolean {
return false;
//console.log("Excalidraw.Data.findNewTextElementsInScene()");
//get scene text elements
this.selectedElementIds = selectedElementIds;
@@ -741,7 +740,13 @@ export class ExcalidrawData {
this.textElements.set(id, { raw, parsed: null, wrapAt });
this.parseasync(id, raw, wrapAt);
}
} else if (!this.textElements.has(te.id)) {
const raw = te.rawText && te.rawText !== "" ? te.rawText : te.text; //this is for compatibility with drawings created before the rawText change on ExcalidrawTextElement
const wrapAt = estimateMaxLineLen(te.text, te.originalText);
this.textElements.set(id, { raw, parsed: null, wrapAt });
this.parseasync(id, raw, wrapAt);
}
}
if (dirty) {
//reload scene json in case it has changed

View File

@@ -2432,6 +2432,7 @@ export default class ExcalidrawView extends TextFileView {
};
this.refresh = () => {
if(this.contentEl.clientWidth === 0 || this.contentEl.clientHeight === 0) return;
const api = this.excalidrawAPI;
if (!excalidrawRef?.current || !api) {
return;

View File

@@ -17,6 +17,9 @@ I develop this plugin as a hobby, spending most of my free time doing this. If y
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://cdn.ko-fi.com/cdn/kofi3.png?v=3" height=45></a></div>
`,
"1.7.18":`
## Critical fix
- duplicating text elements, adding text elements from the library, and pasting excalidraw text elements results in a corrupted file!!`,
"1.7.17":`
## Fixed
- Block transclusions sometimes got lost when switching between RAW mode and PREVIEW mode. [#769](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/769)

View File

@@ -36,7 +36,7 @@ export default {
"Create a new drawing - IN A NEW PANE - and embed into active document",
NEW_IN_ACTIVE_PANE_EMBED:
"Create a new drawing - IN THE CURRENT ACTIVE PANE - and embed into active document",
NEW_IN_POPOUT_WINDOW_EMBED: "Create a new drawing - IN A POPOUT WINDOW - and embedd into active document",
NEW_IN_POPOUT_WINDOW_EMBED: "Create a new drawing - IN A POPOUT WINDOW - and embed into active document",
EXPORT_SVG: "Save as SVG next to the current file",
EXPORT_PNG: "Save as PNG next to the current file",
TOGGLE_LOCK: "Toggle Text Element edit RAW/PREVIEW",

View File

@@ -3063,6 +3063,11 @@
"resolved" "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz"
"version" "2.0.16"
"colormaster@1.2.1":
"integrity" "sha512-+G9g1fOW+TC4+y5IWYI4f7mb+l+oEto/N3qJTFrJNaayFpidZUWhZJGxoSJjhNMIiTttcU1kf4XSyfxHyHkQYw=="
"resolved" "https://registry.npmjs.org/colormaster/-/colormaster-1.2.1.tgz"
"version" "1.2.1"
"combined-stream@^1.0.8":
"integrity" "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="
"resolved" "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"