|
@@ -4,6 +4,8 @@ import Library from 'trapilib/dist/lib';
|
|
import { TextInput, Image, Button } from 'react-native';
|
|
import { TextInput, Image, Button } from 'react-native';
|
|
|
|
|
|
import TextEditor from '../Components/TextEditor';
|
|
import TextEditor from '../Components/TextEditor';
|
|
|
|
+import Alignment from '../Components/Alignment';
|
|
|
|
+
|
|
// import Numbers from '../Components/Numbers';
|
|
// import Numbers from '../Components/Numbers';
|
|
// import ColorEditor from '../Components/ColorEditor';
|
|
// import ColorEditor from '../Components/ColorEditor';
|
|
import TypeHandler from '../Components/TypeHandler.js';
|
|
import TypeHandler from '../Components/TypeHandler.js';
|
|
@@ -64,6 +66,13 @@ export default class SideBar extends BaseSystem {
|
|
node.props[key] = text;
|
|
node.props[key] = text;
|
|
this.forceUpdate();
|
|
this.forceUpdate();
|
|
}
|
|
}
|
|
|
|
+ editNodeStyle(node, style) {
|
|
|
|
+ node.props = {
|
|
|
|
+ ...node.props,
|
|
|
|
+ ...style
|
|
|
|
+ }
|
|
|
|
+ this.forceUpdate();
|
|
|
|
+ }
|
|
|
|
|
|
createHandler(Structure, viewNodeProps, key, onChange) {
|
|
createHandler(Structure, viewNodeProps, key, onChange) {
|
|
let Editor = TypeHandler(Structure);
|
|
let Editor = TypeHandler(Structure);
|
|
@@ -80,6 +89,7 @@ export default class SideBar extends BaseSystem {
|
|
editorProps.value = viewNodeProps[key];
|
|
editorProps.value = viewNodeProps[key];
|
|
break;
|
|
break;
|
|
case DataTypes.Types.Integer:
|
|
case DataTypes.Types.Integer:
|
|
|
|
+ case DataTypes.Types.Real:
|
|
case DataTypes.Types.Bool:
|
|
case DataTypes.Types.Bool:
|
|
editorProps.number = viewNodeProps[key];
|
|
editorProps.number = viewNodeProps[key];
|
|
break;
|
|
break;
|
|
@@ -144,7 +154,9 @@ export default class SideBar extends BaseSystem {
|
|
|
|
|
|
return (
|
|
return (
|
|
<View>
|
|
<View>
|
|
- <Text style={SideBarStyle.title}>Side Bar</Text>
|
|
|
|
|
|
+ <Alignment onSelect={(style) => this.editNodeStyle(selectedNode, style)} />
|
|
|
|
+
|
|
|
|
+
|
|
{StyleData.length > 0 ? (
|
|
{StyleData.length > 0 ? (
|
|
<View key={Math.random()}>
|
|
<View key={Math.random()}>
|
|
<select onChange={(event) => {
|
|
<select onChange={(event) => {
|