diff --git a/manifest.json b/manifest.json index eccebf8..1beb32e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "cmdr", "name": "Commander", - "version": "0.0.4", + "version": "0.0.5", "minAppVersion": "0.12.0", "description": "Customize your workspace by adding commands /everywhere/.", "author": "jsmorabito & phibr0", diff --git a/package.json b/package.json index 1b00931..df0caee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cmdr", - "version": "0.0.4", + "version": "0.0.5", "description": "Customize your workspace by adding commands /everywhere/.", "main": "main.js", "scripts": { diff --git a/src/assets/commander-logo.svg b/src/assets/commander-logo.svg index 2474658..ebd48dd 100644 --- a/src/assets/commander-logo.svg +++ b/src/assets/commander-logo.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index b87c1aa..406c791 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -47,10 +47,6 @@ svg { width: 100%; } - - > .cmdr-icon-wrapper { - width: 196px; - } } .cmdr-add-new-wrapper { diff --git a/src/ui/components/commandViewerComponent.tsx b/src/ui/components/commandViewerComponent.tsx index f9a2808..4b1a4e7 100644 --- a/src/ui/components/commandViewerComponent.tsx +++ b/src/ui/components/commandViewerComponent.tsx @@ -8,6 +8,7 @@ import { arrayMoveMutable } from "array-move"; import { useEffect, useRef } from "preact/hooks"; import { setIcon } from "obsidian"; import ChooseIconModal from "../chooseIconModal"; +import ConfirmDeleteModal from "../confirmDeleteModal"; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion export const ManagerContext = createContext(null!); @@ -32,7 +33,11 @@ export default function CommandViewer({ manager, plugin }: CommandViewerProps): return => { await manager.removeCommand(cmd); this.forceUpdate(); }} + handleRemove={async (): Promise => { + if (!plugin.settings.confirmDeletion || await new ConfirmDeleteModal(plugin).didChooseRemove()) { + await manager.removeCommand(cmd); this.forceUpdate(); + } + }} handleUp={(): void => { arrayMoveMutable(manager.pairs, idx, idx - 1); manager.reorder(); this.forceUpdate(); }} handleDown={(): void => { arrayMoveMutable(manager.pairs, idx, idx + 1); manager.reorder(); this.forceUpdate(); }} handleRename={async (name): Promise => { cmd.name = name; await plugin.saveSettings(); manager.reorder(); this.forceUpdate(); }}