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
title={
!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">
{validationStatus.params

View file

@ -30,24 +30,23 @@ export default function TextAreaComponent({
<div className={disabled ? "cursor-not-allowed" : ""}>
<div
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" : "")
}
>
<input
value={myValue}
className={
editNode
? "input-edit-node"
: "input-primary" + (disabled ? " input-disable " : "")
}
placeholder={"Type something..."}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>
value={myValue}
className={
editNode
? "input-edit-node"
: "input-primary" + (disabled ? " input-disable " : "")
}
placeholder={"Type something..."}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>
<button
onClick={() => {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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