diff --git a/src/components/editor/State.css b/src/components/editor/State.css index face804..5a589f3 100644 --- a/src/components/editor/State.css +++ b/src/components/editor/State.css @@ -51,6 +51,16 @@ textarea { padding-right: .2em; } +.remarks-text div { + font-style: italic; + text-decoration: underline !important; + cursor: text; + color: #336699 !important; + position:relative; + padding-left: .2em; + padding-right: .2em; +} + .editable-error { color: #ff3300 !important; } @@ -59,12 +69,16 @@ span.editable-text:empty { color: #ff3300 !important; } +span.remarks-text div:empty{ + height:1.5em; +} + span.editable-text:empty:after { - content: 'Enter value'; + content: 'Enter Value'; } span.editable-text > :empty:after { - content: 'Enter value'; + content: 'Enter Value'; } .section { @@ -91,3 +105,4 @@ span.editable-text > :empty:after { .warning { color: #ff3300; } + diff --git a/src/components/editor/State.js b/src/components/editor/State.js index 3a2f644..fe7b6c1 100644 --- a/src/components/editor/State.js +++ b/src/components/editor/State.js @@ -12,7 +12,7 @@ import ConditionalEditor from './Conditional'; import Transition from './Transition'; import { getTemplate } from '../../templates/Templates'; import { BasicTutorial, EditTutorial } from '../../templates/Tutorial'; - +import TextArea from './TextArea' import './State.css'; @@ -103,7 +103,20 @@ class StateEditor extends Component { } updateRemarks = (el:any) => { - const remarks = el.remarks? el.remarks.split("\n") : null; + + // Need to make sure new lines get represented correctly + // when input from the remarks editor. + const editedRemarks = el.remarks.split("\n").reduce(((p,d,i)=>{ + if(d.length>0){ + return [...p,d,""]; + + }else{ + return [...p,d]; + } + + }),[]); + console.log(editedRemarks); + let remarks = el.remarks? editedRemarks : null; this.props.onChange(`states.${this.props.state.name}.remarks`)({remarks:{id:remarks}}); } @@ -123,18 +136,16 @@ class StateEditor extends Component { let remarks = this.props.state.remarks ||""; remarks = Array.isArray(remarks)? remarks.join("\n"): remarks; - const transitionType = (this.props.state.transition||{}).type; return (
State Editor
-

+

State Type:
- -
+