-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(chat): remove unused mention components and styles
- Loading branch information
Showing
11 changed files
with
590 additions
and
668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* PromptProps defines the props for the PromptForm component. | ||
*/ | ||
export interface PromptProps { | ||
/** | ||
* A callback function that handles form submission. | ||
* It returns a Promise, so you can handle async actions. | ||
*/ | ||
onSubmit: (value: string) => Promise<void> | ||
/** | ||
* Indicates if the form (or chat) is in a loading/submitting state. | ||
*/ | ||
isLoading: boolean | ||
} | ||
|
||
/** | ||
* PromptFormRef defines the methods exposed by the PromptForm via forwardRef. | ||
*/ | ||
export interface PromptFormRef { | ||
/** | ||
* Focus the editor inside PromptForm. | ||
*/ | ||
focus: () => void | ||
/** | ||
* Set the content of the editor programmatically. | ||
*/ | ||
setInput: (value: string) => void | ||
/** | ||
* Get the current editor text content. | ||
*/ | ||
input: string | ||
} | ||
|
||
/** | ||
* Represents a file item inside the workspace. | ||
* (You can add more properties if needed) | ||
*/ | ||
export interface FileItem { | ||
label: string | ||
id?: string | ||
// ... any other fields that you might have | ||
} | ||
|
||
/** | ||
* Represents a file source item for mention suggestions. | ||
*/ | ||
export interface SourceItem { | ||
name: string | ||
filepath: string | ||
category: 'file' | ||
fileItem: FileItem | ||
} | ||
|
||
/** | ||
* The attributes stored in a mention node. | ||
*/ | ||
export interface MentionNodeAttrs { | ||
id: string | ||
name: string | ||
category: 'file' | ||
fileItem: FileItem | ||
} | ||
|
||
/** | ||
* Stores the current state of the mention feature while typing. | ||
*/ | ||
export interface MentionState { | ||
items: SourceItem[] | ||
command: ((props: MentionNodeAttrs) => void) | null | ||
query: string | ||
selectedIndex: number | ||
} |
Oops, something went wrong.