generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: move properties into their own key * feat: add properties filter data structure * feat: add property filters app * feat: add switch * feat: add divider * feat: add basic property filter modal content * fix: resolve properties not saving * refactor: rename to app * refactor: move into components folder * refactor: rename to group 1 * fix: resolve settings not updating * fix: resolve settings being reset * refactor: simplify code * fix: set folder to root by default * feat: implement property filter display * refactor: use uppercase * fix: remove need for redux * refactor: remove unneeded code * feat: add property filtering * fix: resolve property filtering
- Loading branch information
Showing
56 changed files
with
1,161 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
{ | ||
"name": "obsidian-vault-explorer", | ||
"version": "0.0.18", | ||
"description": "Explore your vault in visual format", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "node esbuild.config.mjs", | ||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", | ||
"version": "node version-bump.mjs && git add manifest.json versions.json" | ||
}, | ||
"keywords": [], | ||
"author": "Trey Wallis", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/bun": "latest", | ||
"@types/lodash": "^4.17.0", | ||
"@types/node": "^16.11.6", | ||
"@types/react": "^18.2.65", | ||
"@types/react-dom": "^18.2.21", | ||
"@typescript-eslint/eslint-plugin": "5.29.0", | ||
"@typescript-eslint/parser": "5.29.0", | ||
"builtin-modules": "3.3.0", | ||
"esbuild": "0.17.3", | ||
"obsidian": "latest", | ||
"tslib": "2.4.0", | ||
"typescript": "4.7.4" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.21", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-virtuoso": "^4.7.2" | ||
} | ||
"name": "obsidian-vault-explorer", | ||
"version": "0.0.18", | ||
"description": "Explore your vault in visual format", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "node esbuild.config.mjs", | ||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", | ||
"version": "node version-bump.mjs && git add manifest.json versions.json" | ||
}, | ||
"keywords": [], | ||
"author": "Trey Wallis", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/bun": "latest", | ||
"@types/lodash": "^4.17.0", | ||
"@types/node": "^16.11.6", | ||
"@types/react": "^18.2.65", | ||
"@types/react-dom": "^18.2.21", | ||
"@typescript-eslint/eslint-plugin": "5.29.0", | ||
"@typescript-eslint/parser": "5.29.0", | ||
"builtin-modules": "3.3.0", | ||
"esbuild": "0.17.3", | ||
"obsidian": "latest", | ||
"tslib": "2.4.0", | ||
"typescript": "4.7.4" | ||
}, | ||
"dependencies": { | ||
"@reduxjs/toolkit": "^2.2.3", | ||
"lodash": "^4.17.21", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-redux": "^9.1.1", | ||
"react-virtuoso": "^4.7.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,33 @@ | ||
import { VaultExplorerPluginSettings } from "./types"; | ||
|
||
export const VAULT_EXPLORER_VIEW = "vault-explorer"; | ||
|
||
export const DEFAULT_SETTINGS: VaultExplorerPluginSettings = { | ||
properties: { | ||
favorite: "", | ||
url: "", | ||
source: "", | ||
status: "", | ||
}, | ||
filters: { | ||
folder: "/", | ||
search: "", | ||
onlyFavorites: false, | ||
timestamp: "all", | ||
sort: "file-name-asc", | ||
properties: { | ||
selectedGroupId: "0", | ||
groups: | ||
[ | ||
{ | ||
id: "0", | ||
name: "Group 1", | ||
filters: [], | ||
position: 0, | ||
isEnabled: true | ||
} | ||
] | ||
} | ||
}, | ||
currentView: "grid", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export type PluginEvent = "rename-file" | "create-file" | "delete-file" | "modify-file" | "metadata-change"; | ||
export type PluginEvent = "rename-file" | "create-file" | "delete-file" | "modify-file" | "metadata-change" | "properties-filter-update"; | ||
|
||
export type EventCallback = (...data: unknown[]) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { App, Modal } from "obsidian"; | ||
import React from "react"; | ||
import { Root, createRoot } from "react-dom/client"; | ||
import { Provider } from "react-redux"; | ||
import AppMountProvider from "src/react/components/shared/app-mount-provider"; | ||
import PropertiesFilterApp from "src/react/components/properties-filter-app"; | ||
import { store } from "src/redux/store"; | ||
import { getCurrentSettings, onSettingsChange } from "src/types"; | ||
|
||
export default class PropertiesFilterModal extends Modal { | ||
root: Root | null; | ||
app: App; | ||
getCurrentSettings: getCurrentSettings; | ||
onSettingsChange: onSettingsChange; | ||
|
||
constructor( | ||
app: App, | ||
getCurrentSettings: getCurrentSettings, | ||
onSettingsChange: onSettingsChange | ||
) { | ||
super(app); | ||
this.root = null; | ||
this.app = app; | ||
this.getCurrentSettings = getCurrentSettings; | ||
this.onSettingsChange = onSettingsChange; | ||
} | ||
|
||
onOpen(): void { | ||
const { contentEl } = this; | ||
|
||
const root = createRoot(contentEl); | ||
root.render( | ||
<React.StrictMode> | ||
<Provider store={store}> | ||
<AppMountProvider | ||
app={this.app} | ||
getCurrentSettings={this.getCurrentSettings} | ||
onSettingsChange={this.onSettingsChange} | ||
> | ||
<PropertiesFilterApp /> | ||
</AppMountProvider> | ||
</Provider> | ||
</React.StrictMode> | ||
); | ||
this.root = root; | ||
} | ||
|
||
onClose(): void { | ||
const { contentEl } = this; | ||
this.root?.unmount(); | ||
contentEl.empty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.