@@ -17,6 +17,7 @@ import { GlobalCommandsProvider } from '@/app/workspace/[workspaceId]/providers/
1717import { SandboxWorkspacePermissionsProvider } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
1818import Workflow from '@/app/workspace/[workspaceId]/w/[workflowId]/workflow'
1919import { getBlock } from '@/blocks/registry'
20+ import { SandboxBlockConstraintsContext } from '@/hooks/use-sandbox-block-constraints'
2021import { useExecutionStore } from '@/stores/execution/store'
2122import { useTerminalConsoleStore } from '@/stores/terminal/console/store'
2223import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
@@ -353,77 +354,79 @@ export function SandboxCanvasProvider({
353354 const currentHint = hintIndex >= 0 ? hints [ hintIndex ] : null
354355
355356 return (
356- < GlobalCommandsProvider >
357- < SandboxWorkspacePermissionsProvider >
358- < div className = { cn ( 'flex h-full w-full overflow-hidden' , className ) } >
359- < div className = 'flex w-56 flex-shrink-0 flex-col gap-3 overflow-y-auto border-[#1F1F1F] border-r bg-[#141414] p-3' >
360- { ( videoUrl || description ) && (
361- < div className = 'flex flex-col gap-2' >
362- { videoUrl && < LessonVideo url = { videoUrl } title = 'Lesson video' /> }
363- { description && (
364- < p className = 'text-[#666] text-[11px] leading-relaxed' > { description } </ p >
365- ) }
366- < div className = 'border-[#1F1F1F] border-t' />
367- </ div >
368- ) }
369- { exerciseConfig . instructions && (
370- < p className = 'text-[#999] text-[11px] leading-relaxed' >
371- { exerciseConfig . instructions }
372- </ p >
373- ) }
374- < ValidationChecklist
375- results = { validationResult . results }
376- allPassed = { validationResult . passed }
377- />
378-
379- < div className = 'mt-auto flex flex-col gap-2' >
380- { currentHint && (
381- < div className = 'rounded-[6px] border border-[#2A2A2A] bg-[#1A1A1A] px-3 py-2 text-[11px]' >
382- < div className = 'mb-1 flex items-center justify-between' >
383- < span className = 'font-[430] text-[#666]' >
384- Hint { hintIndex + 1 } /{ hints . length }
385- </ span >
386- < div className = 'flex gap-1' >
387- < button
388- type = 'button'
389- onClick = { handlePrevHint }
390- disabled = { hintIndex === 0 }
391- className = 'rounded px-1 text-[#666] transition-colors hover:text-[#ECECEC] disabled:opacity-30'
392- aria-label = 'Previous hint'
393- >
394- ‹
395- </ button >
396- < button
397- type = 'button'
398- onClick = { handleShowHint }
399- disabled = { hintIndex === hints . length - 1 }
400- className = 'rounded px-1 text-[#666] transition-colors hover:text-[#ECECEC] disabled:opacity-30'
401- aria-label = 'Next hint'
402- >
403- ›
404- </ button >
405- </ div >
406- </ div >
407- < span className = 'text-[#ECECEC]' > { currentHint } </ span >
357+ < SandboxBlockConstraintsContext . Provider value = { exerciseConfig . availableBlocks } >
358+ < GlobalCommandsProvider >
359+ < SandboxWorkspacePermissionsProvider >
360+ < div className = { cn ( 'flex h-full w-full overflow-hidden' , className ) } >
361+ < div className = 'flex w-56 flex-shrink-0 flex-col gap-3 overflow-y-auto border-[#1F1F1F] border-r bg-[#141414] p-3' >
362+ { ( videoUrl || description ) && (
363+ < div className = 'flex flex-col gap-2' >
364+ { videoUrl && < LessonVideo url = { videoUrl } title = 'Lesson video' /> }
365+ { description && (
366+ < p className = 'text-[#666] text-[11px] leading-relaxed' > { description } </ p >
367+ ) }
368+ < div className = 'border-[#1F1F1F] border-t' />
408369 </ div >
409370 ) }
410- { hints . length > 0 && hintIndex < 0 && (
411- < button
412- type = 'button'
413- onClick = { handleShowHint }
414- className = 'w-full rounded-[5px] border border-[#2A2A2A] bg-[#1A1A1A] px-3 py-1.5 text-[#999] text-[12px] transition-colors hover:border-[#3A3A3A] hover:text-[#ECECEC]'
415- >
416- Show hint
417- </ button >
371+ { exerciseConfig . instructions && (
372+ < p className = 'text-[#999] text-[11px] leading-relaxed' >
373+ { exerciseConfig . instructions }
374+ </ p >
418375 ) }
376+ < ValidationChecklist
377+ results = { validationResult . results }
378+ allPassed = { validationResult . passed }
379+ />
380+
381+ < div className = 'mt-auto flex flex-col gap-2' >
382+ { currentHint && (
383+ < div className = 'rounded-[6px] border border-[#2A2A2A] bg-[#1A1A1A] px-3 py-2 text-[11px]' >
384+ < div className = 'mb-1 flex items-center justify-between' >
385+ < span className = 'font-[430] text-[#666]' >
386+ Hint { hintIndex + 1 } /{ hints . length }
387+ </ span >
388+ < div className = 'flex gap-1' >
389+ < button
390+ type = 'button'
391+ onClick = { handlePrevHint }
392+ disabled = { hintIndex === 0 }
393+ className = 'rounded px-1 text-[#666] transition-colors hover:text-[#ECECEC] disabled:opacity-30'
394+ aria-label = 'Previous hint'
395+ >
396+ ‹
397+ </ button >
398+ < button
399+ type = 'button'
400+ onClick = { handleShowHint }
401+ disabled = { hintIndex === hints . length - 1 }
402+ className = 'rounded px-1 text-[#666] transition-colors hover:text-[#ECECEC] disabled:opacity-30'
403+ aria-label = 'Next hint'
404+ >
405+ ›
406+ </ button >
407+ </ div >
408+ </ div >
409+ < span className = 'text-[#ECECEC]' > { currentHint } </ span >
410+ </ div >
411+ ) }
412+ { hints . length > 0 && hintIndex < 0 && (
413+ < button
414+ type = 'button'
415+ onClick = { handleShowHint }
416+ className = 'w-full rounded-[5px] border border-[#2A2A2A] bg-[#1A1A1A] px-3 py-1.5 text-[#999] text-[12px] transition-colors hover:border-[#3A3A3A] hover:text-[#ECECEC]'
417+ >
418+ Show hint
419+ </ button >
420+ ) }
421+ </ div >
419422 </ div >
420- </ div >
421423
422- < div className = 'relative flex-1 overflow-hidden' >
423- < Workflow workspaceId = { SANDBOX_WORKSPACE_ID } workflowId = { workflowId } sandbox />
424+ < div className = 'relative flex-1 overflow-hidden' >
425+ < Workflow workspaceId = { SANDBOX_WORKSPACE_ID } workflowId = { workflowId } sandbox />
426+ </ div >
424427 </ div >
425- </ div >
426- </ SandboxWorkspacePermissionsProvider >
427- </ GlobalCommandsProvider >
428+ </ SandboxWorkspacePermissionsProvider >
429+ </ GlobalCommandsProvider >
430+ </ SandboxBlockConstraintsContext . Provider >
428431 )
429432}
0 commit comments