Compare commits

..

4 commits

Author SHA1 Message Date
d7sd6u
481d7c875e 1.0.3 2025-03-12 19:50:05 +04:00
d7sd6u
c0949aed2c refactor: move chooser type out 2025-03-12 19:49:58 +04:00
d7sd6u
e1c09d282f 1.0.2 2025-03-12 19:29:08 +04:00
d7sd6u
59bc09e546 feat: add FolderSuggest for inbox setting 2025-03-12 19:29:02 +04:00
5 changed files with 29 additions and 20 deletions

View file

@ -1,7 +1,7 @@
{
"id": "crosslink-advanced",
"name": "Crosslink Advanced",
"version": "1.0.1",
"version": "1.0.3",
"minAppVersion": "1.8.0",
"description": "Tag files using folders and symlinks system (ftags).",
"author": "d7sd6u",

@ -1 +1 @@
Subproject commit 6d64559440fa42f765db2906d5f74af3eed0ada8
Subproject commit fb589401f0ba76fab5c01bab8b63684ceeff3290

View file

@ -1,6 +1,6 @@
{
"name": "crosslink-advanced",
"version": "1.0.1",
"version": "1.0.3",
"description": "",
"main": "./src/main.ts",
"scripts": {

View file

@ -458,15 +458,19 @@ export class FileAndDirChooser extends FuzzySuggestModal<TFile> {
return this.inputEl.value;
}
private get hiddenChooser() {
const chooser = (
this as unknown as {
chooser: {
selectedItem: number | null;
values: { item: TFile }[] | null;
suggestions: unknown[];
};
}
).chooser;
interface WithChooser {
chooser: {
selectedItem: number | null;
values:
| {
item: TFile;
}[]
| null;
suggestions: unknown[];
};
}
const chooser = (this as unknown as WithChooser).chooser;
return chooser;
}

View file

@ -1,5 +1,6 @@
import { App, PluginSettingTab, Setting } from "obsidian";
import Main from "./main";
import { FolderSuggest } from "../obsidian-reusables/src/FolderSuggest";
export const DEFAULT_SETTINGS = {
inbox: "Uncategorized",
@ -13,6 +14,8 @@ export class MainPluginSettingsTab extends PluginSettingTab {
this.plugin = plugin;
}
suggest?: FolderSuggest;
display() {
const { containerEl } = this;
containerEl.empty();
@ -20,17 +23,19 @@ export class MainPluginSettingsTab extends PluginSettingTab {
this.app.vault.getAllFolders().map((v) => [v.path, v.path]),
);
options["/"] = "/";
const setInbox = async (v: string) => {
this.plugin.settings.inbox = v;
await this.plugin.saveSettings();
};
new Setting(containerEl)
.setName("Inbox folder")
.setDesc("Folder where notes without explicit ftags are stored")
.addDropdown((textArea) => {
textArea
.addOptions(options)
.setValue(this.plugin.settings.inbox)
.onChange(async (v) => {
this.plugin.settings.inbox = v;
await this.plugin.saveSettings();
});
.addSearch((search) => {
search.setValue(this.plugin.settings.inbox).onChange(setInbox);
this.suggest = new FolderSuggest(this.app, search.inputEl);
this.suggest.onSelect((v) => setInbox(v.path));
});
}
}