From f5440bfddc10ae4078e173bebb8c85af8c26aa28 Mon Sep 17 00:00:00 2001 From: Orion Reed Date: Sat, 20 Jul 2024 14:06:52 +0200 Subject: [PATCH] checkpoint --- src/PromptShape.tsx | 9 ++++++--- src/SocialShapeUtil.tsx | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/PromptShape.tsx b/src/PromptShape.tsx index e15b674..15dbff5 100644 --- a/src/PromptShape.tsx +++ b/src/PromptShape.tsx @@ -20,7 +20,7 @@ type IPrompt = TLBaseShape< w: number h: number prompt: string - output: string + value: string agentBinding: string | null } > @@ -37,7 +37,7 @@ export class PromptShape extends BaseBoxShapeUtil { w: 300, h: 50, prompt: "", - output: "", + value: "", agentBinding: null, } } @@ -84,12 +84,15 @@ export class PromptShape extends BaseBoxShapeUtil { this.editor.updateShape({ id: shape.id, type: "prompt", - props: { output: partial, agentBinding: done ? null : 'someone' }, + props: { value: partial, agentBinding: done ? null : 'someone' }, }) }) } const handlePrompt = () => { + if (shape.props.agentBinding) { + return + } let processedPrompt = shape.props.prompt; for (const [key, sourceShape] of Object.entries(inputMap)) { const pattern = `{${key}}`; diff --git a/src/SocialShapeUtil.tsx b/src/SocialShapeUtil.tsx index 86b3fd4..447cf9d 100644 --- a/src/SocialShapeUtil.tsx +++ b/src/SocialShapeUtil.tsx @@ -90,7 +90,7 @@ export class SocialShapeUtil extends BaseBoxShapeUtil { return ( e.stopPropagation()}> -