merge fix

This commit is contained in:
Cristhian Zanforlin Lousa 2023-07-07 11:47:05 -03:00
commit 17c80a26f2
8 changed files with 52 additions and 56 deletions

View file

@ -118,8 +118,14 @@ export default function GenericNode({
<Tooltip <Tooltip
title={ title={
!validationStatus ? ( !validationStatus ? (
<span className="flex">Build <Zap className="mx-0.5 h-5 fill-build-trigger stroke-build-trigger stroke-1" strokeWidth={1.5} /> flow to validate status.</span> <span className="flex">
Build{" "}
<Zap
className="mx-0.5 h-5 fill-build-trigger stroke-build-trigger stroke-1"
strokeWidth={1.5}
/>{" "}
flow to validate status.
</span>
) : ( ) : (
<div className="max-h-96 overflow-auto"> <div className="max-h-96 overflow-auto">
{validationStatus.params {validationStatus.params

View file

@ -30,24 +30,23 @@ export default function TextAreaComponent({
<div className={disabled ? "cursor-not-allowed" : ""}> <div className={disabled ? "cursor-not-allowed" : ""}>
<div <div
className={ className={
(editNode ? "w-full relative top-2" : "flex w-full items-center") + (editNode ? "relative top-2 w-full" : "flex w-full items-center") +
(disabled ? " pointer-events-none" : "") (disabled ? " pointer-events-none" : "")
} }
> >
<input <input
value={myValue} value={myValue}
className={ className={
editNode editNode
? "input-edit-node" ? "input-edit-node"
: "input-primary" + (disabled ? " input-disable " : "") : "input-primary" + (disabled ? " input-disable " : "")
} }
placeholder={"Type something..."} placeholder={"Type something..."}
onChange={(e) => { onChange={(e) => {
setMyValue(e.target.value); setMyValue(e.target.value);
onChange(e.target.value); onChange(e.target.value);
}} }}
/> />
<button <button
onClick={() => { onClick={() => {

View file

@ -338,4 +338,4 @@ export async function uploadFile(
const formData = new FormData(); const formData = new FormData();
formData.append("file", file); formData.append("file", file);
return await axios.post(`/api/v1/upload/${id}`, formData); return await axios.post(`/api/v1/upload/${id}`, formData);
} }

View file

@ -111,7 +111,7 @@ export default function ApiModal({ flow }: { flow: FlowType }) {
startTweaks(); startTweaks();
} }
} else { } else {
if(tweak?.current){ if (tweak?.current) {
startTweaks(); startTweaks();
} }
} }

View file

@ -138,15 +138,15 @@ export default function ChatMessage({
<div className="flex w-full items-center"> <div className="flex w-full items-center">
<div className="inline-block text-start"> <div className="inline-block text-start">
<span className=" break-all text-primary"> <span className=" break-all text-primary">
<Accordion type="single" collapsible className="mb-4"> <Accordion type="single" collapsible className="mb-2 flex">
<AccordionItem <AccordionItem
className=" rounded-md border border-ring/60 bg-muted px-4" className=" rounded-md border border-ring/60 bg-muted px-4"
value="prompt" value="prompt"
> >
<AccordionTrigger className="flex gap-4 text-base font-semibold"> <AccordionTrigger className="gap-4 text-base font-semibold">
Initial Prompt Initial Prompt
</AccordionTrigger> </AccordionTrigger>
<AccordionContent className="max-h-96 overflow-auto break-all p-2 text-base"> <AccordionContent className="max-h-96 overflow-auto break-all p-2">
{ {
// Make all the variables that are inside curly braces bold // Make all the variables that are inside curly braces bold
template.split("\n").map((line, index) => { template.split("\n").map((line, index) => {
@ -160,24 +160,14 @@ export default function ChatMessage({
parts.push(line.substring(lastIndex, match.index)); parts.push(line.substring(lastIndex, match.index));
} }
// Push div with matched text // Push div with matched text
parts.push( if (chat.message[match[1]]) {
<div> parts.push(
<div className="my-1 inline-block rounded-md bg-indigo-100 px-2"> <span className="my-1 rounded-md bg-indigo-100">
<span key={match.index}> {chat.message[match[1]]}
<span className=" text-xs font-semibold text-high-indigo"> </span>
{match[1]} );
</span> }
{chat.message[match[1]] ? (
<span>
&nbsp;&nbsp;{chat.message[match[1]]}
</span>
) : (
""
)}
</span>
</div>
</div>
);
// Update last index // Update last index
lastIndex = regex.lastIndex; lastIndex = regex.lastIndex;
} }
@ -191,7 +181,9 @@ export default function ChatMessage({
</AccordionContent> </AccordionContent>
</AccordionItem> </AccordionItem>
</Accordion> </Accordion>
{chat.message[chat.chatKey]} <span className="prose text-primary dark:prose-invert">
{chat.message[chat.chatKey]}
</span>
</span> </span>
</div> </div>
</div> </div>

View file

@ -206,7 +206,7 @@ export default function GenericModal({
{type == TypeModal.PROMPT && isEdit ? ( {type == TypeModal.PROMPT && isEdit ? (
<Textarea <Textarea
ref={ref} ref={ref}
className="form-input h-full w-full rounded-lg border-gray-300 focus-visible:ring-1 dark:border-gray-700 dark:bg-gray-900 dark:text-white custom-scroll" className="form-input h-full w-full rounded-lg border-gray-300 custom-scroll focus-visible:ring-1 dark:border-gray-700 dark:bg-gray-900 dark:text-white"
value={inputValue} value={inputValue}
onBlur={() => { onBlur={() => {
blur(); blur();
@ -236,15 +236,14 @@ export default function GenericModal({
)} )}
</div> </div>
{type == TypeModal.PROMPT && ( {type == TypeModal.PROMPT && (
<> <>
<div className="h-[6vh] overflow-y-auto custom-scroll"> <div className="h-[6vh] overflow-y-auto custom-scroll">
<div className="items-center flex flex-wrap"> <div className="flex flex-wrap items-center">
<Variable className=" -ml-px mr-1 h-4 w-4 text-primary flex"></Variable> <Variable className=" -ml-px mr-1 flex h-4 w-4 text-primary"></Variable>
<span className="text-md font-semibold text-primary"> <span className="text-md font-semibold text-primary">
Input Variables: {wordsHighlight && Input Variables:{" "}
wordsHighlight.length == 0 ? '-' : ''} {wordsHighlight && wordsHighlight.length == 0 ? "-" : ""}
</span> </span>
{wordsHighlight.map((word, index) => ( {wordsHighlight.map((word, index) => (
@ -256,7 +255,8 @@ export default function GenericModal({
> >
<Badge <Badge
key={index} key={index}
variant="gray" size="md" variant="gray"
size="md"
className="m-1 max-w-[40vw] cursor-default truncate p-2.5 text-sm" className="m-1 max-w-[40vw] cursor-default truncate p-2.5 text-sm"
> >
<div className="relative bottom-[1px]"> <div className="relative bottom-[1px]">
@ -269,11 +269,10 @@ export default function GenericModal({
</Badge> </Badge>
</ShadTooltip> </ShadTooltip>
))} ))}
</div> </div>
</div> </div>
</> </>
)} )}
<DialogFooter> <DialogFooter>
<Button <Button
@ -282,7 +281,7 @@ export default function GenericModal({
switch (myModalType) { switch (myModalType) {
case 1: case 1:
setValue(inputValue); setValue(inputValue);
setModalOpen(false); setModalOpen(false);
break; break;
case 2: case 2:
validatePrompt(false); validatePrompt(false);

View file

@ -1022,7 +1022,7 @@ export const INVALID_CHARACTERS = [
")", ")",
"[", "[",
"]", "]",
"\n" "\n",
]; ];
export const regexHighlight = /\{([^}]+)\}/g; export const regexHighlight = /\{([^}]+)\}/g;

View file

@ -199,7 +199,7 @@ module.exports = {
".custom-scroll": { ".custom-scroll": {
"&::-webkit-scrollbar": { "&::-webkit-scrollbar": {
width: "8px", width: "8px",
height: "8px" height: "8px",
}, },
"&::-webkit-scrollbar-track": { "&::-webkit-scrollbar-track": {
backgroundColor: "#f1f1f1", backgroundColor: "#f1f1f1",