mirror of
https://github.com/decaf-dev/obsidian-vault-explorer.git
synced 2026-07-22 10:10:31 +00:00
Add collapse filters (#299)
* refactor: remove unused code * refactor: don't export values * fix: add correct types to migrations * feat: add collapse filters button
This commit is contained in:
parent
2e8d191be8
commit
424a67a130
25 changed files with 946 additions and 516 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "vault-explorer",
|
||||
"name": "Vault Explorer",
|
||||
"version": "1.39.0",
|
||||
"version": "1.40.0",
|
||||
"minAppVersion": "1.4.13",
|
||||
"description": "Explore your vault in visual format",
|
||||
"author": "DecafDev",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "obsidian-vault-explorer",
|
||||
"version": "1.39.0",
|
||||
"version": "1.40.0",
|
||||
"description": "Explore your vault in visual format",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ export const DEFAULT_SETTINGS: VaultExplorerPluginSettings = {
|
|||
loadBodyTags: true,
|
||||
filterGroupsWidth: "300px",
|
||||
shouldWrapFilterGroups: false,
|
||||
shouldCollapseFilters: false,
|
||||
pageSize: 25,
|
||||
viewOrder: [
|
||||
TExplorerView.GRID,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ export enum PluginEvent {
|
|||
FILE_CREATE = "file-create",
|
||||
FILE_DELETE = "file-delete",
|
||||
FILE_MODIFY = "file-modify",
|
||||
COLLAPSE_FILTERS_CHANGE = "collapse-filters-change",
|
||||
METADATA_CHANGE = "metadata-change",
|
||||
PROPERTIES_FILTER_UPDATE = "properties-filter-update",
|
||||
FOLDER_RENAME = "folder-rename",
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import Migrate_1_33_0 from "./migrate_1_33_0";
|
|||
import Migrate_1_37_0 from "./migrate_1_37_0";
|
||||
import Migrate_1_38_0 from "./migrate_1_38_0";
|
||||
import Migrate_1_39_0 from "./migrate_1_39_0";
|
||||
import Migrate_1_40_0 from "./migrate_1_40_0";
|
||||
|
||||
const migrations: TMigration[] = [
|
||||
{
|
||||
|
|
@ -171,6 +172,11 @@ const migrations: TMigration[] = [
|
|||
to: "1.39.0",
|
||||
migrate: Migrate_1_39_0,
|
||||
},
|
||||
{
|
||||
from: "1.39.0",
|
||||
to: "1.40.0",
|
||||
migrate: Migrate_1_40_0,
|
||||
},
|
||||
];
|
||||
|
||||
export const preformMigrations = (
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { VaultExplorerPluginSettings_1_37_2 } from "src/types/types-1-37-0";
|
||||
import MigrationInterface from "./migration_interface";
|
||||
import { VaultExplorerPluginSettings } from "src/types";
|
||||
import { VaultExplorerPluginSettings_1_38_0 } from "src/types/types-1.38.0";
|
||||
|
||||
export default class Migrate_1_38_0 implements MigrationInterface {
|
||||
migrate(data: Record<string, unknown>) {
|
||||
const typedData = data as unknown as VaultExplorerPluginSettings_1_38_0;
|
||||
const newData: VaultExplorerPluginSettings = {
|
||||
const typedData = data as unknown as VaultExplorerPluginSettings_1_37_2;
|
||||
const newData: VaultExplorerPluginSettings_1_38_0 = {
|
||||
...typedData,
|
||||
loadBodyTags: true,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
import MigrationInterface from "./migration_interface";
|
||||
import { TExplorerView, VaultExplorerPluginSettings } from "src/types";
|
||||
import { VaultExplorerPluginSettings_1_38_0 } from "src/types/types-1.38.0";
|
||||
import {
|
||||
TExplorerView_1_39_0,
|
||||
VaultExplorerPluginSettings_1_39_0,
|
||||
} from "src/types/types-1.39.0";
|
||||
|
||||
export default class Migrate_1_39_0 implements MigrationInterface {
|
||||
migrate(data: Record<string, unknown>) {
|
||||
const typedData = data as unknown as VaultExplorerPluginSettings_1_38_0;
|
||||
const newData: VaultExplorerPluginSettings = {
|
||||
const newData: VaultExplorerPluginSettings_1_39_0 = {
|
||||
...typedData,
|
||||
viewOrder: [
|
||||
TExplorerView.GRID,
|
||||
TExplorerView.LIST,
|
||||
TExplorerView.TABLE,
|
||||
TExplorerView.FEED,
|
||||
TExplorerView_1_39_0.GRID,
|
||||
TExplorerView_1_39_0.LIST,
|
||||
TExplorerView_1_39_0.TABLE,
|
||||
TExplorerView_1_39_0.FEED,
|
||||
],
|
||||
views: {
|
||||
...typedData.views,
|
||||
|
|
|
|||
15
src/migrations/migrate_1_40_0.ts
Normal file
15
src/migrations/migrate_1_40_0.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import MigrationInterface from "./migration_interface";
|
||||
import { VaultExplorerPluginSettings_1_39_0 } from "src/types/types-1.39.0";
|
||||
import { VaultExplorerPluginSettings } from "src/types";
|
||||
|
||||
export default class Migrate_1_40_0 implements MigrationInterface {
|
||||
migrate(data: Record<string, unknown>) {
|
||||
const typedData = data as unknown as VaultExplorerPluginSettings_1_39_0;
|
||||
const newData: VaultExplorerPluginSettings = {
|
||||
...typedData,
|
||||
shouldCollapseFilters: false,
|
||||
};
|
||||
|
||||
return newData as unknown as Record<string, unknown>;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@ import { ItemView, WorkspaceLeaf } from "obsidian";
|
|||
import { VAULT_EXPLORER_VIEW } from "src/constants";
|
||||
import VaultExplorerApp from "../svelte/app/index.svelte";
|
||||
import VaultExplorerPlugin from "src/main";
|
||||
import EventManager from "src/event/event-manager";
|
||||
import { PluginEvent } from "src/event/types";
|
||||
|
||||
export default class VaultExplorerView extends ItemView {
|
||||
component: VaultExplorerApp | null;
|
||||
|
|
@ -32,6 +34,12 @@ export default class VaultExplorerView extends ItemView {
|
|||
(app as any).setting.openTabById(this.plugin.manifest.id);
|
||||
});
|
||||
|
||||
this.addAction("chevrons-down-up", "Collapse filters", () => {
|
||||
EventManager.getInstance().emit(
|
||||
PluginEvent.COLLAPSE_FILTERS_CHANGE
|
||||
);
|
||||
});
|
||||
|
||||
const containerEl = this.containerEl.children[1];
|
||||
|
||||
this.component = new VaultExplorerApp({
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
TFavoritesCache,
|
||||
} from "./services/favorites-store";
|
||||
import TableView from "./components/table-view.svelte";
|
||||
import Spacer from "../shared/components/spacer.svelte";
|
||||
|
||||
// ============================================
|
||||
// Variables
|
||||
|
|
@ -71,6 +72,8 @@
|
|||
let startOfThisWeekMillis: number;
|
||||
let startOfLastWeekMillis: number;
|
||||
|
||||
let shouldCollapseFilters: boolean = false;
|
||||
|
||||
let pageSize: number = 0;
|
||||
let searchFilter: TSearchFilter = {
|
||||
isEnabled: true,
|
||||
|
|
@ -133,6 +136,7 @@
|
|||
plugin = p;
|
||||
|
||||
const { app, settings } = plugin;
|
||||
shouldCollapseFilters = settings.shouldCollapseFilters;
|
||||
pageSize = settings.pageSize;
|
||||
searchFilter = settings.filters.search;
|
||||
favoritesFilter = settings.filters.favorites;
|
||||
|
|
@ -214,6 +218,23 @@
|
|||
};
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
function handleToggleFiltersChange() {
|
||||
shouldCollapseFilters = !shouldCollapseFilters;
|
||||
}
|
||||
|
||||
EventManager.getInstance().on(
|
||||
PluginEvent.COLLAPSE_FILTERS_CHANGE,
|
||||
handleToggleFiltersChange,
|
||||
);
|
||||
return () => {
|
||||
EventManager.getInstance().off(
|
||||
PluginEvent.COLLAPSE_FILTERS_CHANGE,
|
||||
handleToggleFiltersChange,
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
function handlePropertiesFilterUpdate() {
|
||||
Logger.trace({
|
||||
|
|
@ -544,6 +565,7 @@
|
|||
plugin.settings.currentView = currentView;
|
||||
plugin.settings.filters.custom = customFilter;
|
||||
plugin.settings.viewOrder = viewOrder;
|
||||
plugin.settings.shouldCollapseFilters = shouldCollapseFilters;
|
||||
await plugin.saveSettings();
|
||||
}
|
||||
|
||||
|
|
@ -850,6 +872,7 @@
|
|||
currentView,
|
||||
customFilter,
|
||||
viewOrder,
|
||||
shouldCollapseFilters,
|
||||
saveSettings();
|
||||
|
||||
$: totalItems = renderData.length;
|
||||
|
|
@ -868,120 +891,133 @@
|
|||
</script>
|
||||
|
||||
<div class="vault-explorer">
|
||||
<div class="vault-explorer-header">
|
||||
{#if searchFilter.isEnabled}
|
||||
<SearchFilter
|
||||
value={searchFilter.value}
|
||||
on:input={debounceSearchFilterChange}
|
||||
on:clear={() => (searchFilter.value = "")}
|
||||
/>
|
||||
{/if}
|
||||
<Stack direction="column" spacing="sm">
|
||||
<Flex justify="space-between">
|
||||
<Stack spacing="sm">
|
||||
{#if favoritesFilter.isEnabled}
|
||||
<FavoritesFilter
|
||||
value={favoritesFilter.value}
|
||||
on:change={handleFavoritesChange}
|
||||
/>
|
||||
{/if}
|
||||
<Flex>
|
||||
{#if timestampFilter.isEnabled}
|
||||
<TimestampFilter
|
||||
value={timestampFilter.value}
|
||||
on:change={handleTimestampFilterChange}
|
||||
/>
|
||||
{/if}
|
||||
{#if sortFilter.isEnabled}
|
||||
<SortFilter
|
||||
value={sortFilter.value}
|
||||
on:change={handleSortChange}
|
||||
/>
|
||||
{/if}
|
||||
{#if sortFilter.value == "random"}
|
||||
<IconButton
|
||||
iconId="shuffle"
|
||||
ariaLabel="Reshuffle files"
|
||||
on:click={handleReshuffleClick}
|
||||
{#if shouldCollapseFilters === false}
|
||||
<div class="vault-explorer-filters">
|
||||
<Stack spacing="md" direction="column">
|
||||
{#if searchFilter.isEnabled}
|
||||
<SearchFilter
|
||||
value={searchFilter.value}
|
||||
on:input={debounceSearchFilterChange}
|
||||
on:clear={() => (searchFilter.value = "")}
|
||||
/>
|
||||
{/if}
|
||||
<Stack direction="column" spacing="sm">
|
||||
<Flex justify="space-between">
|
||||
<Stack spacing="sm">
|
||||
{#if favoritesFilter.isEnabled}
|
||||
<FavoritesFilter
|
||||
value={favoritesFilter.value}
|
||||
on:change={handleFavoritesChange}
|
||||
/>
|
||||
{/if}
|
||||
<Flex>
|
||||
{#if timestampFilter.isEnabled}
|
||||
<TimestampFilter
|
||||
value={timestampFilter.value}
|
||||
on:change={handleTimestampFilterChange}
|
||||
/>
|
||||
{/if}
|
||||
{#if sortFilter.isEnabled}
|
||||
<SortFilter
|
||||
value={sortFilter.value}
|
||||
on:change={handleSortChange}
|
||||
/>
|
||||
{/if}
|
||||
{#if sortFilter.value == "random"}
|
||||
<IconButton
|
||||
iconId="shuffle"
|
||||
ariaLabel="Reshuffle files"
|
||||
on:click={handleReshuffleClick}
|
||||
/>
|
||||
{/if}
|
||||
<IconButton
|
||||
ariaLabel="Change custom filter"
|
||||
iconId="list-filter"
|
||||
on:click={handleCustomFilterClick}
|
||||
/>
|
||||
</Flex>
|
||||
</Stack>
|
||||
</Flex>
|
||||
<Flex justify="space-between">
|
||||
{#if customFilter.isEnabled}
|
||||
<FilterGroupList
|
||||
groups={customFilter.groups}
|
||||
on:groupClick={handleGroupClick}
|
||||
on:groupContextMenu={handleGroupContextMenu}
|
||||
on:groupDrop={handleGroupDrop}
|
||||
on:groupDragOver={handleGroupDragOver}
|
||||
on:groupDragStart={handleGroupDragStart}
|
||||
/>
|
||||
{/if}
|
||||
<IconButton
|
||||
iconId="settings"
|
||||
ariaLabel="Change custom filter"
|
||||
iconId="list-filter"
|
||||
on:click={handleCustomFilterClick}
|
||||
/>
|
||||
</Flex>
|
||||
</Stack>
|
||||
</Flex>
|
||||
{#if customFilter.isEnabled}
|
||||
<FilterGroupList
|
||||
groups={customFilter.groups}
|
||||
on:groupClick={handleGroupClick}
|
||||
on:groupContextMenu={handleGroupContextMenu}
|
||||
on:groupDrop={handleGroupDrop}
|
||||
on:groupDragOver={handleGroupDragOver}
|
||||
on:groupDragStart={handleGroupDragStart}
|
||||
/>
|
||||
{/if}
|
||||
</Stack>
|
||||
<Wrap align="center" spacingY="sm" justify="space-between">
|
||||
<div class="vault-explorer-view-select">
|
||||
<TabList
|
||||
initialSelectedIndex={viewOrder.findIndex(
|
||||
(view) => view === currentView,
|
||||
)}
|
||||
>
|
||||
{#each viewOrder as view}
|
||||
<Tab
|
||||
draggable={true}
|
||||
on:click={() => (currentView = view)}
|
||||
on:dragstart={(e) => handleViewDragStart(e, view)}
|
||||
on:dragover={handleViewDragOver}
|
||||
on:drop={(e) => handleViewDrop(e, view)}
|
||||
>{getDisplayNameForView(view)}</Tab
|
||||
>
|
||||
{/each}
|
||||
</TabList>
|
||||
</div>
|
||||
<PaginationIndicator
|
||||
{startIndex}
|
||||
{endIndex}
|
||||
{currentPage}
|
||||
{totalPages}
|
||||
{totalItems}
|
||||
on:change={handlePageChange}
|
||||
/>
|
||||
</Wrap>
|
||||
{#if currentView === "grid"}
|
||||
<GridView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{:else if currentView === "list"}
|
||||
<ListView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{:else if currentView === "table"}
|
||||
<TableView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{:else if currentView === "feed"}
|
||||
<FeedView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
</Stack>
|
||||
<Spacer size="md" />
|
||||
</div>
|
||||
{/if}
|
||||
<Wrap align="center" spacingY="sm" justify="space-between">
|
||||
<div class="vault-explorer-view-select">
|
||||
<TabList
|
||||
initialSelectedIndex={viewOrder.findIndex(
|
||||
(view) => view === currentView,
|
||||
)}
|
||||
>
|
||||
{#each viewOrder as view}
|
||||
<Tab
|
||||
draggable={true}
|
||||
on:click={() => (currentView = view)}
|
||||
on:dragstart={(e) => handleViewDragStart(e, view)}
|
||||
on:dragover={handleViewDragOver}
|
||||
on:drop={(e) => handleViewDrop(e, view)}
|
||||
>{getDisplayNameForView(view)}</Tab
|
||||
>
|
||||
{/each}
|
||||
</TabList>
|
||||
</div>
|
||||
<PaginationIndicator
|
||||
{startIndex}
|
||||
{endIndex}
|
||||
{currentPage}
|
||||
{totalPages}
|
||||
{totalItems}
|
||||
on:change={handlePageChange}
|
||||
/>
|
||||
</Wrap>
|
||||
<Spacer size="md" />
|
||||
{#if currentView === "grid"}
|
||||
<GridView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{:else if currentView === "list"}
|
||||
<ListView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{:else if currentView === "table"}
|
||||
<TableView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{:else if currentView === "feed"}
|
||||
<FeedView
|
||||
data={renderData}
|
||||
{startIndex}
|
||||
{pageLength}
|
||||
on:favoritePropertyChange={handleFavoritePropertyChange}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
|
@ -990,13 +1026,6 @@
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
.vault-explorer-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.vault-explorer-view-select {
|
||||
flex: 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,42 +135,6 @@
|
|||
groups = newGroups;
|
||||
}
|
||||
|
||||
function handleGroupDragStart(e: CustomEvent) {
|
||||
const { nativeEvent, id } = e.detail;
|
||||
|
||||
nativeEvent.dataTransfer.setData("text", id);
|
||||
nativeEvent.dataTransfer.effectAllowed = "move";
|
||||
}
|
||||
|
||||
function handleGroupDragOver(e: CustomEvent) {
|
||||
const { nativeEvent } = e.detail;
|
||||
|
||||
nativeEvent.preventDefault();
|
||||
}
|
||||
|
||||
function handleGroupDrop(e: CustomEvent) {
|
||||
const { id, nativeEvent } = e.detail;
|
||||
const dragId = nativeEvent.dataTransfer.getData("text");
|
||||
nativeEvent.dataTransfer.dropEffect = "move";
|
||||
|
||||
const draggedIndex = groups.findIndex((group) => group.id === dragId);
|
||||
const dragged = groups.find((group) => group.id === dragId);
|
||||
|
||||
const droppedIndex = groups.findIndex((group) => group.id === id);
|
||||
|
||||
if (!dragged || draggedIndex === -1 || droppedIndex === -1) return;
|
||||
|
||||
let newGroups = [...groups];
|
||||
|
||||
// Remove the dragged item
|
||||
newGroups.splice(draggedIndex, 1);
|
||||
|
||||
// Insert the dragged item at the drop index
|
||||
newGroups.splice(droppedIndex, 0, dragged);
|
||||
|
||||
groups = newGroups;
|
||||
}
|
||||
|
||||
function handleRuleDeleteClick(e: CustomEvent) {
|
||||
const { id } = e.detail;
|
||||
Logger.trace({
|
||||
|
|
|
|||
|
|
@ -650,6 +650,7 @@ export function isVaultExplorerPluginSettings(obj: unknown): obj is VaultExplore
|
|||
typeof typedObj["pageSize"] === "number" &&
|
||||
typeof typedObj["filterGroupsWidth"] === "string" &&
|
||||
typeof typedObj["shouldWrapFilterGroups"] === "boolean" &&
|
||||
typeof typedObj["shouldCollapseFilters"] === "boolean" &&
|
||||
Array.isArray(typedObj["viewOrder"]) &&
|
||||
typedObj["viewOrder"].every((e: any) =>
|
||||
(e === TExplorerView.DASHBOARD ||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ export interface VaultExplorerPluginSettings {
|
|||
pageSize: number;
|
||||
filterGroupsWidth: string;
|
||||
shouldWrapFilterGroups: boolean;
|
||||
shouldCollapseFilters: boolean;
|
||||
viewOrder: TExplorerView[];
|
||||
configDir: string;
|
||||
pluginVersion: string | null;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export interface VaultExplorerPluginSettings_0_3_3 {
|
|||
custom1: string;
|
||||
custom2: string;
|
||||
custom3: string;
|
||||
},
|
||||
};
|
||||
filters: {
|
||||
folder: string;
|
||||
search: string;
|
||||
|
|
@ -15,8 +15,8 @@ export interface VaultExplorerPluginSettings_0_3_3 {
|
|||
properties: {
|
||||
selectedGroupId: string;
|
||||
groups: PropertyFilterGroup[];
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
currentView: CurrentView;
|
||||
pageSize: number;
|
||||
pluginVersion: string | null;
|
||||
|
|
@ -61,6 +61,17 @@ type FilterOperator = "and" | "or";
|
|||
|
||||
type CurrentView = "grid" | "list";
|
||||
|
||||
type SortFilter = "file-name-asc" | "file-name-desc" | "modified-asc" | "modified-desc";
|
||||
type SortFilter =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc";
|
||||
|
||||
type TimestampFilter = "created-today" | "modified-today" | "created-this-week" | "modified-this-week" | "created-2-weeks" | "modified-2-weeks" | "all";
|
||||
type TimestampFilter =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
| "modified-this-week"
|
||||
| "created-2-weeks"
|
||||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export interface VaultExplorerPluginSettings_0_5_5 {
|
|||
custom1: string;
|
||||
custom2: string;
|
||||
custom3: string;
|
||||
},
|
||||
};
|
||||
filters: {
|
||||
folder: string;
|
||||
search: string;
|
||||
|
|
@ -15,18 +15,25 @@ export interface VaultExplorerPluginSettings_0_5_5 {
|
|||
properties: {
|
||||
selectedGroupId: string;
|
||||
groups: PropertyFilterGroup[];
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
currentView: CurrentView;
|
||||
pageSize: number;
|
||||
pluginVersion: string | null;
|
||||
}
|
||||
|
||||
export { TextFilterCondition as TextFilterCondition_0_5_5, PropertyFilterType as PropertyFilterType_0_5_5, NumberFilterCondition as NumberFilterCondition_0_5_5, ListFilterCondition as ListFilterCondition_0_5_5, CheckboxFilterCondition as CheckboxFilterCondition_0_5_5, DateFilterCondition as DateFilterCondition_0_5_5 };
|
||||
export {
|
||||
TextFilterCondition as TextFilterCondition_0_5_5,
|
||||
PropertyFilterType as PropertyFilterType_0_5_5,
|
||||
NumberFilterCondition as NumberFilterCondition_0_5_5,
|
||||
ListFilterCondition as ListFilterCondition_0_5_5,
|
||||
CheckboxFilterCondition as CheckboxFilterCondition_0_5_5,
|
||||
DateFilterCondition as DateFilterCondition_0_5_5,
|
||||
};
|
||||
|
||||
export type FilterOperator = "and" | "or";
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
export enum TextFilterCondition {
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -37,14 +44,14 @@ export enum TextFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ListFilterCondition {
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum NumberFilterCondition {
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
|
|
@ -55,14 +62,14 @@ export enum NumberFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum CheckboxFilterCondition {
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum DateFilterCondition {
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
|
|
@ -70,7 +77,12 @@ export enum DateFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export type FilterCondition = TextFilterCondition | NumberFilterCondition | DateFilterCondition | CheckboxFilterCondition | ListFilterCondition;
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
| CheckboxFilterCondition
|
||||
| ListFilterCondition;
|
||||
|
||||
interface BasePropertyFilter {
|
||||
id: string;
|
||||
|
|
@ -81,7 +93,7 @@ interface BasePropertyFilter {
|
|||
value: string;
|
||||
}
|
||||
|
||||
export enum PropertyFilterType {
|
||||
enum PropertyFilterType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
|
|
@ -90,34 +102,39 @@ export enum PropertyFilterType {
|
|||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
export interface TextPropertyFilter extends BasePropertyFilter {
|
||||
interface TextPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.TEXT;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
export interface NumberPropertyFilter extends BasePropertyFilter {
|
||||
interface NumberPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.NUMBER;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
export interface ListPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.LIST
|
||||
interface ListPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.LIST;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
export interface CheckboxPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.CHECKBOX
|
||||
interface CheckboxPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.CHECKBOX;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
export interface DatePropertyFilter extends BasePropertyFilter {
|
||||
interface DatePropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.DATE | PropertyFilterType.DATETIME;
|
||||
condition: DateFilterCondition;
|
||||
}
|
||||
|
||||
export type PropertyFilter = TextPropertyFilter | NumberPropertyFilter | ListPropertyFilter | CheckboxPropertyFilter | DatePropertyFilter;
|
||||
type PropertyFilter =
|
||||
| TextPropertyFilter
|
||||
| NumberPropertyFilter
|
||||
| ListPropertyFilter
|
||||
| CheckboxPropertyFilter
|
||||
| DatePropertyFilter;
|
||||
|
||||
export interface PropertyFilterGroup {
|
||||
interface PropertyFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
filters: PropertyFilter[];
|
||||
|
|
@ -125,8 +142,19 @@ export interface PropertyFilterGroup {
|
|||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export type CurrentView = "grid" | "list";
|
||||
type CurrentView = "grid" | "list";
|
||||
|
||||
export type SortFilter = "file-name-asc" | "file-name-desc" | "modified-asc" | "modified-desc";
|
||||
type SortFilter =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc";
|
||||
|
||||
export type TimestampFilter = "created-today" | "modified-today" | "created-this-week" | "modified-this-week" | "created-2-weeks" | "modified-2-weeks" | "all";
|
||||
type TimestampFilter =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
| "modified-this-week"
|
||||
| "created-2-weeks"
|
||||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export interface VaultExplorerPluginSettings_1_0_1 {
|
|||
custom1: string;
|
||||
custom2: string;
|
||||
custom3: string;
|
||||
},
|
||||
};
|
||||
filters: {
|
||||
folder: string;
|
||||
search: string;
|
||||
|
|
@ -16,16 +16,16 @@ export interface VaultExplorerPluginSettings_1_0_1 {
|
|||
properties: {
|
||||
selectedGroupId: string;
|
||||
groups: PropertyFilterGroup[];
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
currentView: CurrentView;
|
||||
pageSize: number;
|
||||
pluginVersion: string | null;
|
||||
}
|
||||
|
||||
export type FilterOperator = "and" | "or";
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
export enum TextFilterCondition {
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -36,14 +36,14 @@ export enum TextFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ListFilterCondition {
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum NumberFilterCondition {
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
|
|
@ -54,14 +54,14 @@ export enum NumberFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum CheckboxFilterCondition {
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum DateFilterCondition {
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
|
|
@ -69,7 +69,12 @@ export enum DateFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export type FilterCondition = TextFilterCondition | NumberFilterCondition | DateFilterCondition | CheckboxFilterCondition | ListFilterCondition;
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
| CheckboxFilterCondition
|
||||
| ListFilterCondition;
|
||||
|
||||
interface BasePropertyFilter {
|
||||
id: string;
|
||||
|
|
@ -80,7 +85,7 @@ interface BasePropertyFilter {
|
|||
value: string;
|
||||
}
|
||||
|
||||
export enum PropertyFilterType {
|
||||
enum PropertyFilterType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
|
|
@ -89,42 +94,58 @@ export enum PropertyFilterType {
|
|||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
export interface TextPropertyFilter extends BasePropertyFilter {
|
||||
interface TextPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.TEXT;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
export interface NumberPropertyFilter extends BasePropertyFilter {
|
||||
interface NumberPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.NUMBER;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
export interface ListPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.LIST
|
||||
interface ListPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.LIST;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
export interface CheckboxPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.CHECKBOX
|
||||
interface CheckboxPropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.CHECKBOX;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
export interface DatePropertyFilter extends BasePropertyFilter {
|
||||
interface DatePropertyFilter extends BasePropertyFilter {
|
||||
type: PropertyFilterType.DATE | PropertyFilterType.DATETIME;
|
||||
condition: DateFilterCondition;
|
||||
}
|
||||
|
||||
export type PropertyFilter = TextPropertyFilter | NumberPropertyFilter | ListPropertyFilter | CheckboxPropertyFilter | DatePropertyFilter;
|
||||
type PropertyFilter =
|
||||
| TextPropertyFilter
|
||||
| NumberPropertyFilter
|
||||
| ListPropertyFilter
|
||||
| CheckboxPropertyFilter
|
||||
| DatePropertyFilter;
|
||||
|
||||
export interface PropertyFilterGroup {
|
||||
interface PropertyFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
filters: PropertyFilter[];
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export type CurrentView = "grid" | "list";
|
||||
type CurrentView = "grid" | "list";
|
||||
|
||||
export type SortFilter = "file-name-asc" | "file-name-desc" | "modified-asc" | "modified-desc";
|
||||
type SortFilter =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc";
|
||||
|
||||
export type TimestampFilter = "created-today" | "modified-today" | "created-this-week" | "modified-this-week" | "created-2-weeks" | "modified-2-weeks" | "all";
|
||||
type TimestampFilter =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
| "modified-this-week"
|
||||
| "created-2-weeks"
|
||||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
|
|
|||
|
|
@ -39,46 +39,46 @@ interface BaseView {
|
|||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TTableView extends BaseView {}
|
||||
interface TTableView extends BaseView {}
|
||||
|
||||
export interface TListView extends BaseView {}
|
||||
interface TListView extends BaseView {}
|
||||
|
||||
export interface TGridView extends BaseView {}
|
||||
interface TGridView extends BaseView {}
|
||||
|
||||
export interface TDashboardView extends BaseView {}
|
||||
interface TDashboardView extends BaseView {}
|
||||
|
||||
export interface TFeedView extends BaseView {}
|
||||
interface TFeedView extends BaseView {}
|
||||
|
||||
export interface TRecommendedView extends BaseView {}
|
||||
interface TRecommendedView extends BaseView {}
|
||||
|
||||
export interface TRelatedView extends BaseView {}
|
||||
interface TRelatedView extends BaseView {}
|
||||
|
||||
interface BaseFilter {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TSearchFilter extends BaseFilter {
|
||||
interface TSearchFilter extends BaseFilter {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface TFavoritesFilter extends BaseFilter {
|
||||
interface TFavoritesFilter extends BaseFilter {
|
||||
value: boolean;
|
||||
}
|
||||
|
||||
export interface TSortFilter extends BaseFilter {
|
||||
interface TSortFilter extends BaseFilter {
|
||||
value: SortFilterOption;
|
||||
}
|
||||
|
||||
export interface TTimestampFilter extends BaseFilter {
|
||||
interface TTimestampFilter extends BaseFilter {
|
||||
value: TimestampFilterOption;
|
||||
}
|
||||
|
||||
export interface TCustomFilter extends BaseFilter {
|
||||
interface TCustomFilter extends BaseFilter {
|
||||
selectedGroupId: string;
|
||||
groups: TFilterGroup[];
|
||||
}
|
||||
|
||||
export type TimestampFilterOption =
|
||||
type TimestampFilterOption =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
|
|
@ -87,16 +87,16 @@ export type TimestampFilterOption =
|
|||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
||||
export type SortFilterOption =
|
||||
type SortFilterOption =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc"
|
||||
| "random";
|
||||
|
||||
export type WordBreak = "normal" | "break-word";
|
||||
type WordBreak = "normal" | "break-word";
|
||||
|
||||
export enum TExplorerView {
|
||||
enum TExplorerView {
|
||||
DASHBOARD = "dashboard",
|
||||
GRID = "grid",
|
||||
LIST = "list",
|
||||
|
|
@ -106,9 +106,9 @@ export enum TExplorerView {
|
|||
RELATED = "related",
|
||||
}
|
||||
|
||||
export type FilterOperator = "and" | "or";
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
export enum TextFilterCondition {
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -119,14 +119,14 @@ export enum TextFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ListFilterCondition {
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum NumberFilterCondition {
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
|
|
@ -137,14 +137,14 @@ export enum NumberFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum CheckboxFilterCondition {
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum DateFilterCondition {
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
|
|
@ -154,19 +154,19 @@ export enum DateFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ContentFilterCondition {
|
||||
enum ContentFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
IS_EMPTY = "is-empty",
|
||||
IS_NOT_EMPTY = "is-not-empty",
|
||||
}
|
||||
|
||||
export enum FolderFilterCondition {
|
||||
enum FolderFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
}
|
||||
|
||||
export enum FileNameFilterCondition {
|
||||
enum FileNameFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -175,7 +175,7 @@ export enum FileNameFilterCondition {
|
|||
ENDS_WITH = "ends-with",
|
||||
}
|
||||
|
||||
export type FilterCondition =
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
|
|
@ -186,7 +186,7 @@ export type FilterCondition =
|
|||
| FileNameFilterCondition;
|
||||
|
||||
//This matches the Obsidian property types
|
||||
export enum PropertyType {
|
||||
enum PropertyType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
|
|
@ -195,14 +195,14 @@ export enum PropertyType {
|
|||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
export enum FilterRuleType {
|
||||
enum FilterRuleType {
|
||||
PROPERTY = "property",
|
||||
FOLDER = "folder",
|
||||
FILE_NAME = "file-name",
|
||||
CONTENT = "content",
|
||||
}
|
||||
|
||||
export enum DatePropertyFilterValue {
|
||||
enum DatePropertyFilterValue {
|
||||
TODAY = "today",
|
||||
TOMORROW = "tomorrow",
|
||||
YESTERDAY = "yesterday",
|
||||
|
|
@ -223,35 +223,35 @@ interface BaseFilterRule {
|
|||
matchWhenPropertyDNE: boolean;
|
||||
}
|
||||
|
||||
export interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.TEXT;
|
||||
propertyName: string;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
export interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.NUMBER;
|
||||
propertyName: string;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
export interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.LIST;
|
||||
propertyName: string;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
export interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.CHECKBOX;
|
||||
propertyName: string;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
export interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.DATE | PropertyType.DATETIME;
|
||||
propertyName: string;
|
||||
|
|
@ -259,36 +259,36 @@ export interface DatePropertyFilterRule extends BaseFilterRule {
|
|||
valueData: string;
|
||||
}
|
||||
|
||||
export interface FolderFilterRule extends BaseFilterRule {
|
||||
interface FolderFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FOLDER;
|
||||
condition: FolderFilterCondition;
|
||||
includeSubfolders: boolean;
|
||||
}
|
||||
|
||||
export interface FileNameFilterRule extends BaseFilterRule {
|
||||
interface FileNameFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FILE_NAME;
|
||||
condition: FileNameFilterCondition;
|
||||
}
|
||||
|
||||
export interface ContentFilterRule extends BaseFilterRule {
|
||||
interface ContentFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.CONTENT;
|
||||
condition: ContentFilterCondition;
|
||||
}
|
||||
|
||||
export type TFilterRule =
|
||||
type TFilterRule =
|
||||
| PropertyFilterRule
|
||||
| FolderFilterRule
|
||||
| FileNameFilterRule
|
||||
| ContentFilterRule;
|
||||
|
||||
export type PropertyFilterRule =
|
||||
type PropertyFilterRule =
|
||||
| TextPropertyFilterRule
|
||||
| NumberPropertyFilterRule
|
||||
| ListPropertyFilterRule
|
||||
| CheckboxPropertyFilterRule
|
||||
| DatePropertyFilterRule;
|
||||
|
||||
export interface TFilterGroup {
|
||||
interface TFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
rules: TFilterRule[];
|
||||
|
|
|
|||
|
|
@ -42,50 +42,50 @@ interface BaseView {
|
|||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TTableView extends BaseView {}
|
||||
interface TTableView extends BaseView {}
|
||||
|
||||
export interface TListView extends BaseView {}
|
||||
interface TListView extends BaseView {}
|
||||
|
||||
export interface TGridView extends BaseView {
|
||||
interface TGridView extends BaseView {
|
||||
loadSocialMediaImage: boolean;
|
||||
}
|
||||
|
||||
export interface TDashboardView extends BaseView {}
|
||||
interface TDashboardView extends BaseView {}
|
||||
|
||||
export interface TFeedView extends BaseView {
|
||||
interface TFeedView extends BaseView {
|
||||
collapseContent: boolean;
|
||||
}
|
||||
|
||||
export interface TRecommendedView extends BaseView {}
|
||||
interface TRecommendedView extends BaseView {}
|
||||
|
||||
export interface TRelatedView extends BaseView {}
|
||||
interface TRelatedView extends BaseView {}
|
||||
|
||||
interface BaseFilter {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TSearchFilter extends BaseFilter {
|
||||
interface TSearchFilter extends BaseFilter {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface TFavoritesFilter extends BaseFilter {
|
||||
interface TFavoritesFilter extends BaseFilter {
|
||||
value: boolean;
|
||||
}
|
||||
|
||||
export interface TSortFilter extends BaseFilter {
|
||||
interface TSortFilter extends BaseFilter {
|
||||
value: SortFilterOption;
|
||||
}
|
||||
|
||||
export interface TTimestampFilter extends BaseFilter {
|
||||
interface TTimestampFilter extends BaseFilter {
|
||||
value: TimestampFilterOption;
|
||||
}
|
||||
|
||||
export interface TCustomFilter extends BaseFilter {
|
||||
interface TCustomFilter extends BaseFilter {
|
||||
selectedGroupId: string;
|
||||
groups: TFilterGroup[];
|
||||
}
|
||||
|
||||
export type TimestampFilterOption =
|
||||
type TimestampFilterOption =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
|
|
@ -94,18 +94,18 @@ export type TimestampFilterOption =
|
|||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
||||
export type SortFilterOption =
|
||||
type SortFilterOption =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc"
|
||||
| "random";
|
||||
|
||||
export type WordBreak = "normal" | "break-word";
|
||||
type WordBreak = "normal" | "break-word";
|
||||
|
||||
export type FlexWrap = "wrap" | "nowrap";
|
||||
type FlexWrap = "wrap" | "nowrap";
|
||||
|
||||
export enum TExplorerView {
|
||||
enum TExplorerView {
|
||||
DASHBOARD = "dashboard",
|
||||
GRID = "grid",
|
||||
LIST = "list",
|
||||
|
|
@ -115,9 +115,9 @@ export enum TExplorerView {
|
|||
RELATED = "related",
|
||||
}
|
||||
|
||||
export type FilterOperator = "and" | "or";
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
export enum TextFilterCondition {
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -128,14 +128,14 @@ export enum TextFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ListFilterCondition {
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum NumberFilterCondition {
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
|
|
@ -146,14 +146,14 @@ export enum NumberFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum CheckboxFilterCondition {
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum DateFilterCondition {
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
|
|
@ -163,19 +163,19 @@ export enum DateFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ContentFilterCondition {
|
||||
enum ContentFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
IS_EMPTY = "is-empty",
|
||||
IS_NOT_EMPTY = "is-not-empty",
|
||||
}
|
||||
|
||||
export enum FolderFilterCondition {
|
||||
enum FolderFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
}
|
||||
|
||||
export enum FileNameFilterCondition {
|
||||
enum FileNameFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -184,7 +184,7 @@ export enum FileNameFilterCondition {
|
|||
ENDS_WITH = "ends-with",
|
||||
}
|
||||
|
||||
export type FilterCondition =
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
|
|
@ -195,7 +195,7 @@ export type FilterCondition =
|
|||
| FileNameFilterCondition;
|
||||
|
||||
//This matches the Obsidian property types
|
||||
export enum PropertyType {
|
||||
enum PropertyType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
|
|
@ -204,14 +204,14 @@ export enum PropertyType {
|
|||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
export enum FilterRuleType {
|
||||
enum FilterRuleType {
|
||||
PROPERTY = "property",
|
||||
FOLDER = "folder",
|
||||
FILE_NAME = "file-name",
|
||||
CONTENT = "content",
|
||||
}
|
||||
|
||||
export enum DatePropertyFilterValue {
|
||||
enum DatePropertyFilterValue {
|
||||
TODAY = "today",
|
||||
TOMORROW = "tomorrow",
|
||||
YESTERDAY = "yesterday",
|
||||
|
|
@ -232,35 +232,35 @@ interface BaseFilterRule {
|
|||
matchWhenPropertyDNE: boolean;
|
||||
}
|
||||
|
||||
export interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.TEXT;
|
||||
propertyName: string;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
export interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.NUMBER;
|
||||
propertyName: string;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
export interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.LIST;
|
||||
propertyName: string;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
export interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.CHECKBOX;
|
||||
propertyName: string;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
export interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.DATE | PropertyType.DATETIME;
|
||||
propertyName: string;
|
||||
|
|
@ -268,36 +268,36 @@ export interface DatePropertyFilterRule extends BaseFilterRule {
|
|||
valueData: string;
|
||||
}
|
||||
|
||||
export interface FolderFilterRule extends BaseFilterRule {
|
||||
interface FolderFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FOLDER;
|
||||
condition: FolderFilterCondition;
|
||||
includeSubfolders: boolean;
|
||||
}
|
||||
|
||||
export interface FileNameFilterRule extends BaseFilterRule {
|
||||
interface FileNameFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FILE_NAME;
|
||||
condition: FileNameFilterCondition;
|
||||
}
|
||||
|
||||
export interface ContentFilterRule extends BaseFilterRule {
|
||||
interface ContentFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.CONTENT;
|
||||
condition: ContentFilterCondition;
|
||||
}
|
||||
|
||||
export type TFilterRule =
|
||||
type TFilterRule =
|
||||
| PropertyFilterRule
|
||||
| FolderFilterRule
|
||||
| FileNameFilterRule
|
||||
| ContentFilterRule;
|
||||
|
||||
export type PropertyFilterRule =
|
||||
type PropertyFilterRule =
|
||||
| TextPropertyFilterRule
|
||||
| NumberPropertyFilterRule
|
||||
| ListPropertyFilterRule
|
||||
| CheckboxPropertyFilterRule
|
||||
| DatePropertyFilterRule;
|
||||
|
||||
export interface TFilterGroup {
|
||||
interface TFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
rules: TFilterRule[];
|
||||
|
|
|
|||
|
|
@ -39,56 +39,56 @@ export interface VaultExplorerPluginSettings_1_25_2 {
|
|||
logLevel: string;
|
||||
}
|
||||
|
||||
export type FileInteractionStyle = "title" | "content";
|
||||
type FileInteractionStyle = "title" | "content";
|
||||
|
||||
interface BaseView {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TTableView extends BaseView {}
|
||||
interface TTableView extends BaseView {}
|
||||
|
||||
export interface TListView extends BaseView {}
|
||||
interface TListView extends BaseView {}
|
||||
|
||||
export interface TGridView extends BaseView {
|
||||
interface TGridView extends BaseView {
|
||||
loadSocialMediaImage: boolean;
|
||||
}
|
||||
|
||||
export interface TDashboardView extends BaseView {}
|
||||
interface TDashboardView extends BaseView {}
|
||||
|
||||
export interface TFeedView extends BaseView {
|
||||
interface TFeedView extends BaseView {
|
||||
collapseContent: boolean;
|
||||
}
|
||||
|
||||
export interface TRecommendedView extends BaseView {}
|
||||
interface TRecommendedView extends BaseView {}
|
||||
|
||||
export interface TRelatedView extends BaseView {}
|
||||
interface TRelatedView extends BaseView {}
|
||||
|
||||
interface BaseFilter {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TSearchFilter extends BaseFilter {
|
||||
interface TSearchFilter extends BaseFilter {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface TFavoritesFilter extends BaseFilter {
|
||||
interface TFavoritesFilter extends BaseFilter {
|
||||
value: boolean;
|
||||
}
|
||||
|
||||
export interface TSortFilter extends BaseFilter {
|
||||
interface TSortFilter extends BaseFilter {
|
||||
value: SortFilterOption;
|
||||
}
|
||||
|
||||
export interface TTimestampFilter extends BaseFilter {
|
||||
interface TTimestampFilter extends BaseFilter {
|
||||
value: TimestampFilterOption;
|
||||
}
|
||||
|
||||
export interface TCustomFilter extends BaseFilter {
|
||||
interface TCustomFilter extends BaseFilter {
|
||||
selectedGroupId: string;
|
||||
groups: TFilterGroup[];
|
||||
}
|
||||
|
||||
export type TimestampFilterOption =
|
||||
type TimestampFilterOption =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
|
|
@ -97,18 +97,18 @@ export type TimestampFilterOption =
|
|||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
||||
export type SortFilterOption =
|
||||
type SortFilterOption =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc"
|
||||
| "random";
|
||||
|
||||
export type WordBreak = "normal" | "break-word";
|
||||
type WordBreak = "normal" | "break-word";
|
||||
|
||||
export type FlexWrap = "wrap" | "nowrap";
|
||||
type FlexWrap = "wrap" | "nowrap";
|
||||
|
||||
export enum TExplorerView {
|
||||
enum TExplorerView {
|
||||
DASHBOARD = "dashboard",
|
||||
GRID = "grid",
|
||||
LIST = "list",
|
||||
|
|
@ -118,9 +118,9 @@ export enum TExplorerView {
|
|||
RELATED = "related",
|
||||
}
|
||||
|
||||
export type FilterOperator = "and" | "or";
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
export enum TextFilterCondition {
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -131,14 +131,14 @@ export enum TextFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ListFilterCondition {
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum NumberFilterCondition {
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
|
|
@ -149,14 +149,14 @@ export enum NumberFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum CheckboxFilterCondition {
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum DateFilterCondition {
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
|
|
@ -166,19 +166,19 @@ export enum DateFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ContentFilterCondition {
|
||||
enum ContentFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
IS_EMPTY = "is-empty",
|
||||
IS_NOT_EMPTY = "is-not-empty",
|
||||
}
|
||||
|
||||
export enum FolderFilterCondition {
|
||||
enum FolderFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
}
|
||||
|
||||
export enum FileNameFilterCondition {
|
||||
enum FileNameFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -187,7 +187,7 @@ export enum FileNameFilterCondition {
|
|||
ENDS_WITH = "ends-with",
|
||||
}
|
||||
|
||||
export type FilterCondition =
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
|
|
@ -198,7 +198,7 @@ export type FilterCondition =
|
|||
| FileNameFilterCondition;
|
||||
|
||||
//This matches the Obsidian property types
|
||||
export enum PropertyType {
|
||||
enum PropertyType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
|
|
@ -207,14 +207,14 @@ export enum PropertyType {
|
|||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
export enum FilterRuleType {
|
||||
enum FilterRuleType {
|
||||
PROPERTY = "property",
|
||||
FOLDER = "folder",
|
||||
FILE_NAME = "file-name",
|
||||
CONTENT = "content",
|
||||
}
|
||||
|
||||
export enum DatePropertyFilterValue {
|
||||
enum DatePropertyFilterValue {
|
||||
TODAY = "today",
|
||||
TOMORROW = "tomorrow",
|
||||
YESTERDAY = "yesterday",
|
||||
|
|
@ -235,35 +235,35 @@ interface BaseFilterRule {
|
|||
matchWhenPropertyDNE: boolean;
|
||||
}
|
||||
|
||||
export interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.TEXT;
|
||||
propertyName: string;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
export interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.NUMBER;
|
||||
propertyName: string;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
export interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.LIST;
|
||||
propertyName: string;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
export interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.CHECKBOX;
|
||||
propertyName: string;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
export interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.DATE | PropertyType.DATETIME;
|
||||
propertyName: string;
|
||||
|
|
@ -271,36 +271,36 @@ export interface DatePropertyFilterRule extends BaseFilterRule {
|
|||
valueData: string;
|
||||
}
|
||||
|
||||
export interface FolderFilterRule extends BaseFilterRule {
|
||||
interface FolderFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FOLDER;
|
||||
condition: FolderFilterCondition;
|
||||
includeSubfolders: boolean;
|
||||
}
|
||||
|
||||
export interface FileNameFilterRule extends BaseFilterRule {
|
||||
interface FileNameFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FILE_NAME;
|
||||
condition: FileNameFilterCondition;
|
||||
}
|
||||
|
||||
export interface ContentFilterRule extends BaseFilterRule {
|
||||
interface ContentFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.CONTENT;
|
||||
condition: ContentFilterCondition;
|
||||
}
|
||||
|
||||
export type TFilterRule =
|
||||
type TFilterRule =
|
||||
| PropertyFilterRule
|
||||
| FolderFilterRule
|
||||
| FileNameFilterRule
|
||||
| ContentFilterRule;
|
||||
|
||||
export type PropertyFilterRule =
|
||||
type PropertyFilterRule =
|
||||
| TextPropertyFilterRule
|
||||
| NumberPropertyFilterRule
|
||||
| ListPropertyFilterRule
|
||||
| CheckboxPropertyFilterRule
|
||||
| DatePropertyFilterRule;
|
||||
|
||||
export interface TFilterGroup {
|
||||
interface TFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
rules: TFilterRule[];
|
||||
|
|
|
|||
|
|
@ -40,27 +40,27 @@ export interface VaultExplorerPluginSettings_1_29_0 {
|
|||
logLevel: string;
|
||||
}
|
||||
|
||||
export type FileInteractionStyle = "title" | "content";
|
||||
type FileInteractionStyle = "title" | "content";
|
||||
|
||||
interface BaseView {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TTableView extends BaseView {}
|
||||
interface TTableView extends BaseView {}
|
||||
|
||||
export interface TListView extends BaseView {
|
||||
interface TListView extends BaseView {
|
||||
showTags: boolean;
|
||||
}
|
||||
|
||||
export interface TGridView extends BaseView {
|
||||
interface TGridView extends BaseView {
|
||||
loadSocialMediaImage: boolean;
|
||||
}
|
||||
|
||||
export interface TDashboardView extends BaseView {}
|
||||
interface TDashboardView extends BaseView {}
|
||||
|
||||
export type CollapseStyle = "no-new-lines" | "no-extra-new-lines";
|
||||
type CollapseStyle = "no-new-lines" | "no-extra-new-lines";
|
||||
|
||||
export interface TFeedView extends BaseView {
|
||||
interface TFeedView extends BaseView {
|
||||
collapseStyle: CollapseStyle;
|
||||
removeH1: boolean;
|
||||
lineClampSmall: number;
|
||||
|
|
@ -68,36 +68,36 @@ export interface TFeedView extends BaseView {
|
|||
lineClampLarge: number;
|
||||
}
|
||||
|
||||
export interface TRecommendedView extends BaseView {}
|
||||
interface TRecommendedView extends BaseView {}
|
||||
|
||||
export interface TRelatedView extends BaseView {}
|
||||
interface TRelatedView extends BaseView {}
|
||||
|
||||
interface BaseFilter {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TSearchFilter extends BaseFilter {
|
||||
interface TSearchFilter extends BaseFilter {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface TFavoritesFilter extends BaseFilter {
|
||||
interface TFavoritesFilter extends BaseFilter {
|
||||
value: boolean;
|
||||
}
|
||||
|
||||
export interface TSortFilter extends BaseFilter {
|
||||
interface TSortFilter extends BaseFilter {
|
||||
value: SortFilterOption;
|
||||
}
|
||||
|
||||
export interface TTimestampFilter extends BaseFilter {
|
||||
interface TTimestampFilter extends BaseFilter {
|
||||
value: TimestampFilterOption;
|
||||
}
|
||||
|
||||
export interface TCustomFilter extends BaseFilter {
|
||||
interface TCustomFilter extends BaseFilter {
|
||||
selectedGroupId: string;
|
||||
groups: TFilterGroup[];
|
||||
}
|
||||
|
||||
export type TimestampFilterOption =
|
||||
type TimestampFilterOption =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
|
|
@ -106,18 +106,18 @@ export type TimestampFilterOption =
|
|||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
||||
export type SortFilterOption =
|
||||
type SortFilterOption =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc"
|
||||
| "random";
|
||||
|
||||
export type WordBreak = "normal" | "break-word";
|
||||
type WordBreak = "normal" | "break-word";
|
||||
|
||||
export type FlexWrap = "wrap" | "nowrap";
|
||||
type FlexWrap = "wrap" | "nowrap";
|
||||
|
||||
export enum TExplorerView {
|
||||
enum TExplorerView {
|
||||
DASHBOARD = "dashboard",
|
||||
GRID = "grid",
|
||||
LIST = "list",
|
||||
|
|
@ -127,9 +127,9 @@ export enum TExplorerView {
|
|||
RELATED = "related",
|
||||
}
|
||||
|
||||
export type FilterOperator = "and" | "or";
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
export enum TextFilterCondition {
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -140,14 +140,14 @@ export enum TextFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ListFilterCondition {
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum NumberFilterCondition {
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
|
|
@ -158,14 +158,14 @@ export enum NumberFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum CheckboxFilterCondition {
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum DateFilterCondition {
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
|
|
@ -175,19 +175,19 @@ export enum DateFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ContentFilterCondition {
|
||||
enum ContentFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
IS_EMPTY = "is-empty",
|
||||
IS_NOT_EMPTY = "is-not-empty",
|
||||
}
|
||||
|
||||
export enum FolderFilterCondition {
|
||||
enum FolderFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
}
|
||||
|
||||
export enum FileNameFilterCondition {
|
||||
enum FileNameFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -196,7 +196,7 @@ export enum FileNameFilterCondition {
|
|||
ENDS_WITH = "ends-with",
|
||||
}
|
||||
|
||||
export type FilterCondition =
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
|
|
@ -207,7 +207,7 @@ export type FilterCondition =
|
|||
| FileNameFilterCondition;
|
||||
|
||||
//This matches the Obsidian property types
|
||||
export enum PropertyType {
|
||||
enum PropertyType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
|
|
@ -216,14 +216,14 @@ export enum PropertyType {
|
|||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
export enum FilterRuleType {
|
||||
enum FilterRuleType {
|
||||
PROPERTY = "property",
|
||||
FOLDER = "folder",
|
||||
FILE_NAME = "file-name",
|
||||
CONTENT = "content",
|
||||
}
|
||||
|
||||
export enum DatePropertyFilterValue {
|
||||
enum DatePropertyFilterValue {
|
||||
TODAY = "today",
|
||||
TOMORROW = "tomorrow",
|
||||
YESTERDAY = "yesterday",
|
||||
|
|
@ -244,35 +244,35 @@ interface BaseFilterRule {
|
|||
matchWhenPropertyDNE: boolean;
|
||||
}
|
||||
|
||||
export interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.TEXT;
|
||||
propertyName: string;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
export interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.NUMBER;
|
||||
propertyName: string;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
export interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.LIST;
|
||||
propertyName: string;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
export interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.CHECKBOX;
|
||||
propertyName: string;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
export interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.DATE | PropertyType.DATETIME;
|
||||
propertyName: string;
|
||||
|
|
@ -280,36 +280,36 @@ export interface DatePropertyFilterRule extends BaseFilterRule {
|
|||
valueData: string;
|
||||
}
|
||||
|
||||
export interface FolderFilterRule extends BaseFilterRule {
|
||||
interface FolderFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FOLDER;
|
||||
condition: FolderFilterCondition;
|
||||
includeSubfolders: boolean;
|
||||
}
|
||||
|
||||
export interface FileNameFilterRule extends BaseFilterRule {
|
||||
interface FileNameFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FILE_NAME;
|
||||
condition: FileNameFilterCondition;
|
||||
}
|
||||
|
||||
export interface ContentFilterRule extends BaseFilterRule {
|
||||
interface ContentFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.CONTENT;
|
||||
condition: ContentFilterCondition;
|
||||
}
|
||||
|
||||
export type TFilterRule =
|
||||
type TFilterRule =
|
||||
| PropertyFilterRule
|
||||
| FolderFilterRule
|
||||
| FileNameFilterRule
|
||||
| ContentFilterRule;
|
||||
|
||||
export type PropertyFilterRule =
|
||||
type PropertyFilterRule =
|
||||
| TextPropertyFilterRule
|
||||
| NumberPropertyFilterRule
|
||||
| ListPropertyFilterRule
|
||||
| CheckboxPropertyFilterRule
|
||||
| DatePropertyFilterRule;
|
||||
|
||||
export interface TFilterGroup {
|
||||
interface TFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
rules: TFilterRule[];
|
||||
|
|
|
|||
|
|
@ -40,33 +40,30 @@ export interface VaultExplorerPluginSettings_1_30_5 {
|
|||
logLevel: string;
|
||||
}
|
||||
|
||||
export type FileInteractionStyle = "title" | "content";
|
||||
type FileInteractionStyle = "title" | "content";
|
||||
|
||||
interface BaseView {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TTableView extends BaseView {}
|
||||
interface TTableView extends BaseView {}
|
||||
|
||||
export interface TListView extends BaseView {
|
||||
interface TListView extends BaseView {
|
||||
showTags: boolean;
|
||||
}
|
||||
|
||||
export interface TGridView extends BaseView {
|
||||
interface TGridView extends BaseView {
|
||||
coverImageSource: CoverImageSource;
|
||||
loadSocialMediaImage: boolean;
|
||||
}
|
||||
|
||||
export type CoverImageSource =
|
||||
| "frontmatter-only"
|
||||
| "frontmatter-and-body"
|
||||
| "off";
|
||||
type CoverImageSource = "frontmatter-only" | "frontmatter-and-body" | "off";
|
||||
|
||||
export interface TDashboardView extends BaseView {}
|
||||
interface TDashboardView extends BaseView {}
|
||||
|
||||
export type CollapseStyle = "no-new-lines" | "no-extra-new-lines";
|
||||
type CollapseStyle = "no-new-lines" | "no-extra-new-lines";
|
||||
|
||||
export interface TFeedView extends BaseView {
|
||||
interface TFeedView extends BaseView {
|
||||
collapseStyle: CollapseStyle;
|
||||
removeH1: boolean;
|
||||
lineClampSmall: number;
|
||||
|
|
@ -74,36 +71,36 @@ export interface TFeedView extends BaseView {
|
|||
lineClampLarge: number;
|
||||
}
|
||||
|
||||
export interface TRecommendedView extends BaseView {}
|
||||
interface TRecommendedView extends BaseView {}
|
||||
|
||||
export interface TRelatedView extends BaseView {}
|
||||
interface TRelatedView extends BaseView {}
|
||||
|
||||
interface BaseFilter {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface TSearchFilter extends BaseFilter {
|
||||
interface TSearchFilter extends BaseFilter {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface TFavoritesFilter extends BaseFilter {
|
||||
interface TFavoritesFilter extends BaseFilter {
|
||||
value: boolean;
|
||||
}
|
||||
|
||||
export interface TSortFilter extends BaseFilter {
|
||||
interface TSortFilter extends BaseFilter {
|
||||
value: SortFilterOption;
|
||||
}
|
||||
|
||||
export interface TTimestampFilter extends BaseFilter {
|
||||
interface TTimestampFilter extends BaseFilter {
|
||||
value: TimestampFilterOption;
|
||||
}
|
||||
|
||||
export interface TCustomFilter extends BaseFilter {
|
||||
interface TCustomFilter extends BaseFilter {
|
||||
selectedGroupId: string;
|
||||
groups: TFilterGroup[];
|
||||
}
|
||||
|
||||
export type TimestampFilterOption =
|
||||
type TimestampFilterOption =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
|
|
@ -112,18 +109,18 @@ export type TimestampFilterOption =
|
|||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
||||
export type SortFilterOption =
|
||||
type SortFilterOption =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc"
|
||||
| "random";
|
||||
|
||||
export type WordBreak = "normal" | "break-word";
|
||||
type WordBreak = "normal" | "break-word";
|
||||
|
||||
export type FlexWrap = "wrap" | "nowrap";
|
||||
type FlexWrap = "wrap" | "nowrap";
|
||||
|
||||
export enum TExplorerView {
|
||||
enum TExplorerView {
|
||||
DASHBOARD = "dashboard",
|
||||
GRID = "grid",
|
||||
LIST = "list",
|
||||
|
|
@ -133,9 +130,9 @@ export enum TExplorerView {
|
|||
RELATED = "related",
|
||||
}
|
||||
|
||||
export type FilterOperator = "and" | "or";
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
export enum TextFilterCondition {
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -146,14 +143,14 @@ export enum TextFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ListFilterCondition {
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum NumberFilterCondition {
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
|
|
@ -164,14 +161,14 @@ export enum NumberFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum CheckboxFilterCondition {
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum DateFilterCondition {
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
|
|
@ -181,19 +178,19 @@ export enum DateFilterCondition {
|
|||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
export enum ContentFilterCondition {
|
||||
enum ContentFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
IS_EMPTY = "is-empty",
|
||||
IS_NOT_EMPTY = "is-not-empty",
|
||||
}
|
||||
|
||||
export enum FolderFilterCondition {
|
||||
enum FolderFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
}
|
||||
|
||||
export enum FileNameFilterCondition {
|
||||
enum FileNameFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
|
|
@ -202,7 +199,7 @@ export enum FileNameFilterCondition {
|
|||
ENDS_WITH = "ends-with",
|
||||
}
|
||||
|
||||
export type FilterCondition =
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
|
|
@ -213,7 +210,7 @@ export type FilterCondition =
|
|||
| FileNameFilterCondition;
|
||||
|
||||
//This matches the Obsidian property types
|
||||
export enum PropertyType {
|
||||
enum PropertyType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
|
|
@ -222,14 +219,14 @@ export enum PropertyType {
|
|||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
export enum FilterRuleType {
|
||||
enum FilterRuleType {
|
||||
PROPERTY = "property",
|
||||
FOLDER = "folder",
|
||||
FILE_NAME = "file-name",
|
||||
CONTENT = "content",
|
||||
}
|
||||
|
||||
export enum DatePropertyFilterValue {
|
||||
enum DatePropertyFilterValue {
|
||||
TODAY = "today",
|
||||
TOMORROW = "tomorrow",
|
||||
YESTERDAY = "yesterday",
|
||||
|
|
@ -250,35 +247,35 @@ interface BaseFilterRule {
|
|||
matchWhenPropertyDNE: boolean;
|
||||
}
|
||||
|
||||
export interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.TEXT;
|
||||
propertyName: string;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
export interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.NUMBER;
|
||||
propertyName: string;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
export interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.LIST;
|
||||
propertyName: string;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
export interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.CHECKBOX;
|
||||
propertyName: string;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
export interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.DATE | PropertyType.DATETIME;
|
||||
propertyName: string;
|
||||
|
|
@ -286,36 +283,36 @@ export interface DatePropertyFilterRule extends BaseFilterRule {
|
|||
valueData: string;
|
||||
}
|
||||
|
||||
export interface FolderFilterRule extends BaseFilterRule {
|
||||
interface FolderFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FOLDER;
|
||||
condition: FolderFilterCondition;
|
||||
includeSubfolders: boolean;
|
||||
}
|
||||
|
||||
export interface FileNameFilterRule extends BaseFilterRule {
|
||||
interface FileNameFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FILE_NAME;
|
||||
condition: FileNameFilterCondition;
|
||||
}
|
||||
|
||||
export interface ContentFilterRule extends BaseFilterRule {
|
||||
interface ContentFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.CONTENT;
|
||||
condition: ContentFilterCondition;
|
||||
}
|
||||
|
||||
export type TFilterRule =
|
||||
type TFilterRule =
|
||||
| PropertyFilterRule
|
||||
| FolderFilterRule
|
||||
| FileNameFilterRule
|
||||
| ContentFilterRule;
|
||||
|
||||
export type PropertyFilterRule =
|
||||
type PropertyFilterRule =
|
||||
| TextPropertyFilterRule
|
||||
| NumberPropertyFilterRule
|
||||
| ListPropertyFilterRule
|
||||
| CheckboxPropertyFilterRule
|
||||
| DatePropertyFilterRule;
|
||||
|
||||
export interface TFilterGroup {
|
||||
interface TFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
rules: TFilterRule[];
|
||||
|
|
|
|||
327
src/types/types-1.39.0.ts
Normal file
327
src/types/types-1.39.0.ts
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
export interface VaultExplorerPluginSettings_1_39_0 {
|
||||
properties: {
|
||||
favorite: string;
|
||||
url: string;
|
||||
image: string;
|
||||
createdDate: string;
|
||||
modifiedDate: string;
|
||||
custom1: string;
|
||||
custom2: string;
|
||||
custom3: string;
|
||||
};
|
||||
filters: {
|
||||
search: TSearchFilter;
|
||||
favorites: TFavoritesFilter;
|
||||
sort: TSortFilter;
|
||||
timestamp: TTimestampFilter;
|
||||
custom: TCustomFilter;
|
||||
};
|
||||
views: {
|
||||
dashboard: TDashboardView;
|
||||
grid: TGridView;
|
||||
list: TListView;
|
||||
table: TTableView;
|
||||
feed: TFeedView;
|
||||
recommended: TRecommendedView;
|
||||
related: TRelatedView;
|
||||
};
|
||||
titleWrapping: WordBreak;
|
||||
enableClockUpdates: boolean;
|
||||
enableFileIcons: boolean;
|
||||
loadBodyTags: boolean;
|
||||
currentView: TExplorerView | null;
|
||||
pageSize: number;
|
||||
filterGroupsWidth: string;
|
||||
shouldWrapFilterGroups: boolean;
|
||||
viewOrder: TExplorerView[];
|
||||
configDir: string;
|
||||
pluginVersion: string | null;
|
||||
logLevel: string;
|
||||
}
|
||||
|
||||
export { TExplorerView as TExplorerView_1_39_0 };
|
||||
|
||||
interface BaseView {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
interface TTableView extends BaseView {}
|
||||
|
||||
interface TListView extends BaseView {
|
||||
showTags: boolean;
|
||||
}
|
||||
|
||||
interface TGridView extends BaseView {
|
||||
coverImageSources: CoverImageSource[];
|
||||
loadSocialMediaImage: boolean;
|
||||
}
|
||||
|
||||
interface CoverImageSource {
|
||||
type: CoverImageSourceType;
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
type CoverImageSourceType =
|
||||
| "image-property"
|
||||
| "url-property"
|
||||
| "frontmatter"
|
||||
| "body";
|
||||
|
||||
interface TDashboardView extends BaseView {}
|
||||
|
||||
type CollapseStyle = "no-new-lines" | "no-extra-new-lines";
|
||||
|
||||
interface TFeedView extends BaseView {
|
||||
collapseStyle: CollapseStyle;
|
||||
removeH1: boolean;
|
||||
lineClampSmall: number;
|
||||
lineClampMedium: number;
|
||||
lineClampLarge: number;
|
||||
}
|
||||
|
||||
interface TRecommendedView extends BaseView {}
|
||||
|
||||
interface TRelatedView extends BaseView {}
|
||||
|
||||
interface BaseFilter {
|
||||
isEnabled: boolean;
|
||||
}
|
||||
|
||||
interface TSearchFilter extends BaseFilter {
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface TFavoritesFilter extends BaseFilter {
|
||||
value: boolean;
|
||||
}
|
||||
|
||||
interface TSortFilter extends BaseFilter {
|
||||
value: SortFilterOption;
|
||||
}
|
||||
|
||||
interface TTimestampFilter extends BaseFilter {
|
||||
value: TimestampFilterOption;
|
||||
}
|
||||
|
||||
interface TCustomFilter extends BaseFilter {
|
||||
selectedGroupId: string;
|
||||
groups: TFilterGroup[];
|
||||
}
|
||||
|
||||
type TimestampFilterOption =
|
||||
| "created-today"
|
||||
| "modified-today"
|
||||
| "created-this-week"
|
||||
| "modified-this-week"
|
||||
| "created-2-weeks"
|
||||
| "modified-2-weeks"
|
||||
| "all";
|
||||
|
||||
type SortFilterOption =
|
||||
| "file-name-asc"
|
||||
| "file-name-desc"
|
||||
| "modified-asc"
|
||||
| "modified-desc"
|
||||
| "random";
|
||||
|
||||
type WordBreak = "normal" | "break-word";
|
||||
|
||||
enum TExplorerView {
|
||||
DASHBOARD = "dashboard",
|
||||
GRID = "grid",
|
||||
LIST = "list",
|
||||
FEED = "feed",
|
||||
TABLE = "table",
|
||||
RECOMMENDED = "recommended",
|
||||
RELATED = "related",
|
||||
}
|
||||
|
||||
type FilterOperator = "and" | "or";
|
||||
|
||||
enum TextFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
STARTS_WITH = "starts-with",
|
||||
ENDS_WITH = "ends-with",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
enum ListFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
enum NumberFilterCondition {
|
||||
IS_EQUAL = "is-equal",
|
||||
IS_NOT_EQUAL = "is-not-equal",
|
||||
IS_GREATER = "is-greater",
|
||||
IS_LESS = "is-less",
|
||||
IS_GREATER_OR_EQUAL = "is-greater-or-equal",
|
||||
IS_LESS_OR_EQUAL = "is-less-or-equal",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
enum CheckboxFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
enum DateFilterCondition {
|
||||
IS = "is",
|
||||
IS_BEFORE = "is-before",
|
||||
IS_AFTER = "is-after",
|
||||
IS_ON_OR_BEFORE = "is-on-or-before",
|
||||
IS_ON_OR_AFTER = "is-on-or-after",
|
||||
EXISTS = "exists",
|
||||
DOES_NOT_EXIST = "does-not-exist",
|
||||
}
|
||||
|
||||
enum ContentFilterCondition {
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
IS_EMPTY = "is-empty",
|
||||
IS_NOT_EMPTY = "is-not-empty",
|
||||
}
|
||||
|
||||
enum FolderFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
}
|
||||
|
||||
enum FileNameFilterCondition {
|
||||
IS = "is",
|
||||
IS_NOT = "is-not",
|
||||
CONTAINS = "contains",
|
||||
DOES_NOT_CONTAIN = "does-not-contain",
|
||||
STARTS_WITH = "starts-with",
|
||||
ENDS_WITH = "ends-with",
|
||||
}
|
||||
|
||||
type FilterCondition =
|
||||
| TextFilterCondition
|
||||
| NumberFilterCondition
|
||||
| DateFilterCondition
|
||||
| CheckboxFilterCondition
|
||||
| ListFilterCondition
|
||||
| ContentFilterCondition
|
||||
| FolderFilterCondition
|
||||
| FileNameFilterCondition;
|
||||
|
||||
//This matches the Obsidian property types
|
||||
enum PropertyType {
|
||||
TEXT = "text",
|
||||
NUMBER = "number",
|
||||
LIST = "list",
|
||||
CHECKBOX = "checkbox",
|
||||
DATE = "date",
|
||||
DATETIME = "datetime",
|
||||
}
|
||||
|
||||
enum FilterRuleType {
|
||||
PROPERTY = "property",
|
||||
FOLDER = "folder",
|
||||
FILE_NAME = "file-name",
|
||||
CONTENT = "content",
|
||||
}
|
||||
|
||||
enum DatePropertyFilterValue {
|
||||
TODAY = "today",
|
||||
TOMORROW = "tomorrow",
|
||||
YESTERDAY = "yesterday",
|
||||
ONE_WEEK_FROM_NOW = "one-week-from-now",
|
||||
ONE_WEEK_AGO = "one-week-ago",
|
||||
ONE_MONTH_FROM_NOW = "one-month-from-now",
|
||||
ONE_MONTH_AGO = "one-month-ago",
|
||||
CUSTOM = "custom",
|
||||
}
|
||||
|
||||
interface BaseFilterRule {
|
||||
id: string;
|
||||
operator: FilterOperator;
|
||||
type: FilterRuleType;
|
||||
condition: FilterCondition;
|
||||
isEnabled: boolean;
|
||||
value: string;
|
||||
matchWhenPropertyDNE: boolean;
|
||||
}
|
||||
|
||||
interface TextPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.TEXT;
|
||||
propertyName: string;
|
||||
condition: TextFilterCondition;
|
||||
}
|
||||
|
||||
interface NumberPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.NUMBER;
|
||||
propertyName: string;
|
||||
condition: NumberFilterCondition;
|
||||
}
|
||||
|
||||
interface ListPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.LIST;
|
||||
propertyName: string;
|
||||
condition: ListFilterCondition;
|
||||
}
|
||||
|
||||
interface CheckboxPropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.CHECKBOX;
|
||||
propertyName: string;
|
||||
condition: CheckboxFilterCondition;
|
||||
}
|
||||
|
||||
interface DatePropertyFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.PROPERTY;
|
||||
propertyType: PropertyType.DATE | PropertyType.DATETIME;
|
||||
propertyName: string;
|
||||
condition: DateFilterCondition;
|
||||
valueData: string;
|
||||
}
|
||||
|
||||
interface FolderFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FOLDER;
|
||||
condition: FolderFilterCondition;
|
||||
includeSubfolders: boolean;
|
||||
}
|
||||
|
||||
interface FileNameFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.FILE_NAME;
|
||||
condition: FileNameFilterCondition;
|
||||
}
|
||||
|
||||
interface ContentFilterRule extends BaseFilterRule {
|
||||
type: FilterRuleType.CONTENT;
|
||||
condition: ContentFilterCondition;
|
||||
}
|
||||
|
||||
type TFilterRule =
|
||||
| PropertyFilterRule
|
||||
| FolderFilterRule
|
||||
| FileNameFilterRule
|
||||
| ContentFilterRule;
|
||||
|
||||
type PropertyFilterRule =
|
||||
| TextPropertyFilterRule
|
||||
| NumberPropertyFilterRule
|
||||
| ListPropertyFilterRule
|
||||
| CheckboxPropertyFilterRule
|
||||
| DatePropertyFilterRule;
|
||||
|
||||
interface TFilterGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
rules: TFilterRule[];
|
||||
isEnabled: boolean;
|
||||
isSticky: boolean;
|
||||
}
|
||||
|
|
@ -21,20 +21,12 @@
|
|||
},
|
||||
"sort": {
|
||||
"isEnabled": true,
|
||||
"value": "modified-desc"
|
||||
"value": "file-name-asc"
|
||||
},
|
||||
"custom": {
|
||||
"isEnabled": true,
|
||||
"selectedGroupId": "A3PgwC3AaYu1XqDn",
|
||||
"groups": [
|
||||
{
|
||||
"id": "A3PgwC3AaYu1XqDn",
|
||||
"name": "Group 1",
|
||||
"rules": [],
|
||||
"isEnabled": true,
|
||||
"isSticky": false
|
||||
}
|
||||
]
|
||||
"selectedGroupId": "",
|
||||
"groups": []
|
||||
},
|
||||
"favorites": {
|
||||
"isEnabled": true,
|
||||
|
|
@ -95,13 +87,14 @@
|
|||
"isEnabled": false
|
||||
}
|
||||
},
|
||||
"currentView": "table",
|
||||
"currentView": "grid",
|
||||
"titleWrapping": "normal",
|
||||
"enableClockUpdates": true,
|
||||
"enableFileIcons": true,
|
||||
"loadBodyTags": true,
|
||||
"filterGroupsWidth": "759px",
|
||||
"filterGroupsWidth": "69px",
|
||||
"shouldWrapFilterGroups": false,
|
||||
"shouldCollapseFilters": false,
|
||||
"pageSize": 25,
|
||||
"viewOrder": [
|
||||
"grid",
|
||||
|
|
@ -110,6 +103,6 @@
|
|||
"feed"
|
||||
],
|
||||
"configDir": ".vaultexplorer",
|
||||
"pluginVersion": "1.39.0",
|
||||
"pluginVersion": "1.40.0",
|
||||
"logLevel": "trace"
|
||||
}
|
||||
|
|
@ -1,89 +1,106 @@
|
|||
import { preformMigrations } from "src/migrations";
|
||||
import { isVaultExplorerPluginSettings } from "src/types/index.guard";
|
||||
import { TextFilterCondition_0_3_3, VaultExplorerPluginSettings_0_3_3 } from "src/types/types-0.3.3";
|
||||
import { CheckboxFilterCondition_0_5_5, DateFilterCondition_0_5_5, ListFilterCondition_0_5_5, NumberFilterCondition_0_5_5, PropertyFilterType_0_5_5, TextFilterCondition_0_5_5, VaultExplorerPluginSettings_0_5_5 } from "src/types/types-0.5.5";
|
||||
import {
|
||||
TextFilterCondition_0_3_3,
|
||||
VaultExplorerPluginSettings_0_3_3,
|
||||
} from "src/types/types-0.3.3";
|
||||
import {
|
||||
CheckboxFilterCondition_0_5_5,
|
||||
DateFilterCondition_0_5_5,
|
||||
ListFilterCondition_0_5_5,
|
||||
NumberFilterCondition_0_5_5,
|
||||
PropertyFilterType_0_5_5,
|
||||
TextFilterCondition_0_5_5,
|
||||
VaultExplorerPluginSettings_0_5_5,
|
||||
} from "src/types/types-0.5.5";
|
||||
|
||||
describe("preformMigrations", () => {
|
||||
it("should migrate from 0.3.3 to the latest version", () => {
|
||||
//Arrange
|
||||
const settingsData: VaultExplorerPluginSettings_0_3_3 = {
|
||||
"properties": {
|
||||
"favorite": "note-123",
|
||||
"url": "https://example.com",
|
||||
"custom1": "custom-value-1",
|
||||
"custom2": "custom-value-2",
|
||||
"custom3": "custom-value-3"
|
||||
properties: {
|
||||
favorite: "note-123",
|
||||
url: "https://example.com",
|
||||
custom1: "custom-value-1",
|
||||
custom2: "custom-value-2",
|
||||
custom3: "custom-value-3",
|
||||
},
|
||||
"filters": {
|
||||
"folder": "MyNotes",
|
||||
"search": "project",
|
||||
"onlyFavorites": true,
|
||||
"sort": "file-name-asc",
|
||||
"timestamp": "created-today",
|
||||
"properties": {
|
||||
"selectedGroupId": "group-1",
|
||||
"groups": [
|
||||
filters: {
|
||||
folder: "MyNotes",
|
||||
search: "project",
|
||||
onlyFavorites: true,
|
||||
sort: "file-name-asc",
|
||||
timestamp: "created-today",
|
||||
properties: {
|
||||
selectedGroupId: "group-1",
|
||||
groups: [
|
||||
{
|
||||
"id": "group-1",
|
||||
"name": "Project Filters",
|
||||
"filters": [
|
||||
id: "group-1",
|
||||
name: "Project Filters",
|
||||
filters: [
|
||||
{
|
||||
"id": "filter-1",
|
||||
"propertyName": "status",
|
||||
"operator": "and",
|
||||
"isEnabled": true,
|
||||
"condition": TextFilterCondition_0_3_3.IS,
|
||||
"value": "active"
|
||||
id: "filter-1",
|
||||
propertyName: "status",
|
||||
operator: "and",
|
||||
isEnabled: true,
|
||||
condition: TextFilterCondition_0_3_3.IS,
|
||||
value: "active",
|
||||
},
|
||||
{
|
||||
"id": "filter-2",
|
||||
"propertyName": "priority",
|
||||
"operator": "or",
|
||||
"isEnabled": false,
|
||||
"condition": TextFilterCondition_0_3_3.CONTAINS,
|
||||
"value": "high"
|
||||
}
|
||||
id: "filter-2",
|
||||
propertyName: "priority",
|
||||
operator: "or",
|
||||
isEnabled: false,
|
||||
condition:
|
||||
TextFilterCondition_0_3_3.CONTAINS,
|
||||
value: "high",
|
||||
},
|
||||
],
|
||||
"position": 0,
|
||||
"isEnabled": true
|
||||
position: 0,
|
||||
isEnabled: true,
|
||||
},
|
||||
{
|
||||
"id": "group-2",
|
||||
"name": "Personal Filters",
|
||||
"filters": [
|
||||
id: "group-2",
|
||||
name: "Personal Filters",
|
||||
filters: [
|
||||
{
|
||||
"id": "filter-3",
|
||||
"propertyName": "tag",
|
||||
"operator": "and",
|
||||
"isEnabled": true,
|
||||
"condition": TextFilterCondition_0_3_3.STARTS_WITH,
|
||||
"value": "work"
|
||||
id: "filter-3",
|
||||
propertyName: "tag",
|
||||
operator: "and",
|
||||
isEnabled: true,
|
||||
condition:
|
||||
TextFilterCondition_0_3_3.STARTS_WITH,
|
||||
value: "work",
|
||||
},
|
||||
{
|
||||
"id": "filter-4",
|
||||
"propertyName": "deadline",
|
||||
"operator": "or",
|
||||
"isEnabled": true,
|
||||
"condition": TextFilterCondition_0_3_3.IS_NOT_EMPTY,
|
||||
"value": ""
|
||||
}
|
||||
id: "filter-4",
|
||||
propertyName: "deadline",
|
||||
operator: "or",
|
||||
isEnabled: true,
|
||||
condition:
|
||||
TextFilterCondition_0_3_3.IS_NOT_EMPTY,
|
||||
value: "",
|
||||
},
|
||||
],
|
||||
"position": 1,
|
||||
"isEnabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
position: 1,
|
||||
isEnabled: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
"currentView": "grid",
|
||||
"pageSize": 20,
|
||||
"pluginVersion": "0.3.3"
|
||||
}
|
||||
currentView: "grid",
|
||||
pageSize: 20,
|
||||
pluginVersion: "0.3.3",
|
||||
};
|
||||
|
||||
//Same guard clause as in main.js
|
||||
if (settingsData.pluginVersion === null) return;
|
||||
|
||||
//Act
|
||||
const result = preformMigrations(settingsData.pluginVersion, settingsData as unknown as Record<string, unknown>);
|
||||
const result = preformMigrations(
|
||||
settingsData.pluginVersion,
|
||||
settingsData as unknown as Record<string, unknown>
|
||||
);
|
||||
|
||||
//Assert
|
||||
expect(isVaultExplorerPluginSettings(result)).toBe(true);
|
||||
|
|
@ -97,7 +114,7 @@ describe("preformMigrations", () => {
|
|||
url: "https://example.com",
|
||||
custom1: "customValue1",
|
||||
custom2: "customValue2",
|
||||
custom3: "customValue3"
|
||||
custom3: "customValue3",
|
||||
},
|
||||
filters: {
|
||||
folder: "root",
|
||||
|
|
@ -119,7 +136,8 @@ describe("preformMigrations", () => {
|
|||
type: PropertyFilterType_0_5_5.TEXT,
|
||||
isEnabled: true,
|
||||
value: "example",
|
||||
condition: TextFilterCondition_0_5_5.CONTAINS
|
||||
condition:
|
||||
TextFilterCondition_0_5_5.CONTAINS,
|
||||
},
|
||||
{
|
||||
id: "filter2",
|
||||
|
|
@ -128,11 +146,12 @@ describe("preformMigrations", () => {
|
|||
type: PropertyFilterType_0_5_5.NUMBER,
|
||||
isEnabled: true,
|
||||
value: "100",
|
||||
condition: NumberFilterCondition_0_5_5.IS_GREATER
|
||||
}
|
||||
condition:
|
||||
NumberFilterCondition_0_5_5.IS_GREATER,
|
||||
},
|
||||
],
|
||||
position: 1,
|
||||
isEnabled: true
|
||||
isEnabled: true,
|
||||
},
|
||||
{
|
||||
id: "group2",
|
||||
|
|
@ -145,7 +164,8 @@ describe("preformMigrations", () => {
|
|||
type: PropertyFilterType_0_5_5.LIST,
|
||||
isEnabled: true,
|
||||
value: "important",
|
||||
condition: ListFilterCondition_0_5_5.CONTAINS
|
||||
condition:
|
||||
ListFilterCondition_0_5_5.CONTAINS,
|
||||
},
|
||||
{
|
||||
id: "filter4",
|
||||
|
|
@ -154,7 +174,7 @@ describe("preformMigrations", () => {
|
|||
type: PropertyFilterType_0_5_5.CHECKBOX,
|
||||
isEnabled: true,
|
||||
value: "true",
|
||||
condition: CheckboxFilterCondition_0_5_5.IS
|
||||
condition: CheckboxFilterCondition_0_5_5.IS,
|
||||
},
|
||||
{
|
||||
id: "filter5",
|
||||
|
|
@ -163,25 +183,29 @@ describe("preformMigrations", () => {
|
|||
type: PropertyFilterType_0_5_5.DATE,
|
||||
isEnabled: true,
|
||||
value: "2023-01-01",
|
||||
condition: DateFilterCondition_0_5_5.IS_AFTER
|
||||
}
|
||||
condition:
|
||||
DateFilterCondition_0_5_5.IS_AFTER,
|
||||
},
|
||||
],
|
||||
position: 2,
|
||||
isEnabled: true
|
||||
}
|
||||
]
|
||||
}
|
||||
isEnabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
currentView: "list",
|
||||
pageSize: 20,
|
||||
pluginVersion: "0.4.0"
|
||||
pluginVersion: "0.4.0",
|
||||
};
|
||||
|
||||
//This the same guard clause as in main.js
|
||||
if (settingsData.pluginVersion === null) return;
|
||||
|
||||
//Act
|
||||
const result = preformMigrations(settingsData.pluginVersion, settingsData as unknown as Record<string, unknown>);
|
||||
const result = preformMigrations(
|
||||
settingsData.pluginVersion,
|
||||
settingsData as unknown as Record<string, unknown>
|
||||
);
|
||||
|
||||
//Assert
|
||||
expect(isVaultExplorerPluginSettings(result)).toBe(true);
|
||||
|
|
|
|||
|
|
@ -131,5 +131,6 @@
|
|||
"1.37.1": "1.4.13",
|
||||
"1.37.2": "1.4.13",
|
||||
"1.38.0": "1.4.13",
|
||||
"1.39.0": "1.4.13"
|
||||
"1.39.0": "1.4.13",
|
||||
"1.40.0": "1.4.13"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue