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
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.
* 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>
* 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>
* 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
* 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>
* 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
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.
* 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
* 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.
* 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>
* 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
* 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
* 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.
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.
Prettier currently has a bug that causes it's formatWithCursor() to be extremely slow in some cases. In Heynote, whenever you pasted a large JSON chunk and auto formatted it, with the cursor at the beginning or the start of the block, this would trigger that bug. This commit introduces a work around by using format() if the cursor is at the beginning or the end of the block.
Update to latest version of Prettier.
Explicitly add "@codemirror/*" packages instead of relying on the "codemirror" sample package.
Update to newer versions for implicit dependencies in in package-lock.json.
This should fix errors in development mode on Windows.
Replace [ ] and [x] with checkboxes in Markdown todo lists.
Add Markdown LanguageSupport extension in order to automatically add/remove new list items when pressing enter/backspace in a list in Markdown mode.
If content starts and ends with { & } or [ & ], we first try to parse is as JSON. If that succeeds, we'll assume it's JSON.
Increase the highlightjs relevance threshold.
Hopefully this will result in fewer false positives that have been observed (e.g. for CSS and JSON).