Skip to content

Commit bdd8b66

Browse files
merge adam styling
2 parents 65cd5ef + bc77427 commit bdd8b66

18 files changed

+258
-141
lines changed

electron-builder.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ directories:
22
output: dist
33
buildResources: build
44
appId: reactype
5-
copyright: Copyright © 2019
5+
copyright: Copyright © 2018
66
linux:
77
target:
88
- AppImage
@@ -20,7 +20,7 @@ win:
2020
files:
2121
- main.js
2222
- build
23-
productName: reactype
23+
productName: ReacType
2424
dmg:
2525
contents:
2626
- x: 110

main.js

Lines changed: 90 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
const {
2-
app,
3-
BrowserWindow,
4-
Menu,
5-
shell,
6-
dialog,
7-
ipcMain,
2+
app, BrowserWindow, Menu, shell, dialog, ipcMain,
83
} = require('electron');
94

10-
5+
// Uncomment below for hot reloading during development
116
require('electron-reload')(__dirname);
127

138
// const isDev = true;
@@ -22,9 +17,12 @@ function openFile() {
2217
// Opens file dialog looking for markdown
2318
const files = dialog.showOpenDialog(mainWindow, {
2419
properties: ['openFile'],
25-
filters: [{
26-
name: 'Images', extensions: ['jpeg', 'jpg', 'png', 'gif', 'pdf'],
27-
}],
20+
filters: [
21+
{
22+
name: 'Images',
23+
extensions: ['jpeg', 'jpg', 'png', 'gif', 'pdf'],
24+
},
25+
],
2826
});
2927

3028
// if no files
@@ -77,77 +75,81 @@ const createWindow = () => {
7775
mainWindow.show();
7876
});
7977

80-
const template = [{
81-
label: 'File',
82-
submenu: [{
83-
label: 'Open File',
84-
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
85-
click() {
86-
openFile();
87-
},
78+
const template = [
79+
{
80+
label: 'File',
81+
submenu: [
82+
{
83+
label: 'Open File',
84+
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
85+
click() {
86+
openFile();
87+
},
88+
},
89+
{
90+
label: 'Export Components',
91+
accelerator: process.platform === 'darwin' ? 'Cmd+E' : 'Ctrl+Shift+E',
92+
click() {
93+
exportComponents();
94+
},
95+
},
96+
],
8897
},
8998
{
90-
label: 'Export Components',
91-
accelerator: process.platform === 'darwin' ? 'Cmd+E' : 'Ctrl+Shift+E',
92-
click() {
93-
exportComponents();
94-
},
95-
}],
96-
},
97-
{
98-
label: 'Edit',
99-
submenu: [
100-
{ role: 'undo' },
101-
{ role: 'redo' },
102-
{ type: 'separator' },
103-
{ role: 'cut' },
104-
{ role: 'copy' },
105-
{ role: 'paste' },
106-
{ role: 'pasteandmatchstyle' },
107-
{ role: 'delete' },
108-
{ role: 'selectall' },
109-
],
110-
},
111-
{
112-
label: 'View',
113-
submenu: [
114-
{ role: 'reload' },
115-
{ role: 'forcereload' },
116-
{ role: 'toggledevtools' },
117-
{ type: 'separator' },
118-
{ role: 'resetzoom' },
119-
{ role: 'zoomin' },
120-
{ role: 'zoomout' },
121-
{ type: 'separator' },
122-
{ role: 'togglefullscreen' },
123-
],
124-
},
125-
{
126-
role: 'window',
127-
submenu: [
128-
{ role: 'minimize' },
129-
{ role: 'close' },
130-
],
131-
},
132-
{
133-
role: 'help',
134-
submenu: [{
135-
label: 'Learn More',
136-
click() {
137-
shell.openExternal('https://electronjs.org');
138-
},
139-
}],
140-
},
141-
{
142-
label: 'Developer',
143-
submenu: [{
144-
label: 'Toggle Developer Tools',
145-
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
146-
click() {
147-
mainWindow.webContents.toggleDevTools();
148-
},
149-
}],
150-
},
99+
label: 'Edit',
100+
submenu: [
101+
{ role: 'undo' },
102+
{ role: 'redo' },
103+
{ type: 'separator' },
104+
{ role: 'cut' },
105+
{ role: 'copy' },
106+
{ role: 'paste' },
107+
{ role: 'pasteandmatchstyle' },
108+
{ role: 'delete' },
109+
{ role: 'selectall' },
110+
],
111+
},
112+
{
113+
label: 'View',
114+
submenu: [
115+
{ role: 'reload' },
116+
{ role: 'forcereload' },
117+
{ role: 'toggledevtools' },
118+
{ type: 'separator' },
119+
{ role: 'resetzoom' },
120+
{ role: 'zoomin' },
121+
{ role: 'zoomout' },
122+
{ type: 'separator' },
123+
{ role: 'togglefullscreen' },
124+
],
125+
},
126+
{
127+
role: 'window',
128+
submenu: [{ role: 'minimize' }, { role: 'close' }],
129+
},
130+
{
131+
role: 'help',
132+
submenu: [
133+
{
134+
label: 'Learn More',
135+
click() {
136+
shell.openExternal('https://electronjs.org');
137+
},
138+
},
139+
],
140+
},
141+
{
142+
label: 'Developer',
143+
submenu: [
144+
{
145+
label: 'Toggle Developer Tools',
146+
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
147+
click() {
148+
mainWindow.webContents.toggleDevTools();
149+
},
150+
},
151+
],
152+
},
151153
];
152154

153155
if (process.platform === 'darwin') {
@@ -167,12 +169,15 @@ const createWindow = () => {
167169
});
168170

169171
// Edit menu
170-
template[2].submenu.push({
171-
type: 'separator',
172-
}, {
173-
label: 'Speech',
174-
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
175-
});
172+
template[2].submenu.push(
173+
{
174+
type: 'separator',
175+
},
176+
{
177+
label: 'Speech',
178+
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
179+
},
180+
);
176181

177182
// Window menu
178183
template[4].submenu = [

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
{
2-
"name": "teamreactype",
2+
"name": "reactype",
33
"version": "1.0.0",
44
"description": "Prototyping tool for React/Typescript Applications.",
55
"main": "main.js",
6+
"contributors": [
7+
"Christian Padilla",
8+
"Tolga Mizrakci",
9+
"Shlomo Porges",
10+
"Adam Singer"
11+
],
612
"repository": {
713
"type": "git",
8-
"url": ""
14+
"url": "https://github.com/team-reactype/ReacType"
915
},
1016
"build": {
11-
"appId": "",
17+
"appId": "com.team-reactype.reactype",
1218
"copyright": "Copyright © 2018",
1319
"linux": {
1420
"target": [
1521
"AppImage",
1622
"deb"
1723
],
18-
"maintainer": "blessingebowe@gmail.com"
24+
"maintainer": "spincycle01@yahoo.com"
1925
},
2026
"mac": {
2127
"category": "public.app-category.developer-tools",
@@ -63,7 +69,6 @@
6369
"reactype": "./index.js"
6470
},
6571
"preferGlobal": true,
66-
"contributors": [],
6772
"license": "MIT",
6873
"jest": {
6974
"moduleNameMapper": {
@@ -86,9 +91,8 @@
8691
"cli-spinner": "^0.2.8",
8792
"commander": "^2.17.1",
8893
"d3": "^5.9.2",
89-
"electron": "^2.0.7",
90-
"electron-reload": "^1.4.0",
9194
"enzyme": "^3.4.1",
95+
"electron-reload": "^1.4.0",
9296
"konva": "^2.1.7",
9397
"localforage": "^1.7.2",
9498
"lodash.throttle": "^4.1.1",

src/components/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { Component } from 'react';
22
import '../public/styles/style.css';
3+
import { MuiThemeProvider } from '@material-ui/core/styles';
34
import AppContainer from '../containers/AppContainer';
45

56
class App extends Component {

src/components/KonvaStage.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import Button from '@material-ui/core/Button';
33
import { Stage, Layer, Line, Group, Label, Text, Rect, Transformer } from 'react-konva';
44
import Rectangle from './Rectangle.jsx';
55
import cloneDeep from '../utils/cloneDeep.ts';
6+
import DeleteIcon from '@material-ui/icons/Delete';
7+
import Fab from '@material-ui/core/Fab';
68

79
class KonvaStage extends Component {
810
constructor(props) {
@@ -132,7 +134,7 @@ class KonvaStage extends Component {
132134
};
133135

134136
render() {
135-
const { components, handleTransform, focusComponent, focusChild, deleteChild } = this.props;
137+
const { components, handleTransform, focusComponent, focusChild, deleteChild, classes } = this.props;
136138

137139
return (
138140
<div
@@ -145,7 +147,7 @@ class KonvaStage extends Component {
145147
}}
146148
tabIndex="0" // required for keydown event to be heard by this.container
147149
>
148-
<Button
150+
{/* <Button
149151
onClick={deleteChild}
150152
style={{
151153
width: '150px',
@@ -156,7 +158,30 @@ class KonvaStage extends Component {
156158
}}
157159
>
158160
delete child
159-
</Button>
161+
</Button> */}
162+
<Fab
163+
variant="extended"
164+
size="small"
165+
color="inherit"
166+
aria-label="Delete"
167+
// className={classes.margin}
168+
style={{
169+
width: '150px',
170+
position: 'relative',
171+
float: 'right',
172+
marginTop: '10px',
173+
marginLeft: '10px',
174+
// background: "#dbdbdb",
175+
zIndex: 2,
176+
}}
177+
// style={{ maxWidth: "20px" }}
178+
onClick={deleteChild}
179+
>
180+
<DeleteIcon />
181+
Delete Child
182+
{/* {`Delete
183+
${focusChild.}`} */}
184+
</Fab>
160185
<Stage
161186
className={'canvasStage'}
162187
ref={node => {

src/components/Rectangle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class Rectangle extends Component {
140140
// fill={color}
141141
// opacity={0.8}
142142
onTransformEnd={event => this.handleResize(componentId, childId, event.target, blockSnapSize)}
143-
strokeWidth={4}
143+
strokeWidth={childType === 'COMP' ? 4 : 1}
144144
strokeScaleEnabled={false}
145145
draggable={false}
146146
fill={childId === -1 ? 'white' : null}

src/components/SortChildren.jsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
import React, { Component} from "react";
3+
import { connect } from "react-redux";
4+
5+
const mapStateToProps = store => ({
6+
focusComponent: store.workspace.focusComponent,
7+
});
8+
9+
10+
class SortChildren extends Component {
11+
// constructor(props) {
12+
// super(props);
13+
state = {test: 'myTestValue'};
14+
//}
15+
16+
17+
render() {
18+
const children = this.props.focusComponent.childrenArray;
19+
const List = children.map( (child,idx) => {
20+
console.log(`mappping...... ${idx} ${child.componentName + child.childId}`)
21+
return (
22+
<li
23+
Childid={child.Childid}
24+
key={idx}
25+
draggable='true'
26+
// onDragEnd={this.dragEnd.bind(this)}
27+
// onDragStart={this.dragStart.bind(this)}>{item}
28+
>
29+
{child.componentName + child.childId}
30+
</li>
31+
)})
32+
console.log('children')
33+
console.log(children)
34+
console.log('List')
35+
console.log(List)
36+
return (
37+
<div>
38+
<p>Childrens List</p>
39+
{/* <List/> */}
40+
</div>
41+
)
42+
43+
}
44+
45+
}
46+
47+
export default connect(
48+
mapStateToProps
49+
)(SortChildren);

0 commit comments

Comments
 (0)