formatting
This commit is contained in:
parent
02fc2004e1
commit
c9fd97f1f6
9 changed files with 130 additions and 119 deletions
|
|
@ -27,60 +27,59 @@ export default function CodeAreaComponent({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setMyValue(typeof value == "string" ? value : JSON.stringify(value));
|
setMyValue(typeof value == "string" ? value : JSON.stringify(value));
|
||||||
}, [value]);
|
}, [value]);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<span
|
<span
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
openPopUp(
|
openPopUp(
|
||||||
<CodeAreaModal
|
<CodeAreaModal
|
||||||
value={myValue}
|
value={myValue}
|
||||||
nodeClass={nodeClass}
|
nodeClass={nodeClass}
|
||||||
setNodeClass={setNodeClass}
|
setNodeClass={setNodeClass}
|
||||||
setValue={(t: string) => {
|
setValue={(t: string) => {
|
||||||
setMyValue(t);
|
setMyValue(t);
|
||||||
onChange(t);
|
onChange(t);
|
||||||
}}
|
}}
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className={
|
|
||||||
editNode
|
|
||||||
? "input-edit-node input-dialog"
|
|
||||||
: (disabled ? " input-disable " : "") +
|
|
||||||
" input-primary input-dialog"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{myValue !== "" ? myValue : "Type something..."}
|
|
||||||
</span>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
openPopUp(
|
|
||||||
<CodeAreaModal
|
|
||||||
setNodeClass={setNodeClass}
|
|
||||||
value={myValue}
|
|
||||||
nodeClass={nodeClass}
|
|
||||||
setValue={(t: string) => {
|
|
||||||
setMyValue(t);
|
|
||||||
onChange(t);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{!editNode && (
|
|
||||||
<ExternalLink
|
|
||||||
strokeWidth={1.5}
|
|
||||||
className={
|
|
||||||
"icons-parameters-comp" +
|
|
||||||
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
)}
|
);
|
||||||
</button>
|
}}
|
||||||
</div>
|
className={
|
||||||
|
editNode
|
||||||
|
? "input-edit-node input-dialog"
|
||||||
|
: (disabled ? " input-disable " : "") +
|
||||||
|
" input-dialog input-primary"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{myValue !== "" ? myValue : "Type something..."}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
openPopUp(
|
||||||
|
<CodeAreaModal
|
||||||
|
setNodeClass={setNodeClass}
|
||||||
|
value={myValue}
|
||||||
|
nodeClass={nodeClass}
|
||||||
|
setValue={(t: string) => {
|
||||||
|
setMyValue(t);
|
||||||
|
onChange(t);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{!editNode && (
|
||||||
|
<ExternalLink
|
||||||
|
strokeWidth={1.5}
|
||||||
|
className={
|
||||||
|
"icons-parameters-comp" +
|
||||||
|
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,9 @@ export default function InputFileComponent({
|
||||||
className={
|
className={
|
||||||
editNode
|
editNode
|
||||||
? "input-edit-node input-dialog text-muted-foreground"
|
? "input-edit-node input-dialog text-muted-foreground"
|
||||||
: (disabled ? "input-disable input-primary input-dialog" : "input-primary input-dialog text-muted-foreground")
|
: disabled
|
||||||
|
? "input-disable input-dialog input-primary"
|
||||||
|
: "input-dialog input-primary text-muted-foreground"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{myValue !== "" ? myValue : "No file"}
|
{myValue !== "" ? myValue : "No file"}
|
||||||
|
|
|
||||||
|
|
@ -47,64 +47,64 @@ export default function PromptAreaComponent({
|
||||||
}, [reactFlowInstance, field_name, myValue, nodeClass, setNodeClass]);
|
}, [reactFlowInstance, field_name, myValue, nodeClass, setNodeClass]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<span
|
<span
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
openPopUp(
|
openPopUp(
|
||||||
<GenericModal
|
<GenericModal
|
||||||
type={TypeModal.PROMPT}
|
type={TypeModal.PROMPT}
|
||||||
value={myValue}
|
value={myValue}
|
||||||
buttonText="Check & Save"
|
buttonText="Check & Save"
|
||||||
modalTitle="Edit Prompt"
|
modalTitle="Edit Prompt"
|
||||||
setValue={(t: string) => {
|
setValue={(t: string) => {
|
||||||
setMyValue(t);
|
setMyValue(t);
|
||||||
onChange(t);
|
onChange(t);
|
||||||
}}
|
}}
|
||||||
nodeClass={nodeClass}
|
nodeClass={nodeClass}
|
||||||
setNodeClass={setNodeClass}
|
setNodeClass={setNodeClass}
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
className={
|
|
||||||
editNode
|
|
||||||
? "input-edit-node input-dialog"
|
|
||||||
: (disabled ? " input-disable " : "") +
|
|
||||||
" input-primary input-dialog"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{myValue !== "" ? myValue : "Type your prompt here"}
|
|
||||||
</span>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
openPopUp(
|
|
||||||
<GenericModal
|
|
||||||
field_name={field_name}
|
|
||||||
type={TypeModal.PROMPT}
|
|
||||||
value={myValue}
|
|
||||||
buttonText="Check & Save"
|
|
||||||
modalTitle="Edit Prompt"
|
|
||||||
setValue={(t: string) => {
|
|
||||||
setMyValue(t);
|
|
||||||
onChange(t);
|
|
||||||
}}
|
|
||||||
nodeClass={nodeClass}
|
|
||||||
setNodeClass={setNodeClass}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{!editNode && (
|
|
||||||
<ExternalLink
|
|
||||||
strokeWidth={1.5}
|
|
||||||
className={
|
|
||||||
"icons-parameters-comp" +
|
|
||||||
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
)}
|
);
|
||||||
</button>
|
}}
|
||||||
</div>
|
className={
|
||||||
|
editNode
|
||||||
|
? "input-edit-node input-dialog"
|
||||||
|
: (disabled ? " input-disable " : "") +
|
||||||
|
" input-dialog input-primary"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{myValue !== "" ? myValue : "Type your prompt here"}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
openPopUp(
|
||||||
|
<GenericModal
|
||||||
|
field_name={field_name}
|
||||||
|
type={TypeModal.PROMPT}
|
||||||
|
value={myValue}
|
||||||
|
buttonText="Check & Save"
|
||||||
|
modalTitle="Edit Prompt"
|
||||||
|
setValue={(t: string) => {
|
||||||
|
setMyValue(t);
|
||||||
|
onChange(t);
|
||||||
|
}}
|
||||||
|
nodeClass={nodeClass}
|
||||||
|
setNodeClass={setNodeClass}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{!editNode && (
|
||||||
|
<ExternalLink
|
||||||
|
strokeWidth={1.5}
|
||||||
|
className={
|
||||||
|
"icons-parameters-comp" +
|
||||||
|
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ export default function TextAreaComponent({
|
||||||
}, [closePopUp]);
|
}, [closePopUp]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<input
|
<input
|
||||||
value={myValue}
|
value={myValue}
|
||||||
className={
|
className={
|
||||||
|
|
@ -41,7 +41,6 @@ export default function TextAreaComponent({
|
||||||
setMyValue(e.target.value);
|
setMyValue(e.target.value);
|
||||||
onChange(e.target.value);
|
onChange(e.target.value);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ export default function ApiModal({ flow }: { flow: FlowType }) {
|
||||||
|
|
||||||
function startTweaks() {
|
function startTweaks() {
|
||||||
const t = buildTweaks(flow);
|
const t = buildTweaks(flow);
|
||||||
tweak?.current?.push(t);
|
tweak?.current?.push(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterNodes() {
|
function filterNodes() {
|
||||||
|
|
|
||||||
|
|
@ -374,7 +374,9 @@ export default function ChatModal({
|
||||||
<ChatMessage
|
<ChatMessage
|
||||||
lockChat={lockChat}
|
lockChat={lockChat}
|
||||||
chat={c}
|
chat={c}
|
||||||
lastMessage={chatHistory.length - 1 === i ? true : false}
|
lastMessage={
|
||||||
|
chatHistory.length - 1 === i ? true : false
|
||||||
|
}
|
||||||
key={i}
|
key={i}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,21 @@ export default function ChatMessage({
|
||||||
{!chat.isSend ? (
|
{!chat.isSend ? (
|
||||||
<div className="form-modal-chat-image">
|
<div className="form-modal-chat-image">
|
||||||
<div className="form-modal-chat-bot-icon ">
|
<div className="form-modal-chat-bot-icon ">
|
||||||
<img src={Robot} className="form-modal-chat-icon-img" alt="robot_image"/>
|
<img
|
||||||
|
src={Robot}
|
||||||
|
className="form-modal-chat-icon-img"
|
||||||
|
alt="robot_image"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="form-modal-chat-image">
|
<div className="form-modal-chat-image">
|
||||||
<div className="form-modal-chat-user-icon ">
|
<div className="form-modal-chat-user-icon ">
|
||||||
<img src={MaleTechnology} className="form-modal-chat-icon-img" alt="male_technology"/>
|
<img
|
||||||
|
src={MaleTechnology}
|
||||||
|
className="form-modal-chat-icon-img"
|
||||||
|
alt="male_technology"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -517,7 +517,9 @@ export default function FormModal({
|
||||||
<ChatMessage
|
<ChatMessage
|
||||||
lockChat={lockChat}
|
lockChat={lockChat}
|
||||||
chat={c}
|
chat={c}
|
||||||
lastMessage={chatHistory.length - 1 === i ? true : false}
|
lastMessage={
|
||||||
|
chatHistory.length - 1 === i ? true : false
|
||||||
|
}
|
||||||
key={i}
|
key={i}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,10 @@ export type FlowStyleType = {
|
||||||
flow_id: string;
|
flow_id: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type TweaksType = Array<
|
export type TweaksType = Array<
|
||||||
{
|
{
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
output_key?: string;
|
output_key?: string;
|
||||||
};
|
};
|
||||||
} & FlowStyleType
|
} & FlowStyleType
|
||||||
>;
|
>;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue