Skip to content

Commit 3659b79

Browse files
authored
Merge pull request #1 from fsrocha-dev/fixex
Fixes
2 parents a553dab + d3749b6 commit 3659b79

File tree

21 files changed

+107
-38
lines changed

21 files changed

+107
-38
lines changed

.DS_Store

-8 KB
Binary file not shown.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ node_modules
22
dist
33
out
44
*.log*
5-
.DS_Store
5+
*.DS_Store

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ After running the app, you can create a new document in which you must follow th
5151
<td>Open search document bar</td>
5252
<td>Yes</td>
5353
</tr>
54+
<tr>
55+
<td><kbd>esc</kbd></td>
56+
<td><kbd>esc</kbd></td>
57+
<td>Close current presentation</td>
58+
<td>Yes</td>
59+
</tr>
5460
</tbody>
5561
</table>
5662

build/.DS_Store

-6 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "slidefy",
33
"productName": "Slidefy",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"description": "A slideshow focused on reading markdown files.",
66
"main": "./out/main/index.js",
77
"author": "frankrocha.dev",

resources/.DS_Store

-6 KB
Binary file not shown.

src/.DS_Store

-6 KB
Binary file not shown.

src/main/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import './store'
1111
function createWindow(): void {
1212
// Create the browser window.
1313
const mainWindow = new BrowserWindow({
14-
width: 900,
15-
height: 670,
14+
width: 1024,
15+
height: 900,
1616
center: true,
1717
show: false,
1818
autoHideMenuBar: true,

src/main/shortcuts.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ export function createShortcuts(window: BrowserWindow) {
55
globalShortcut.register('CommandOrControl+N', () => {
66
window.webContents.send('new-document')
77
})
8+
globalShortcut.register('Escape', () => {
9+
window.webContents.send('close-document')
10+
})
811
})
912

1013
app.on('browser-window-blur', () => {

src/main/store.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
import Store from 'electron-store'
22
import { Document } from '@shared/types/ipc'
3+
import { randomUUID } from 'node:crypto'
34

45
interface StoreType {
6+
isFirstOpening: boolean
57
documents: Record<string, Document>
68
}
79

810
export const store = new Store<StoreType>({
911
defaults: {
12+
isFirstOpening: false,
1013
documents: {},
1114
},
1215
})
16+
17+
if (store.get('isFirstOpening')) {
18+
const id = randomUUID()
19+
store.set(`documents.${id}`, {
20+
id,
21+
title: 'Presentation Example',
22+
content: `
23+
<p>&lt;!— This is a comment! It is not displayed. It also serves to configure the slides —&gt;</p><h1>Hello Slidefy</h1><blockquote><p>Making your presentations easier</p></blockquote><hr><h1>Code Block</h1><p>You can use blocks of code easily</p><pre><code class="language-javascript">const productName = "Slidefy";</code></pre><hr><p>&lt;!— .slide: transition=”convex" background=”aquamarine" —&gt;</p><h1>Custom Slide</h1><p>You can customize the transition effect and background of each slide, using a markdown comment with the tags below:</p><pre><code class="language-javascript">.slide: transition="fast" backgroundColor="aquamarine"</code></pre><hr><h1>Images and gifs</h1><p>Use images or gifs via web image url:</p><p><img class="object-scale-down w-6/12" src="https://source.unsplash.com/8xznAGy4HcY/800x400" alt="teste" contenteditable="false" draggable="true"><img class="ProseMirror-separator" alt=""><br class="ProseMirror-trailingBreak"></p>
24+
`,
25+
})
26+
store.set('isFirstOpening', false)
27+
}

0 commit comments

Comments
 (0)