Skip to content

Commit 5f2053e

Browse files
code exporting successfully
1 parent d82d9ea commit 5f2053e

File tree

3 files changed

+250
-239
lines changed

3 files changed

+250
-239
lines changed

main.js

Lines changed: 76 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
const path = require('path');
22

33
const {
4-
app,
5-
BrowserWindow,
6-
Menu,
7-
shell,
8-
dialog,
9-
ipcMain
10-
} = require("electron");
4+
app, BrowserWindow, Menu, shell, dialog, ipcMain,
5+
} = require('electron');
116

127
// Uncomment below for hot reloading during development
13-
<<<<<<< HEAD
14-
require("electron-reload")(__dirname);
15-
=======
168
// require('electron-reload')(__dirname);
17-
>>>>>>> 11e0643d114b6c294dc2b66c3fd4727ffb173825
189

1910
// const isDev = true;
20-
const isDev =
21-
process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
11+
const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
2212

2313
// Keep a global reference of the window object, if you don't, the window will
2414
// be closed automatically when the JavaScript object is garbage collected.
@@ -28,53 +18,53 @@ let mainWindow;
2818
function openFile() {
2919
// Opens file dialog looking for markdown
3020
const files = dialog.showOpenDialog(mainWindow, {
31-
properties: ["openFile"],
21+
properties: ['openFile'],
3222
filters: [
3323
{
34-
name: "Images",
35-
extensions: ["jpeg", "jpg", "png", "gif", "pdf"]
36-
}
37-
]
24+
name: 'Images',
25+
extensions: ['jpeg', 'jpg', 'png', 'gif', 'pdf'],
26+
},
27+
],
3828
});
3929

4030
// if no files
4131
if (!files) return;
4232
const file = files[0];
4333

4434
// Send fileContent to renderer
45-
mainWindow.webContents.send("new-file", file);
35+
mainWindow.webContents.send('new-file', file);
4636
}
4737

4838
// Choose directory
49-
ipcMain.on("choose_app_dir", event => {
39+
ipcMain.on('choose_app_dir', (event) => {
5040
const directory = dialog.showOpenDialog(mainWindow, {
51-
properties: ["openDirectory"],
52-
buttonLabel: "Export"
41+
properties: ['openDirectory'],
42+
buttonLabel: 'Export',
5343
});
5444

5545
if (!directory) return;
56-
event.sender.send("app_dir_selected", directory[0]);
46+
event.sender.send('app_dir_selected', directory[0]);
5747
});
5848

59-
ipcMain.on("view_app_dir", (event, appDir) => {
49+
ipcMain.on('view_app_dir', (event, appDir) => {
6050
shell.openItem(appDir);
6151
});
6252

6353
// Update file
64-
ipcMain.on("update-file", () => {
54+
ipcMain.on('update-file', () => {
6555
openFile();
6656
});
6757

6858
const createWindow = () => {
6959
// Create the browser window.
7060
// eslint-disable-next-line
71-
const { width, height } = require("electron").screen.getPrimaryDisplay().size;
61+
const { width, height } = require('electron').screen.getPrimaryDisplay().size;
7262
mainWindow = new BrowserWindow({
7363
width,
7464
height,
7565
webPreferences: {
7666
zoomFactor: 0.7,
77-
"node-Integration": false
67+
'node-Integration': false,
7868
},
7969
show: false,
8070
icon: path.join(__dirname, '/src/public/icons/mac/icon.icns'),
@@ -87,22 +77,22 @@ const createWindow = () => {
8777
// and load the index.html of the app.
8878
mainWindow.loadURL(`file://${__dirname}/build/index.html`);
8979
// load page once window is loaded
90-
mainWindow.once("ready-to-show", () => {
80+
mainWindow.once('ready-to-show', () => {
9181
mainWindow.show();
9282
});
9383

9484
const template = [
9585
{
96-
label: "File",
86+
label: 'File',
9787
submenu: [
9888
{
99-
label: "Open File",
100-
accelerator: process.platform === "darwin" ? "Cmd+O" : "Ctrl+Shift+O",
89+
label: 'Open File',
90+
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
10191
click() {
10292
openFile();
103-
}
104-
}
105-
]
93+
},
94+
},
95+
],
10696
},
10797
// {
10898
// label: 'Edit',
@@ -119,90 +109,89 @@ const createWindow = () => {
119109
// ],
120110
// },
121111
{
122-
label: "View",
112+
label: 'View',
123113
submenu: [
124-
{ role: "reload" },
125-
{ role: "forcereload" },
126-
{ type: "separator" },
127-
{ role: "resetzoom" },
128-
{ role: "zoomin" },
129-
{ role: "zoomout" },
130-
{ type: "separator" },
131-
{ role: "togglefullscreen" }
132-
]
114+
{ role: 'reload' },
115+
{ role: 'forcereload' },
116+
{ type: 'separator' },
117+
{ role: 'resetzoom' },
118+
{ role: 'zoomin' },
119+
{ role: 'zoomout' },
120+
{ type: 'separator' },
121+
{ role: 'togglefullscreen' },
122+
],
133123
},
134124
{
135-
role: "window",
136-
submenu: [{ role: "minimize" }, { role: "close" }]
125+
role: 'window',
126+
submenu: [{ role: 'minimize' }, { role: 'close' }],
137127
},
138128
{
139-
role: "help",
129+
role: 'help',
140130
submenu: [
141131
{
142-
label: "Learn More",
132+
label: 'Learn More',
143133
click() {
144-
shell.openExternal("https://electronjs.org");
145-
}
146-
}
147-
]
134+
shell.openExternal('https://electronjs.org');
135+
},
136+
},
137+
],
148138
},
149139
{
150-
label: "Developer",
140+
label: 'Developer',
151141
submenu: [
152142
{
153-
label: "Toggle Developer Tools",
154-
accelerator:
155-
process.platform === "darwin" ? "Alt+Command+I" : "Ctrl+Shift+I",
143+
label: 'Toggle Developer Tools',
144+
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
156145
click() {
157146
mainWindow.webContents.toggleDevTools();
158-
}
159-
}
160-
]
161-
}
147+
},
148+
},
149+
],
150+
},
162151
];
163152

164-
if (process.platform === "darwin") {
153+
if (process.platform === 'darwin') {
165154
template.unshift({
166155
label: app.getName(),
167156
submenu: [
168-
{ role: "about" },
169-
{ type: "separator" },
170-
{ role: "services", submenu: [] },
171-
{ type: "separator" },
172-
{ role: "hide" },
173-
{ role: "hideothers" },
174-
{ role: "unhide" },
175-
{ type: "separator" },
176-
{ role: "quit" }
177-
]
157+
{ role: 'about' },
158+
{ type: 'separator' },
159+
{ role: 'services', submenu: [] },
160+
{ type: 'separator' },
161+
{ role: 'hide' },
162+
{ role: 'hideothers' },
163+
{ role: 'unhide' },
164+
{ type: 'separator' },
165+
{ role: 'quit' },
166+
],
178167
});
179168

180169
// Edit menu
181170
template[2].submenu.push(
182171
{
183-
type: "separator"
172+
type: 'separator',
184173
},
185174
{
186-
label: "Speech",
187-
submenu: [{ role: "startspeaking" }, { role: "stopspeaking" }]
188-
}
175+
label: 'Speech',
176+
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
177+
},
189178
);
190179

191180
// Window menu
192181
template[4].submenu = [
193-
{ role: "close" },
194-
{ role: "minimize" },
195-
{ role: "zoom" },
196-
{ type: "separator" },
197-
{ role: "front" }
182+
{ role: 'close' },
183+
{ role: 'minimize' },
184+
{ role: 'zoom' },
185+
{ type: 'separator' },
186+
{ role: 'front' },
198187
];
199188
}
200189

201190
const menu = Menu.buildFromTemplate(template);
202191
Menu.setApplicationMenu(menu);
203192

204193
// Emitted when the window is closed.
205-
mainWindow.on("closed", () => {
194+
mainWindow.on('closed', () => {
206195
// Dereference the window object, usually you would store windows
207196
// in an array if your app supports multi windows, this is the time
208197
// when you should delete the corresponding element.
@@ -213,13 +202,13 @@ const createWindow = () => {
213202
// This method will be called when Electron has finished
214203
// initialization and is ready to create browser windows.
215204
// Some APIs can only be used after this event occurs.
216-
app.on("ready", () => {
205+
app.on('ready', () => {
217206
if (isDev) {
218207
const {
219208
default: installExtension,
220209
REACT_DEVELOPER_TOOLS,
221-
REDUX_DEVTOOLS
222-
} = require("electron-devtools-installer");
210+
REDUX_DEVTOOLS,
211+
} = require('electron-devtools-installer');
223212

224213
installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
225214
.then(() => {
@@ -232,15 +221,15 @@ app.on("ready", () => {
232221
});
233222

234223
// Quit when all windows are closed.
235-
app.on("window-all-closed", () => {
224+
app.on('window-all-closed', () => {
236225
// On OS X it is common for applications and their menu bar
237226
// to stay active until the user quits explicitly with Cmd + Q
238-
if (process.platform !== "darwin") {
227+
if (process.platform !== 'darwin') {
239228
app.quit();
240229
}
241230
});
242231

243-
app.on("activate", () => {
232+
app.on('activate', () => {
244233
// On OS X it's common to re-create a window in the app when the
245234
// dock icon is clicked and there are no other windows open.
246235
if (mainWindow === null) {

src/components/TransformerComponent.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
<<<<<<< HEAD
2-
import React, { Component } from "react";
3-
import { Transformer } from "react-konva";
4-
import { ComponentInt, ComponentsInt, ChildInt } from "../utils/interfaces";
5-
=======
61
import React, { Component } from 'react';
72
import { Transformer } from 'react-konva';
83
import { ChildInt } from '../utils/interfaces.ts';
9-
>>>>>>> 11e0643d114b6c294dc2b66c3fd4727ffb173825
104

115
interface PropsInt {
126
focusChild: ChildInt;

0 commit comments

Comments
 (0)