-
+
{
- onNameChange(new_name).then((success) => {
- setTitleStyle(success ? {} : ERROR_STYLE)
+ service.setName(new_name).then((state) => {
+ setTitleStyle(
+ state == SaveStates.Ok
+ ? {}
+ : ERROR_STYLE,
+ )
})
},
- [onNameChange],
+ [service],
)}
/>
-
+
+
+
-
-
-
+
+ {isStepsTreeVisible ? (
+
+ {contentNode}
+ {stepsTreeNode}
+
+ ) : (
+ contentNode
+ )}
+
+
+ )
+}
-
- overlaps(
- courtBounds(),
- div.getBoundingClientRect(),
- ),
- [courtBounds],
- )}
- onElementDetached={useCallback(
- (r, e: RackedCourtObject) =>
- setContent((content) =>
- placeObjectAt(
- r.getBoundingClientRect(),
- courtBounds(),
- e,
- content,
- ),
- ),
- [courtBounds, setContent],
- )}
- render={renderCourtObject}
- />
+interface EditorStepsTreeProps {
+ selectedStepId: number
+ root: StepInfoNode
+ onAddChildren: (parent: StepInfoNode) => void
+ onRemoveNode: (node: StepInfoNode) => void
+ onStepSelected: (node: StepInfoNode) => void
+}
-
-
-
-
- }
- courtRef={courtRef}
- previewAction={previewAction}
- renderComponent={renderComponent}
- renderActions={renderActions}
- />
-
-
-
+function EditorStepsTree({
+ selectedStepId,
+ root,
+ onAddChildren,
+ onRemoveNode,
+ onStepSelected,
+}: EditorStepsTreeProps) {
+ return (
+