diff --git a/apps/remix-ide/src/app/components/status-bar.tsx b/apps/remix-ide/src/app/components/status-bar.tsx index 088e0b4da1..c264fdd434 100644 --- a/apps/remix-ide/src/app/components/status-bar.tsx +++ b/apps/remix-ide/src/app/components/status-bar.tsx @@ -7,6 +7,7 @@ import { PluginProfile, StatusBarInterface } from '../../types' import { RemixUIStatusBar } from '@remix-ui/statusbar' import { FilePanelType } from '@remix-ui/workspace' import { VerticalIcons } from './vertical-icons' +import { CustomRemixApi } from '@remix-api' const statusBarProfile: PluginProfile = { name: 'statusBar', @@ -16,7 +17,7 @@ const statusBarProfile: PluginProfile = { version: packageJson.version, } -export class StatusBar extends Plugin implements StatusBarInterface { +export class StatusBar extends Plugin implements StatusBarInterface { htmlElement: HTMLDivElement events: EventEmitter filePanelPlugin: FilePanelType @@ -75,7 +76,7 @@ export class StatusBar extends Plugin implements StatusBarInterface { const workspaceName = localStorage.getItem('currentWorkspace') workspaceName && workspaceName.length > 0 ? this.currentWorkspaceName = workspaceName : this.currentWorkspaceName = 'error' }) - this.on('settings', 'copilotChoiceChanged', (isAiActive) => { + this.on('settings', 'copilotChoiceChanged', (isAiActive: boolean) => { this.isAiActive = isAiActive }) this.renderComponent() diff --git a/libs/remix-api/src/lib/plugins/filePanel-api.ts b/libs/remix-api/src/lib/plugins/filePanel-api.ts new file mode 100644 index 0000000000..02255c26ba --- /dev/null +++ b/libs/remix-api/src/lib/plugins/filePanel-api.ts @@ -0,0 +1,12 @@ +import { IFilePanel } from '@remixproject/plugin-api' +import { StatusEvents } from '@remixproject/plugin-utils' + +export interface IFilePanelApi { + events: IFilePanel['events'] & { + workspaceInitializationCompleted: () => void; + switchToWorkspace: (workspace: string) => Promise; + } & StatusEvents + methods: IFilePanel['methods'] & { + + } +} diff --git a/libs/remix-api/src/lib/plugins/fileSystem-api.ts b/libs/remix-api/src/lib/plugins/fileSystem-api.ts index 04d0a2a0af..cba69f007e 100644 --- a/libs/remix-api/src/lib/plugins/fileSystem-api.ts +++ b/libs/remix-api/src/lib/plugins/fileSystem-api.ts @@ -4,7 +4,7 @@ import { IFileSystem } from "@remixproject/plugin-api" // Extended interface with 'diff' method export interface IExtendedFileSystem extends IFileSystem { methods: IFileSystem['methods'] & { - /** Compare the differences between two files */ diff(change: commitChange): Promise + isGitRepo(): Promise }; } \ No newline at end of file diff --git a/libs/remix-api/src/lib/plugins/settings-api.ts b/libs/remix-api/src/lib/plugins/settings-api.ts index dd7323ac73..a9251b3f78 100644 --- a/libs/remix-api/src/lib/plugins/settings-api.ts +++ b/libs/remix-api/src/lib/plugins/settings-api.ts @@ -3,6 +3,8 @@ import { StatusEvents } from '@remixproject/plugin-utils' export interface ISettings { events: { configChanged: () => void, + copilotChoiceUpdated: (isChecked: boolean) => void, + copilotChoiceChanged: (isChecked: boolean) => void, } & StatusEvents methods: { getGithubAccessToken(): string diff --git a/libs/remix-api/src/lib/remix-api.ts b/libs/remix-api/src/lib/remix-api.ts index 8469d9e057..2dff94abdc 100644 --- a/libs/remix-api/src/lib/remix-api.ts +++ b/libs/remix-api/src/lib/remix-api.ts @@ -6,6 +6,8 @@ import { IFileDecoratorApi } from "./plugins/filedecorator-api" import { IExtendedFileSystem } from "./plugins/fileSystem-api" import { INotificationApi } from "./plugins/notification-api" import { ISettings } from "./plugins/settings-api" +import { IFilePanelApi } from "./plugins/filePanel-api" +import { Plugin } from "@remixproject/engine" export interface ICustomRemixApi extends IRemixApi { dgitApi: IGitApi @@ -14,6 +16,7 @@ export interface ICustomRemixApi extends IRemixApi { settings: ISettings fileDecorator: IFileDecoratorApi fileManager: IExtendedFileSystem + filePanel: IFilePanelApi } export declare type CustomRemixApi = Readonly \ No newline at end of file diff --git a/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx b/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx index 07c299c132..68201b7c9f 100644 --- a/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx +++ b/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx @@ -32,7 +32,7 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G setGitBranchName('Not a git repo') } }) - plugin.on('dGitProvider', 'init', async () => { + plugin.on('dgitApi', 'init', async () => { const isGit = await plugin.call('fileManager', 'isGitRepo') if (isGit) { const workspace = localStorage.getItem('currentWorkspace') @@ -52,7 +52,7 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G } const initializeNewGitRepo = async () => { - await plugin.call('dGitProvider', 'init') + await plugin.call('dgitApi', 'init') const isActive = await plugin.call('manager', 'isActive', 'dgit') if (isLocalHost === false) { if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit') diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 534bd07481..03d807808a 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -257,7 +257,7 @@ export function Workspace() { } } - global.plugin.on('dGitProvider', 'repositoryWithSubmodulesCloned', () => { + global.plugin.on('dgitApi', 'repositoryWithSubmodulesCloned', () => { setHighlightUpdateSubmodules(true) }) }, [])