From 901d260192545d5f1ac2d11dfb7283cd26f21b11 Mon Sep 17 00:00:00 2001 From: waleed Date: Wed, 12 Nov 2025 14:04:08 -0800 Subject: [PATCH] fix(files): changed file input value sample from string -> object --- .../components/starter/input-format.tsx | 41 +++++++++++++++++++ .../components/emcn/components/code/code.tsx | 4 ++ 2 files changed, 45 insertions(+) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/starter/input-format.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/starter/input-format.tsx index 3c9fe885542..ad1e3671c54 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/starter/input-format.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/starter/input-format.tsx @@ -310,6 +310,47 @@ export function FieldFormat({ ) } + if (field.type === 'files') { + const lineCount = fieldValue.split('\n').length + const gutterWidth = calculateGutterWidth(lineCount) + + const renderLineNumbers = () => { + return Array.from({ length: lineCount }, (_, i) => ( +
+ {i + 1} +
+ )) + } + + return ( + + {renderLineNumbers()} + + + { + '[\n {\n "data": "data:application/pdf;base64,...",\n "type": "file",\n "name": "document.pdf",\n "mime": "application/pdf"\n }\n]' + } + + { + if (!isReadOnly) { + updateField(field.id, 'value', newValue) + } + }} + highlight={(code) => highlight(code, languages.json, 'json')} + disabled={isReadOnly} + {...getCodeEditorProps({ disabled: isReadOnly })} + /> + + + ) + } + return ( <>