diff --git a/main.ts b/main.ts index da8323f..dcb6d7e 100644 --- a/main.ts +++ b/main.ts @@ -4,10 +4,12 @@ import { MarkdownView, Notice, Plugin, - PluginManifest, PluginSettingTab, SuggestModal, } from "obsidian"; + +import type { MarkdownFileInfo, PluginManifest }from "obsidian"; + import { DatamuseApi } from "./DatamuseApi"; interface WordyPluginSettings { @@ -45,7 +47,7 @@ export default class WordyPlugin extends Plugin { this.addCommand({ id: "wordy-syn", name: "Synonyms", - editorCallback: async (editor: Editor, view: MarkdownView) => { + editorCallback: async (editor: Editor, view: MarkdownView | MarkdownFileInfo) => { const rootWord = editor.getSelection(); if (rootWord != "") { const similarWords = await this.datamuseApi.wordsSimilarTo( @@ -71,7 +73,7 @@ export default class WordyPlugin extends Plugin { this.addCommand({ id: "wordy-ant", name: "Antonyms", - editorCallback: async (editor: Editor, view: MarkdownView) => { + editorCallback: async (editor: Editor, view: MarkdownView | MarkdownFileInfo) => { const rootWord = editor.getSelection(); if (rootWord != "") { const oppositeWords = @@ -96,7 +98,7 @@ export default class WordyPlugin extends Plugin { this.addCommand({ id: "wordy-rhy", name: "Rhymes", - editorCallback: async (editor: Editor, view: MarkdownView) => { + editorCallback: async (editor: Editor, view: MarkdownView | MarkdownFileInfo) => { const rootWord = editor.getSelection(); if (rootWord != "") { const rhymes = await this.datamuseApi.wordsThatRhymeWith( @@ -122,7 +124,7 @@ export default class WordyPlugin extends Plugin { this.addCommand({ id: "wordy-asyn", name: "Alliterative Synonyms", - editorCallback: async (editor: Editor, view: MarkdownView) => { + editorCallback: async (editor: Editor, view: MarkdownView | MarkdownFileInfo) => { const [priorWord, rootWord] = editor.getSelection().split(" "); if (rootWord != "") { const alliterativeSynonyms = diff --git a/manifest.json b/manifest.json index d57cede..f020491 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { "id": "obsidian-wordy", "name": "Wordy", - "version": "1.2.0", + "version": "1.3.0", "minAppVersion": "0.15.0", - "description": "Thesaurus, dictionary and more using the Datamuse API", + "description": "Thesaurus, rhymes, alliterations, dictionary and more using the Datamuse API", "author": "Nate", "authorUrl": "https://nqthqn.com", "isDesktopOnly": false diff --git a/package-lock.json b/package-lock.json index 414531b..65df951 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "builtin-modules": "3.3.0", "esbuild": "0.14.47", "esbuild-svelte": "^0.7.4", - "obsidian": "latest", + "obsidian": "1.3.5", "svelte": "^4.0.5", "svelte-preprocess": "^5.0.4", "tslib": "2.4.0", @@ -215,9 +215,9 @@ "dev": true }, "node_modules/@types/codemirror": { - "version": "0.0.108", - "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-0.0.108.tgz", - "integrity": "sha512-3FGFcus0P7C2UOGCNUVENqObEb4SFk+S8Dnxq7K6aIsLVs/vDtlangl3PEO0ykaKXyK56swVF6Nho7VsA44uhw==", + "version": "5.60.8", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.8.tgz", + "integrity": "sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==", "dev": true, "dependencies": { "@types/tern": "*" @@ -1897,12 +1897,12 @@ "peer": true }, "node_modules/obsidian": { - "version": "0.16.3", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-0.16.3.tgz", - "integrity": "sha512-hal9qk1A0GMhHSeLr2/+o3OpLmImiP+Y+sx2ewP13ds76KXsziG96n+IPFT0mSkup1zSwhEu+DeRhmbcyCCXWw==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.3.5.tgz", + "integrity": "sha512-2Zg9vlaEZw6fd2AohcdrC1kV+lZcb4a1Ju6GcIwdWaGOWj6l//7wbKD6vVhO2GlfoQRGARYu++eLo7FEc+f6Tw==", "dev": true, "dependencies": { - "@types/codemirror": "0.0.108", + "@types/codemirror": "5.60.8", "moment": "2.29.4" }, "peerDependencies": { @@ -2713,9 +2713,9 @@ "dev": true }, "@types/codemirror": { - "version": "0.0.108", - "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-0.0.108.tgz", - "integrity": "sha512-3FGFcus0P7C2UOGCNUVENqObEb4SFk+S8Dnxq7K6aIsLVs/vDtlangl3PEO0ykaKXyK56swVF6Nho7VsA44uhw==", + "version": "5.60.8", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.8.tgz", + "integrity": "sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==", "dev": true, "requires": { "@types/tern": "*" @@ -3874,12 +3874,12 @@ "peer": true }, "obsidian": { - "version": "0.16.3", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-0.16.3.tgz", - "integrity": "sha512-hal9qk1A0GMhHSeLr2/+o3OpLmImiP+Y+sx2ewP13ds76KXsziG96n+IPFT0mSkup1zSwhEu+DeRhmbcyCCXWw==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.3.5.tgz", + "integrity": "sha512-2Zg9vlaEZw6fd2AohcdrC1kV+lZcb4a1Ju6GcIwdWaGOWj6l//7wbKD6vVhO2GlfoQRGARYu++eLo7FEc+f6Tw==", "dev": true, "requires": { - "@types/codemirror": "0.0.108", + "@types/codemirror": "5.60.8", "moment": "2.29.4" } }, diff --git a/package.json b/package.json index f32b9c4..e7616e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-wordy", - "version": "1.1.0", + "version": "1.3.0", "description": "Thesaurus, dictionary and more using the Datamuse API", "main": "main.js", "scripts": { @@ -19,7 +19,7 @@ "builtin-modules": "3.3.0", "esbuild": "0.14.47", "esbuild-svelte": "^0.7.4", - "obsidian": "latest", + "obsidian": "1.3.5", "svelte": "^4.0.5", "svelte-preprocess": "^5.0.4", "tslib": "2.4.0", @@ -29,4 +29,4 @@ "@types/lodash": "^4.14.195", "lodash": "^4.17.21" } -} +} \ No newline at end of file diff --git a/versions.json b/versions.json index 908e85c..dd51364 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,5 @@ { "1.0.0": "0.15.0", - "1.1.0": "0.15.0" + "1.1.0": "0.15.0", + "1.3.0": "0.15.0" } \ No newline at end of file