Skip to content

Commit 7fa0261

Browse files
authored
Merge pull request #295 from decaf-dev/dev
1.39.0
2 parents 410f6d7 + cd72249 commit 7fa0261

File tree

19 files changed

+673
-48
lines changed

19 files changed

+673
-48
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "vault-explorer",
33
"name": "Vault Explorer",
4-
"version": "1.38.0",
4+
"version": "1.39.0",
55
"minAppVersion": "1.4.13",
66
"description": "Explore your vault in visual format",
77
"author": "DecafDev",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-vault-explorer",
3-
"version": "1.38.0",
3+
"version": "1.39.0",
44
"description": "Explore your vault in visual format",
55
"main": "main.js",
66
"scripts": {

src/constants.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ export const DEFAULT_SETTINGS: VaultExplorerPluginSettings = {
9595
filterGroupsWidth: "300px",
9696
shouldWrapFilterGroups: false,
9797
pageSize: 25,
98-
viewOrder: [TExplorerView.GRID, TExplorerView.LIST, TExplorerView.FEED],
98+
viewOrder: [
99+
TExplorerView.GRID,
100+
TExplorerView.LIST,
101+
TExplorerView.TABLE,
102+
TExplorerView.FEED,
103+
],
99104
configDir: ".vaultexplorer",
100105
pluginVersion: null,
101106
logLevel: LOG_LEVEL_WARN,

src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { PluginEvent } from "./event/types";
1919
import { isVersionLessThan } from "./utils";
2020
import License from "./svelte/shared/services/license";
2121
import { clearSocialMediaImageCache } from "./svelte/app/services/social-media-image-cache";
22+
import store from "./svelte/shared/services/store";
2223

2324
export default class VaultExplorerPlugin extends Plugin {
2425
settings: VaultExplorerPluginSettings = DEFAULT_SETTINGS;
@@ -28,6 +29,8 @@ export default class VaultExplorerPlugin extends Plugin {
2829
await this.loadSettings();
2930
this.setupLogger();
3031

32+
store.plugin.set(this);
33+
3134
await License.getInstance().loadStoredKey();
3235

3336
this.registerView(

src/migrations/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import Migrate_1_31_0 from "./migrate_1_31_0";
2828
import Migrate_1_33_0 from "./migrate_1_33_0";
2929
import Migrate_1_37_0 from "./migrate_1_37_0";
3030
import Migrate_1_38_0 from "./migrate_1_38_0";
31+
import Migrate_1_39_0 from "./migrate_1_39_0";
3132

3233
const migrations: TMigration[] = [
3334
{
@@ -165,6 +166,11 @@ const migrations: TMigration[] = [
165166
to: "1.38.0",
166167
migrate: Migrate_1_38_0,
167168
},
169+
{
170+
from: "1.38.0",
171+
to: "1.39.0",
172+
migrate: Migrate_1_39_0,
173+
},
168174
];
169175

170176
export const preformMigrations = (

src/migrations/migrate_1_38_0.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { VaultExplorerPluginSettings_1_37_2 } from "src/types/types-1-37-0";
22
import MigrationInterface from "./migration_interface";
33
import { VaultExplorerPluginSettings } from "src/types";
4+
import { VaultExplorerPluginSettings_1_38_0 } from "src/types/types-1.38.0";
45

56
export default class Migrate_1_38_0 implements MigrationInterface {
67
migrate(data: Record<string, unknown>) {
7-
const typedData = data as unknown as VaultExplorerPluginSettings_1_37_2;
8+
const typedData = data as unknown as VaultExplorerPluginSettings_1_38_0;
89
const newData: VaultExplorerPluginSettings = {
910
...typedData,
1011
loadBodyTags: true,

src/migrations/migrate_1_39_0.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import MigrationInterface from "./migration_interface";
2+
import { TExplorerView, VaultExplorerPluginSettings } from "src/types";
3+
import { VaultExplorerPluginSettings_1_38_0 } from "src/types/types-1.38.0";
4+
5+
export default class Migrate_1_39_0 implements MigrationInterface {
6+
migrate(data: Record<string, unknown>) {
7+
const typedData = data as unknown as VaultExplorerPluginSettings_1_38_0;
8+
const newData: VaultExplorerPluginSettings = {
9+
...typedData,
10+
viewOrder: [
11+
TExplorerView.GRID,
12+
TExplorerView.LIST,
13+
TExplorerView.TABLE,
14+
TExplorerView.FEED,
15+
],
16+
views: {
17+
...typedData.views,
18+
table: {
19+
isEnabled: true,
20+
},
21+
},
22+
};
23+
24+
return newData as unknown as Record<string, unknown>;
25+
}
26+
}

src/obsidian/vault-explorer-settings-tab.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ export default class VaultExplorerSettingsTab extends PluginSettingTab {
247247

248248
new Setting(containerEl).setName("Table view").addToggle((toggle) =>
249249
toggle
250-
.setDisabled(true) //TODO implement
251-
.setTooltip("This view is not yet implemented.")
252250
.setValue(this.plugin.settings.views.table.isEnabled)
253251
.onChange(async (value) => {
254252
this.plugin.settings.views.table.isEnabled = value;

src/obsidian/vault-explorer-view.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ItemView, WorkspaceLeaf } from "obsidian";
22

33
import { VAULT_EXPLORER_VIEW } from "src/constants";
44
import VaultExplorerApp from "../svelte/app/index.svelte";
5-
import store from "../svelte/shared/services/store";
65
import VaultExplorerPlugin from "src/main";
76

87
export default class VaultExplorerView extends ItemView {
@@ -35,7 +34,6 @@ export default class VaultExplorerView extends ItemView {
3534

3635
const containerEl = this.containerEl.children[1];
3736

38-
store.plugin.set(this.plugin);
3937
this.component = new VaultExplorerApp({
4038
target: containerEl,
4139
});

src/svelte/app/components/feed-card.svelte

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
const dispatch = createEventDispatcher();
5050
5151
let plugin: VaultExplorerPlugin;
52-
store.plugin.subscribe((value) => {
53-
plugin = value;
52+
store.plugin.subscribe((p) => {
53+
plugin = p;
5454
enableFileIcons = plugin.settings.enableFileIcons;
5555
removeH1 = plugin.settings.views.feed.removeH1;
5656
collapseStyle = plugin.settings.views.feed.collapseStyle;
@@ -158,10 +158,6 @@
158158
});
159159
}
160160
161-
function handleTitleContextMenu(e: Event) {
162-
handleCardContextMenu(e);
163-
}
164-
165161
function handleCardMouseOver(e: MouseEvent) {
166162
const targetEl = e.currentTarget as HTMLElement;
167163
plugin.app.workspace.trigger("hover-link", {
@@ -233,14 +229,6 @@
233229
role="link"
234230
class="vault-explorer-feed-card__title"
235231
on:focus={() => {}}
236-
on:click={(e) => {
237-
e.preventDefault();
238-
handleTitleClick();
239-
}}
240-
on:contextmenu={(e) => {
241-
e.preventDefault();
242-
handleTitleContextMenu(e);
243-
}}
244232
on:keydown={(e) => {
245233
if (e.key === "Enter" || e.key === " ") {
246234
e.preventDefault();
@@ -285,7 +273,7 @@
285273
}
286274
287275
.vault-explorer-feed-card:focus-visible {
288-
box-shadow: 0 0 0 3px var(--background-modifier-border-focus);
276+
box-shadow: 0 0 0 3px var(--background-modifier-focus);
289277
}
290278
291279
.vault-explorer-feed-card__title {

0 commit comments

Comments
 (0)