Skip to content

Commit 2198e66

Browse files
committed
merged
2 parents faf072f + c04fa26 commit 2198e66

16 files changed

+374
-334
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ class BottomTabs extends Component {
168168
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
169169
label={`Component Props ${propCount ? `(${propCount})` : ''} `}
170170
/>
171-
{/* <Tab
172-
disableRipple
173-
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
174-
label="Component State"
175-
/> */}
176171
<Tab
177172
disableRipple
178173
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
179174
label={`HTML Element Attributes ${htmlAttribCount ? `(${htmlAttribCount})` : ''} `}
180175
/>
176+
{/* <Tab
177+
disableRipple
178+
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
179+
label="Component State"
180+
/> */}
181181
</Tabs>
182182

183183
{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, classes } = this.props;
36+
const { classes } = this.props;
3737
return (
38-
<div className={'htmlPanel'} 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
@@ -84,7 +84,7 @@ class HtmlAttr extends Component {
8484
input: classes.input,
8585
},
8686
}}
87-
style={{ background: '#424242', height: '80%' }}
87+
style={{ background: '#424242', height: '70%' }}
8888
label={attr}
8989
variant="outlined"
9090
id={attr}
@@ -95,7 +95,7 @@ class HtmlAttr extends Component {
9595
<Grid item xs={1}>
9696
<Fab
9797
variant="extended"
98-
size="large"
98+
size="small"
9999
color="default"
100100
aria-label="Save"
101101
style={{
@@ -110,7 +110,7 @@ class HtmlAttr extends Component {
110110
</Fab>
111111
</Grid>
112112
<Grid item xs={4}>
113-
<Paper className={classes.root} style={{ height: '80%' }}>
113+
<Paper className={classes.root} style={{ height: '70%' }}>
114114
<p style={{ color: 'black' }}>
115115
{focusChild.HTMLInfo[attr] ? focusChild.HTMLInfo[attr] : ' no attribute assigned'}
116116
</p>

src/components/KonvaStage.jsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,7 @@ class KonvaStage extends Component {
158158
}}
159159
tabIndex="0" // required for keydown event to be heard by this.container
160160
>
161-
{/* <Button
162-
onClick={deleteChild}
163-
style={{
164-
width: '150px',
165-
position: 'relative',
166-
float: 'right',
167-
background: '#dbdbdb',
168-
zIndex: 2,
169-
}}
170-
>
171-
delete child
172-
</Button> */}
173-
<Fab
161+
{/* <Fab
174162
variant="extended"
175163
size="small"
176164
color="inherit"
@@ -190,7 +178,7 @@ class KonvaStage extends Component {
190178
>
191179
<DeleteIcon />
192180
Delete Child
193-
</Fab>
181+
</Fab> */}
194182
<Stage
195183
className={'canvasStage'}
196184
ref={(node) => {

src/components/LeftColExpansionPanel.jsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import IconButton from '@material-ui/core/IconButton';
88
import Grid from '@material-ui/core/Grid';
99
import AddIcon from '@material-ui/icons/Add';
1010
import DeleteIcon from '@material-ui/icons/Delete';
11-
import Fab from '@material-ui/core/Fab';
11+
import Button from '@material-ui/core/Button';
1212

1313
const LeftColExpansionPanel = (props) => {
1414
const {
@@ -72,48 +72,51 @@ const LeftColExpansionPanel = (props) => {
7272
{directParents ? (
7373
<p
7474
style={{
75-
marginLeft: '10px',
76-
color: 'white',
75+
padding: '0px',
76+
marginTop: '0px',
77+
marginLeft: '15px',
78+
color: '#D3D3D3',
7779
fontSize: '12px',
78-
marginTop: '1px',
7980
}}
8081
>
8182
Used in: {directParents}
8283
</p>
8384
) : (
8485
<p
8586
style={{
86-
marginLeft: '10px',
87-
color: 'white',
87+
padding: '0px',
88+
marginTop: '0px',
89+
marginLeft: '15px',
90+
color: '#D3D3D3',
8891
fontSize: '12px',
89-
marginTop: '1px',
9092
}}
9193
>
9294
Not used
9395
</p>
9496
)}
9597
</span>
96-
<Fab
97-
variant="extended"
98+
<Button
99+
variant="text"
98100
size="small"
99-
color="inherit"
101+
color="default"
100102
aria-label="Delete"
101103
className={classes.margin}
102-
style={{
103-
marginLeft: '10px',
104-
marginTop: '5px',
105-
marginBottom: '10px',
106-
}}
107-
// style={{ maxWidth: "20px" }}
108104
onClick={() => deleteComponent({
109105
componentId: id,
110106
stateComponents: components,
111107
})
112108
}
109+
style={{
110+
color: '#D3D3D3',
111+
marginBottom: '10px',
112+
marginTop: '0px',
113+
marginLeft: '11px',
114+
padding: '0px',
115+
}}
113116
>
114-
<DeleteIcon />
117+
<DeleteIcon style={{ color: '#D3D3D3' }} />
115118
Delete
116-
</Fab>
119+
</Button>
117120
{/* <IconButton
118121
style={{ display: "inline-block" }}
119122
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)