chore: removing deprecated module

This commit is contained in:
Kacper Kula 2025-09-18 11:12:39 +01:00
parent df1bf46413
commit 0c600c6981
3 changed files with 0 additions and 93 deletions

View file

@ -1,43 +0,0 @@
import { ItemView, WorkspaceLeaf } from "obsidian";
import { DityGraph } from '@hypersphere/dity-graph'
import { mainModule } from "../main/module";
import { settingsModule } from "../settings/module";
export const VIEW_TYPE_EXAMPLE = "example-view";
export class DityGraphView extends ItemView {
constructor(leaf: WorkspaceLeaf) {
super(leaf);
}
getViewType() {
return VIEW_TYPE_EXAMPLE;
}
getDisplayText() {
return "Example sidebar";
}
async onOpen() {
const container = this.containerEl.children[1];
container.empty();
// container.createEl("h4", { text: "Example Sidebar" });
// container.createEl("p", { text: "Your sidebar content goes here" });
const el = container.createEl('div')
el.style = 'width: 100%; height: 100%'
const module = settingsModule.resolve({ plugin: { } as any, app: {} as any, cellParser: { } as any})
// .resolve({
// 'obsidian.app': {} as any,
// 'obsidian.plugin': {} as any,
// 'obsidian.vault': {} as any,
// })
const dityGraph = new DityGraph(module as any, el)
dityGraph.render()
}
async onClose() {
// Clean up if needed
}
}

View file

@ -1,34 +0,0 @@
import { Plugin, WorkspaceLeaf } from "obsidian";
import { DityGraphView, VIEW_TYPE_EXAMPLE } from "./DityGraphView";
export class DityGraph {
make(plugin: Plugin) {
const activateView = async () => {
const { workspace } = plugin.app;
let leaf: WorkspaceLeaf | null = null;
const leaves = workspace.getLeavesOfType(VIEW_TYPE_EXAMPLE);
if (leaves.length > 0) {
// A leaf with our view already exists, use that
leaf = leaves[0];
} else {
// Our view could not be found in the workspace, create a new leaf
// in the right sidebar for it
leaf = workspace.getRightLeaf(false);
if (!leaf) { return }
await leaf.setViewState({ type: VIEW_TYPE_EXAMPLE, active: true });
}
// "Reveal" the leaf in case it is in a collapsed sidebar
workspace.revealLeaf(leaf);
}
return () => {
plugin.registerView(VIEW_TYPE_EXAMPLE, leaf => new DityGraphView(leaf))
plugin.addRibbonIcon('dice', 'Dity Graph', activateView)
}
}
}

View file

@ -1,16 +0,0 @@
import { asFactory, buildContainer } from "@hypersphere/dity";
import { DityGraph } from "./dityGraph";
import { Plugin } from "obsidian";
export const debugModule = buildContainer(c =>
c
.register({
init: asFactory(DityGraph)
})
.exports('init')
.externals<{
plugin: Plugin
}>()
)
export type DebugModule = typeof debugModule