mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 16:30:27 +00:00
- Updated package.json to include dependencies for rehype and remark plugins for markdown processing. - Added default highlight.js CSS for code highlighting. - Included KaTeX CSS for rendering mathematical expressions. - Created markdown.css for styling markdown content in the Obsidian plugin, incorporating styles for headings, paragraphs, lists, tables, and code blocks. - Customized highlight.js colors to match Obsidian theme.
37 lines
No EOL
702 B
TypeScript
37 lines
No EOL
702 B
TypeScript
import { ItemView, WorkspaceLeaf } from 'obsidian';
|
|
import { mount, unmount } from 'svelte';
|
|
import ChatWindow from 'Components/ChatWindow.svelte';
|
|
|
|
export const VIEW_TYPE_MAIN = 'main-view';
|
|
|
|
export class MainView extends ItemView {
|
|
constructor(leaf: WorkspaceLeaf) {
|
|
super(leaf);
|
|
}
|
|
|
|
input: ReturnType<typeof ChatWindow> | undefined;
|
|
|
|
getViewType() {
|
|
return VIEW_TYPE_MAIN;
|
|
}
|
|
|
|
getDisplayText() {
|
|
return 'Main View';
|
|
}
|
|
|
|
async onOpen() {
|
|
const container = this.contentEl;
|
|
container.empty();
|
|
|
|
this.input = mount(ChatWindow, {
|
|
target: container,
|
|
props: {}
|
|
});
|
|
}
|
|
|
|
async onClose() {
|
|
if (this.input) {
|
|
unmount(this.input);
|
|
}
|
|
}
|
|
} |