Implement v1 checklist feedback

This commit is contained in:
phibr0 2022-07-13 21:47:57 +02:00
parent 96531eeefc
commit b3850369fb
11 changed files with 60 additions and 63 deletions

View file

@ -5,7 +5,7 @@
"Rename": "Umbenennen",
"Delete": "Löschen",
"Add command": "Befehl hinzufügen",
"Add new": "Neu hinzufügen",
"Add new": "Neuen Befehl hinzufügen",
"This Command seems to have been removed. {{command_name}}": "Dieser Befehl wurde entfernt. {{command_name}}",
"Choose a Command to add": "Wähle einen Befehl zum hinzufügen",
"to navigate": "zum navigieren",
@ -56,5 +56,11 @@
"Add command only to mobile devices": "Füge Befehl nur Mobilen Geräten hinzu",
"Add command only to desktop devices": "Füge Befehl nur Desktop Geräten hinzu",
"Add command only to this device": "Füge Befehl nur diesem Gerät hinzu",
"Done": "Fertig"
"Done": "Fertig",
"By Johnny✨ and phibr0": "Von Johnny✨ und phibr0",
"Leave feedback": "Feedback geben",
"Donate": "Spenden",
"Share feedback, issues, and ideas with our feedback form.": "Teile Feedback, Probleme und Ideen mit unserem Feedback Formular!",
"Consider donating to support development.": "Spende um die Entwicklung zu unterstützen.",
"Save": "Speichern"
}

View file

@ -5,7 +5,7 @@
"Rename": "Rename",
"Delete": "Delete",
"Add command": "Add command",
"Add new": "Add new",
"Add new": "Add new command",
"This Command seems to have been removed. {{command_name}}": "This Command seems to have been removed. {{command_name}}",
"Choose a Command to add": "Choose a Command to add",
"to navigate": "to navigate",
@ -56,5 +56,11 @@
"Add command only to mobile devices": "Add command only to mobile devices",
"Add command only to desktop devices": "Add command only to desktop devices",
"Add command only to this device": "Add command only to this device",
"Done": "Done"
"Done": "Done",
"By Johnny✨ and phibr0": "By Johnny✨ and phibr0",
"Leave feedback": "Leave feedback",
"Donate": "Donate",
"Share feedback, issues, and ideas with our feedback form.": "Share feedback, issues, and ideas with our feedback form.",
"Consider donating to support development.": "Consider donating to support development.",
"Save": "Save"
}

View file

@ -1,7 +1,7 @@
{
"id": "cmdr",
"name": "Commander",
"version": "0.0.14",
"version": "0.0.15",
"minAppVersion": "0.12.0",
"description": "Customize your workspace by adding commands /everywhere/.",
"author": "jsmorabito & phibr0",

View file

@ -1,6 +1,6 @@
{
"name": "cmdr",
"version": "0.0.14",
"version": "0.0.15",
"description": "Customize your workspace by adding commands /everywhere/.",
"main": "main.js",
"scripts": {

View file

@ -1 +1 @@
<svg viewbox="0 0 118 105" width="118" xmlns="http://www.w3.org/2000/svg" height="105" style="-webkit-print-color-adjust:exact" fill="none"><defs><clipPath id="a" class="frame-clip"><rect rx="0" ry="0" width="118" height="105"/></clipPath></defs><g clip-path="url(#a)"><rect rx="0" ry="0" width="118" height="105" class="frame-background"/><g class="frame-children"><g class="any-key" style="fill:#000"><path d="M35.2 1C25.7 1 18 8.7 18 18.2v51.6C18 79.3 25.7 87 35.2 87h45.6C90.3 87 98 79.3 98 69.8V18.2C98 8.7 90.3 1 80.8 1H35.2Zm0 4h45.6C88.1 5 94 10.9 94 18.2v37.6C94 63.1 88.1 69 80.8 69H35.2C27.9 69 22 63.1 22 55.8V18.2C22 10.9 27.9 5 35.2 5ZM56 19v14.5L43.6 26l-2.1 3.4L54.1 37l-12.6 7.6 2.1 3.4L56 40.5V55h4V40.5L72.4 48l2.1-3.4L61.9 37l12.6-7.6-2.1-3.4L60 33.5V19h-4ZM22 66.8c3.2 3.8 7.9 6.2 13.2 6.2h45.6c5.3 0 10-2.4 13.2-6.2v3C94 77.1 88.1 83 80.8 83H35.2C27.9 83 22 77.1 22 69.8v-3Z" style="fill:#7b6cd9;fill-opacity:1"/><path d="M35.2 1C25.7 1 18 8.7 18 18.2v51.6C18 79.3 25.7 87 35.2 87h45.6C90.3 87 98 79.3 98 69.8V18.2C98 8.7 90.3 1 80.8 1H35.2Zm0 4h45.6C88.1 5 94 10.9 94 18.2v37.6C94 63.1 88.1 69 80.8 69H35.2C27.9 69 22 63.1 22 55.8V18.2C22 10.9 27.9 5 35.2 5ZM56 19v14.5L43.6 26l-2.1 3.4L54.1 37l-12.6 7.6 2.1 3.4L56 40.5V55h4V40.5L72.4 48l2.1-3.4L61.9 37l12.6-7.6-2.1-3.4L60 33.5V19h-4ZM22 66.8c3.2 3.8 7.9 6.2 13.2 6.2h45.6c5.3 0 10-2.4 13.2-6.2v3C94 77.1 88.1 83 80.8 83H35.2C27.9 83 22 77.1 22 69.8v-3Z" style="fill:none;stroke-width:1;stroke:#7b6cd9;stroke-opacity:1" class="stroke-shape"/></g><path d="M20.11 53.587 3 63.9"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="b" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M20.11 53.587 3 63.9" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#b)"/></g><path d="m96 53.567 19.161-11.55"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="c" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="m96 53.567 19.161-11.55" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#c)"/></g><path d="M20.11 53.587 3 63.9"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="d" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M20.11 53.587 3 63.9" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#d)"/></g><path d="M42 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="e" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M42 84v18h12" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#e)"/></g><path d="M74 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="f" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M74 84v18h12" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#f)"/></g><path d="m96 53.567 19.161-11.55"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="g" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="m96 53.567 19.161-11.55" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#g)"/></g><path d="M42 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="h" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M42 84v18h12" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#h)"/></g><path d="M74 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="i" viewBox="0 0 6 6" fill="#7b6cd9" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M74 84v18h12" style="fill:none;stroke-width:5;stroke:#7b6cd9;stroke-opacity:1;marker-end:url(#i)"/></g></g></g></svg>
<svg viewbox="0 0 118 105" width="118" xmlns="http://www.w3.org/2000/svg" height="105" style="-webkit-print-color-adjust:exact" fill="none"><defs><clipPath id="a" class="frame-clip"><rect rx="0" ry="0" width="118" height="105"/></clipPath></defs><g clip-path="url(#a)"><rect rx="0" ry="0" width="118" height="105" class="frame-background"/><g class="frame-children"><g class="any-key" style="fill:#000"><path d="M35.2 1C25.7 1 18 8.7 18 18.2v51.6C18 79.3 25.7 87 35.2 87h45.6C90.3 87 98 79.3 98 69.8V18.2C98 8.7 90.3 1 80.8 1H35.2Zm0 4h45.6C88.1 5 94 10.9 94 18.2v37.6C94 63.1 88.1 69 80.8 69H35.2C27.9 69 22 63.1 22 55.8V18.2C22 10.9 27.9 5 35.2 5ZM56 19v14.5L43.6 26l-2.1 3.4L54.1 37l-12.6 7.6 2.1 3.4L56 40.5V55h4V40.5L72.4 48l2.1-3.4L61.9 37l12.6-7.6-2.1-3.4L60 33.5V19h-4ZM22 66.8c3.2 3.8 7.9 6.2 13.2 6.2h45.6c5.3 0 10-2.4 13.2-6.2v3C94 77.1 88.1 83 80.8 83H35.2C27.9 83 22 77.1 22 69.8v-3Z" style="fill:var(--text-accent);fill-opacity:1"/><path d="M35.2 1C25.7 1 18 8.7 18 18.2v51.6C18 79.3 25.7 87 35.2 87h45.6C90.3 87 98 79.3 98 69.8V18.2C98 8.7 90.3 1 80.8 1H35.2Zm0 4h45.6C88.1 5 94 10.9 94 18.2v37.6C94 63.1 88.1 69 80.8 69H35.2C27.9 69 22 63.1 22 55.8V18.2C22 10.9 27.9 5 35.2 5ZM56 19v14.5L43.6 26l-2.1 3.4L54.1 37l-12.6 7.6 2.1 3.4L56 40.5V55h4V40.5L72.4 48l2.1-3.4L61.9 37l12.6-7.6-2.1-3.4L60 33.5V19h-4ZM22 66.8c3.2 3.8 7.9 6.2 13.2 6.2h45.6c5.3 0 10-2.4 13.2-6.2v3C94 77.1 88.1 83 80.8 83H35.2C27.9 83 22 77.1 22 69.8v-3Z" style="fill:none;stroke-width:1;stroke:var(--text-accent);stroke-opacity:1" class="stroke-shape"/></g><path d="M20.11 53.587 3 63.9"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="b" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M20.11 53.587 3 63.9" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#b)"/></g><path d="m96 53.567 19.161-11.55"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="c" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="m96 53.567 19.161-11.55" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#c)"/></g><path d="M20.11 53.587 3 63.9"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="d" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M20.11 53.587 3 63.9" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#d)"/></g><path d="M42 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="e" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M42 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#e)"/></g><path d="M74 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="f" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M74 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#f)"/></g><path d="m96 53.567 19.161-11.55"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="g" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="m96 53.567 19.161-11.55" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#g)"/></g><path d="M42 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="h" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M42 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#h)"/></g><path d="M74 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="i" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M74 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#i)"/></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

@ -78,23 +78,17 @@ abstract class Base extends CommandManagerBase {
setIcon(optionEl, "more-vertical", 16);
item.dom.append(optionEl);
item
.setTitle(cmdPair.name ?? command.name)
.setIcon(cmdPair.icon)
.onClick(() => app.commands.executeCommandById(cmdPair.id));
let isRemovable = false;
const setNormal = (): void => {
optionEl.style.display = "none";
item
.setTitle(cmdPair.name ?? command.name)
.setIcon(cmdPair.icon)
.onClick(() => app.commands.executeCommandById(cmdPair.id));
};
const setRemovable = (): void => {
optionEl.style.display = "block";
item.setTitle(t("Delete")).setIcon("trash").onClick(async (event) => {
event.preventDefault();
event.stopImmediatePropagation();
if (!plugin.settings.confirmDeletion || (await new ConfirmDeleteModal(plugin).didChooseRemove())) {
removeMenu();
}
});
};
const removeMenu = async (): Promise<void> => {
item.dom.addClass("cmdr-removing");
@ -108,10 +102,8 @@ abstract class Base extends CommandManagerBase {
menu.registerDomEvent(item.dom, "mousemove", (event) => {
event.preventDefault();
event.stopImmediatePropagation();
if (event.shiftKey) {
if (!isRemovable) setRemovable();
isRemovable = true;
}
if (!isRemovable) setRemovable();
isRemovable = true;
});
menu.registerDomEvent(item.dom, "mouseleave", () => {
setNormal();

View file

@ -281,9 +281,6 @@
button {
display: flex;
align-items: center;
background-color: transparent !important;
border: 2px solid var(--interactive-accent);
color: var(--interactive-accent);
height: 2.6em;
font-weight: 700;
gap: 16px;
@ -316,33 +313,11 @@
}
}
// @media only screen and (max-width: 1500px) {
// .cmdr-setting-header {
// display: flex;
// flex-direction: column;
// align-items: flex-start;
// border: none;
// background-color: var(--background-secondary-alt);
// padding: 6px 12px;
// border-radius: 12px;
// }
.cmdr-name-input-wrapper {
display: flex;
gap: 8px;
// .cmdr-tab {
// border: none;
// transform: none;
// padding: 6px 0px;
// transition: color 200ms ease;
// &:hover {
// color: var(--interactive-accent);
// }
// &:first-child {
// margin-left: 0px;
// }
// }
// .cmdr-tab-active {
// font-weight: bold;
// }
// }
button {
margin: 0;
}
}

View file

@ -28,7 +28,15 @@ export default class ChooseCustomNameModal extends SuggestModal<string> {
public onOpen(): void {
super.onOpen();
this.inputEl.value = this.defaultName;
const wrapper = createDiv({ cls: "cmdr-name-input-wrapper" });
this.inputEl.parentNode?.insertBefore(wrapper, this.inputEl);
wrapper.appendChild(this.inputEl);
const btn = createEl("button", { text: t("Save"), cls: "mod-cta" });
btn.onclick = (e): void => this.selectSuggestion(this.inputEl.value, e);
wrapper.appendChild(btn);
}
public async awaitSelection(): Promise<string> {

View file

@ -1,20 +1,21 @@
import { Platform, PluginManifest } from "obsidian";
import { h } from "preact";
import t from "src/l10n";
import { showConfetti, ObsidianIcon } from "src/util";
import Credits from "./Credits";
import Logo from "./Logo";
export default function About({ manifest }: { manifest: PluginManifest }): h.JSX.Element {
const feedbackBtn = <button onClick={(e): void => { showConfetti(e); setTimeout(() => location.replace("https://forms.gle/hPjn61G9bqqFb3256"), Math.random() * 800 + 500); }}><ObsidianIcon icon="message-square" size={20} /> Leave Feedback</button>;
const donateBtn = <button onClick={(e): void => { showConfetti(e); setTimeout(() => location.replace("https://buymeacoffee.com/phibr0"), Math.random() * 800 + 500); }}><ObsidianIcon icon="coffee" size={20} />Support Development</button>;
const feedbackBtn = <button className="mod-cta" onClick={(e): void => { showConfetti(e); setTimeout(() => location.replace("https://forms.gle/hPjn61G9bqqFb3256"), Math.random() * 800 + 500); }}><ObsidianIcon icon="message-square" size={20} />{t("Leave feedback")}</button>;
const donateBtn = <button className="mod-cta" onClick={(e): void => { showConfetti(e); setTimeout(() => location.replace("https://ko-fi.com/phibr0"), Math.random() * 800 + 500); }}><ObsidianIcon icon="coffee" size={20} />{t("Support development")}</button>;
return (
<div className="cmdr-about">
{Platform.isMobile && [<hr />, feedbackBtn, donateBtn]}
{Platform.isDesktop && [
<div className="setting-item mod-toggle" style={{ width: "100%", borderTop: "1px solid var(--background-modifier-border)", paddingTop: "18px" }}>
<div className="setting-item-info">
<div className="setting-item-name">Leave Feedback</div>
<div className="setting-item-description">Share feedback, issues, and ideas with our feedback form.</div>
<div className="setting-item-name">{t("Leave feedback")}</div>
<div className="setting-item-description">{t("Share feedback, issues, and ideas with our feedback form.")}</div>
</div>
<div className="setting-item-control">
{feedbackBtn}
@ -22,8 +23,8 @@ export default function About({ manifest }: { manifest: PluginManifest }): h.JSX
</div>,
<div className="setting-item mod-toggle" style={{ width: "100%" }}>
<div className="setting-item-info">
<div className="setting-item-name">Donate</div>
<div className="setting-item-description">Consider donating to support development.</div>
<div className="setting-item-name">{t("Donate")}</div>
<div className="setting-item-description">{t("Consider donating to support development.")}</div>
</div>
<div className="setting-item-control">
{donateBtn}

View file

@ -1,9 +1,10 @@
import { h } from "preact";
import t from "src/l10n";
export default function Credits(): h.JSX.Element {
return (
<div className="cmdr-credits">
<span>By Johnny and phibr0</span>
<span>{t("By Johnny✨ and phibr0")}</span>
</div>
);
}

View file

@ -132,9 +132,17 @@ export default function CommandComponent({
/>
</span>
<span className="mobile-option-setting-item-option-icon">
<ObsidianIcon icon={pair.icon} size={22} />
<ObsidianIcon
icon={pair.icon}
size={22}
onClick={(): void => {
new MobileModifyModal(pair, handleRename, handleNewIcon, handleModeChange).open();
}}
/>
</span>
<span className="mobile-option-setting-item-name">
<span className="mobile-option-setting-item-name" onClick={(): void => {
new MobileModifyModal(pair, handleRename, handleNewIcon, handleModeChange).open();
}}>
{pair.name}
{pair.name !== cmd.name && (
<span style="margin-left: .8ex">({cmd.name})</span>