merge fixes

This commit is contained in:
Nate Sesti 2024-08-05 18:54:22 -04:00
parent d9b46aca28
commit 78bfecf7f6
2 changed files with 20 additions and 23 deletions

View file

@ -6,7 +6,6 @@ import { useDispatch } from "react-redux";
import { Button, HelperText, Input, lightGray } from "..";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { setShowDialog } from "../../redux/slices/uiStateSlice";
import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/outline";
const DEFAULT_MAX_DEPTH = 3;

View file

@ -828,29 +828,27 @@ function TipTapEditor(props: TipTapEditorProps) {
event.stopPropagation();
}}
/>
{(isEditorFocused || props.isMainInput) && (
<InputToolbar
showNoContext={optionKeyHeld}
hidden={!(editorFocusedRef.current || props.isMainInput)}
onAddContextItem={() => {
if (editor.getText().endsWith("@")) {
} else {
editor.commands.insertContent("@");
}
}}
onEnter={onEnterRef.current}
onImageFileSelected={(file) => {
handleImageFile(file).then(([img, dataUrl]) => {
const { schema } = editor.state;
const node = schema.nodes.image.create({ src: dataUrl });
editor.commands.command(({ tr }) => {
tr.insert(0, node);
return true;
});
<InputToolbar
showNoContext={optionKeyHeld}
hidden={!(editorFocusedRef.current || props.isMainInput)}
onAddContextItem={() => {
if (editor.getText().endsWith("@")) {
} else {
editor.commands.insertContent("@");
}
}}
onEnter={onEnterRef.current}
onImageFileSelected={(file) => {
handleImageFile(file).then(([img, dataUrl]) => {
const { schema } = editor.state;
const node = schema.nodes.image.create({ src: dataUrl });
editor.commands.command(({ tr }) => {
tr.insert(0, node);
return true;
});
}}
/>
)}
});
}}
/>
{showDragOverMsg &&
modelSupportsImages(
defaultModel.provider,