2.10.1 0.18.0-7
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled

This commit is contained in:
zsviczian
2025-04-16 20:33:48 +02:00
parent 063bef92b9
commit 6e57d4e69a
9 changed files with 81 additions and 8 deletions

View File

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

View File

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

View File

@@ -23,7 +23,7 @@
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/excalidraw": "0.18.0-6",
"@zsviczian/excalidraw": "0.18.0-7",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"@zsviczian/colormaster": "^1.2.2",

View File

@@ -380,6 +380,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
DYNAMIC_COLOR: true,
COLOR: "#000000",
OPACITY: 50,
GRID_DIRECTION: {horizontal: true, vertical: true},
},
laserSettings: {
DECAY_LENGTH: 50,
@@ -1380,6 +1381,42 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.updateGridColor());
};
const updateGridDirection = () => {
getExcalidrawViews(this.app).forEach(excalidrawView=>
excalidrawView.updateGridDirection(this.plugin.settings.gridSettings.GRID_DIRECTION));
}
new Setting(detailsEl)
.setName(t("GRID_DIRECTION_NAME"))
.setDesc(t("GRID_DIRECTION_DESC"))
.addToggle((toggle) =>
toggle
.setTooltip(t("GRID_HORIZONTAL"))
.setValue(this.plugin.settings.gridSettings.GRID_DIRECTION?.horizontal ?? true)
.onChange((value) => {
if(!this.plugin.settings.gridSettings.GRID_DIRECTION) {
this.plugin.settings.gridSettings.GRID_DIRECTION = { horizontal: true, vertical: true };
} //2.10.1 migration
this.plugin.settings.gridSettings.GRID_DIRECTION.horizontal = value;
this.applySettingsUpdate();
updateGridDirection();
}),
)
.addToggle((toggle) =>
toggle
.setTooltip(t("GRID_VERTICAL"))
.setValue(this.plugin.settings.gridSettings.GRID_DIRECTION?.vertical ?? true)
.onChange((value) => {
if(!this.plugin.settings.gridSettings.GRID_DIRECTION) {
this.plugin.settings.gridSettings.GRID_DIRECTION = { horizontal: true, vertical: true };
} //2.10.1 migration
this.plugin.settings.gridSettings.GRID_DIRECTION.vertical = value;
this.applySettingsUpdate();
updateGridDirection();
}),
);
// Dynamic color toggle
let gridColorSection: HTMLDivElement;
new Setting(detailsEl)

View File

@@ -427,6 +427,10 @@ FILENAME_HEAD: "Filename",
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_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",
GRID_VERTICAL: "Render vertical grid",
LASER_HEAD: "Laser pointer",
LASER_COLOR: "Laser pointer color",
LASER_DECAY_TIME_NAME: "Laser pointer decay time",

View File

@@ -11,12 +11,32 @@ Thank you & Enjoy!
`;
export const RELEASE_NOTES: { [k: string]: string } = {
Intro: `After each update you'll be prompted with the release notes. You can disable this in plugin settings.
Intro: `After each update, youll see these release notes (you can turn this off in the plugin settings).
I develop this plugin as a hobby, spending my free time doing this. If you find it valuable, then please say THANK YOU or...
I build this plugin in my free time, as a labor of love. Curious about the philosophy behind it? Check out [📕 Sketch Your Mind](https://sketch-your-mind.com). If you find it valuable, say THANK YOU or
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://storage.ko-fi.com/cdn/kofi6.png?v=6" border="0" alt="Buy Me a Coffee at ko-fi.com" height=45></a></div>
`,
"2.10.1": `
## Fixed by Excalidraw.com
- Eraser performance improvement regression. Erasing locked elements. [#9400](https://github.com/excalidraw/excalidraw/pull/9400)
## New
- Grid Customization Options in plugin settings (appearance and behavior/grid): You can now selectively show or hide vertical and horizontal grid lines independently. This allows you to create alternative grid styles, such as horizontal-only lined grids instead of the traditional checkered pattern.
## Fixed in ExcalidrawAutomate
- ${String.fromCharCode(96)}ea.createSVG${String.fromCharCode(96)} throws error [#2321]https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2321)
---
## ❤️ Enjoying the plugin?
Support my work by checking out my new book, now available for pre-order:
[Sketch Your Mind: Nurture a Playful and Creative Brain](https://sketch-your-mind.com) is about visual Personal Knowledge Management. It explores the thinking behind Excalidraw and how it helps you structure and evolve ideas visually. Its the book I wish I had when I began my own PKM journey.
<div class="ex-coffee-div"><a href="https://sketch-your-mind.com"><img src="https://raw.githubusercontent.com/zsviczian/sketch-your-mind/refs/heads/main/images/cover-mini.jpg" border="0" alt="Pre-order Sketch Your Mind" height="100%"></a></div>
`,
"2.10.0": `
## New from Excalidraw.com
- Lasso select [#9169](https://github.com/excalidraw/excalidraw/pull/9169)
@@ -28,7 +48,7 @@ I develop this plugin as a hobby, spending my free time doing this. If you find
- Keep arrow label horizontal [#9364](https://github.com/excalidraw/excalidraw/pull/9364)
## Fixed in ExcalidrawAutomate
- ea.addText did not honor the width parameter.
- ${String.fromCharCode(96)}ea.addText${String.fromCharCode(96)} did not honor the width parameter.
`,
"2.9.2":`
- More minor fix. Toolbars are not responsive when dynamic styling is turned off. [#2287](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2287)

View File

@@ -1096,13 +1096,14 @@ export class ExcalidrawAutomate {
? "light"
: undefined;
}
if (theme && !exportSettings) {
if (!exportSettings) {
exportSettings = {
withBackground: this.plugin.settings.exportWithBackground,
withTheme: true,
isMask: false,
skipInliningFonts: !embedFont,
};
}
}
if (!loader) {
loader = new EmbeddedFilesLoader(
this.plugin,

View File

@@ -18,6 +18,7 @@ export type GridSettings = {
DYNAMIC_COLOR: boolean; // Whether the grid color is dynamic
COLOR: string; // The grid color (in hex format)
OPACITY: number; // The grid opacity (hex value between "00" and "FF")
GRID_DIRECTION: {horizontal: boolean, vertical: boolean}; // Whether the grid is horizontal or vertical
};
export type DeviceType = {

View File

@@ -155,6 +155,7 @@ import { ImageInfo } from "src/types/excalidrawAutomateTypes";
import { exportToPDF, getMarginValue, getPageDimensions, PageOrientation, PageSize } from "src/utils/exportUtils";
import { FrameRenderingOptions } from "src/types/utilTypes";
import { CaptureUpdateAction } from "src/constants/constants";
import { FlipHorizontal } from "lucide-react";
const EMBEDDABLE_SEMAPHORE_TIMEOUT = 2000;
const PREVENT_RELOAD_TIMEOUT = 2000;
@@ -2769,6 +2770,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
allowWheelZoom: this.plugin.settings.allowWheelZoom,
pinnedScripts: this.plugin.settings.pinnedScripts,
customPens: this.plugin.settings.customPens.slice(0,this.plugin.settings.numberOfCustomPens),
gridDirection: this.plugin.settings.gridSettings.GRID_DIRECTION ?? {horizontal: true, vertical: true},
},
captureUpdate: CaptureUpdateAction.NEVER,
},
@@ -2797,6 +2799,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
allowWheelZoom: this.plugin.settings.allowWheelZoom,
pinnedScripts: this.plugin.settings.pinnedScripts,
customPens: this.plugin.settings.customPens.slice(0,this.plugin.settings.numberOfCustomPens),
gridDirection: this.plugin.settings.gridSettings.GRID_DIRECTION,
},
files: excalidrawData.files,
libraryItems: await this.getLibrary(),
@@ -3939,6 +3942,13 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
window.setTimeout(()=>this.updateScene({appState:{gridColor: this.getGridColor(canvasColor, st)}, captureUpdate: CaptureUpdateAction.NEVER}));
}
public updateGridDirection(gridDirection: {horizontal: boolean, vertical: boolean}) {
window.setTimeout(()=>this.updateScene({appState:{gridDirection: {
horizontal: gridDirection.horizontal,
vertical: gridDirection.vertical}
}, captureUpdate: CaptureUpdateAction.NEVER}));
}
private canvasColorChangeHook(st: AppState) {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.canvasColorChangeHook, "ExcalidrawView.canvasColorChangeHook", st);
const canvasColor = st.viewBackgroundColor === "transparent" ? "white" : st.viewBackgroundColor;