diff --git a/manifest-beta.json b/manifest-beta.json index 86dc7a6..dd40b4e 100644 --- a/manifest-beta.json +++ b/manifest-beta.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.7.0-beta-7", + "version": "2.7.0", "minAppVersion": "1.1.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/manifest.json b/manifest.json index 9210142..9ad3848 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.6.8", + "version": "2.7.0", "minAppVersion": "1.1.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/rollup.config.js b/rollup.config.js index 3628116..86967c1 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -31,13 +31,8 @@ function trimLastSemicolon(input) { return input; } -function compressLanguageFile(lang) { - const inputDir = "./src/lang/locale"; - const filePath = `${inputDir}/${lang}.ts`; - let content = fs.readFileSync(filePath, "utf-8"); - content = trimLastSemicolon(content.split("export default")[1].trim()); - - const minified = minify(`x = ${content};`,{ +function minifyCode(code) { + const minified = minify(code,{ compress: true, mangle: true, output: { @@ -49,18 +44,26 @@ function compressLanguageFile(lang) { if (minified.error) { throw new Error(minified.error); } - return LZString.compressToBase64(minified.code); + return minified.code; } -const excalidraw_pkg = isLib ? "" : isProd +function compressLanguageFile(lang) { + const inputDir = "./src/lang/locale"; + const filePath = `${inputDir}/${lang}.ts`; + let content = fs.readFileSync(filePath, "utf-8"); + content = trimLastSemicolon(content.split("export default")[1].trim()); + return LZString.compressToBase64(minifyCode(`x = ${content};`)); +} + +const excalidraw_pkg = isLib ? "" : minifyCode( isProd ? fs.readFileSync("./node_modules/@zsviczian/excalidraw/dist/excalidraw.production.min.js", "utf8") - : fs.readFileSync("./node_modules/@zsviczian/excalidraw/dist/excalidraw.development.js", "utf8"); -const react_pkg = isLib ? "" : isProd + : fs.readFileSync("./node_modules/@zsviczian/excalidraw/dist/excalidraw.development.js", "utf8")); +const react_pkg = isLib ? "" : minifyCode(isProd ? fs.readFileSync("./node_modules/react/umd/react.production.min.js", "utf8") - : fs.readFileSync("./node_modules/react/umd/react.development.js", "utf8"); -const reactdom_pkg = isLib ? "" : isProd + : fs.readFileSync("./node_modules/react/umd/react.development.js", "utf8")); +const reactdom_pkg = isLib ? "" : minifyCode(isProd ? fs.readFileSync("./node_modules/react-dom/umd/react-dom.production.min.js", "utf8") - : fs.readFileSync("./node_modules/react-dom/umd/react-dom.development.js", "utf8"); + : fs.readFileSync("./node_modules/react-dom/umd/react-dom.development.js", "utf8")); const lzstring_pkg = isLib ? "" : fs.readFileSync("./node_modules/lz-string/libs/lz-string.min.js", "utf8"); if (!isLib) { diff --git a/src/dialogs/Messages.ts b/src/dialogs/Messages.ts index 82341fd..6c1b5d0 100644 --- a/src/dialogs/Messages.ts +++ b/src/dialogs/Messages.ts @@ -17,6 +17,24 @@ I develop this plugin as a hobby, spending my free time doing this. If you find
`, +"2.7.0":` +## Fixed +- Various Markdown embeddable "fuzziness": + - Fixed issues with appearance settings and edit mode toggling when single-click editing is enabled. + - Ensured embeddable file editing no longer gets interrupted unexpectedly. +- **Hover Preview**: Disabled hover preview for back-of-the-note cards to reduce distractions. +- **Settings Save**: Fixed an issue where plugin settings unnecessarily saved on every startup. + +## New Features +- **Image Cropping Snaps to Objects**: When snapping is enabled in the scene, image cropping now aligns to nearby objects. +- **Session Persistence for Pen Mode**: Excalidraw remembers the last pen mode when switching between drawings within the same session. + +## Refactoring +- **Mermaid Diagrams**: Excalidraw now uses its own Mermaid package, breaking future dependencies on Obsidian's Mermaid updates. This ensures stability and includes all fixes and improvements made to Excalidraw Mermaid since February 2024. The plugin file size has increased slightly, but this change significantly improves maintainability while remaining invisible to users. +- **MathJax Optimization**: MathJax (LaTeX equation SVG image generation) now loads only on demand, with the package compressed to minimize the startup and file size impact caused by the inclusion of Mermaid. +- **On-Demand Language Loading**: Non-English language files are now compressed and load only when needed, counterbalancing the increase in file size due to Mermaid and improving load speeds. +- **Codebase Restructuring**: Improved type safety by removing many ${String.fromCharCode(96)}//@ts-ignore${String.fromCharCode(96)} commands and enhancing modularity. Introduced new management classes: **CommandManager**, **EventManager**, **PluginFileManager**, **ObserverManager**, and **PackageManager**. Further restructuring is planned for upcoming releases to improve maintainability and stability. +`, "2.6.8":` ## New - **QoL improvements**: diff --git a/src/main.ts b/src/main.ts index 8abd047..2e2c8d9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -143,6 +143,10 @@ export default class ExcalidrawPlugin extends Plugin { >(); this.equationsMaster = new Map