fix(tui): update CustomEditor ctor
This commit is contained in:
@@ -13,10 +13,9 @@ export class CustomEditor extends Editor {
|
|||||||
onAltEnter?: () => void;
|
onAltEnter?: () => void;
|
||||||
|
|
||||||
constructor(tuiOrTheme: TUI | EditorTheme, themeMaybe?: EditorTheme) {
|
constructor(tuiOrTheme: TUI | EditorTheme, themeMaybe?: EditorTheme) {
|
||||||
const useTui = typeof themeMaybe !== "undefined" && Editor.length >= 2;
|
const useLegacyCtor = typeof themeMaybe !== "undefined" && Editor.length >= 2;
|
||||||
const args = (useTui ? [tuiOrTheme, themeMaybe] : [tuiOrTheme]) as ConstructorParameters<
|
const args = (useLegacyCtor ? [tuiOrTheme, themeMaybe] : [themeMaybe ?? tuiOrTheme]) as
|
||||||
typeof Editor
|
ConstructorParameters<typeof Editor>;
|
||||||
>;
|
|
||||||
super(...args);
|
super(...args);
|
||||||
}
|
}
|
||||||
handleInput(data: string): void {
|
handleInput(data: string): void {
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ export async function runTui(opts: TuiOptions) {
|
|||||||
const statusContainer = new Container();
|
const statusContainer = new Container();
|
||||||
const footer = new Text("", 1, 0);
|
const footer = new Text("", 1, 0);
|
||||||
const chatLog = new ChatLog();
|
const chatLog = new ChatLog();
|
||||||
const editor = new CustomEditor(tui, editorTheme);
|
const editor = new CustomEditor(editorTheme);
|
||||||
const root = new Container();
|
const root = new Container();
|
||||||
root.addChild(header);
|
root.addChild(header);
|
||||||
root.addChild(chatLog);
|
root.addChild(chatLog);
|
||||||
|
|||||||
Reference in New Issue
Block a user