From 0c600c6981188703ac1e85977730739e023f41e1 Mon Sep 17 00:00:00 2001 From: Kacper Kula Date: Thu, 18 Sep 2025 11:12:39 +0100 Subject: [PATCH] chore: removing deprecated module --- src/modules/debug/DityGraphView.ts | 43 ------------------------------ src/modules/debug/dityGraph.ts | 34 ----------------------- src/modules/debug/module.ts | 16 ----------- 3 files changed, 93 deletions(-) delete mode 100644 src/modules/debug/DityGraphView.ts delete mode 100644 src/modules/debug/dityGraph.ts delete mode 100644 src/modules/debug/module.ts diff --git a/src/modules/debug/DityGraphView.ts b/src/modules/debug/DityGraphView.ts deleted file mode 100644 index 27e522c..0000000 --- a/src/modules/debug/DityGraphView.ts +++ /dev/null @@ -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 - } -} \ No newline at end of file diff --git a/src/modules/debug/dityGraph.ts b/src/modules/debug/dityGraph.ts deleted file mode 100644 index c2e8803..0000000 --- a/src/modules/debug/dityGraph.ts +++ /dev/null @@ -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) - - } - } -} \ No newline at end of file diff --git a/src/modules/debug/module.ts b/src/modules/debug/module.ts deleted file mode 100644 index ed01a98..0000000 --- a/src/modules/debug/module.ts +++ /dev/null @@ -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