refactor(code): various code improvements and fixes

This commit is contained in:
Uglyboy 2026-04-22 06:22:15 +08:00
parent 48421feda2
commit 6972e91405
6 changed files with 7 additions and 7 deletions

View file

@ -11,7 +11,7 @@ import {
loadMemory,
loadScrollafterchoice,
} from "@inkweave/plugins";
import type { PluginSettings } from "settings";
import type { PluginSettings } from "./settings";
const PLUGIN_LOADER: Record<keyof PluginSettings, () => void> = {
audio: loadAudio,

View file

@ -1,5 +1,5 @@
import { MarkdownView } from "obsidian";
import type InkWeavePlugin from "./plugin";
import type InkWeavePlugin from "./main";
export const setupCommands = (plugin: InkWeavePlugin) => {
const commandText = plugin.i18n.t("command_activate");

View file

@ -1,8 +1,8 @@
import type { InkStory } from "@inkweave/core";
import type { SaveSlot } from "@inkweave/plugins";
import { memory } from "@inkweave/plugins";
import { I18n } from "locales/i18n";
import { memo } from "react";
import { I18n } from "../locales/i18n";
const i18n = new I18n();
const t = (key: Parameters<typeof i18n.t>[0], vars?: Record<string, string>) => i18n.t(key, vars);

View file

@ -8,7 +8,7 @@ interface InkWeavePlayerProps {
ink: InkStory;
}
const InkWeavePlayer: React.FC<InkWeavePlayerProps> = ({ ink }) => {
const InkWeavePlayer = ({ ink }: InkWeavePlayerProps) => {
return (
<div id="inkweave-player" className="container">
<InkWeaveMenu ink={ink} />

View file

@ -1,6 +1,6 @@
import type { TransItemType } from "locales/i18n";
import { type App, PluginSettingTab, Setting } from "obsidian";
import type InkWeavePlugin from "./plugin";
import type { TransItemType } from "./locales/i18n";
import type InkWeavePlugin from "./main";
import { DEFAULT_SETTINGS } from "./settings";
export class SettingsTab extends PluginSettingTab {

View file

@ -3,7 +3,7 @@ import useError from "./error";
import useFile from "./file";
class ObsidianFileHandler extends BaseFileHandler {
loadFile(filename: string): string {
override loadFile(filename: string): string {
return useFile.getState().getResource(filename);
}
}