sxoinas12 пре 5 година
родитељ
комит
9160cf69ae

+ 5 - 1
App.js

@@ -16,6 +16,10 @@ import ButtonComp from './modules/Button';
 import Environment from './environment';
 import * as Font from 'expo-font';
 import Module from './modules';
+import BlogFeed from './modules/BlogFeed';
+
+
+
 console.log("@@@@@@@@@@@@@@")
 console.log(Module)
 
@@ -177,7 +181,7 @@ export default class App extends React.Component {
   let currentView2 = CS.render();  
   return (
     <Div>
-      <Div>{CS.ModuleSystem.createElementCtor(ButtonComp)}</Div>
+      <Div>{CS.ModuleSystem.createElementCtor(BlogFeed)}</Div>
       <Div>{currentView2}</Div>
     </Div>)
     }

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/lib/Module.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/lib/systems/CoreSystem.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/lib/systems/ViewSystem.js


+ 1 - 1
dist/modules/BaseContainer/index.js

@@ -1 +1 @@
-"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=BaseContainer;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _Types=_interopRequireDefault(require("../../lib/Types"));var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\modules\\BaseContainer\\index.js";function BaseContainer(props){var selected=props.selected,width=props.width,height=props.height,overflow=props.overflow,restProps=(0,_objectWithoutProperties2["default"])(props,["selected","width","height","overflow"]);if(!width)width=BaseContainer.Inputs.width["default"];if(!height)height=BaseContainer.Inputs.height["default"];return _react["default"].createElement(_reactNative.View,(0,_extends2["default"])({},restProps,{style:{width:width,height:height,overflow:overflow},__source:{fileName:_jsxFileName,lineNumber:17}}));}BaseContainer.Inputs={width:new _Types["default"].Integer().require()["default"](50),height:new _Types["default"].Integer().require()["default"](50),overflow:new _Types["default"].Integer().require()["default"]('hidden')};
+"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=BaseContainer;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _Types=_interopRequireDefault(require("../../lib/Types"));var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\modules\\BaseContainer\\index.js";function BaseContainer(props){var selected=props.selected,width=props.width,height=props.height,overflow=props.overflow,restProps=(0,_objectWithoutProperties2["default"])(props,["selected","width","height","overflow"]);if(!width)width=BaseContainer.Inputs.width["default"];if(!height)height=BaseContainer.Inputs.height["default"];return _react["default"].createElement(_reactNative.View,(0,_extends2["default"])({},restProps,{style:{width:width,height:height,overflow:overflow},__source:{fileName:_jsxFileName,lineNumber:17}}));}BaseContainer.Inputs={width:new _Types["default"].Integer().require()["default"](50),height:new _Types["default"].Integer().require()["default"](50),overflow:new _Types["default"].Integer().require()["default"]('hidden')};

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/BaseHolder/index.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/Button/index.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/Col.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/DatePicker.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/Form/index.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/Image/index.js


+ 1 - 1
dist/modules/RootComp/index.js

@@ -1 +1 @@
-"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Types=_interopRequireDefault(require("../../lib/Types"));var _Module2=_interopRequireDefault(require("../../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\modules\\RootComp\\index.js";var RootComp=function(_Module){(0,_inherits2["default"])(RootComp,_Module);function RootComp(props){(0,_classCallCheck2["default"])(this,RootComp);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(RootComp).call(this,props));}(0,_createClass2["default"])(RootComp,[{key:"display",value:function display(){return;_react["default"].createElement(_reactNative.Text,{__source:{fileName:_jsxFileName,lineNumber:14}},this.props.text||""," - ",this.props.second);}}]);return RootComp;}(_Module2["default"]);exports["default"]=RootComp;RootComp.Inputs={text:new _Types["default"].Text().require()["default"]("Sample Text"),second:new _Types["default"].Integer().require()["default"](5)};
+"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Types=_interopRequireDefault(require("../../lib/Types"));var _Module2=_interopRequireDefault(require("../../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\modules\\RootComp\\index.js";var RootComp=function(_Module){(0,_inherits2["default"])(RootComp,_Module);function RootComp(props){(0,_classCallCheck2["default"])(this,RootComp);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(RootComp).call(this,props));}(0,_createClass2["default"])(RootComp,[{key:"display",value:function display(){return;_react["default"].createElement(_reactNative.Text,{__source:{fileName:_jsxFileName,lineNumber:14}},this.props.text||""," - ",this.props.second);}}]);return RootComp;}(_Module2["default"]);exports["default"]=RootComp;RootComp.Inputs={text:new _Types["default"].Text().require()["default"]("Sample Text"),second:new _Types["default"].Integer().require()["default"](5)};

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/Row.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/modules/Text/index.js


+ 1 - 1
dist/modules/View.js

@@ -1 +1 @@
-"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\modules\\View.js";var ViewComp=function(_Module){(0,_inherits2["default"])(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2["default"])(this,ViewComp);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(ViewComp).call(this,props));}(0,_createClass2["default"])(ViewComp,[{key:"display",value:function display(){return _react["default"].createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:16}},this.props.children);}}]);return ViewComp;}(_Module2["default"]);exports["default"]=ViewComp;
+"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\modules\\View.js";var ViewComp=function(_Module){(0,_inherits2["default"])(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2["default"])(this,ViewComp);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(ViewComp).call(this,props));}(0,_createClass2["default"])(ViewComp,[{key:"display",value:function display(){return _react["default"].createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:16}},this.props.children);}}]);return ViewComp;}(_Module2["default"]);exports["default"]=ViewComp;

+ 1 - 1
dist/modules/ViewComp.js

@@ -1 +1 @@
-"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\modules\\ViewComp.js";var ViewComp=function(_Module){(0,_inherits2["default"])(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2["default"])(this,ViewComp);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(ViewComp).call(this,props));}(0,_createClass2["default"])(ViewComp,[{key:"display",value:function display(){return _react["default"].createElement(_reactNative.View,{key:Math.random(),__source:{fileName:_jsxFileName,lineNumber:16}});}}]);return ViewComp;}(_Module2["default"]);exports["default"]=ViewComp;
+"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\modules\\ViewComp.js";var ViewComp=function(_Module){(0,_inherits2["default"])(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2["default"])(this,ViewComp);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(ViewComp).call(this,props));}(0,_createClass2["default"])(ViewComp,[{key:"display",value:function display(){return _react["default"].createElement(_reactNative.View,{key:Math.random(),__source:{fileName:_jsxFileName,lineNumber:16}});}}]);return ViewComp;}(_Module2["default"]);exports["default"]=ViewComp;

+ 8 - 1
lib/Module.js

@@ -19,17 +19,24 @@ export default class Module extends React.Component{
 		});
 		this.isTemplate = false
 		//console.log("GEN EV: " , eventName, EventSystem);
+		this._containerStyle = {
+			margin: 10
+		}
 	}
 	
 	componentWillMount() {
 
 	}
 
+	setContainerStyle(style) { 
+		this._containerStyle = style;
+	}
+
 	display() {
 		throw new Error("You must extend this base Module and override display method!");
 	}
 	render() { 
-		return <View ModuleID={this.props.ModuleID} style={{}} MY_WRAPPER_FROM_BASE_MODULE={true}>
+		return <View ModuleID={this.props.ModuleID} style={[{overflow:'hidden'},this._containerStyle]} MY_WRAPPER_FROM_BASE_MODULE={true}>
 			{this.display()}
 		</View>
 		// throw new Error("You must extend this base Module and override render method!");

+ 1 - 1
lib/systems/CoreSystem.js

@@ -10,7 +10,7 @@ export default class CoreSystem {
 		this.Routing = new RoutingSystem();
 		this.ModuleSystem = new ModuleSystem();
 		this.EventSystem = new EventSystem();
-		this.ViewSystem    = new ViewSystem(this.ModuleSystem, this.EventSystem);
+		this.ViewSystem    = new ViewSystem(this);
 		this.loadFonts()
 		this.__loadModules(Modules);
 	}

+ 13 - 11
lib/systems/ViewSystem.js

@@ -29,10 +29,11 @@ export class Node extends TreeNode {
 }
 
 export default class ViewSystem {
-	constructor(MS, ES) {
+	constructor(CS) {
 		this.views = {};
-		this.ModuleSystem = MS;
-		this.EventSystem = ES;
+		this.CoreSystem = CS;
+		this.ModuleSystem = CS.ModuleSystem;
+		this.EventSystem = CS.EventSystem;
 	}
 
 	getNode(ViewId, NodeId) {
@@ -54,7 +55,7 @@ export default class ViewSystem {
 	}
 
 	render(name) {
-		return this.views[name].render(this.ModuleSystem, this.EventSystem);
+		return this.views[name].render(this.CoreSystem);
 	}
 
 	export() {
@@ -109,9 +110,9 @@ export class View {
 		return this.getNode(node.id);
 	}
 
-	render(MS, ES) {
+	render(CS) {
 		let node = this.ViewTree.root;
-		return (<Renderer ModuleSystem={MS} EventSystem={ES} node={node} tree={this.ViewTree}/>);	
+		return (<Renderer CoreSystem={CS} node={node} tree={this.ViewTree}/>);	
 	}
 
 	addViewNode(node,parentNode = null){
@@ -249,17 +250,17 @@ export class View {
 
 
 let Renderer = (props) => {
-	let { node , tree, ModuleSystem, EventSystem } = props;
+	let { node , tree, CoreSystem } = props;
 	let childrens = tree.getChildren(node);
 	let childrenReact = childrens.map(child => {
 		return(
 		<Renderer node = {child}
 				tree={tree}
 				key={child.id} 
-				ModuleSystem={ModuleSystem}
-				EventSystem={EventSystem} />)
+				CoreSystem={CoreSystem} />)
 	});
-		
+	let ModuleSystem = CoreSystem.ModuleSystem;
+	let EventSystem = CoreSystem.EventSystem;
 	let viewNode = node.content;
 	let ViewNodeReact;
 	// IF CONTENT
@@ -273,7 +274,8 @@ let Renderer = (props) => {
 			{ 
 				...viewNode.props,
 				ModuleID: viewNode.id,
-				EventSystem: EventSystem
+				EventSystem: EventSystem,
+				CoreSystem: CoreSystem
 			},
 			[], // children
 			viewNode.namespace,

+ 6 - 7
modules/BaseHolder/index.js

@@ -59,8 +59,7 @@ export default class BaseHolder extends React.Component {
 						alignContent,
 						flexDirection,
 						flexWrap,
-						flexFlow,
-						padding: 10
+						flexFlow
 		    	 	}
 		    	 	]}>
 					{children}
@@ -80,10 +79,10 @@ const styles = StyleSheet.create({
 	}, 
 	stretchToContent: {
 		position: 'absolute',
-		top: 10,
-		left: 10,
-		bottom: 10,
-		right: 10,
+		top: 0,
+		left: 0,
+		bottom: 0,
+		right: 0,
 		// borderColor: 'red',
 		// borderWidth: 1
 	},
@@ -111,7 +110,7 @@ BaseHolder.Inputs = {
 	width: new Types.Integer(),
 	height: new Types.Integer(),
 	stretchContainer: new Types.Bool().default(false),
-	overflow: new Types.Text().default('hidden'),
+	overflow: new Types.Text().default('visible'),
 	justifyContent: new Types.Text().default("flex-start"),
 	alignItems: new Types.Text(),
 	alignContent: new Types.Text(),

+ 2 - 1
modules/BlogFeed/index.js

@@ -10,7 +10,8 @@ export default class BlogFeed extends Module {
 	constructor(props){
 		super(props)
 		this.isTemplate = true;
-		
+		console.log("@@@@@@here i am ")
+		console.log(this.props.node)
 	}
 	render(){
 		return(

+ 7 - 7
modules/Image/index.js

@@ -7,7 +7,8 @@ let image = require('./assets/default.jpg')
 export default class ImageComp extends Module {
 	constructor(props) {
 		super(props);
-
+		this.setContainerStyle({ marginLeft: 0, marginRight: 0});
+		
 	}
 
 	display() {
@@ -17,11 +18,10 @@ export default class ImageComp extends Module {
 			resizeMode,
 			source
 		} = this.props;
-		if(!width) width = 100;
-		if(!height) height = 100;
-		if(!resizeMode) resizeMode = 'cover';
+		console.log(width);
+		if(!width) width = "100%";
 		return 	<Image
-			          style={{width, height}}
+			          style={{width, height, paddingTop: height ? '0' : '56.25%'}}
 			          resizeMode={resizeMode}
 			          source={source || image}
 			        />
@@ -31,7 +31,7 @@ export default class ImageComp extends Module {
 
 ImageComp.Inputs = {
 	source: new Types.Text(),
-	width: new Types.Integer().require().default(70),
-	height: new Types.Integer().require().default(70),
+	width: new Types.Integer(),
+	height: new Types.Integer(),
 	resizeMode: new Types.Text().require().default('cover')
 }

+ 6 - 0
modules/Text/index.js

@@ -9,6 +9,12 @@ export default class TextComp extends Module {
 		this.state = {
 			text: props.text || ""
 		}
+		console.log("Look at me now")
+		console.log(this)
+		if(this.props.CoreSystem){
+
+		//console.log(this.props.CoreSystem.ViewSystem.getChildren(this))
+		}
 	}
 
 	display() {

Неке датотеке нису приказане због велике количине промена