From d667b19716c1bf0488178020af4820f4ed97a238 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 26 Dec 2021 11:40:28 +0100 Subject: [PATCH 01/21] 5.9.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5af57033..69fedcb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-front-matter-beta", - "version": "5.8.0", + "version": "5.9.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-front-matter-beta", - "version": "5.8.0", + "version": "5.9.0", "license": "MIT", "devDependencies": { "@bendera/vscode-webview-elements": "0.6.2", diff --git a/package.json b/package.json index a5fa9f03..d74d9d4f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Front Matter", "description": "An essential Visual Studio Code extension when you want to manage the markdown pages of your static site like: Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...", "icon": "assets/frontmatter-teal-128x128.png", - "version": "5.8.0", + "version": "5.9.0", "preview": false, "publisher": "eliostruyf", "galleryBanner": { From 24f79d9d3f2d1aabfdd6024c827c2f6eede2b816 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 26 Dec 2021 11:52:45 +0100 Subject: [PATCH 02/21] #210 - Media file extension fix --- CHANGELOG.md | 9 +++++++++ src/helpers/MediaHelpers.ts | 2 +- src/helpers/MediaLibrary.ts | 9 +++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73688a45..8eaf063d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [5.9.0] - 2021-01-XX + +### 🎨 Enhancements + +### 🐞 Fixes + +- [#210](https://github.com/estruyf/vscode-front-matter/issues/210): Fix for adding media files with uppercase file extensions + + ## [5.8.0] - 2021-12-21 - 🎄 ### 🎨 Enhancements diff --git a/src/helpers/MediaHelpers.ts b/src/helpers/MediaHelpers.ts index 33ca36c0..e8bd33dc 100644 --- a/src/helpers/MediaHelpers.ts +++ b/src/helpers/MediaHelpers.ts @@ -313,7 +313,7 @@ export class MediaHelpers { private static filterMedia(files: Uri[]) { return files.filter(file => { const ext = extname(file.fsPath); - return ['.jpg', '.jpeg', '.png', '.gif', '.svg'].includes(ext); + return ['.jpg', '.jpeg', '.png', '.gif', '.svg'].includes(ext.toLowerCase()); }).map((file) => ({ fsPath: file.fsPath, vsPath: Dashboard.getWebview()?.asWebviewUri(file).toString(), diff --git a/src/helpers/MediaLibrary.ts b/src/helpers/MediaLibrary.ts index 7671817d..430966df 100644 --- a/src/helpers/MediaLibrary.ts +++ b/src/helpers/MediaLibrary.ts @@ -27,11 +27,12 @@ export class MediaLibrary { workspace.onDidRenameFiles(e => { e.files.forEach(f => { + const path = f.oldUri.path.toLowerCase(); // Check if file is an image - if (f.oldUri.path.endsWith('.jpeg') || - f.oldUri.path.endsWith('.jpg') || - f.oldUri.path.endsWith('.png') || - f.oldUri.path.endsWith('.gif')) { + if (path.endsWith('.jpeg') || + path.endsWith('.jpg') || + path.endsWith('.png') || + path.endsWith('.gif')) { this.rename(f.oldUri.fsPath, f.newUri.fsPath); MediaHelpers.resetMedia(); } From 092eb0fd2a10963c5afb91c536238113c10fbd62 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 26 Dec 2021 12:11:38 +0100 Subject: [PATCH 03/21] #211 - Replace text selection on media insert --- CHANGELOG.md | 3 ++- src/helpers/MediaHelpers.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eaf063d..bca654d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,12 @@ ### 🎨 Enhancements +- [#211](https://github.com/estruyf/vscode-front-matter/issues/211): Replace text selection on media inserts + ### 🐞 Fixes - [#210](https://github.com/estruyf/vscode-front-matter/issues/210): Fix for adding media files with uppercase file extensions - ## [5.8.0] - 2021-12-21 - 🎄 ### 🎨 Enhancements diff --git a/src/helpers/MediaHelpers.ts b/src/helpers/MediaHelpers.ts index e8bd33dc..05b88b85 100644 --- a/src/helpers/MediaHelpers.ts +++ b/src/helpers/MediaHelpers.ts @@ -283,7 +283,15 @@ export class MediaHelpers { } } - await editor?.edit(builder => builder.insert(new Position(line, character), data.snippet || `![${data.alt || data.caption || ""}](${imgPath})`)); + const selection = editor?.selection; + await editor?.edit(builder => { + const snippet = data.snippet || `![${data.alt || data.caption || ""}](${imgPath})`; + if (selection !== undefined) { + builder.replace(selection, snippet); + } else { + builder.insert(new Position(line, character), snippet); + } + }); } panel.getMediaSelection(); } else { From cb80a10de29b8baf6b209e5c4a2e0772865d10c7 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 26 Dec 2021 17:19:31 +0100 Subject: [PATCH 04/21] #213 - Media folder design --- CHANGELOG.md | 1 + src/dashboardWebView/components/Media/FolderItem.tsx | 10 ++++++---- src/dashboardWebView/components/Media/List.tsx | 10 +++++++--- src/dashboardWebView/components/Media/Media.tsx | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bca654d2..3b24fde2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### 🎨 Enhancements - [#211](https://github.com/estruyf/vscode-front-matter/issues/211): Replace text selection on media inserts +- [#213](https://github.com/estruyf/vscode-front-matter/issues/213): New media folder overview design ### 🐞 Fixes diff --git a/src/dashboardWebView/components/Media/FolderItem.tsx b/src/dashboardWebView/components/Media/FolderItem.tsx index cea4febe..9b52ca00 100644 --- a/src/dashboardWebView/components/Media/FolderItem.tsx +++ b/src/dashboardWebView/components/Media/FolderItem.tsx @@ -16,11 +16,13 @@ export const FolderItem: React.FunctionComponent = ({ folder, const relFolderPath = wsFolder ? folder.replace(wsFolder, '') : folder; return ( -
  • - diff --git a/src/dashboardWebView/components/Media/List.tsx b/src/dashboardWebView/components/Media/List.tsx index abf0746b..d932d661 100644 --- a/src/dashboardWebView/components/Media/List.tsx +++ b/src/dashboardWebView/components/Media/List.tsx @@ -1,10 +1,14 @@ import * as React from 'react'; -export interface IListProps {} +export interface IListProps { + gap?: number; +} + +export const List: React.FunctionComponent = ({gap, children}: React.PropsWithChildren) => { + const gapClass = gap !== undefined ? `gap-y-${gap}` : `gap-y-8`; -export const List: React.FunctionComponent = ({children}: React.PropsWithChildren) => { return ( -
      +
        {children}
      ); diff --git a/src/dashboardWebView/components/Media/Media.tsx b/src/dashboardWebView/components/Media/Media.tsx index 1c9adb98..83fc1dd7 100644 --- a/src/dashboardWebView/components/Media/Media.tsx +++ b/src/dashboardWebView/components/Media/Media.tsx @@ -113,7 +113,7 @@ export const Media: React.FunctionComponent = (props: React.PropsWi { folders && folders.length > 0 && (
      - + { folders && folders.map((folder) => ( From 0149885289bbd1925e50e6e365023d5261d995e2 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 26 Dec 2021 18:56:24 +0100 Subject: [PATCH 05/21] Item borders --- src/dashboardWebView/components/Contents/Item.tsx | 2 +- src/dashboardWebView/components/Media/Item.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dashboardWebView/components/Contents/Item.tsx b/src/dashboardWebView/components/Contents/Item.tsx index f9006bb2..24bd6bc8 100644 --- a/src/dashboardWebView/components/Contents/Item.tsx +++ b/src/dashboardWebView/components/Contents/Item.tsx @@ -26,7 +26,7 @@ export const Item: React.FunctionComponent = ({ fmFilePath, date, ti if (view === DashboardViewType.Grid) { return (
    • - - -
    • + +
      +
        +
      • + +
      • +
      • + +
      • +
      { From 2f13c335ed5d5f46e90dde3bf85acb36b9c1a58c Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 26 Dec 2021 20:24:23 +0100 Subject: [PATCH 07/21] #212 - Added folder watchers --- CHANGELOG.md | 1 + src/commands/Folders.ts | 5 ++++- src/extension.ts | 5 +++++ src/listeners/PagesListener.ts | 30 +++++++++++++++++++++++++++++- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b24fde2..80b61165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### 🎨 Enhancements - [#211](https://github.com/estruyf/vscode-front-matter/issues/211): Replace text selection on media inserts +- [#212](https://github.com/estruyf/vscode-front-matter/issues/212): Create folder watchers for content folders. When new content gets created, the dashboard updates. - [#213](https://github.com/estruyf/vscode-front-matter/issues/213): New media folder overview design ### 🐞 Fixes diff --git a/src/commands/Folders.ts b/src/commands/Folders.ts index 179fc4e1..f81e9e57 100644 --- a/src/commands/Folders.ts +++ b/src/commands/Folders.ts @@ -12,7 +12,7 @@ import { format } from 'date-fns'; import { Dashboard } from './Dashboard'; import { parseWinPath } from '../helpers/parseWinPath'; import { MediaHelpers } from '../helpers/MediaHelpers'; -import { MediaListener } from '../listeners'; +import { MediaListener, PagesListener } from '../listeners'; export const WORKSPACE_PLACEHOLDER = `[[workspace]]`; @@ -288,6 +288,9 @@ export class Folders { })); await Settings.update(SETTINGS_CONTENT_PAGE_FOLDERS, folderDetails, true); + + // Reinitialize the folder listeners + PagesListener.startWatchers(); } /** diff --git a/src/extension.ts b/src/extension.ts index 3b46f7f5..3b9b3563 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -18,6 +18,7 @@ import { Content } from './commands/Content'; import ContentProvider from './providers/ContentProvider'; import { Wysiwyg } from './commands/Wysiwyg'; import { Diagnostics } from './commands/Diagnostics'; +import { PagesListener } from './listeners'; let frontMatterStatusBar: vscode.StatusBarItem; let statusDebouncer: { (fnc: any, time: number): void; }; @@ -40,6 +41,10 @@ export async function activate(context: vscode.ExtensionContext) { SettingsHelper.checkToPromote(); + // Start listening to the folders for content changes. + // This will make sure the dashboard is up to date + PagesListener.startWatchers(); + collection = vscode.languages.createDiagnosticCollection('frontMatter'); // Pages dashboard diff --git a/src/listeners/PagesListener.ts b/src/listeners/PagesListener.ts index 7296a9f5..1b112278 100644 --- a/src/listeners/PagesListener.ts +++ b/src/listeners/PagesListener.ts @@ -1,7 +1,7 @@ import { isValidFile } from './../helpers/isValidFile'; import { existsSync } from "fs"; import { dirname, join } from "path"; -import { commands, Uri } from "vscode"; +import { commands, FileSystemWatcher, RelativePattern, Uri, workspace } from "vscode"; import { Dashboard } from "../commands/Dashboard"; import { Folders } from "../commands/Folders"; import { COMMAND_NAME, DefaultFields, SETTINGS_CONTENT_STATIC_FOLDER, SETTING_DATE_FIELD, SETTING_SEO_DESCRIPTION_FIELD } from "../constants"; @@ -16,6 +16,34 @@ import { BaseListener } from "./BaseListener"; export class PagesListener extends BaseListener { + private static watchers: { [path: string]: FileSystemWatcher } = {}; + + /** + * Start watching the folders in the current workspace for content changes + */ + public static async startWatchers() { + const folders = Folders.get(); + + if (!folders || folders.length === 0) { + return; + } + + // Dispose all the current watchers + const paths = Object.keys(this.watchers); + for (const path of paths) { + const watcher = this.watchers[path]; + watcher.dispose(); + delete this.watchers[path]; + } + + // Recreate all the watchers + for (const folder of folders) { + const folderUri = Uri.parse(folder.path); + let watcher = workspace.createFileSystemWatcher(new RelativePattern(folderUri, "*")); + watcher.onDidCreate(async (uri: Uri) => this.getPagesData); + this.watchers[folderUri.fsPath] = watcher; + } + } /** * Process the messages for the dashboard views From c5b7b7845df938310ee0c59862a168dd2d0585d9 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 26 Dec 2021 20:29:44 +0100 Subject: [PATCH 08/21] #212 - Added deleted folder watcher --- src/listeners/PagesListener.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/listeners/PagesListener.ts b/src/listeners/PagesListener.ts index 1b112278..94e71b07 100644 --- a/src/listeners/PagesListener.ts +++ b/src/listeners/PagesListener.ts @@ -41,6 +41,7 @@ export class PagesListener extends BaseListener { const folderUri = Uri.parse(folder.path); let watcher = workspace.createFileSystemWatcher(new RelativePattern(folderUri, "*")); watcher.onDidCreate(async (uri: Uri) => this.getPagesData); + watcher.onDidDelete(async (uri: Uri) => this.getPagesData); this.watchers[folderUri.fsPath] = watcher; } } From ab3686b3b5cbf32dc4b20da3f87af2534043532d Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Mon, 27 Dec 2021 15:56:12 +0100 Subject: [PATCH 09/21] #199 - Search media files --- CHANGELOG.md | 1 + .../components/Header/Breadcrumb.tsx | 87 +++++---- .../components/Header/Header.tsx | 9 +- .../components/Header/Pagination.tsx | 72 ++++++++ .../{Media => Header}/PaginationButton.tsx | 0 .../components/Header/PaginationStatus.tsx | 46 +++++ .../components/Header/Searchbox.tsx | 13 +- .../components/Media/FolderCreation.tsx | 34 ++-- .../components/Media/Media.tsx | 31 +--- .../components/Media/MediaHeaderBottom.tsx | 30 ++++ .../components/Media/MediaHeaderTop.tsx | 81 +++++++++ .../components/Media/Pagination.tsx | 169 ------------------ src/dashboardWebView/components/Startup.tsx | 2 +- src/dashboardWebView/hooks/useMedia.tsx | 75 ++++++++ src/helpers/MediaHelpers.ts | 2 +- src/models/MediaPaths.ts | 1 + tsconfig.json | 3 + 17 files changed, 393 insertions(+), 263 deletions(-) create mode 100644 src/dashboardWebView/components/Header/Pagination.tsx rename src/dashboardWebView/components/{Media => Header}/PaginationButton.tsx (100%) create mode 100644 src/dashboardWebView/components/Header/PaginationStatus.tsx create mode 100644 src/dashboardWebView/components/Media/MediaHeaderBottom.tsx create mode 100644 src/dashboardWebView/components/Media/MediaHeaderTop.tsx delete mode 100644 src/dashboardWebView/components/Media/Pagination.tsx create mode 100644 src/dashboardWebView/hooks/useMedia.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b61165..4deaf71c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### 🎨 Enhancements +- [#199](https://github.com/estruyf/vscode-front-matter/issues/199): Search media files in the currently selected folder - [#211](https://github.com/estruyf/vscode-front-matter/issues/211): Replace text selection on media inserts - [#212](https://github.com/estruyf/vscode-front-matter/issues/212): Create folder watchers for content folders. When new content gets created, the dashboard updates. - [#213](https://github.com/estruyf/vscode-front-matter/issues/213): New media folder overview design diff --git a/src/dashboardWebView/components/Header/Breadcrumb.tsx b/src/dashboardWebView/components/Header/Breadcrumb.tsx index 3b7866a2..b7ddc697 100644 --- a/src/dashboardWebView/components/Header/Breadcrumb.tsx +++ b/src/dashboardWebView/components/Header/Breadcrumb.tsx @@ -1,28 +1,32 @@ -import {CollectionIcon} from '@heroicons/react/outline'; +import { CollectionIcon } from '@heroicons/react/outline'; import { basename, join } from 'path'; import * as React from 'react'; import { useRecoilState, useRecoilValue } from 'recoil'; -import { Sorting } from '.'; import { HOME_PAGE_NAVIGATION_ID } from '../../../constants'; import { parseWinPath } from '../../../helpers/parseWinPath'; -import { NavigationType } from '../../models'; -import { SelectedMediaFolderAtom, SettingsAtom } from '../../state'; +import { SearchAtom, SelectedMediaFolderAtom, SettingsAtom } from '../../state'; export interface IBreadcrumbProps {} export const Breadcrumb: React.FunctionComponent = (props: React.PropsWithChildren) => { const [ selectedFolder, setSelectedFolder ] = useRecoilState(SelectedMediaFolderAtom); - const settings = useRecoilValue(SettingsAtom); + const [ , setSearchValue ] = useRecoilState(SearchAtom); const [ folders, setFolders ] = React.useState([]); + const settings = useRecoilValue(SettingsAtom); - if (!settings?.wsFolder) { - return null; + const updateFolder = (folder: string) => { + setSearchValue(''); + setSelectedFolder(folder); } React.useEffect(() => { + if (!settings) { + return; + } + const { wsFolder, staticFolder, contentFolders } = settings; - const isValid = (folderPath: string) => { + const isValid = (folderPath: string) => { if (staticFolder) { const staticPath = parseWinPath(join(wsFolder, staticFolder)) as string; const relPath = folderPath.replace(staticPath, '') as string; @@ -33,7 +37,7 @@ export const Breadcrumb: React.FunctionComponent = (props: Rea return false; } } -1 + for (let i = 0; i < contentFolders.length; i++) { const folder = contentFolders[i]; const contentFolder = parseWinPath(folder.path) as string; @@ -62,45 +66,40 @@ export const Breadcrumb: React.FunctionComponent = (props: Rea setFolders(allFolders); } - }, [selectedFolder]); - + }, [selectedFolder, settings]); + return ( - + ))} + ); }; \ No newline at end of file diff --git a/src/dashboardWebView/components/Header/Header.tsx b/src/dashboardWebView/components/Header/Header.tsx index a3818485..c480b25f 100644 --- a/src/dashboardWebView/components/Header/Header.tsx +++ b/src/dashboardWebView/components/Header/Header.tsx @@ -15,9 +15,9 @@ import { Messenger } from '@estruyf/vscode/dist/client'; import { ClearFilters } from './ClearFilters'; import { MarkdownIcon } from '../../../panelWebView/components/Icons/MarkdownIcon'; import {PhotographIcon} from '@heroicons/react/outline'; -import { Pagination } from '../Media/Pagination'; +import { MediaHeaderTop } from '../Media/MediaHeaderTop'; import { ChoiceButton } from '../ChoiceButton'; -import { Breadcrumb } from './Breadcrumb'; +import { MediaHeaderBottom } from '../Media/MediaHeaderBottom'; export interface IHeaderProps { settings: Settings | null; @@ -125,8 +125,9 @@ export const Header: React.FunctionComponent = ({totalPages, folde { view === NavigationType.Media && ( <> - - + + + ) } diff --git a/src/dashboardWebView/components/Header/Pagination.tsx b/src/dashboardWebView/components/Header/Pagination.tsx new file mode 100644 index 00000000..85dbdda1 --- /dev/null +++ b/src/dashboardWebView/components/Header/Pagination.tsx @@ -0,0 +1,72 @@ +import * as React from 'react'; +import { useRecoilState, useRecoilValue } from 'recoil'; +import { LIMIT } from '../../hooks/useMedia'; +import { MediaTotalSelector, PageAtom } from '../../state'; +import { PaginationButton } from './PaginationButton'; + +export interface IPaginationProps {} + +export const Pagination: React.FunctionComponent = (props: React.PropsWithChildren) => { + const [ page, setPage ] = useRecoilState(PageAtom); + const totalMedia = useRecoilValue(MediaTotalSelector); + + const totalPages = Math.ceil(totalMedia / LIMIT) - 1; + + const getButtons = (): number[] => { + const maxButtons = 5; + const buttons: number[] = []; + const start = page - maxButtons; + const end = page + maxButtons; + + for (let i = start; i <= end; i++) { + if (i >= 0 && i <= totalPages) { + buttons.push(i); + } + } + return buttons; + }; + + return ( +
      + { + if (page > 0) { + setPage(0) + } + }} /> + + { + if (page > 0) { + setPage(page - 1) + } + }} /> + + {getButtons().map((button) => ( + + ))} + + = totalPages} + onClick={() => setPage(page + 1)} /> + + = totalPages} + onClick={() => setPage(totalPages)} /> +
      + ); +}; \ No newline at end of file diff --git a/src/dashboardWebView/components/Media/PaginationButton.tsx b/src/dashboardWebView/components/Header/PaginationButton.tsx similarity index 100% rename from src/dashboardWebView/components/Media/PaginationButton.tsx rename to src/dashboardWebView/components/Header/PaginationButton.tsx diff --git a/src/dashboardWebView/components/Header/PaginationStatus.tsx b/src/dashboardWebView/components/Header/PaginationStatus.tsx new file mode 100644 index 00000000..49d6abf0 --- /dev/null +++ b/src/dashboardWebView/components/Header/PaginationStatus.tsx @@ -0,0 +1,46 @@ +import * as React from 'react'; +import { useRecoilState, useRecoilValue } from 'recoil'; +import { MediaTotalSelector, PageAtom, SearchAtom, SelectedMediaFolderSelector } from '../../state'; +import { Messenger } from '@estruyf/vscode/dist/client'; +import { DashboardMessage } from '../../DashboardMessage'; +import { RefreshIcon } from '@heroicons/react/outline'; +import { LIMIT } from '../../hooks/useMedia'; + +export interface IPaginationStatusProps {} + +export const PaginationStatus: React.FunctionComponent = (props: React.PropsWithChildren) => { + const totalMedia = useRecoilValue(MediaTotalSelector); + const selectedFolder = useRecoilValue(SelectedMediaFolderSelector); + const [ page, setPage ] = useRecoilState(PageAtom); + const [ , setSearch ] = useRecoilState(SearchAtom); + + const getTotalPage = () => { + const mediaItems = ((page + 1) * LIMIT); + if (totalMedia < mediaItems) { + return totalMedia; + } + return mediaItems; + }; + + const refresh = () => { + setPage(0); + setSearch(''); + Messenger.send(DashboardMessage.refreshMedia, { folder: selectedFolder }); + } + + return ( +
      + + +

      + Showing {(page * LIMIT) + 1} to {getTotalPage()} of{' '} + {totalMedia} results +

      +
      + ); +}; \ No newline at end of file diff --git a/src/dashboardWebView/components/Header/Searchbox.tsx b/src/dashboardWebView/components/Header/Searchbox.tsx index 80e9dc63..a9840a80 100644 --- a/src/dashboardWebView/components/Header/Searchbox.tsx +++ b/src/dashboardWebView/components/Header/Searchbox.tsx @@ -8,25 +8,32 @@ export interface ISearchboxProps {} export const Searchbox: React.FunctionComponent = ({}: React.PropsWithChildren) => { const [ value, setValue ] = React.useState(''); - const [ , setDebounceValue ] = useRecoilState(SearchAtom); + const [ debounceSearchValue, setDebounceValue ] = useRecoilState(SearchAtom); const debounceSearch = useDebounce(value, 500); const handleChange = (event: React.ChangeEvent) => { setValue(event.target.value); }; + React.useEffect(() => { + if (!debounceSearchValue && value) { + setValue(''); + } + } , [debounceSearchValue]); + React.useEffect(() => { setDebounceValue(debounceSearch); }, [debounceSearch]); return ( -
      -
      +
      +
      + = (pr const scripts = (settings?.scripts || []).filter(script => script.type === ScriptType.MediaFolder); if (scripts.length > 0) { return ( - ({ - title: s.title, - onClick: () => runCustomScript(s) - }))} - onClick={onFolderCreation} - disabled={!settings?.initialized} /> +
      + ({ + title: s.title, + onClick: () => runCustomScript(s) + }))} + onClick={onFolderCreation} + disabled={!settings?.initialized} /> +
      ) } return ( - +
      + +
      ); }; \ No newline at end of file diff --git a/src/dashboardWebView/components/Media/Media.tsx b/src/dashboardWebView/components/Media/Media.tsx index 83fc1dd7..78062ca1 100644 --- a/src/dashboardWebView/components/Media/Media.tsx +++ b/src/dashboardWebView/components/Media/Media.tsx @@ -17,19 +17,17 @@ import { useCallback } from 'react'; import { DashboardMessage } from '../../DashboardMessage'; import { FrontMatterIcon } from '../../../panelWebView/components/Icons/FrontMatterIcon'; import { FolderItem } from './FolderItem'; +import useMedia from '../../hooks/useMedia'; export interface IMediaProps {} -export const LIMIT = 16; - export const Media: React.FunctionComponent = (props: React.PropsWithChildren) => { + const { media } = useMedia(); const settings = useRecoilValue(SettingsSelector); - const [ selectedFolder, setSelectedFolder ] = useRecoilState(SelectedMediaFolderAtom); - const [ media, setMedia ] = React.useState([]); - const [ , setTotal ] = useRecoilState(MediaTotalAtom); - const [ folders, setFolders ] = useRecoilState(MediaFoldersAtom); - const [ loading, setLoading ] = useRecoilState(LoadingAtom); const viewData = useRecoilValue(ViewDataSelector); + const selectedFolder = useRecoilValue(SelectedMediaFolderAtom); + const folders = useRecoilValue(MediaFoldersAtom); + const loading = useRecoilValue(LoadingAtom); const onDrop = useCallback((acceptedFiles: File[]) => { acceptedFiles.forEach((file) => { @@ -52,25 +50,6 @@ export const Media: React.FunctionComponent = (props: React.PropsWi onDrop, accept: 'image/*' }); - - const messageListener = (message: MessageEvent>) => { - if (message.data.command === DashboardCommand.media) { - const data: MediaPaths = message.data.data as MediaPaths; - setLoading(false); - setMedia(data.media); - setTotal(data.total); - setFolders(data.folders); - setSelectedFolder(data.selectedFolder); - } - }; - - React.useEffect(() => { - Messenger.listen(messageListener); - - return () => { - Messenger.unlisten(messageListener); - } - }, ['']); return (
      diff --git a/src/dashboardWebView/components/Media/MediaHeaderBottom.tsx b/src/dashboardWebView/components/Media/MediaHeaderBottom.tsx new file mode 100644 index 00000000..6aefa5b2 --- /dev/null +++ b/src/dashboardWebView/components/Media/MediaHeaderBottom.tsx @@ -0,0 +1,30 @@ +import * as React from 'react'; +import { useRecoilValue } from 'recoil'; +import { NavigationType } from '../../models/NavigationType'; +import { SettingsAtom } from '../../state'; +import { Sorting } from '../Header'; +import { Breadcrumb } from '../Header/Breadcrumb'; +import { Pagination } from '../Header/Pagination'; + +export interface IMediaHeaderBottomProps {} + +export const MediaHeaderBottom: React.FunctionComponent = (props: React.PropsWithChildren) => { + const settings = useRecoilValue(SettingsAtom); + + if (!settings?.wsFolder) { + return null; + } + + return ( + + ); +}; \ No newline at end of file diff --git a/src/dashboardWebView/components/Media/MediaHeaderTop.tsx b/src/dashboardWebView/components/Media/MediaHeaderTop.tsx new file mode 100644 index 00000000..75ca8a1b --- /dev/null +++ b/src/dashboardWebView/components/Media/MediaHeaderTop.tsx @@ -0,0 +1,81 @@ +import { EventData } from '@estruyf/vscode'; +import { Messenger } from '@estruyf/vscode/dist/client'; +import * as React from 'react'; +import { useRecoilState, useRecoilValue } from 'recoil'; +import { useDebounce } from '../../../hooks/useDebounce'; +import { usePrevious } from '../../../panelWebView/hooks/usePrevious'; +import { DashboardCommand } from '../../DashboardCommand'; +import { DashboardMessage } from '../../DashboardMessage'; +import { LoadingAtom, PageAtom, SelectedMediaFolderSelector, SettingsSelector, SortingSelector } from '../../state'; +import { Searchbox } from '../Header'; +import { PaginationStatus } from '../Header/PaginationStatus'; +import { FolderCreation } from './FolderCreation'; + +export interface IMediaHeaderTopProps {} + +export const MediaHeaderTop: React.FunctionComponent = ({}: React.PropsWithChildren) => { + const [ lastUpdated, setLastUpdated ] = React.useState(null); + const selectedFolder = useRecoilValue(SelectedMediaFolderSelector); + const crntSorting = useRecoilValue(SortingSelector); + const [ , setLoading ] = useRecoilState(LoadingAtom); + const [ page, setPage ] = useRecoilState(PageAtom); + const settings = useRecoilValue(SettingsSelector); + const debounceGetMedia = useDebounce(lastUpdated, 200); + const prevSelectedFolder = usePrevious(selectedFolder); + + const mediaUpdate = (message: MessageEvent>) => { + if (message.data.command === DashboardCommand.mediaUpdate) { + setLoading(true); + Messenger.send(DashboardMessage.getMedia, { + page, + folder: selectedFolder || '', + sorting: crntSorting + }); + } + } + + React.useEffect(() => { + if (prevSelectedFolder !== null || settings?.dashboardState?.media.selectedFolder !== selectedFolder) { + setLoading(true); + setPage(0); + setLastUpdated(new Date().getTime().toString()); + } + }, [selectedFolder]); + + React.useEffect(() => { + setLastUpdated(new Date().getTime().toString()); + }, [crntSorting]); + + React.useEffect(() => { + if (debounceGetMedia) { + setLoading(true); + + Messenger.send(DashboardMessage.getMedia, { + page, + folder: selectedFolder || '', + sorting: crntSorting + }); + } + }, [debounceGetMedia]); + + React.useEffect(() => { + Messenger.listen(mediaUpdate); + + return () => { + Messenger.unlisten(mediaUpdate); + } + }, []); + + return ( + + ); +}; \ No newline at end of file diff --git a/src/dashboardWebView/components/Media/Pagination.tsx b/src/dashboardWebView/components/Media/Pagination.tsx deleted file mode 100644 index cd8a62fb..00000000 --- a/src/dashboardWebView/components/Media/Pagination.tsx +++ /dev/null @@ -1,169 +0,0 @@ -import { EventData } from '@estruyf/vscode'; -import { Messenger } from '@estruyf/vscode/dist/client'; -import {RefreshIcon} from '@heroicons/react/outline'; -import * as React from 'react'; -import { useRecoilState, useRecoilValue } from 'recoil'; -import { useDebounce } from '../../../hooks/useDebounce'; -import { usePrevious } from '../../../panelWebView/hooks/usePrevious'; -import { DashboardCommand } from '../../DashboardCommand'; -import { DashboardMessage } from '../../DashboardMessage'; -import { LoadingAtom, MediaTotalSelector, PageAtom, SelectedMediaFolderSelector, SettingsSelector, SortingSelector } from '../../state'; -import { FolderCreation } from './FolderCreation'; -import { LIMIT } from './Media'; -import { PaginationButton } from './PaginationButton'; - -export interface IPaginationProps {} - -export const Pagination: React.FunctionComponent = ({}: React.PropsWithChildren) => { - const [ lastUpdated, setLastUpdated ] = React.useState(null); - const selectedFolder = useRecoilValue(SelectedMediaFolderSelector); - const crntSorting = useRecoilValue(SortingSelector); - const totalMedia = useRecoilValue(MediaTotalSelector); - const [ , setLoading ] = useRecoilState(LoadingAtom); - const [ page, setPage ] = useRecoilState(PageAtom); - const settings = useRecoilValue(SettingsSelector); - const debounceGetMedia = useDebounce(lastUpdated, 200); - const prevSelectedFolder = usePrevious(selectedFolder); - - const totalPages = Math.ceil(totalMedia / LIMIT) - 1; - - const getTotalPage = () => { - const mediaItems = ((page + 1) * LIMIT); - if (totalMedia < mediaItems) { - return totalMedia; - } - return mediaItems; - }; - - // Write me function to retrieve buttons before and after current page - const getButtons = (): number[] => { - const maxButtons = 5; - const buttons: number[] = []; - const start = page - maxButtons; - const end = page + maxButtons; - - for (let i = start; i <= end; i++) { - if (i >= 0 && i <= totalPages) { - buttons.push(i); - } - } - return buttons; - }; - - const refresh = () => { - setPage(0); - Messenger.send(DashboardMessage.refreshMedia, { folder: selectedFolder }); - } - - const mediaUpdate = (message: MessageEvent>) => { - if (message.data.command === DashboardCommand.mediaUpdate) { - setLoading(true); - Messenger.send(DashboardMessage.getMedia, { - page, - folder: selectedFolder || '', - sorting: crntSorting - }); - } - } - - React.useEffect(() => { - setLastUpdated(new Date().getTime().toString()); - }, [page]); - - React.useEffect(() => { - if (prevSelectedFolder !== null || settings?.dashboardState?.media.selectedFolder !== selectedFolder) { - setLoading(true); - setPage(0); - setLastUpdated(new Date().getTime().toString()); - } - }, [selectedFolder]); - - React.useEffect(() => { - setLastUpdated(new Date().getTime().toString()); - }, [crntSorting]); - - React.useEffect(() => { - if (debounceGetMedia) { - setLoading(true); - - Messenger.send(DashboardMessage.getMedia, { - page, - folder: selectedFolder || '', - sorting: crntSorting - }); - } - }, [debounceGetMedia]); - - React.useEffect(() => { - Messenger.listen(mediaUpdate); - - return () => { - Messenger.unlisten(mediaUpdate); - } - }, []); - - return ( - - ); -}; \ No newline at end of file diff --git a/src/dashboardWebView/components/Startup.tsx b/src/dashboardWebView/components/Startup.tsx index 79e25e66..07156d94 100644 --- a/src/dashboardWebView/components/Startup.tsx +++ b/src/dashboardWebView/components/Startup.tsx @@ -21,7 +21,7 @@ export const Startup: React.FunctionComponent = ({settings}: Reac }, [settings?.openOnStart]); return ( -
      +
      = { + keys: [ + { name: 'filename', weight: 0.8 }, + { name: 'fsPath', weight: 0.5 }, + { name: 'caption', weight: 0.5 }, + { name: 'alt', weight: 0.5 } + ], + threshold: 0.2, + includeScore: true +}; + +export const LIMIT = 16; + +export default function useMedia() { + const [ media, setMedia ] = useState([]); + const [ page, setPage ] = useRecoilState(PageAtom); + const [ searchedMedia, setSearchedMedia ] = useState([]); + const [ , setSelectedFolder ] = useRecoilState(SelectedMediaFolderAtom); + const [ , setTotal ] = useRecoilState(MediaTotalAtom); + const [ , setFolders ] = useRecoilState(MediaFoldersAtom); + const [ , setLoading ] = useRecoilState(LoadingAtom); + const search = useRecoilValue(SearchAtom); + + const getMedia = useCallback(() => { + return searchedMedia.slice(page * LIMIT, ((page + 1) * LIMIT)); + }, [searchedMedia, page]); + + const messageListener = (message: MessageEvent>) => { + if (message.data.command === DashboardCommand.media) { + const data: MediaPaths = message.data.data as MediaPaths; + setLoading(false); + setMedia(data.media); + setTotal(data.total); + setFolders(data.folders); + setSelectedFolder(data.selectedFolder); + setSearchedMedia(data.media); + } + }; + + useEffect(() => { + if (search) { + const fuse = new Fuse(media, fuseOptions); + const results = fuse.search(search); + const newSearchedMedia = results.map(page => page.item); + + setSearchedMedia(newSearchedMedia); + setTotal(results.length); + + return; + } + + setSearchedMedia(media); + }, [search]); + + useEffect(() => { + Messenger.listen(messageListener); + + return () => { + Messenger.unlisten(messageListener); + } + }, []); + + return { + media: getMedia() + }; +} \ No newline at end of file diff --git a/src/helpers/MediaHelpers.ts b/src/helpers/MediaHelpers.ts index 05b88b85..a1d6815b 100644 --- a/src/helpers/MediaHelpers.ts +++ b/src/helpers/MediaHelpers.ts @@ -111,7 +111,6 @@ export class MediaHelpers { const total = files.length; // Get media set - files = files.slice(page * 16, ((page + 1) * 16)); files = files.map((file) => { try { const metadata = MediaLibrary.getInstance().get(file.fsPath); @@ -323,6 +322,7 @@ export class MediaHelpers { const ext = extname(file.fsPath); return ['.jpg', '.jpeg', '.png', '.gif', '.svg'].includes(ext.toLowerCase()); }).map((file) => ({ + filename: basename(file.fsPath), fsPath: file.fsPath, vsPath: Dashboard.getWebview()?.asWebviewUri(file).toString(), stats: undefined diff --git a/src/models/MediaPaths.ts b/src/models/MediaPaths.ts index e40a2b22..bf51df50 100644 --- a/src/models/MediaPaths.ts +++ b/src/models/MediaPaths.ts @@ -8,6 +8,7 @@ export interface MediaPaths { } export interface MediaInfo { + filename: string; fsPath: string; vsPath: string | undefined; dimensions?: ISizeCalculationResult | undefined; diff --git a/tsconfig.json b/tsconfig.json index 493a911b..c16f7952 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,9 @@ "es6", "DOM" ], + "typeRoots": [ + "node_modules/@types" + ], "sourceMap": true, "rootDir": "src", "strict": true, From 5182a9ae1ad59415192e15549a1364ee7d07b79f Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Mon, 27 Dec 2021 16:22:01 +0100 Subject: [PATCH 10/21] Fix spinner overlapping the global navigation --- src/dashboardWebView/components/Header/Header.tsx | 4 ++-- src/dashboardWebView/components/Spinner.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dashboardWebView/components/Header/Header.tsx b/src/dashboardWebView/components/Header/Header.tsx index c480b25f..8afbb253 100644 --- a/src/dashboardWebView/components/Header/Header.tsx +++ b/src/dashboardWebView/components/Header/Header.tsx @@ -55,8 +55,8 @@ export const Header: React.FunctionComponent = ({totalPages, folde return (
      -
      -
        +
        +
        • + ); +}; \ No newline at end of file diff --git a/src/dashboardWebView/components/Menu/MenuItem.tsx b/src/dashboardWebView/components/Menu/MenuItem.tsx index aa1d930c..99492359 100644 --- a/src/dashboardWebView/components/Menu/MenuItem.tsx +++ b/src/dashboardWebView/components/Menu/MenuItem.tsx @@ -15,7 +15,7 @@ export const MenuItem: React.FunctionComponent = ({title, value, diff --git a/src/dashboardWebView/components/Menu/MenuItems.tsx b/src/dashboardWebView/components/Menu/MenuItems.tsx index 77c3b185..78f414b5 100644 --- a/src/dashboardWebView/components/Menu/MenuItems.tsx +++ b/src/dashboardWebView/components/Menu/MenuItems.tsx @@ -17,7 +17,7 @@ export const MenuItems: React.FunctionComponent = ({widthClass, leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - +
          {children}
          From d31c403bdca876155175c6e75b0fa93188a3fcb9 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 28 Dec 2021 10:43:36 +0100 Subject: [PATCH 15/21] Update icon --- src/dashboardWebView/components/Media/Item.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dashboardWebView/components/Media/Item.tsx b/src/dashboardWebView/components/Media/Item.tsx index 1a0e8c3b..8dd7b563 100644 --- a/src/dashboardWebView/components/Media/Item.tsx +++ b/src/dashboardWebView/components/Media/Item.tsx @@ -1,6 +1,6 @@ import { Messenger } from '@estruyf/vscode/dist/client'; import { Menu } from '@headlessui/react'; -import {ArchiveIcon, ClipboardIcon, CodeIcon, PhotographIcon, PlusIcon} from '@heroicons/react/outline'; +import { ClipboardIcon, CodeIcon, PhotographIcon, PlusIcon, TrashIcon } from '@heroicons/react/outline'; import { basename, dirname } from 'path'; import * as React from 'react'; import { useEffect } from 'react'; @@ -240,7 +240,7 @@ export const Item: React.FunctionComponent = ({media}: React.PropsWi - ) From f144d713d1cd8c1467e9976fef9b2d07eeffc7dc Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 28 Dec 2021 10:45:33 +0100 Subject: [PATCH 16/21] added edit quick action --- src/dashboardWebView/components/Media/Item.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dashboardWebView/components/Media/Item.tsx b/src/dashboardWebView/components/Media/Item.tsx index 8dd7b563..f3706cef 100644 --- a/src/dashboardWebView/components/Media/Item.tsx +++ b/src/dashboardWebView/components/Media/Item.tsx @@ -1,6 +1,6 @@ import { Messenger } from '@estruyf/vscode/dist/client'; import { Menu } from '@headlessui/react'; -import { ClipboardIcon, CodeIcon, PhotographIcon, PlusIcon, TrashIcon } from '@heroicons/react/outline'; +import { ClipboardIcon, CodeIcon, PencilIcon, PhotographIcon, PlusIcon, TrashIcon } from '@heroicons/react/outline'; import { basename, dirname } from 'path'; import * as React from 'react'; import { useEffect } from 'react'; @@ -210,6 +210,12 @@ export const Item: React.FunctionComponent = ({media}: React.PropsWi
          + + + { viewData?.data?.filePath ? ( <> From d046f73d16285110440f408cbd5f35ae1134a9ac Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 28 Dec 2021 20:52:42 +0100 Subject: [PATCH 17/21] #214 - Open file after creation fix --- src/helpers/ContentType.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/helpers/ContentType.ts b/src/helpers/ContentType.ts index 55fc33ec..d942d818 100644 --- a/src/helpers/ContentType.ts +++ b/src/helpers/ContentType.ts @@ -2,7 +2,7 @@ import { PagesListener } from './../listeners/PagesListener'; import { ArticleHelper, Settings } from "."; import { SETTINGS_CONTENT_DRAFT_FIELD, SETTING_TAXONOMY_CONTENT_TYPES } from "../constants"; import { ContentType as IContentType, DraftField } from '../models'; -import { Uri, workspace, window } from 'vscode'; +import { Uri, workspace, window, commands } from 'vscode'; import { Folders } from "../commands/Folders"; import { Questions } from "./Questions"; import { writeFileSync } from "fs"; @@ -123,10 +123,7 @@ export class ContentType { writeFileSync(newFilePath, content, { encoding: "utf8" }); - const txtDoc = await workspace.openTextDocument(Uri.parse(newFilePath)); - if (txtDoc) { - window.showTextDocument(txtDoc); - } + await commands.executeCommand('vscode.open', Uri.file(newFilePath)); Notifications.info(`Your new content has been created.`); From 0668d48fd54c05861f29ed44ea7b184321d208c0 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 28 Dec 2021 21:20:16 +0100 Subject: [PATCH 18/21] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7324f8c..06574071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ ### 🐞 Fixes - [#210](https://github.com/estruyf/vscode-front-matter/issues/210): Fix for adding media files with uppercase file extensions +- [#214](https://github.com/estruyf/vscode-front-matter/issues/214): Fix for opening markdown file after creating it for the specified content type ## [5.8.0] - 2021-12-21 - 🎄 From ee79f89c7f4897e1731417e61412b011ee18a5cd Mon Sep 17 00:00:00 2001 From: Luise Freese Date: Wed, 29 Dec 2021 11:17:11 +0100 Subject: [PATCH 19/21] fixes casing issues that led to links that only referred to settings site but not to the specific heading --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index a5fa9f03..50622363 100644 --- a/package.json +++ b/package.json @@ -113,12 +113,12 @@ "type": "string" } ], - "markdownDescription": "Specify the default sorting option for the content dashboard. You can use one of the values from the enum or define your own ID. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.content.sorting.default)", + "markdownDescription": "Specify the default sorting option for the content dashboard. You can use one of the values from the enum or define your own ID. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.content.sorting.default)", "scope": "Content" }, "frontMatter.content.draftField": { "type": "object", - "markdownDescription": "Define the draft field you want to use to manage your content. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.content.draftField)", + "markdownDescription": "Define the draft field you want to use to manage your content. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.content.draftfield)", "default": { "name": "draft", "type": "boolean" @@ -156,7 +156,7 @@ "frontMatter.content.fmHighlight": { "type": "boolean", "default": true, - "markdownDescription": "Specify if you want to highlight the Front Matter in the Markdown file. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.content.fmhighlight)", + "markdownDescription": "Specify if you want to highlight the Front Matter in the Markdown file. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.content.fmhighlight)", "scope": "Content" }, "frontMatter.content.pageFolders": { @@ -197,7 +197,7 @@ "frontMatter.content.sorting": { "type": "array", "default": [], - "markdownDescription": "Define the sorting options for your dashboard content. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.content.sorting)", + "markdownDescription": "Define the sorting options for your dashboard content. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.content.sorting)", "items": { "type": "object", "properties": { @@ -243,7 +243,7 @@ "frontMatter.content.wysiwyg": { "type": "boolean", "default": true, - "markdownDescription": "Specifies if you want to enable/disable the What You See, Is What You Get (WYSIWYG) markdown controls. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.content.wysiwyg)", + "markdownDescription": "Specifies if you want to enable/disable the What You See, Is What You Get (WYSIWYG) markdown controls. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.content.wysiwyg)", "scope": "Content" }, "frontMatter.custom.scripts": { @@ -303,7 +303,7 @@ "frontMatter.dashboard.mediaSnippet": { "type": "array", "default": [], - "markdownDescription": "Specify the a snippet for your custom media insert markup. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.dashboard.mediaSnippet)", + "markdownDescription": "Specify the a snippet for your custom media insert markup. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.dashboard.mediasnippet)", "items": { "type": "string", "description": "The parts of your snippet. Use `{mediaUrl}` as placeholder where the path of the image needs to be inserted." @@ -322,7 +322,7 @@ "frontMatter.framework.id": { "type": "string", "default": "", - "markdownDescription": "Specify the ID of your static site generator or framework you are using for your website. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.framework.id)" + "markdownDescription": "Specify the ID of your static site generator or framework you are using for your website. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.framework.id)" }, "frontMatter.media.defaultSorting": { "type": "string", @@ -333,7 +333,7 @@ "FileNameAsc", "FileNameDesc" ], - "markdownDescription": "Specify the default sorting option for the media dashboard. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.media.sorting.default)", + "markdownDescription": "Specify the default sorting option for the media dashboard. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.media.defaultsorting)", "scope": "Content" }, "frontMatter.panel.freeform": { @@ -357,7 +357,7 @@ "frontMatter.site.baseURL": { "type": "string", "default": "", - "markdownDescription": "Specify the base URL of your site, this will be used for SEO checks. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.site.baseURL)", + "markdownDescription": "Specify the base URL of your site, this will be used for SEO checks. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.site.baseurl)", "scope": "Site" }, "frontMatter.taxonomy.alignFilename": { @@ -376,7 +376,7 @@ }, "frontMatter.taxonomy.commaSeparatedFields": { "type": "array", - "markdownDescription": "Specify the fields names that Front Matter should treat as a comma-separated array. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.taxonomy.commaSeparatedFields)", + "markdownDescription": "Specify the fields names that Front Matter should treat as a comma-separated array. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.taxonomy.commaSeparatedFields)", "items": { "type": "string", "description": "Name of the fields you want to use as comma-separated arrays." @@ -388,7 +388,7 @@ "array", "null" ], - "markdownDescription": "Specify the type of contents you want to use for your articles/pages/etc. Make sure the `type` is correctly set in your front matter. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.taxonomy.contentTypes)", + "markdownDescription": "Specify the type of contents you want to use for your articles/pages/etc. Make sure the `type` is correctly set in your front matter. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.taxonomy.contentTypes)", "items": { "type": "object", "description": "Define the content types you want to use in Front Matter.", @@ -725,7 +725,7 @@ "warning", "error" ], - "markdownDescription": "Specifies the notifications you want to see. By default, all notifications types will be shown. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.global.notifications)", + "markdownDescription": "Specifies the notifications you want to see. By default, all notifications types will be shown. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.global.notifications)", "scope": "Templates" } } From 1da8bf3f8b5db35b2fe9104b1a93008d305002bc Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 29 Dec 2021 19:14:10 +0100 Subject: [PATCH 20/21] To lowercase links --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7eec1087..266aa93a 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "type": "string" } ], - "markdownDescription": "Specify the default sorting option for the content dashboard. You can use one of the values from the enum or define your own ID. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.content.sorting.default)", + "markdownDescription": "Specify the default sorting option for the content dashboard. You can use one of the values from the enum or define your own ID. [Check in the docs](https://frontmatter.codes/docs/settings#frontmatter.content.defaultSorting)", "scope": "Content" }, "frontMatter.content.draftField": { From e6750205befb104b31aa3db7485b330fc5557fd3 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sat, 1 Jan 2022 20:14:15 +0100 Subject: [PATCH 21/21] =?UTF-8?q?=F0=9F=8E=87=20New=20Year=20release=20?= =?UTF-8?q?=F0=9F=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06574071..4a8e2c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [5.9.0] - 2021-01-XX +## [5.9.0] - 2022-01-01 - 🎇🎆 ### 🎨 Enhancements