mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
Add path alias and update imports
This commit is contained in:
parent
d3650d8339
commit
b6f4a49294
4 changed files with 11 additions and 8 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import { WorkspaceLeaf, ItemView } from 'obsidian';
|
||||
import { SharedState } from 'src/sharedState';
|
||||
import SharedState from '@/sharedState';
|
||||
import * as React from 'react';
|
||||
import Chat from 'src/components/Chat';
|
||||
import Chat from '@/components/Chat';
|
||||
import { createRoot, Root } from 'react-dom/client';
|
||||
import { AppContext } from 'src/context';
|
||||
import { CHAT_VIEWTYPE } from 'src/constants';
|
||||
import CopilotPlugin, {CopilotSettings} from 'src/main';
|
||||
import { AppContext } from '@/context';
|
||||
import { CHAT_VIEWTYPE } from '@/constants';
|
||||
import CopilotPlugin, {CopilotSettings} from '@/main';
|
||||
|
||||
|
||||
export default class CopilotView extends ItemView {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { App } from 'obsidian';
|
||||
import { SharedState } from 'src/sharedState';
|
||||
import SharedState from '@/sharedState';
|
||||
|
||||
// App context
|
||||
export const AppContext = React.createContext<App | undefined>(undefined);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react';
|
||||
import { App } from 'obsidian';
|
||||
import { AppContext, SharedStateContext } from 'src/context';
|
||||
import { SharedState } from 'src/sharedState';
|
||||
import { AppContext, SharedStateContext } from '@/context';
|
||||
import SharedState from '@/sharedState';
|
||||
|
||||
// Custom hook to use the App context
|
||||
export const useApp = (): App | undefined => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
},
|
||||
"inlineSourceMap": true,
|
||||
"inlineSources": true,
|
||||
"module": "ESNext",
|
||||
|
|
|
|||
Loading…
Reference in a new issue