Skip to content

Commit

Permalink
Update to 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
chhoumann committed Apr 11, 2022
1 parent 7d0055c commit e4e049a
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 33 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Quickly add new pages or content to your vault.
You can also do a [manual installation](docs/ManualInstallation.md).

## What's new?
### 0.5.4
- Improved the file suggester: now suggests by alias and has a better display.

### 0.5.0 - 0.5.3
- Added support for scripts on mobile devices.
- (0.5.1) Exposed Obsidian API for scripts. Only works for desktop usage.
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "quickadd",
"name": "QuickAdd",
"version": "0.5.3",
"version": "0.5.4",
"minAppVersion": "0.13.19",
"description": "Quickly add new pages or content to your vault.",
"author": "Christian B. B. Houmann",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quickadd",
"version": "0.5.2",
"version": "0.5.4",
"description": "Quickly add new pages or content to your vault.",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/choiceExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {CaptureChoiceEngine} from "./engine/CaptureChoiceEngine";
import {MacroChoiceEngine} from "./engine/MacroChoiceEngine";
import type {IChoiceExecutor} from "./IChoiceExecutor";
import type IMultiChoice from "./types/choices/IMultiChoice";
import ChoiceSuggester from "./gui/choiceSuggester";
import ChoiceSuggester from "./gui/suggesters/choiceSuggester";

export class ChoiceExecutor implements IChoiceExecutor {
public variables: Map<string, string> = new Map<string, string>();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/ChoiceBuilder/captureChoiceBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {ChoiceBuilder} from "./choiceBuilder";
import type ICaptureChoice from "../../types/choices/ICaptureChoice";
import type {App} from "obsidian";
import {Setting, TextAreaComponent, TextComponent, ToggleComponent} from "obsidian";
import {FormatSyntaxSuggester} from "../formatSyntaxSuggester";
import {
CREATE_IF_NOT_FOUND_BOTTOM,
CREATE_IF_NOT_FOUND_TOP,
Expand All @@ -12,10 +11,11 @@ import {
import {FormatDisplayFormatter} from "../../formatters/formatDisplayFormatter";
import type QuickAdd from "../../main";
import {FileNameDisplayFormatter} from "../../formatters/fileNameDisplayFormatter";
import {GenericTextSuggester} from "../genericTextSuggester";
import {getTemplatePaths} from "../../utility";
import {NewTabDirection} from "../../types/newTabDirection";
import type {FileViewMode} from "../../types/fileViewMode";
import {GenericTextSuggester} from "../suggesters/genericTextSuggester";
import {FormatSyntaxSuggester} from "../suggesters/formatSyntaxSuggester";

export class CaptureChoiceBuilder extends ChoiceBuilder {
choice: ICaptureChoice;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/ChoiceBuilder/choiceBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {App, Modal, SearchComponent, Setting} from "obsidian";
import type IChoice from "../../types/choices/IChoice";
import type {SvelteComponent} from "svelte";
import {GenericTextSuggester} from "../genericTextSuggester";
import GenericInputPrompt from "../GenericInputPrompt/GenericInputPrompt";
import {log} from "../../logger/logManager";
import {GenericTextSuggester} from "../suggesters/genericTextSuggester";

export abstract class ChoiceBuilder extends Modal {
private resolvePromise: (input: IChoice) => void;
Expand Down
3 changes: 1 addition & 2 deletions src/gui/ChoiceBuilder/macroChoiceBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {ChoiceBuilder} from "./choiceBuilder";
import type IMacroChoice from "../../types/choices/IMacroChoice";
import type {App} from "obsidian";
import {DropdownComponent, Setting} from "obsidian";
import {GenericTextSuggester} from "../genericTextSuggester";
import {DropdownComponent} from "obsidian";
import type {IMacro} from "../../types/macros/IMacro";

export class MacroChoiceBuilder extends ChoiceBuilder {
Expand Down
6 changes: 3 additions & 3 deletions src/gui/ChoiceBuilder/templateChoiceBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {ChoiceBuilder} from "./choiceBuilder";
import {App, ButtonComponent, Setting, TextComponent, ToggleComponent} from "obsidian";
import type ITemplateChoice from "../../types/choices/ITemplateChoice";
import {FormatSyntaxSuggester} from "../formatSyntaxSuggester";
import {NewTabDirection} from "../../types/newTabDirection";
import FolderList from "./FolderList.svelte";
import {FileNameDisplayFormatter} from "../../formatters/fileNameDisplayFormatter";
import {ExclusiveSuggester} from "../exclusiveSuggester";
import {log} from "../../logger/logManager";
import {getAllFolderPathsInVault, getTemplatePaths} from "../../utility";
import {GenericTextSuggester} from "../genericTextSuggester";
import type QuickAdd from "../../main";
import type {FileViewMode} from "../../types/fileViewMode";
import {GenericTextSuggester} from "../suggesters/genericTextSuggester";
import {FormatSyntaxSuggester} from "../suggesters/formatSyntaxSuggester";
import {ExclusiveSuggester} from "../suggesters/exclusiveSuggester";

export class TemplateChoiceBuilder extends ChoiceBuilder {
choice: ITemplateChoice;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MacroGUIs/MacroBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type {IMacro} from "../../types/macros/IMacro";
import {App, ButtonComponent, DropdownComponent, Modal, Setting, TextComponent, TFile} from "obsidian";
import type {IObsidianCommand} from "../../types/macros/IObsidianCommand";
import {GenericTextSuggester} from "../genericTextSuggester";
import {UserScript} from "../../types/macros/UserScript";
import {ObsidianCommand} from "../../types/macros/ObsidianCommand";
import {JAVASCRIPT_FILE_EXTENSION_REGEX} from "../../constants";
Expand All @@ -27,6 +26,7 @@ import {log} from "../../logger/logManager";
import {SelectActiveLineCommand} from "../../types/macros/EditorCommands/SelectActiveLineCommand";
import {SelectLinkOnActiveLineCommand} from "../../types/macros/EditorCommands/SelectLinkOnActiveLineCommand";
import GenericYesNoPrompt from "../GenericYesNoPrompt/GenericYesNoPrompt";
import {GenericTextSuggester} from "../suggesters/genericTextSuggester";

export class MacroBuilder extends Modal {
public macro: IMacro;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MacroGUIs/UserScriptSettingsModal.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {App, Modal, Setting, TextComponent} from "obsidian";
import type {IUserScript} from "../../types/macros/IUserScript";
import {FormatSyntaxSuggester} from "../formatSyntaxSuggester";
import QuickAdd from "../../main";
import {FormatDisplayFormatter} from "../../formatters/formatDisplayFormatter";
import {FormatSyntaxSuggester} from "../suggesters/formatSyntaxSuggester";

export class UserScriptSettingsModal extends Modal {
constructor(app: App, private command: IUserScript, private settings: {[key: string]: any}) {
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MathModal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ButtonComponent, debounce, finishRenderMath, loadMathJax, Modal, renderMath, TextAreaComponent} from "obsidian";
import QuickAdd from "../main";
import {LaTeXSuggester} from "./LaTeXSuggester";
import {LATEX_CURSOR_MOVE_HERE} from "../LaTeXSymbols";
import {LaTeXSuggester} from "./suggesters/LaTeXSuggester";

export class MathModal extends Modal {
public waitForClose: Promise<string>;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/suggesters/LaTeXSuggester.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {TextInputSuggest} from "./suggest";
import {LATEX_CURSOR_MOVE_HERE, LaTeXSymbols} from "../LaTeXSymbols";
import QuickAdd from "../main";
import Fuse from "fuse.js";
import {renderMath} from "obsidian";
import {LATEX_CURSOR_MOVE_HERE, LaTeXSymbols} from "../../LaTeXSymbols";
import QuickAdd from "../../main";

const LATEX_REGEX = new RegExp(/\\([a-z{}A-Z0-9]*)$/);

Expand Down
14 changes: 7 additions & 7 deletions src/gui/suggesters/choiceSuggester.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {FuzzySuggestModal} from "obsidian";
import type IChoice from "../types/choices/IChoice";
import type QuickAdd from "../main";
import type IMultiChoice from "../types/choices/IMultiChoice";
import {MultiChoice} from "../types/choices/MultiChoice";
import {ChoiceType} from "../types/choices/choiceType";
import type {IChoiceExecutor} from "../IChoiceExecutor";
import {ChoiceExecutor} from "../choiceExecutor";
import type IChoice from "../../types/choices/IChoice";
import {ChoiceExecutor} from "../../choiceExecutor";
import {ChoiceType} from "../../types/choices/choiceType";
import {MultiChoice} from "../../types/choices/MultiChoice";
import type IMultiChoice from "../../types/choices/IMultiChoice";
import type QuickAdd from "../../main";
import type {IChoiceExecutor} from "../../IChoiceExecutor";

export default class ChoiceSuggester extends FuzzySuggestModal<IChoice> {
private choiceExecutor: IChoiceExecutor = new ChoiceExecutor(this.app, this.plugin);
Expand Down
19 changes: 11 additions & 8 deletions src/gui/suggesters/formatSyntaxSuggester.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import {TextInputSuggest} from "./suggest";
import type {App} from "obsidian";
import type QuickAdd from "../main";
import {
DATE_FORMAT_SYNTAX_SUGGEST_REGEX, DATE_SYNTAX,
DATE_SYNTAX_SUGGEST_REGEX, LINKCURRENT_SYNTAX,
LINKCURRENT_SYNTAX_SUGGEST_REGEX,
MACRO_SYNTAX_SUGGEST_REGEX, MATH_VALUE_SYNTAX, MATH_VALUE_SYNTAX_SUGGEST_REGEX, NAME_SYNTAX,
DATE_FORMAT_SYNTAX_SUGGEST_REGEX,
DATE_SYNTAX, DATE_SYNTAX_SUGGEST_REGEX,
LINKCURRENT_SYNTAX,
LINKCURRENT_SYNTAX_SUGGEST_REGEX, MACRO_SYNTAX_SUGGEST_REGEX, MATH_VALUE_SYNTAX,
MATH_VALUE_SYNTAX_SUGGEST_REGEX,
NAME_SYNTAX,
NAME_SYNTAX_SUGGEST_REGEX,
TEMPLATE_SYNTAX_SUGGEST_REGEX, VALUE_SYNTAX,
TEMPLATE_SYNTAX_SUGGEST_REGEX,
VALUE_SYNTAX,
VALUE_SYNTAX_SUGGEST_REGEX,
VARIABLE_DATE_SYNTAX_SUGGEST_REGEX,
VARIABLE_SYNTAX_SUGGEST_REGEX
} from "../constants";
import {getTemplatePaths} from "../utility";
} from "../../constants";
import {getTemplatePaths} from "../../utility";
import type QuickAdd from "../../main";

enum FormatSyntaxToken {
Date, DateFormat, VariableDate, Value, Name,
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Plugin} from 'obsidian';
import {DEFAULT_SETTINGS, QuickAddSettings, QuickAddSettingsTab} from "./quickAddSettingsTab";
import ChoiceSuggester from "./gui/choiceSuggester";
import {log} from "./logger/logManager";
import {ConsoleErrorLogger} from "./logger/consoleErrorLogger";
import {GuiLogger} from "./logger/guiLogger";
Expand All @@ -12,6 +11,7 @@ import type IMultiChoice from "./types/choices/IMultiChoice";
import {deleteObsidianCommand} from "./utility";
import type IMacroChoice from "./types/choices/IMacroChoice";
import {MathModal} from "./gui/MathModal";
import ChoiceSuggester from "./gui/suggesters/choiceSuggester";

export default class QuickAdd extends Plugin {
static instance: QuickAdd;
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"0.4.17": "0.12.17",
"0.4.18": "0.13.19",
"0.4.21": "0.13.19",
"0.5.3": "0.13.19"
"0.5.4": "0.13.19"
}

0 comments on commit e4e049a

Please sign in to comment.