diff --git a/packages/workflow/src/ui/Provider.tsx b/packages/workflow/src/ui/Provider.tsx index f703128..fae924b 100644 --- a/packages/workflow/src/ui/Provider.tsx +++ b/packages/workflow/src/ui/Provider.tsx @@ -30,7 +30,7 @@ export type ProviderContextType = ProviderProps & { sidebarPosition: "right" | "left"; setSidebarPosition: (p: "right" | "left") => void; - selectedNode: Node | undefined; + selectedNode: Node | undefined; setSelectedNode: (n: Node | undefined) => void; // blankNodeParent represents the parent of a blank node. The blank node @@ -63,7 +63,7 @@ export const useOnChange = (): (w: Workflow) => void => { /** * Hook for accessing the workflow we're modifying - * + * */ export const useWorkflow = (): Workflow | undefined => { const ctx = useContext(ProviderContext); @@ -72,7 +72,7 @@ export const useWorkflow = (): Workflow | undefined => { /** * Hook for accessing the trigger which runs the workflow. - * + * */ export const useTrigger = (): any => { const ctx = useContext(ProviderContext); @@ -82,7 +82,7 @@ export const useTrigger = (): any => { /** * Hook for accessing the available actions we can use within * the workflow. - * + * */ export const useAvailableActions = (): PublicEngineAction[] => { const ctx = useContext(ProviderContext); @@ -93,7 +93,7 @@ export const useAvailableActions = (): PublicEngineAction[] => { /** * Hook for accessing the position of the sidebar. Only for internal * use. - * + * * @returns the position of the sidebar. */ export const useSidebarPosition = (): "right" | "left" => { @@ -200,4 +200,4 @@ export const Provider = (props: ProviderProps & { children: React.ReactNode }) = {children} ); -} \ No newline at end of file +} diff --git a/packages/workflow/src/ui/sidebar/ActionForm.tsx b/packages/workflow/src/ui/sidebar/ActionForm.tsx index 7d2fe65..bd83bfd 100644 --- a/packages/workflow/src/ui/sidebar/ActionForm.tsx +++ b/packages/workflow/src/ui/sidebar/ActionForm.tsx @@ -1,4 +1,5 @@ import { ActionInput, PublicEngineAction, WorkflowAction } from "../../types"; +import { useProvider } from '../Provider'; type SidebarActionFormProps = { workflowAction: WorkflowAction, @@ -37,12 +38,40 @@ export const InputFormUI = (inputs: Record) => { // or previous actions. return ( <> - {Object.entries(inputs).map(([key, input]) => ( -