Skip to content

Commit

Permalink
0.8.11 (#1896)
Browse files Browse the repository at this point in the history
* feat: Updated crossnote to 0.9.7

* doc: Fixed CHANGELOG.md

* ci: Fixed prettier format
  • Loading branch information
shd101wyy authored Dec 10, 2023
1 parent e131100 commit 1c25f97
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 6 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "markdown-preview-enhanced",
"displayName": "%displayName%",
"version": "0.8.10",
"version": "0.8.11",
"description": "%description%",
"categories": [
"Other"
Expand Down Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -247,6 +248,9 @@ export class MarkdownPreviewEnhancedConfig implements NotebookConfig {
this.alwaysShowBacklinksInPreview =
getMPEConfig<boolean>('alwaysShowBacklinksInPreview') ??
defaultConfig.alwaysShowBacklinksInPreview;
this.enablePreviewZenMode =
getMPEConfig<boolean>('enablePreviewZenMode') ??
defaultConfig.enablePreviewZenMode;
this.wikiLinkTargetFileExtension =
getMPEConfig<string>('wikiLinkTargetFileExtension') ??
defaultConfig.wikiLinkTargetFileExtension;
Expand Down
15 changes: 15 additions & 0 deletions src/extension-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,14 @@ export async function initExtensionCommon(context: vscode.ExtensionContext) {
updateMPEConfig('previewTheme', theme, true);
}

function togglePreviewZenMode(uri) {
updateMPEConfig(
'enablePreviewZenMode',
!getMPEConfig<boolean>('enablePreviewZenMode'),
true,
);
}

function setCodeBlockTheme(uri, theme) {
updateMPEConfig('codeBlockTheme', theme, true);
}
Expand Down Expand Up @@ -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',
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1c25f97

Please sign in to comment.