Nikatlas %!s(int64=5) %!d(string=hai) anos
pai
achega
7c44ea3e6a
Modificáronse 3 ficheiros con 48 adicións e 77 borrados
  1. 34 77
      App.js
  2. 0 0
      environment.js
  3. 14 0
      webpack.config.js

+ 34 - 77
App.js

@@ -1,19 +1,19 @@
 import React , { useState } from 'react';
 import { StyleSheet, Text, View as Div, TextInput, Button } from 'react-native';
-import RoutingSystem from './lib/systems/RoutingSystem.js';
-import ViewSystem, { View, Node, ViewNode, RowNode, ColNode } from './lib/systems/ViewSystem.js';
-import CoreSystem from './lib/systems/CoreSystem.js';
+import RoutingSystem from './dist/lib/systems/RoutingSystem.js';
+import ViewSystem, { View, Node, ViewNode, RowNode, ColNode } from './dist/lib/systems/ViewSystem.js';
+import CoreSystem from './dist/lib/systems/CoreSystem.js';
 
 /*********** Custom View Tree ****/
-import { Tree } from './lib/helpers/tree';
+import { Tree } from './dist/lib/helpers/tree';
 
-import FormComp from './modules/Form';
-
-import  TextComp  from './modules/Text';
-import RootComp from './modules/RootComp';
-import ImageComp from './modules/Image';
-import ButtonComp from './modules/Button';
+import FormComp from './dist/modules/Form';
 
+import  TextComp  from './dist/modules/Text';
+import RootComp from './dist/modules/RootComp';
+import ImageComp from './dist/modules/Image';
+import ButtonComp from './dist/modules/Button';
+import Environment from './environment';
 
 const CustomStyle = StyleSheet.create({
   container:{
@@ -121,81 +121,38 @@ VS.replace(NodeK,EditNode)
 //**************************************  Routing Ends
 
 let CS = new CoreSystem()
-.addPage('test', VS2, 'VS1')
-.setHome('test');
-
-
-let data = CS.export();
-console.log("Original");
-console.log(data);
-let js = JSON.stringify(data);
-console.log("String");
-console.log(js);
-let NCS = new CoreSystem()
-let againdata = JSON.parse(js);
-console.log("Again");
-console.log(againdata)
-NCS.import(againdata);
-
-window.onclick = (event) => {
-  console.log("Mouse event --- ", event);
-
-  let res = NCS.ray({event}); // returns ViewNode
-  console.log(res);
-}
+// .addPage('test', VS2, 'VS1')
+// .setHome('test');
+CS.import(Environment);
+
+// let data = CS.export();
+// console.log("Original");
+// console.log(data);
+// let js = JSON.stringify(data);
+// console.log("String");
+// console.log(js);
+// let NCS = new CoreSystem()
+// let againdata = JSON.parse(js);
+// console.log("Again");
+// console.log(againdata)
+// NCS.import(againdata);
+
+// window.onclick = (event) => {
+//   console.log("Mouse event --- ", event);
+
+//   let res = NCS.ray({event}); // returns ViewNode
+//   console.log(res);
+// }
 
 
 const useForceUpdate = (text) => useState(text)[1];
 export default function App() {
   let [text, setText] = useState('');
   let forceUpdate = useForceUpdate(text);
-  let currentView =  NCS.render();
+  // let currentView =  NCS.render();
   let currentView2 = CS.render();
   // console.log(currentView)
-  return (
-    <Div style={styles.container}>
-      <TextInput
-        style={{height: 40, borderColor: 'gray', borderWidth: 1}}
-        onChangeText={(txt) => setText(txt)}
-        value={text}
-      />
-      <Button title={'Change Route'} onPress={() => {
-        //VS.setColumns(root, text);
-        // CS.goto(text);
-        // NCS.goto(text);
-        //forceUpdate(text)
-      }}></Button>
-
-       <Text>Open up App.js to start working on your app!</Text>
-        <Text>Open up App.js to start working on your app!</Text>
-
-      {React.createElement(ButtonComp)}
-         <Text>Open up App.js to start working on your app!</Text>
-
-        <Text>here i s</Text>
-      {React.createElement(TextComp)}
-      <Text>sdadada</Text>
-      {React.createElement(RootComp)}
-      <Div style={{width: 200, height:400}}>
-        {React.createElement(ImageComp)}
-      </Div>
-      <Div style={{width: 200, height:400}}>
-      {React.createElement(FormComp)}
-      </Div>
-      <Text>Open up App.js to start working on your app!</Text>
-      
-      <Div style={{width:500, height:600}}>
-        {currentView}
-      </Div>
-      <Div>
-        <Text>------------------</Text>
-        <Text>------------------</Text>
-      </Div>
-      <Div style={{width:500, height:600}}>
-        {currentView2}
-      </Div>
-    </Div>
-  );
+  return <Div>currentView2</Div>;
 }
 
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
environment.js


+ 14 - 0
webpack.config.js

@@ -0,0 +1,14 @@
+module.exports = {
+  module: {
+    loaders: [
+      {
+        test: /\.js?$/,
+        exclude: /(node_modules|bower_components)/,
+        loaders: [
+          'react-hot',
+          'babel?presets[]=react,presets[]=es2015,presets[]=stage-0'
+        ]
+      }
+    ]
+  }
+}

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio