@@ -18,7 +18,8 @@ import {
1818 StepEditorProvider ,
1919 KeyboardConfiguration ,
2020 I18n ,
21- PreferenceStorage
21+ PreferenceStorage ,
22+ PlaceholderConfiguration
2223} from 'sequential-workflow-designer' ;
2324import { RootEditorWrapperContext } from './RootEditorWrapper' ;
2425import { StepEditorWrapperContext } from './StepEditorWrapper' ;
@@ -46,6 +47,7 @@ export interface SequentialWorkflowDesignerProps<TDefinition extends Definition>
4647 undoStackSize ?: number ;
4748 stepsConfiguration : StepsConfiguration ;
4849 validatorConfiguration ?: ValidatorConfiguration ;
50+ placeholderConfiguration ?: PlaceholderConfiguration ;
4951 toolboxConfiguration : false | ReactToolboxConfiguration ;
5052 isToolboxCollapsed ?: boolean ;
5153 onIsToolboxCollapsedChanged ?: ( isCollapsed : boolean ) => void ;
@@ -63,7 +65,7 @@ export interface SequentialWorkflowDesignerProps<TDefinition extends Definition>
6365}
6466
6567export function SequentialWorkflowDesigner < TDefinition extends Definition > ( props : SequentialWorkflowDesignerProps < TDefinition > ) {
66- const [ placeholder , setPlaceholder ] = useState < HTMLElement | null > ( null ) ;
68+ const [ root , setRoot ] = useState < HTMLElement | null > ( null ) ;
6769
6870 const onDefinitionChangeRef = useRef ( props . onDefinitionChange ) ;
6971 const onSelectedStepIdChangedRef = useRef ( props . onSelectedStepIdChanged ) ;
@@ -84,6 +86,7 @@ export function SequentialWorkflowDesigner<TDefinition extends Definition>(props
8486 const undoStackSize = props . undoStackSize ;
8587 const steps = props . stepsConfiguration ;
8688 const validator = props . validatorConfiguration ;
89+ const placeholder = props . placeholderConfiguration ;
8790 const toolbox = props . toolboxConfiguration ;
8891 const isEditorCollapsed = props . isEditorCollapsed ;
8992 const isToolboxCollapsed = props . isToolboxCollapsed ;
@@ -181,7 +184,7 @@ export function SequentialWorkflowDesigner<TDefinition extends Definition>(props
181184 } , [ props . customActionHandler ] ) ;
182185
183186 useEffect ( ( ) => {
184- if ( ! placeholder ) {
187+ if ( ! root ) {
185188 return ;
186189 }
187190
@@ -215,7 +218,7 @@ export function SequentialWorkflowDesigner<TDefinition extends Definition>(props
215218 tryDestroy ( ) ;
216219 }
217220
218- const designer = Designer . create ( placeholder , definition . value , {
221+ const designer = Designer . create ( root , definition . value , {
219222 theme,
220223 undoStackSize,
221224 toolbox : toolbox
@@ -226,6 +229,7 @@ export function SequentialWorkflowDesigner<TDefinition extends Definition>(props
226229 : false ,
227230 steps,
228231 validator,
232+ placeholder,
229233 controlBar,
230234 contextMenu,
231235 keyboard,
@@ -272,7 +276,7 @@ export function SequentialWorkflowDesigner<TDefinition extends Definition>(props
272276
273277 designerRef . current = designer ;
274278 } , [
275- placeholder ,
279+ root ,
276280 definition ,
277281 selectedStepId ,
278282 isReadonly ,
@@ -287,6 +291,7 @@ export function SequentialWorkflowDesigner<TDefinition extends Definition>(props
287291 controlBar ,
288292 steps ,
289293 validator ,
294+ placeholder ,
290295 extensions ,
291296 i18n
292297 ] ) ;
@@ -295,5 +300,5 @@ export function SequentialWorkflowDesigner<TDefinition extends Definition>(props
295300 return tryDestroy ;
296301 } , [ ] ) ;
297302
298- return < div ref = { setPlaceholder } data-testid = "designer" className = "sqd-designer-react" > </ div > ;
303+ return < div ref = { setRoot } data-testid = "designer" className = "sqd-designer-react" > </ div > ;
299304}
0 commit comments