Skip to content

Commit aa628f9

Browse files
authored
Merge pull request #89 from Danger-Noodle/master
Beta v2.0.0
2 parents 54d94f2 + 1d69482 commit aa628f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3708
-18508
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -483,4 +483,7 @@ ASALocalRun/
483483
React-Proto.dmg
484484
installers/
485485

486+
# yarn primary pkg mgr. npm lock file
487+
package-lock.json
488+
486489
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
React-Proto allows the user to visualize/setup their application architecture upfront and eject this architecture as application files either into a previous project or a new create-react-app project or a starter template from any repository.
88

9-
Download for [MacOS](https://github.com/React-Proto/react-proto/releases/download/v1.0.0/React-Proto-1.0.0.dmg), [Windows](https://github.com/React-Proto/react-proto/releases/download/v1.0.0/React-Proto.Web.Setup.1.0.0.exe), [Linux](https://github.com/React-Proto/react-proto/releases/download/v1.0.0/react-proto_1.0.0_amd64.deb).
9+
Download for v1.0.0 [MacOS](https://github.com/React-Proto/react-proto/releases/download/v1.0.0/React-Proto-1.0.0.dmg), [Windows](https://github.com/React-Proto/react-proto/releases/download/v1.0.0/React-Proto.Web.Setup.1.0.0.exe), [Linux](https://github.com/React-Proto/react-proto/releases/download/v1.0.0/react-proto_1.0.0_amd64.deb).
10+
11+
Download for v2.0.0-beta [MacOS](https://github.com/React-Proto/react-proto/releases/download/v2.0.0-beta/React-Proto-2.0.0.dmg), [Windows](https://github.com/React-Proto/react-proto/releases/download/v2.0.0-beta/react-proto-2.0.0-x86_64.AppImage), [Linux](https://github.com/React-Proto/react-proto/releases/download/v2.0.0-beta/react-proto_2.0.0_amd64.deb).
12+
1013
* Mac users only: for now you might need to go to your security settings to allow the app run on your system as we do not have an Apple license yet.
1114

1215
If you find any issues, [file issue](https://github.com/React-Proto/react-proto/issues)
@@ -48,6 +51,12 @@ If you find any issues, [file issue](https://github.com/React-Proto/react-proto/
4851

4952
[Erik Guntner](https://www.linkedin.com/in/erik-guntner-9aa324b9/) [@erikguntner](https://github.com/erikguntner)
5053

54+
[Adrian Sun](https://www.linkedin.com/in/adrian-sun/) [@adriansun1](https://github.com/adriansun1)
55+
56+
[Darryl Amour](https://www.linkedin.com/in/darryl-amour/) [@darryl-amour](https://github.com/darryl-amour)
57+
58+
[Frank Ma](https://www.linkedin.com/in/frankma2/) [@frankyma](https://github.com/frankyma)
59+
5160
## Running Your Own Version
5261

5362
- **Fork** and **Clone** Repository.

assets/dragging.gif

-15.5 MB
Loading

assets/export.gif

-10.3 MB
Loading

assets/hierarchy.gif

-23 MB
Loading

docs/assets/dragging.gif

-15.5 MB
Loading

docs/assets/export.gif

-10.3 MB
Loading

docs/assets/hierarchy.gif

-23 MB
Loading

docs/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h3 class="detail-title">Quick Prototyping</h3>
7070
</div>
7171
</div>
7272
<div class="about-image">
73-
<img src="assets/dragging.gif" alt="">
73+
<img src="../assets/dragging.gif" alt="">
7474
</div>
7575
</div>
7676
<div class="about-container">
@@ -83,7 +83,7 @@ <h3 class="detail-title">Define component hierarchy </h3>
8383
</div>
8484
</div>
8585
<div class="about-image">
86-
<img src="assets/hierarchy.gif" alt="">
86+
<img src="../assets/hierarchy.gif" alt="">
8787
</div>
8888
</div>
8989
<div class="about-container">
@@ -96,7 +96,7 @@ <h3 class="detail-title">Export Files</h3>
9696
</div>
9797
</div>
9898
<div class="about-image">
99-
<img src="assets/export.gif" alt="">
99+
<img src="../assets/export.gif" alt="">
100100
</div>
101101
</div>
102102
</section>

electron-builder.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ directories:
22
output: dist
33
buildResources: build
44
appId: com.eevee.react-proto
5-
copyright: Copyright © 2018
5+
copyright: Copyright © 2019
66
linux:
77
target:
88
- AppImage
@@ -29,4 +29,4 @@ dmg:
2929
'y': 150
3030
type: link
3131
path: /Applications
32-
electronVersion: 2.0.7
32+
electronVersion: 3.1.0

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const spinner = new Spinner('running app... %s');
88
spinner.setSpinnerString('|/-\\');
99

1010
program
11-
.version('1.0.0', '-v, --version, -V')
11+
.version('2.0.0 Beta', '-v, --version, -V')
1212
.description('An application for prototyping React application.');
1313

1414
program

main.js

+102-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,85 @@ function openFile() {
3131
mainWindow.webContents.send('new-file', file);
3232
}
3333

34+
/*
35+
* openWorkspace: Verify the user wants to perform Open Workspace
36+
* as any unsaved work will be lost. If user proceeds
37+
* opens file dialog looking for workspace file with extension
38+
* '*.rproto'.
39+
*/
40+
const openWorkspace = () => {
41+
// Prompt user to verify they want to move continue
42+
dialog.showMessageBox(
43+
mainWindow,
44+
{
45+
type: 'warning',
46+
buttons: ['Go Back', 'Continue'],
47+
defaultId: 0,
48+
cancelId: 0,
49+
title: 'Open Workspace',
50+
message: 'Are you sure you want to open another Workspace?',
51+
detail: 'Current work will be lost if not saved',
52+
},
53+
(response) => {
54+
if (response === 0) return; // If 'Go Back' return to main window w/ no changes
55+
if (response === 1) {
56+
// If 'Continue' allow user to select workspace file
57+
dialog.showOpenDialog(
58+
mainWindow,
59+
{
60+
properties: ['openFile'],
61+
title: 'Open Workspace',
62+
filters: [{
63+
name: 'Workspaces',
64+
extensions: ['rproto'],
65+
}],
66+
},
67+
(filePaths) => {
68+
if (!filePaths) return; // if no files return to main window
69+
const workspaceFilePath = filePaths[0];
70+
// send selected file back to React application
71+
mainWindow.webContents.send('chosen-workspace', workspaceFilePath);
72+
},
73+
);
74+
}
75+
},
76+
);
77+
};
78+
79+
80+
/*
81+
* saveWorkspace: Opens file save dialog allowing user to specify file name and
82+
* location for workspace file with extension '*.rproto'.
83+
*/
84+
const saveWorkspace = () => {
85+
dialog.showSaveDialog(
86+
mainWindow,
87+
{
88+
title: 'Save Workspace As',
89+
nameFieldLabel: 'Workspace',
90+
filters: [{
91+
name: 'Workspace',
92+
extensions: ['rproto'],
93+
}],
94+
},
95+
(filename) => {
96+
if (!filename) return; // if no file return to main window
97+
// send identified new file path back to React application
98+
mainWindow.webContents.send('new-workspace', filename);
99+
},
100+
);
101+
};
102+
103+
// Receive message from React main-header-buttons palette
104+
ipcMain.on('save_workspace', () => {
105+
saveWorkspace();
106+
});
107+
108+
// Receive message from React main-header-buttons palette
109+
ipcMain.on('open_workspace', () => {
110+
openWorkspace();
111+
});
112+
34113
// Choose directory
35114
ipcMain.on('choose_app_dir', (event) => {
36115
const directory = dialog.showOpenDialog(mainWindow, {
@@ -57,6 +136,10 @@ const createWindow = () => {
57136
mainWindow = new BrowserWindow({
58137
width,
59138
height,
139+
webPreferences: {
140+
nodeIntegration: true,
141+
webSecurity: true,
142+
},
60143
});
61144

62145
// and load the index.html of the app.
@@ -65,11 +148,28 @@ const createWindow = () => {
65148
const template = [{
66149
label: 'File',
67150
submenu: [{
68-
label: 'Open File',
69-
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
151+
label: 'Update Image',
152+
accelerator: process.platform === 'darwin' ? 'Cmd+U' : 'Ctrl+Shift+U',
70153
click() {
71154
openFile();
72155
},
156+
},
157+
{
158+
type: 'separator',
159+
},
160+
{
161+
label: 'Open Workspace...',
162+
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
163+
click() {
164+
openWorkspace();
165+
},
166+
},
167+
{
168+
label: 'Save Workspace As...',
169+
accelerator: process.platform === 'darwin' ? 'Cmd+S' : 'Ctrl+Shift+S',
170+
click() {
171+
saveWorkspace();
172+
},
73173
}],
74174
},
75175
{

0 commit comments

Comments
 (0)