Commit Graph

111 Commits

Author SHA1 Message Date
Jonatan Heyman
6187d6d468 Add menu item to open "Move block" dialog 2025-01-07 23:17:23 +01:00
Jonatan Heyman
9bf3a5dacc * Add window.heynote.mainProcess.on() and off() which can be used in browser land to communicate with the main process. Use these methods to remove intermediate onOpenSettings() and onSettingsChange() methods from window.heynote objects.
* Convert some pesky TypeScript to JavaScript
2025-01-06 16:20:00 +01:00
Jonatan Heyman
64740192bf Move constants from electron/constants.ts into src/common/constants.js 2025-01-06 16:20:00 +01:00
Jonatan Heyman
45b98a2c87 Fix broken syntax in 4139bc9c9c 2025-01-06 15:17:12 +01:00
Jonatan Heyman
4139bc9c9c Remove unused quit function from preload script for cleanup 2025-01-06 15:06:04 +01:00
Jonatan Heyman
82494d818b fix(macos): show window on dock click when using menu bar mode
When "Show in menu bar" is enabled and the window is closed, clicking
the app icon in the dock now properly shows the window again instead
of only focusing it.
2025-01-04 12:47:00 +01:00
Jonatan Heyman
45c5379256 Make a backup copy of buffer.txt before migrating to new note library 2024-12-12 13:41:55 +01:00
Jason
a7471fcb3b Fix icon for nix systems 2024-12-10 01:29:44 +01:00
Jonatan Heyman
612df6c851 Add block with link to documentation to inital scratch buffer content 2024-12-09 14:04:07 +01:00
Jonatan Heyman
146e33ef3f Set window title to name of current buffer
#build
2024-12-09 12:37:05 +01:00
Jonatan Heyman
3e84850147 Add code comment 2024-12-09 12:37:05 +01:00
Jonatan Heyman
f6b086b7e6 Use FileLibrary.load() method to make sure tracking of current buffer content works 2024-12-09 12:37:05 +01:00
Jonatan Heyman
374e2b4e5d Check all open buffer files for changes when window gets focus
The reason we do this is because fs.watch() is unreliable in some case.

#build
2024-12-09 12:37:05 +01:00
Jonatan Heyman
6c95005544 #build 2024-12-09 12:37:05 +01:00
Jonatan Heyman
c47d824111 Don't trigger buffer:change event when file is removed 2024-12-09 12:37:05 +01:00
Jonatan Heyman
e34a1c8ca3 Remove unused import 2024-12-09 12:37:05 +01:00
Jonatan Heyman
a924d33453 Remove debug log 2024-12-09 12:37:05 +01:00
Jonatan Heyman
f0e299122f Implement functionality for deleting notes 2024-12-09 12:37:05 +01:00
Jonatan Heyman
7be0a304d0 WIP: Multiple notes support
Add support for migrating old buffer file to new library.

Add support for changing location for the notes library.

Replace theme toggle in status bar with a dropdown in Appearance settings.

Improve New Note and Update Note dialogs.

Implement UI for confirming note delete (the actualal deltion is still to be implemented).
2024-12-09 12:37:05 +01:00
Jonatan Heyman
7e1f01471a Implement support for editing notes' metadata, and ability to move notes into other directories.
Create separate pinia store for the editor cache functionality.
2024-12-09 12:37:05 +01:00
Jonatan Heyman
5b61a0a234 WIP: Implement ability to create new notes.
Support cache of multiple Editor instances.

Change so that current note name is included in the event data dispatched by emitCursorChange.
2024-12-09 12:37:05 +01:00
Jonatan Heyman
5e34656c1d WIP: Create new node dialog
Implement folder selector UI element.
Retrieve actual folder structure from Notes library.
2024-12-09 12:37:05 +01:00
Jonatan Heyman
d01c19fd72 WIP: Implement support for multiple notes
Refactor Vue <-> Editor <-> CodeMirror code.
Introduce Pinia store to keep global state, in order to get rid of a lot of event juggling between Editor class/child components and the root App component.
2024-12-09 12:37:05 +01:00
Jonatan Heyman
c14c700791 Add a way to display error dialogs 2024-12-09 12:37:05 +01:00
Peter Jaric
372ce351b4 Improve handling of global hotkey in Linux. 2024-07-24 16:42:34 +02:00
Jonatan Heyman
d82b3920d7 Add setting for configuring the default block language and language auto detection 2024-07-14 12:19:29 +02:00
Jonatan Heyman
4890cd6a6b Add menu item to Help menu that opens documentation page 2024-07-08 14:14:21 +02:00
Jonatan Heyman
2f22951e9f Add "Always on top" setting which makes Heynote stay on top of other programs 2024-02-09 16:07:27 +01:00
Jonatan Heyman
a5088a48af Open the Heynote window when menu bar icon is left-clicked on Mac 2024-01-26 01:42:29 +01:00
Jonatan Heyman
91f80ff84a Check that stored screen position and size are still valid (not larger than screen or outside screen), and if not, reset them. 2024-01-25 14:31:02 +01:00
ImKaashif
5e169a1927 added x and y co-ordinates to windowConfig 2024-01-25 14:31:02 +01:00
Jonatan Heyman
295e55552b Add version number to settings dialog.
For the web app we also display the git hash.
2024-01-12 15:09:13 +01:00
Jonatan Heyman
37b62d416e Move window.heynote.isWebApp to window.heynote.platform.isWebApp 2024-01-12 14:42:37 +01:00
Jonatan Heyman
15ee6b9194 Change "Preferences" to "Settings" in the application menu (#100) 2024-01-12 14:29:36 +01:00
Jonatan Heyman
66e7082786 Set default font size to 16px in webapp for mobile devices in order to avoid auto zoom in when the keyboard appears on iOS Safari 2024-01-11 21:05:15 +01:00
Jonatan Heyman
fea7e3cec2 Fix bug causing crash when starting the app for the first time (without a config file) 2024-01-10 09:55:38 +01:00
Jonatan Heyman
a56a267e06 Add support for changing font family and font size 2024-01-09 00:35:33 +01:00
Jonathon Hodges
fb62652847 Update initial-content.ts
Fixed typo in initial content

## Why
The area of a circle is pi times the radius squared (A = π r²), not the volume.
2024-01-09 00:27:00 +01:00
Jonatan Heyman
e887d7e35f Automatically remove/add window from Taskbar in Windows, when Show in tray is turned on.
Call setForceQuite() before autoUpdater.quitAndInstall() to make sure auto updating works when Tray/Menu Bar setting is turned on.
2024-01-06 21:30:41 +01:00
Jonatan Heyman
05aba1ac65 Make close button just hide the window if "Show in menu bar" is active on Mac 2024-01-06 03:11:15 +01:00
Jonatan Heyman
bb5975455c Hide Heynote from taskbar on Windows when Tray icon has been turned on. Make close button just hide the window, and require using the Tray menu to quit for real. Fixes 137. 2024-01-06 03:11:15 +01:00
Joshua Blum
aa420acd1d Resolve ~ to homedir 2024-01-06 02:10:45 +01:00
Fernando Pinedo
d055db1831
FIX: fixed trayicon on linux not appearing (#136)
* Fix trayicon on linux not appearing

---------

Co-authored-by: Fernando Pinedo <fernando.pinedo@luizalabs.com>
Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2024-01-06 02:04:50 +01:00
Jonatan Heyman
554e04ea67 Fix test on linux/windows
Change Playwright reporter when running in Github action

Change default emacs meta key to Alt on non Linux and Windows

Always set emacsMetaKey to "alt" if not on Mac, since the option is only available on Mac
2024-01-06 01:51:07 +01:00
Jonatan Heyman
957b22c70e Refactor the way we handle copy/cut/paste in Emacs mode
Previously we listened for the key bindings for copy, cut and paste in the Electron main process, and triggered the event using copy(), paste() and cut() methods on win.webContent. Now this is fully handled within the renderer process using the window.navigator.clipboard API.

This will make it simpler to implement fully customizable key bindings.
2024-01-06 01:51:07 +01:00
Jonatan Heyman
b9fd161551
Add functionality for selecting a custom path for the buffer file. (#130)
Automatically reload the buffer file (if one exists) when buffer path is changed.
Move code buffer related code from main/index.ts into buffer.js
2024-01-05 00:41:46 +01:00
Florian Labarre
d0d8f872a6
Add key bindings for inserting new blocks at the end/top of the buffer, as well as before the current block (#85)
* Add functionality to insert new block after the last block

- Update key bindings in `initial-content.ts` to include `Alt + Enter` for adding a new block after the last block.
- Implement `getLastNoteBlock` function in `block.js` to retrieve the last block in the note.
- Add `addNewBlockAfterLast` command in `commands.js` to handle the insertion of a new block after the last one.
- Integrate `addNewBlockAfterLast` command into the keymap in `keymap.js`.

* Add block insertion before/after current, before first and after last. Also, tests.

- Added `getFirstNoteBlock` in `block.js` for accessing the first text block.
- Implemented new functions in `commands.js` like `addNewBlockBeforeCurrent` and `addNewBlockBeforeFirst`.
- Updated `keymap.js` with new key bindings to facilitate block creation.
- Introduced `block-creation.spec.js` for testing the new block manipulation features.

* Fix visual bug when inserting new block at the top

* Update help text and Readme

* Fix wrong cursor position after inserting new blocks at the top of the buffer, when the previous first block's delimiter is long (e.g. Markdown)

* Make RegEx more generic

* Fix import

* Auto-generate the README.md and initial-content documentation

- Add a documentation generator
- Add an option to force the initial content to be erased with an env variable

* Add more specific tests

* Fix Mod key on Mac in test

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2024-01-04 16:11:26 +01:00
Florian Labarre
0f3c714d56
CloseBrackets setting toggle (#102)
* Add a setting to toggle the auto bracket-closing of CodeMirror

* Move Auto-close brackets setting into new settings tab Editing

* Add tests for Auto-close bracket setting

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2024-01-04 14:52:41 +01:00
Jonatan Heyman
acb7ddf189
Add Settings to web app (#125)
* Add support for opening settings dialog in the webapp

* Add tests for settings dialog

* Hide stand-alone app specific settings in web app

* Remove debug log
2024-01-04 14:27:04 +01:00
Tanuj Pancholi
0ba5820cf4
Added Show in Dock Toggle and System Tray Feature (#90)
* Issue #62 Added Show in Dock, System Tray Toggle

* show dock toggle for mac only

* Add Open Heynote and Quit Heynote to Tray context menu

* Add Template Image as menu bar icon on MacOS

https://www.electronjs.org/docs/latest/api/native-image#template-image

* Use isMac, isWindows and isLinux for platform checks

* Add new tray/favicon

* Use favicon.ico as windows tray icon

* Show window on Tray double-click

* Open window when Tray is single clicked on non Mac platforms

* Fix indentation

* Remove unused import

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2024-01-01 20:02:30 +01:00