From bb9795952dbde207b33602638f88d604c8fa56d4 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Mon, 14 Mar 2022 16:07:20 +0100 Subject: [PATCH] Updated changelog + smaller command enhancements --- CHANGELOG.md | 5 ++-- frontmatter.json | 46 ++++++++++++++++++++++++++++++++++- package.json | 50 +++++++++++++++++++++++++++++++++++++++ src/commands/Dashboard.ts | 1 - src/constants/context.ts | 8 +++---- 5 files changed, 102 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6ee6e46..85382352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Change Log -## [7.0.0] - 2022-03-xx +## [7.0.0] - 2022-03-xx - [Release notes](https://beta.frontmatter.codes/updates/v7.0.0) -### ✨ Features +### ✨ New Features - [#175](https://github.com/estruyf/vscode-front-matter/issues/175): New snippet support + dashboard - [#281](https://github.com/estruyf/vscode-front-matter/issues/281): New `isPublishDate` and `isModifiedDate` datetime field properties @@ -12,6 +12,7 @@ - Light color theme enhancements to media cards - Light color theme enhancements to folder cards - Added collapse and dashboard button to the view title of the FM Panel +- Show content commands only when a supported file type is active - [#272](https://github.com/estruyf/vscode-front-matter/issues/272): New slide over panel for showing details of media files - [#276](https://github.com/estruyf/vscode-front-matter/issues/276): Add a Front Matter walkthrough for VS Code - [#270](https://github.com/estruyf/vscode-front-matter/issues/270): Only show media files from public folder if `pageBundle` is not enabled on any of the content types diff --git a/frontmatter.json b/frontmatter.json index c66afcd7..5dfc5256 100644 --- a/frontmatter.json +++ b/frontmatter.json @@ -7,5 +7,49 @@ "title": ".vscode", "path": "[[workspace]]/.vscode" } - ] + ], + "frontMatter.content.snippets": { + "New version": { + "description": "Insert a new version to the changelog", + "body": [ + "## [{{version}}] - {{year}}-{{month}}-{{day}}", + "", + "### ✨ New features", + "", + "### 🎨 Enhancements", + "", + "### ⚡️ Optimizations", + "", + "### 🐞 Fixes" + ], + "fields": [ + { + "type": "string", + "name": "version", + "title": "Version", + "single": true + }, + { + "type": "string", + "name": "year", + "title": "Year", + "default": "2022" + }, + { + "type": "string", + "name": "month", + "title": "Month", + "default": "xx" + }, + { + "type": "string", + "name": "day", + "title": "Day", + "default": "xx" + } + ], + "openingTags": "{{", + "closingTags": "}}" + } + } } \ No newline at end of file diff --git a/package.json b/package.json index d7e8ea7d..a901dd53 100644 --- a/package.json +++ b/package.json @@ -245,6 +245,16 @@ }, "fields": { "$ref": "#contenttypefield" + }, + "openingTags": { + "description": "The snippet opening tags.", + "type": "string", + "default": "[[" + }, + "closingTags": { + "description": "The snippet closing tags.", + "type": "string", + "default": "]]" } }, "additionalProperties": false @@ -1516,6 +1526,46 @@ { "command": "frontMatter.markup.options", "when": "false" + }, + { + "command": "frontMatter.insertSnippet", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.insertImage", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.createCategory", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.createTag", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.insertCategories", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.insertTags", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.createTemplate", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.preview", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.setLastModifiedDate", + "when": "frontMatter:file:isValid == true" + }, + { + "command": "frontMatter.generateSlug", + "when": "frontMatter:file:isValid == true" } ], "view/title": [ diff --git a/src/commands/Dashboard.ts b/src/commands/Dashboard.ts index 66cad2f1..e6d6a645 100644 --- a/src/commands/Dashboard.ts +++ b/src/commands/Dashboard.ts @@ -6,7 +6,6 @@ import { DashboardCommand } from '../dashboardWebView/DashboardCommand'; import { Extension } from '../helpers/Extension'; import { WebviewHelper } from '@estruyf/vscode'; import { DashboardData } from '../models/DashboardData'; -import { ExplorerView } from '../explorerView/ExplorerView'; import { MediaLibrary } from '../helpers/MediaLibrary'; import { DashboardListener, MediaListener, SettingsListener, TelemetryListener, DataListener, PagesListener, ExtensionListener, SnippetListener } from '../listeners/dashboard'; import { MediaListener as PanelMediaListener } from '../listeners/panel' diff --git a/src/constants/context.ts b/src/constants/context.ts index f35d31bf..88978a4a 100644 --- a/src/constants/context.ts +++ b/src/constants/context.ts @@ -1,8 +1,8 @@ export const CONTEXT = { - canInit: "frontMatterCanInit", - initialized: "frontMatterInitialized", - canOpenPreview: "frontMatterCanOpenPreview", - canOpenDashboard: "frontMatterCanOpenDashboard", + canInit: "frontMatter:CanInit", + initialized: "frontMatter:Initialized", + canOpenPreview: "frontMatter:CanOpenPreview", + canOpenDashboard: "frontMatter:CanOpenDashboard", isEnabled: "frontMatter:enabled", isDashboardOpen: "frontMatter:dashboard:open", wysiwyg: "frontMatter:markdown:wysiwyg",