mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-16 09:36:00 +00:00
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { WorkspaceLeaf } from "../../../deps.ts";
|
|
import GlobalHistoryComponent from "./GlobalHistory.svelte";
|
|
import type ObsidianLiveSyncPlugin from "../../../main.ts";
|
|
import { SvelteItemView } from "../../../common/SvelteItemView.ts";
|
|
import { mount } from "svelte";
|
|
|
|
export const VIEW_TYPE_GLOBAL_HISTORY = "global-history";
|
|
export class GlobalHistoryView extends SvelteItemView {
|
|
instantiateComponent(target: HTMLElement) {
|
|
return mount(GlobalHistoryComponent, {
|
|
target: target,
|
|
props: {
|
|
plugin: this.plugin,
|
|
},
|
|
});
|
|
}
|
|
|
|
plugin: ObsidianLiveSyncPlugin;
|
|
override icon = "clock";
|
|
title: string = "";
|
|
override navigation = true;
|
|
|
|
override getIcon(): string {
|
|
return "clock";
|
|
}
|
|
|
|
constructor(leaf: WorkspaceLeaf, plugin: ObsidianLiveSyncPlugin) {
|
|
super(leaf);
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
getViewType() {
|
|
return VIEW_TYPE_GLOBAL_HISTORY;
|
|
}
|
|
|
|
getDisplayText() {
|
|
return "Vault history";
|
|
}
|
|
}
|