From 1c25f97fbffec5e2a6bf688ce7ab1347a195e982 Mon Sep 17 00:00:00 2001 From: Yiyi Wang Date: Sun, 10 Dec 2023 18:15:45 +0800 Subject: [PATCH] 0.8.11 (#1896) * feat: Updated crossnote to 0.9.7 * doc: Fixed CHANGELOG.md * ci: Fixed prettier format --- CHANGELOG.md | 15 +++++++++++++++ package.json | 9 +++++++-- src/config.ts | 4 ++++ src/extension-common.ts | 15 +++++++++++++++ yarn.lock | 8 ++++---- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 473f42b..32f717a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.8.11] - 2023-12-10 + +Updated [crossnote](https://github.com/shd101wyy/crossnote) to version [0.9.7](https://github.com/shd101wyy/crossnote/releases/tag/0.9.7). + +### New features + +- Added `enablePreviewZenMode` option and reorganized the right-click context menu. + + ![image](https://github.com/shd101wyy/crossnote/assets/1908863/26e2237e-c6e2-433e-a063-6de2c01a64bb) + +### Bug fixes + +- Fixed rendering `vega-lite` in `Reveal.js` slide: https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues/1880 +- Removed one github-dark background css attribute: https://github.com/shd101wyy/crossnote/issues/344 + ## [0.8.10] - 2023-10-26 Updated [crossnote](https://github.com/shd101wyy/crossnote) to version [0.9.6](https://github.com/shd101wyy/crossnote/releases/tag/0.9.6). diff --git a/package.json b/package.json index 222592c..e5cafa6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "markdown-preview-enhanced", "displayName": "%displayName%", - "version": "0.8.10", + "version": "0.8.11", "description": "%description%", "categories": [ "Other" @@ -594,6 +594,11 @@ "description": "Always show backlinks in preview.", "default": false, "type": "boolean" + }, + "markdown-preview-enhanced.enablePreviewZenMode": { + "description": "Enable this option will hide unnecessary UI elements in preview unless your mouse is over it.", + "default": false, + "type": "boolean" } } }, @@ -674,7 +679,7 @@ "@types/crypto-js": "^4.1.2", "@types/vfile": "^3.0.2", "async-mutex": "^0.4.0", - "crossnote": "^0.9.6", + "crossnote": "^0.9.7", "crypto-js": "^4.2.0" }, "devDependencies": { diff --git a/src/config.ts b/src/config.ts index 2a8a17c..0d32f60 100644 --- a/src/config.ts +++ b/src/config.ts @@ -89,6 +89,7 @@ export class MarkdownPreviewEnhancedConfig implements NotebookConfig { public readonly jsdelivrCdnHost: string; public readonly krokiServer: string; public readonly alwaysShowBacklinksInPreview: boolean; + public readonly enablePreviewZenMode: boolean; public readonly wikiLinkTargetFileExtension: string; public readonly wikiLinkTargetFileNameChangeCase: WikiLinkTargetFileNameChangeCase; // Don't set values for these properties in constructor: @@ -247,6 +248,9 @@ export class MarkdownPreviewEnhancedConfig implements NotebookConfig { this.alwaysShowBacklinksInPreview = getMPEConfig('alwaysShowBacklinksInPreview') ?? defaultConfig.alwaysShowBacklinksInPreview; + this.enablePreviewZenMode = + getMPEConfig('enablePreviewZenMode') ?? + defaultConfig.enablePreviewZenMode; this.wikiLinkTargetFileExtension = getMPEConfig('wikiLinkTargetFileExtension') ?? defaultConfig.wikiLinkTargetFileExtension; diff --git a/src/extension-common.ts b/src/extension-common.ts index eb669c9..40fe648 100644 --- a/src/extension-common.ts +++ b/src/extension-common.ts @@ -382,6 +382,14 @@ export async function initExtensionCommon(context: vscode.ExtensionContext) { updateMPEConfig('previewTheme', theme, true); } + function togglePreviewZenMode(uri) { + updateMPEConfig( + 'enablePreviewZenMode', + !getMPEConfig('enablePreviewZenMode'), + true, + ); + } + function setCodeBlockTheme(uri, theme) { updateMPEConfig('codeBlockTheme', theme, true); } @@ -1131,6 +1139,13 @@ export async function initExtensionCommon(context: vscode.ExtensionContext) { ), ); + context.subscriptions.push( + vscode.commands.registerCommand( + '_crossnote.togglePreviewZenMode', + togglePreviewZenMode, + ), + ); + context.subscriptions.push( vscode.commands.registerCommand( '_crossnote.setCodeBlockTheme', diff --git a/yarn.lock b/yarn.lock index 8603480..6fe935e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1920,10 +1920,10 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crossnote@^0.9.6: - version "0.9.6" - resolved "https://registry.yarnpkg.com/crossnote/-/crossnote-0.9.6.tgz#cda4f4f705762e08c11dacedf0ed9d90fa4fb144" - integrity sha512-jNJmYj7Q7YWI3Sm7omAezPQbPSo+LO+AmklA/Zr5PpKGGwblyClW/ESmxipxVhQ9zr2SMn9aUVNrglynemusuA== +crossnote@^0.9.7: + version "0.9.7" + resolved "https://registry.yarnpkg.com/crossnote/-/crossnote-0.9.7.tgz#eb52ed28669c6149cfe5eab0542c9d1bf87879a1" + integrity sha512-CsFBTstVWHpbHGH0h+3scwfu4xVljIIEEydVLkDCJwM50S71uSGCTMfBPtF1EdWd1GA3DNBJ2uDzR2x/6XtNiw== dependencies: "@headlessui/react" "^1.7.17" "@heroicons/react" "^2.0.18"