Skip to content

Commit b7e4e56

Browse files
merged with export bug fixes
2 parents 81d8d0b + a9ae35b commit b7e4e56

16 files changed

+523
-372
lines changed

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2018 ReacType
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,70 @@
11
# ReacType
2-
Prototyping Tool for React/Typescript Applications
2+
3+
**ReacType** is a prototyping tool for developers employing **React** component architecture while utilizing the comprehensive type checking of **TypeScript**.
4+
5+
**ReacType** allows the user to _visualize_ their application architecture dynamically, employing a _canvas display_, an _application tree_, and a _component code preview_. The user can create components and load _instances_ of these components, as well as nested HTML elements, onto the canvas. These visual representations quickly reveal parent-child relationships between components and the embedded instances, with component views that can be toggled between and draggable representations that resized on the canvas itself. This architecture can then be _exported_ as TypeScript application files to be used as a starter template for any repository.
6+
7+
Download for [MacOS](), [Windows](), [Linux]().
8+
9+
### How to use
10+
11+
- Open the application to start a new project. It will open in the root App component, with its name listed in the left panel and the component represented by the white box on the canvas.
12+
- To add a new component, type its name in the upper right panel, in the field '**Add class component**', and press the plus button.
13+
- To render a component **_instance_** to the screen, first select the component, or _parent_, that the instance will be rendered within. This selected component will be represented in a new canvas view, with its own white box. Then press the plus button next to the component name. An instance, or _child_, representation will appear on the canvas.
14+
- To add draggable HTML elements, select the image icons on the lower left panel.
15+
- The bottom panel allows the user to toggle between 4 different views: a tree diagram of the application, a preview of the code, a form to enter component props, and a form to add HTML attributes.
16+
- **_Props_** can be added to each component within its tab on bottom panel. Enter in a _key-value pair_, select its data _type_ and press the bottom 'ADD PROP'.
17+
- **_HTML Element Attributes_** of class name and ID can be added to each HTML element after an HTML element has been rendered to the canvas.
18+
- To **_delete_** a _child_ or instance from the canvas, select the desired instance and either press the _delete_ key or click the 'DELETE CHILD' button.
19+
- To **_delete_** a _component_, click the 'DELETE' button of the desired component in the left panel.
20+
- To _start over_, select the blue 'CLEAR WORKSPACE' button in the left panel. This will **clear the entire application**.
21+
22+
### To Export Files
23+
24+
- Once finished setting up the application template, press the green 'EXPORT PROJECT' button at the bottom of the left panel and choose between two options to export your files:
25+
1. Export the component files into a src folder. This option will allow a developer to add these files to an existing project.
26+
1. Export a new project with TypeScript config files and the component files. This option will allow a developer to immediately begin a new project.
27+
28+
#### Authors
29+
30+
[Christian Padilla](linkedin.com/in/ChristianEdwardPadilla) [@ChristianEdwardPadilla](https://github.com/ChristianEdwardPadilla)
31+
32+
[Tolga Mizrakci](linkedin.com/in/tolga-mizrakci) [@tolgamizrakci](https://github.com/tolgamizrakci)
33+
34+
[Shlomo Porges](linkedin.com/shlomoporges) [@shlomoporges](https://github.com/ShlomoPorges)
35+
36+
[Adam Singer](linkedin.com/in/adsing) [@spincycle01](https://github.com/spincycle01)
37+
38+
## To Run Your Own Version
39+
40+
- **Fork** and **Clone** Repository.
41+
- Open project directory
42+
- Install dependencies
43+
44+
```bash
45+
yarn install
46+
```
47+
48+
- Run application
49+
50+
```bash
51+
yarn start
52+
```
53+
54+
- For development experience, in one terminal...
55+
56+
```bash
57+
yarn run dev
58+
```
59+
60+
- and on another terminal
61+
62+
```bash
63+
yarn run electron
64+
```
65+
66+
### Logo Design
67+
68+
## License
69+
70+
This project is licensed under the MIT License - see the [LICENSE.md]() file for details.

main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ const createWindow = () => {
6565
mainWindow = new BrowserWindow({
6666
width,
6767
height,
68+
webPreferences: {
69+
zoomFactor: 0.8,
70+
'node-Integration': false,
71+
},
6872
show: false,
6973
});
7074

src/components/BottomTabs.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ class BottomTabs extends Component {
162162
<Tab
163163
disableRipple
164164
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
165-
label="Component State"
165+
label={`HTML Element Attributes ${htmlAttribCount ? `(${htmlAttribCount})` : ''} `}
166166
/>
167-
<Tab
167+
{/* <Tab
168168
disableRipple
169169
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
170-
label={`HTML Element Attributes ${htmlAttribCount ? `(${htmlAttribCount})` : ''} `}
171-
/>
170+
label="Component State"
171+
/> */}
172172
</Tabs>
173173

174174
{value === 0 && (

src/components/HTMLComponentPanel.jsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class HTMLComponentPanel extends Component {
3333
};
3434

3535
render() {
36-
const { addChild } = this.props;
36+
const { classes } = this.props;
3737
return (
38-
<div className={'htmlPanel'} alignItems="flex-start" align="center">
38+
<div align="center">
3939
<Tab
4040
disableRipple
4141
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
@@ -67,7 +67,7 @@ class HTMLComponentPanel extends Component {
6767
variant="outlined"
6868
style={{
6969
color: 'white',
70-
fontSize: '50%',
70+
fontSize: '80%',
7171
margin: 0,
7272
padding: 0,
7373
}}
@@ -94,7 +94,7 @@ class HTMLComponentPanel extends Component {
9494
variant="outlined"
9595
style={{
9696
color: 'white',
97-
fontSize: '50%',
97+
fontSize: '80%',
9898
}}
9999
/>
100100
</Grid>
@@ -118,7 +118,7 @@ class HTMLComponentPanel extends Component {
118118
variant="outlined"
119119
style={{
120120
color: 'white',
121-
fontSize: '50%',
121+
fontSize: '80%',
122122
}}
123123
/>
124124
</Grid>
@@ -142,7 +142,7 @@ class HTMLComponentPanel extends Component {
142142
variant="outlined"
143143
style={{
144144
color: 'white',
145-
fontSize: '50%',
145+
fontSize: '80%',
146146
}}
147147
/>
148148
</Grid>
@@ -166,11 +166,18 @@ class HTMLComponentPanel extends Component {
166166
variant="outlined"
167167
style={{
168168
color: 'white',
169-
fontSize: '50%',
169+
fontSize: '80%',
170170
}}
171171
/>
172172
</Grid>
173-
<Grid item xs={4}>
173+
<Grid
174+
item
175+
xs={4}
176+
style={{
177+
margin: 0,
178+
padding: 0,
179+
}}
180+
>
174181
<IconButton
175182
className="htmlicons"
176183
aria-label="Paragraph"
@@ -182,15 +189,19 @@ class HTMLComponentPanel extends Component {
182189
padding: 0,
183190
}}
184191
>
185-
<ParagraphIcon style={{ color: '#e0e0e0' }} />
192+
<ParagraphIcon
193+
style={{ color: '#e0e0e0', paddingRight: '0px', marginRight: '0px' }}
194+
/>
186195
</IconButton>
187196
<Chip
188197
label="Paragraph"
189198
className={classes.chip}
190199
variant="outlined"
191200
style={{
192201
color: 'white',
193-
fontSize: '50%',
202+
fontSize: '62%',
203+
padding: '0px',
204+
margin: '0px',
194205
}}
195206
/>
196207
</Grid>

src/components/HtmlAttr.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class HtmlAttr extends Component {
8181
notchedOutline: classes.notchedOutline,
8282
},
8383
}}
84-
style={{ background: '#424242', height: '80%' }}
84+
style={{ background: '#424242', height: '70%' }}
8585
label={attr}
8686
variant="outlined"
8787
id={attr}
@@ -92,7 +92,7 @@ class HtmlAttr extends Component {
9292
<Grid item xs={1}>
9393
<Fab
9494
variant="extended"
95-
size="large"
95+
size="small"
9696
color="default"
9797
aria-label="Save"
9898
style={{
@@ -107,7 +107,7 @@ class HtmlAttr extends Component {
107107
</Fab>
108108
</Grid>
109109
<Grid item xs={4}>
110-
<Paper className={classes.root} style={{ height: '80%' }}>
110+
<Paper className={classes.root} style={{ height: '70%' }}>
111111
<p style={{ color: 'black' }}>
112112
{focusChild.HTMLInfo[attr] ? focusChild.HTMLInfo[attr] : ' no attribute assigned'}
113113
</p>

src/components/KonvaStage.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,7 @@ class KonvaStage extends Component {
147147
}}
148148
tabIndex="0" // required for keydown event to be heard by this.container
149149
>
150-
{/* <Button
151-
onClick={deleteChild}
152-
style={{
153-
width: '150px',
154-
position: 'relative',
155-
float: 'right',
156-
background: '#dbdbdb',
157-
zIndex: 2,
158-
}}
159-
>
160-
delete child
161-
</Button> */}
162-
<Fab
150+
{/* <Fab
163151
variant="extended"
164152
size="small"
165153
color="inherit"
@@ -179,7 +167,7 @@ class KonvaStage extends Component {
179167
>
180168
<DeleteIcon />
181169
Delete Child
182-
</Fab>
170+
</Fab> */}
183171
<Stage
184172
className={'canvasStage'}
185173
ref={node => {

src/components/LeftColExpansionPanel.jsx

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, { Fragment } from "react";
2-
import { withStyles } from "@material-ui/core/styles";
3-
import Typography from "@material-ui/core/Typography";
4-
import List from "@material-ui/core/List";
5-
import ListItem from "@material-ui/core/ListItem";
6-
import ListItemText from "@material-ui/core/ListItemText";
7-
import IconButton from "@material-ui/core/IconButton";
8-
import Grid from "@material-ui/core/Grid";
9-
import AddIcon from "@material-ui/icons/Add";
10-
import DeleteIcon from "@material-ui/icons/Delete";
11-
import Fab from "@material-ui/core/Fab";
1+
import React, { Fragment } from 'react';
2+
import { withStyles } from '@material-ui/core/styles';
3+
import Typography from '@material-ui/core/Typography';
4+
import List from '@material-ui/core/List';
5+
import ListItem from '@material-ui/core/ListItem';
6+
import ListItemText from '@material-ui/core/ListItemText';
7+
import IconButton from '@material-ui/core/IconButton';
8+
import Grid from '@material-ui/core/Grid';
9+
import AddIcon from '@material-ui/icons/Add';
10+
import DeleteIcon from '@material-ui/icons/Delete';
11+
import Button from '@material-ui/core/Button';
1212

1313
const LeftColExpansionPanel = props => {
1414
const {
@@ -82,49 +82,51 @@ const LeftColExpansionPanel = props => {
8282
{directParents ? (
8383
<p
8484
style={{
85-
marginLeft: "10px",
86-
color: "white",
87-
fontSize: "12px",
88-
marginTop: "1px"
85+
padding: '0px',
86+
marginTop: '0px',
87+
marginLeft: '15px',
88+
color: '#D3D3D3',
89+
fontSize: '12px',
8990
}}
9091
>
9192
Used in: {directParents}
9293
</p>
9394
) : (
9495
<p
9596
style={{
96-
marginLeft: "10px",
97-
color: "white",
98-
fontSize: "12px",
99-
marginTop: "1px"
97+
padding: '0px',
98+
marginTop: '0px',
99+
marginLeft: '15px',
100+
color: '#D3D3D3',
101+
fontSize: '12px',
100102
}}
101103
>
102104
Not used
103105
</p>
104106
)}
105107
</span>
106-
<Fab
107-
variant="extended"
108+
<Button
109+
variant="text"
108110
size="small"
109-
color="inherit"
111+
color="default"
110112
aria-label="Delete"
111113
className={classes.margin}
114+
onClick={() => deleteComponent({
115+
componentId: id,
116+
stateComponents: components,
117+
})
118+
}
112119
style={{
113-
marginLeft: "10px",
114-
marginTop: "5px",
115-
marginBottom: "10px"
120+
color: '#D3D3D3',
121+
marginBottom: '10px',
122+
marginTop: '0px',
123+
marginLeft: '11px',
124+
padding: '0px',
116125
}}
117-
// style={{ maxWidth: "20px" }}
118-
onClick={() =>
119-
deleteComponent({
120-
componentId: id,
121-
stateComponents: components
122-
})
123-
}
124126
>
125-
<DeleteIcon />
127+
<DeleteIcon style={{ color: '#D3D3D3' }} />
126128
Delete
127-
</Fab>
129+
</Button>
128130
{/* <IconButton
129131
style={{ display: "inline-block" }}
130132
onClick={() =>

src/components/MainContainerHeader.jsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,4 @@ const MainContainerHeader = (props) => {
103103
);
104104
};
105105

106-
// MainContainerHeader.propTypes = {
107-
// image: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
108-
// classes: PropTypes.object.isRequired,
109-
// increaseHeight: PropTypes.func.isRequired,
110-
// decreaseHeight: PropTypes.func.isRequired,
111-
// showImageDeleteModal: PropTypes.func.isRequired,
112-
// updateImage: PropTypes.func.isRequired,
113-
// showGenerateAppModal: PropTypes.func.isRequired,
114-
// totalComponents: PropTypes.number.isRequired,
115-
// collapseColumn: PropTypes.func.isRequired,
116-
// rightColumnOpen: PropTypes.bool.isRequired,
117-
// toggleClass: PropTypes.bool.isRequired,
118-
// };
119-
120106
export default withStyles(styles)(MainContainerHeader);

src/components/SimpleModal.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const SimpleModal = (props) => {
7878
<div>
7979
{secBtnLabel ? (
8080
<Button
81-
variant="extendedFab"
81+
variant="contained"
8282
color="secondary"
8383
className={classes.button}
8484
onClick={secBtnAction}
@@ -88,7 +88,7 @@ const SimpleModal = (props) => {
8888
) : null}
8989
{primBtnLabel ? (
9090
<Button
91-
variant="extendedFab"
91+
variant="contained"
9292
color="primary"
9393
className={classes.button}
9494
onClick={primBtnAction}

0 commit comments

Comments
 (0)