|
@@ -13,7 +13,7 @@ export default class SideBar{
|
|
this.CoreSystem = CoreSystem;
|
|
this.CoreSystem = CoreSystem;
|
|
}
|
|
}
|
|
|
|
|
|
- onToolUpdate(props){
|
|
|
|
|
|
+ onUpdate(fn){
|
|
this.__onUpdate = fn
|
|
this.__onUpdate = fn
|
|
}
|
|
}
|
|
|
|
|
|
@@ -35,8 +35,10 @@ export default class SideBar{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- editNode(text,node){
|
|
|
|
-
|
|
|
|
|
|
+ editNode(text,key){
|
|
|
|
+ console.log(text,key);
|
|
|
|
+ this.viewNode.props[key] = text;
|
|
|
|
+ this.forceUpdate();
|
|
}
|
|
}
|
|
//TODO Change everything :P
|
|
//TODO Change everything :P
|
|
render(){
|
|
render(){
|
|
@@ -44,31 +46,26 @@ export default class SideBar{
|
|
console.log("@@@@@@@@@@@@@")
|
|
console.log("@@@@@@@@@@@@@")
|
|
console.log(tool)
|
|
console.log(tool)
|
|
let ModuleSystem = this.CoreSystem.ModuleSystem;
|
|
let ModuleSystem = this.CoreSystem.ModuleSystem;
|
|
- let NodeProps = {};
|
|
|
|
|
|
+ let Structure = {};
|
|
if(tool){
|
|
if(tool){
|
|
if(tool.selectedNode && tool.selectedNode.content && tool.selectedNode.content.value){
|
|
if(tool.selectedNode && tool.selectedNode.content && tool.selectedNode.content.value){
|
|
- let ctor = tool.selectedNode.content.value
|
|
|
|
- let namespace = tool.selectedNode.content.namespace
|
|
|
|
|
|
+ this.viewNode = tool.selectedNode.content;
|
|
// give ViewNode
|
|
// give ViewNode
|
|
- NodeProps = ModuleSystem.constructors[namespace][ctor].propTypes;
|
|
|
|
- console.log(NodeProps);
|
|
|
|
|
|
+ Structure = ModuleSystem.fromViewNode(this.viewNode).Inputs;
|
|
|
|
+ console.log(Structure);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- let data = Object.keys(NodeProps || {}).map((key) => {
|
|
|
|
|
|
+ let data = Object.keys(Structure || {}).map((key) => {
|
|
return(
|
|
return(
|
|
<View style={SideBarStyle.body}>
|
|
<View style={SideBarStyle.body}>
|
|
<Text>{key}</Text>
|
|
<Text>{key}</Text>
|
|
{key === 'text' ? (
|
|
{key === 'text' ? (
|
|
<TextInput
|
|
<TextInput
|
|
style={{height: 40, borderColor: 'gray', borderWidth: 1}}
|
|
style={{height: 40, borderColor: 'gray', borderWidth: 1}}
|
|
- onChangeText={(text) => this.editNode(text,node)}
|
|
|
|
- value={NodeProps[key]}
|
|
|
|
|
|
+ onChangeText={(text) => this.editNode(text, key)}
|
|
|
|
+ value={this.viewNode.props[key]}
|
|
/>
|
|
/>
|
|
):(null)}
|
|
):(null)}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
</View>
|
|
</View>
|
|
)
|
|
)
|
|
|
|
|