mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
- Add AssetsService to manage plugin icon and banner assets - Update sidebar, ribbon, and quick actions to use new icon - Add plugin banner to help modal welcome section - Update help text to reference "plugin icon" instead of "sparkles icon"
33 lines
No EOL
976 B
TypeScript
33 lines
No EOL
976 B
TypeScript
import type VaultkeeperAIPlugin from "main";
|
|
import { Resolve } from "./DependencyService";
|
|
import { Services } from "./Services";
|
|
import { addIcon } from "obsidian";
|
|
|
|
export class AssetsService {
|
|
|
|
private readonly plugin: VaultkeeperAIPlugin;
|
|
|
|
public pluginIcon: string = "";
|
|
public bannerSource: string = "";
|
|
|
|
public constructor() {
|
|
this.plugin = Resolve<VaultkeeperAIPlugin>(Services.VaultkeeperAIPlugin);
|
|
}
|
|
|
|
public async loadAssets(): Promise<void> {
|
|
this.pluginIcon = this.addIcon(
|
|
await this.plugin.app.vault.adapter.read(`${this.plugin.manifest.dir}/Assets/vaultkeeper-mono.svg`),
|
|
"vaultkeeper-ai-icon"
|
|
);
|
|
|
|
this.bannerSource = this.plugin.app.vault.adapter.getResourcePath(
|
|
`${this.plugin.manifest.dir}/Assets/vaultkeeper-social-1280x330.png`
|
|
);
|
|
}
|
|
|
|
private addIcon(icon: string, name: string): string {
|
|
addIcon(name, icon);
|
|
return name;
|
|
}
|
|
|
|
} |