Commit Graph

452 Commits

Author SHA1 Message Date
Jonatan Heyman
a94415ab65 Change order of key bindings in help text 2024-01-04 16:16:21 +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
Hojun Lee
b80230454d
Add Groovy language support (#111) 2024-01-04 15:18:28 +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
Jonatan Heyman
4274e6237b
Watch buffer file for changes, and automatically reload it if changed (#76)
* Implement Buffer class in main process that watches for changes to the file, and notifies the editor in the renderer process so that it can update the buffer.

* Add Editor.setReadOnly() method

* Add dummy onChangeCallback function

* Remove debug logging
2024-01-01 19:04:40 +01:00
Jonatan Heyman
0b6a1a49e8
Add support for specifying a custom format function within a math block (#99) 2023-12-31 10:43:42 +01:00
Laeyoung
b0f3bdd19e
Add Swift and Kotlin language support #10 (#96)
* Add Swift language support

* Add Kotlin language support
2023-12-31 10:07:21 +01:00
Jonatan Heyman
a1cad5b335
Don't display string quotes for math results that are strings. (#92)
Fix bug that could cause the cursor to be positioned immediately to the left of the widget (within its margin) making it look like there was a space character in the buffer when there was not.
Add tests for math blocks.

Fixes #21.
2023-12-29 10:47:02 +01:00
Jonatan Heyman
6bbad360d4 Set correct platform for the Heynote web app 2023-12-28 18:01:10 +01:00
Jonatan Heyman
6022356478
Settings improvements (#88)
* Organize Settings in different tabs

* Add setting for turning off/on auto updates.

* Remove debug log

* Use a better variable name (systemTheme -> themeSetting)

* Store theme setting for Heynote webapp in local storage
2023-12-28 16:48:56 +01:00
Jonatan Heyman
77ed45cfa2 Remove old, unused file 2023-12-28 14:40:01 +01:00
Jonatan Heyman
fa643a46f4 Add info about running tests 2023-12-28 00:07:49 +01:00
Jonatan Heyman
713febbd40 More Readme formatting 2023-12-28 00:01:17 +01:00
Jonatan Heyman
7d59bffada Readme formatting to look better on mobile devices 2023-12-27 23:59:45 +01:00
Jonatan Heyman
ab3df60032 Readme formatting 2023-12-27 17:42:07 +01:00
Jonatan Heyman
56428fa2f9 Readme formatting:
Change list of supported languages to comma separated list in a code block, in order to save vertical space
2023-12-27 17:41:16 +01:00
TimTrademark
b706b89dcb
Fix zoom in key binding (#80) 2023-12-27 14:21:52 +01:00
Jonatan Heyman
eda4981e59
Fix issue with large buffers where block delimiters wouldn't be "atomic" when first starting Heynote, before the first edit (#81)
* Increase timeout for parsing the syntax tree when it's done for the first time

* Return the already parsed blocks in the blockState facet from Editor.getBlocks() instead of parsing the syntax tree again.
Make the block extension's getBlocks() method private.
2023-12-27 12:55:24 +01:00
Jonatan Heyman
1d2f1645f9 Add info about Math.js to the FAQ 2023-12-27 11:54:23 +01:00
Jonatan Heyman
93fb003476 Bump version to 1.5.0 2023-12-27 01:12:02 +01:00
Jonatan Heyman
d02075f343 Rename function 2023-12-27 01:03:54 +01:00
Jonatan Heyman
eaccfd35da Add default keyboard shortcuts to Readme. Fixes #74 2023-12-27 00:34:54 +01:00
Jonatan Heyman
cb7b071517 Add box-shadow to Settings dialog 2023-12-27 00:15:57 +01:00
Jonatan Heyman
1487590d1d Bump version to 1.5.0-beta 2023-12-26 01:34:34 +01:00
Jonatan Heyman
60caac45ab Add TOML support 2023-12-26 01:31:36 +01:00
Espen Jacobsson
475f3465fe
Add TypeScript, JSX and TSX language support (#64)
* Add language support for TypeScript

* Add formatter for TypeScript

* Add language autodetection for TypeScript

* Add TypeScript to list of featured languages

* Add language support for JSX and TSX

* Add JSX and TSX to list of featured languages

* Remove guesslang token from JSX and TSX

* Fix syntax error

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2023-12-26 00:47:28 +01:00
Jonatan Heyman
bb511b868b
Add support for more languages (#69)
* Contain language selection dialog in an element that can be scrolled, and automatically scroll it if needed when navigating the list with arrow keys

* Add support for more languages:

Clojure, Erlang, Golang, Lezer, Ruby, Shell, YAML

* Move prettier auto format settings for languages into Language() class

* Remove invalid import

* Fix bug that could cause auto formatting to fail for the last block.
Add tests for language auto detection and formatting.

* Fix broken tests

* Fix language auto detection on Safari Webkit which was broken

* Remove unnecessary wait time
2023-12-26 00:27:43 +01:00
Jonatan Heyman
6eda3efa63
Fix wrong badge URL 2023-12-25 23:48:33 +01:00
Jonatan Heyman
ae5bd48495 Remove debug print 2023-12-25 19:44:53 +01:00
Jonatan Heyman
9d0d38194c Add Build status badge 2023-12-25 17:43:19 +01:00
Jonatan Heyman
1006fd4580
Implement tests using Playwright (#68)
* Set up Playwright and add first test

* Add npm run commands for running tests
Run tests in github actions

* Fix tests on non Mac environments

* Add method to HeynoteEditor class to set the buffer content

* Add more tests

* Set Github action job name
2023-12-25 17:41:15 +01:00
Jonatan Heyman
079fa666d6
Implement web version of Heynote (#63)
* Move windows.darkMode -> window.heynote.themeMode

* Only add UpdateStatusItem if window.heynote.autoUpdate is set

* Update Vite

* Implement web version of Heynote.

Add a child vite project in ./webapp/ that is Heynote running within a browser. Imports almost all code from ../src/ and only adds a thin bridge that corresponds to the API between the Electron main process and the app code.

* Remove commented out tag

* Specify publicDir in vite config, instead of using a symlink

* Add webapp_dev npm command to package.json

* Add npm run command: webapp:build

* Add resolve alias '@' that points to project root.
Move assets file from public to assets in order to let Vite/Rollup handle bundling.
2023-12-25 14:18:44 +01:00
Jonatan Heyman
bbb6387581 Make sure saveFunction() is called when the page is unloaded 2023-12-24 22:21:41 +01:00
Ahmed M. Atia
96440b28ba
Add syntax highlighting support for C# (#55)
* feat: add syntax highlighting support for C#

* update README - add C# sysntac highlighting support

* restore original indentation / formatting

* Fix syntax error in Lezer grammar

* Fix language auto detection of C#

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2023-12-24 10:59:24 +01:00
Jonatan Heyman
5d7af5031d Improve settings dialog
* Fix issue where it would overflow the viewport if using high enough zoom
* Some minor design improvements
2023-12-24 00:23:07 +01:00
Jonatan Heyman
bb9a39fe6e Fix bug where language auto detection will not trigger in some cases
E.g. if you pasted a piece of javascript, selected the whole block and deleted the text (which will change back the default language to Plaintext (auto)) and then paste the same javascript code again.
2023-12-24 00:13:17 +01:00
Jonatan Heyman
206abbc31c Change tense 2023-12-23 12:17:14 +01:00
Jonatan Heyman
b4953bf8a3 Fix links to Github issues 2023-12-23 12:16:30 +01:00
Jonatan Heyman
9290c8ef73 Add FAQ question on naming blocks/tags 2023-12-23 12:15:05 +01:00
Jonatan Heyman
0c88fbf242 Fix typo 2023-12-23 12:02:55 +01:00
Jonatan Heyman
6678c264d5 Add note about installation on Linux (ChromeOS)
Fixes #48.
2023-12-23 12:02:26 +01:00
Jonatan Heyman
6a5efea5c9 Add FAQ to Readme 2023-12-23 11:39:07 +01:00
Joshua Blum
f532c7939b
Add bufferPath to config, support bufferPath symlink (#27)
* Add bufferPath to config, support bufferPath symlink

* defaultPath before checking realpath

* Move code for retrieving buffer path into its own file

* Do the realpathSync() call for the whole final file path, to allow the buffer file to be a symlink

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2023-12-23 11:17:13 +01:00
Jonatan Heyman
d1ea17c197 Fix keyboard shortcut help text in the initial buffer text 2023-12-23 00:52:14 +01:00
Jonatan Heyman
9ee25ab758 Tweak body background in light mode 2023-12-22 20:09:39 +01:00
Jonatan Heyman
1b4b22eb62 Set dark body background in dark mode to prevent white flicker when resizing 2023-12-22 20:07:42 +01:00
Jonatan Heyman
8d261571b3 Improve help text of initial buffer content 2023-12-22 20:07:42 +01:00
Noah Andrews
a871291ec6
Remove reference to Linux support "coming soon" in the README (#18)
* Note that Linux support is now available in the README
2023-12-22 18:43:36 +01:00