mirror of
https://github.com/uglyboy-tl/obsidian-ink-player.git
synced 2026-07-22 05:42:02 +00:00
refactor(code): various code improvements and fixes
This commit is contained in:
parent
48421feda2
commit
6972e91405
6 changed files with 7 additions and 7 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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} />
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue