Commit graph

275 commits

Author SHA1 Message Date
Erik Michelson
e53ad15bfe enhancement(sidebar): hide delete note button when not being the owner
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-08 13:53:19 +02:00
Tilman Vatteroth
f786fe538b fix(editor): fix emoji picker data path
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-10-08 13:47:00 +02:00
Tilman Vatteroth
72a211b58f Revert "fix(codemirror): remove defect language highlighting"
This reverts commit 6e36ab56b7.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-10-08 13:33:14 +02:00
Erik Michelson
6e36ab56b7 fix(codemirror): remove defect language highlighting
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-08 12:58:59 +02:00
Philip Molares
9a81e3ae18 refactor: remove name tooltip from user avatar
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-10-08 12:58:46 +02:00
Erik Michelson
792f4b7dbc fix: show guest access button only with relevant config being set
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 18:25:05 +02:00
Erik Michelson
cd68794157 fix: redirect to history page after register to avoid problems
With the previous redirect to the root page, there were some problems when having no other routes in the route history.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 18:04:24 +02:00
Philip Molares
f47f6c3658 fix: clicking the logo let's the user get back to the note
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-10-07 18:00:20 +02:00
Philip Molares
2693ebbb82 feat(editor): show notification if user is not allowed to edit note
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 17:49:55 +02:00
Erik Michelson
1fefabb3b2 fix: use correct import for identicon
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 16:17:55 +02:00
Philip Molares
5435dd54ee fix(sidebar): indicate that some feature are not yet supported
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-10-07 15:55:23 +02:00
Erik Michelson
a8b3b117dc feature: add identicon generation to users without photo
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 15:51:32 +02:00
Philip Molares
c4dade2fc5 fix: height and width of history table button
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-10-07 14:44:04 +02:00
Philip Molares
d43da06ec1 refactor: remove dropbox, facebook & twitter login
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-10-07 13:28:37 +02:00
Erik Michelson
29bf32b76f enhancement: use isLoggedIn hook
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 12:34:34 +02:00
Erik Michelson
3dfad0cea5 enhancement: use isLoggedIn hook
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 12:34:34 +02:00
Erik Michelson
8e10fb6804 fix: show new note button only dependent on guest access
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-10-07 12:34:34 +02:00
Tilman Vatteroth
5a1edea00a fix(iframe-loader): add fallback for iframe loading
Some browsers (mostly cypress's chrome) doesn't execute
the onLoad callback automatically on the iframe.
The fallback is a timer that triggers this after a timeout of 500ms.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-10-02 09:13:30 +02:00
Tilman Vatteroth
62abd9cbe0 fix: don't double load iframe content
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-10-02 09:13:30 +02:00
Tilman Vatteroth
d5455f7c33 fix: include uuid in iframe communicator logger
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-10-02 09:13:30 +02:00
Erik Michelson
1199db4692 enhancement(login): add redirectBackTo parameter to login button
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-09-25 00:13:43 +02:00
Erik Michelson
1207ce7690 fix(frontend-config): use guest access level instead of allowAnonymous
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-09-24 23:19:12 +02:00
Tilman Vatteroth
56643ffd85 feat: merge login, register and intro page
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-24 22:12:39 +02:00
Tilman Vatteroth
a1a09f07d0 fix(frontend): fix type mismatch in revision-viewer.tsx
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-24 09:00:37 +00:00
Tilman Vatteroth
b72411a021 fix(frontend): type of revision-viewer.tsx
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-22 08:35:17 +00:00
Tilman Vatteroth
11a47b6087 Revert "fix(frontend): replace expected-origin-boundary with middleware"
This reverts commit 982bc4ba

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-10 21:38:53 +02:00
Tilman Vatteroth
6698450461 fix(frontend): make note details in redux optional
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-09 09:40:06 +02:00
Erik Michelson
ad80b444ff refactor(tests): add test utils for mocking common things
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-09-05 13:05:27 +02:00
Tilman Vatteroth
b3fb1bbf30 fix: extract app bar into layout slot
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-05 12:41:26 +02:00
Tilman Vatteroth
982bc4ba59 fix(frontend): replace expected-origin-boundary with middleware
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-03 22:00:34 +02:00
Tilman Vatteroth
8602645bea feat: migrate frontend app to nextjs app router
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-03 22:00:34 +02:00
Tilman Vatteroth
5b5dabc84e fix: increase type safety of local storage settings
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-03 22:00:34 +02:00
Tilman Vatteroth
46e1b7471d refactor: rename isMac to isAppleDevice
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-03 22:00:34 +02:00
Tilman Vatteroth
9e44f2b26c fix: replace exclamation mark in application error alert with SVG to ensure sizing and position
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-20 20:08:27 +02:00
Tilman Vatteroth
8bc167239c refactor: use application error alert in flowchart
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:56:38 +02:00
Tilman Vatteroth
dccd58f0c1 fix: remove subpath support for HD_BASE_URL
With this commit we drop the subpath support which results in the constraint that HedgeDoc must always run on the root of a domain. This makes a lot of things in testing, rendering and security much easier.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:38:53 +02:00
Philip Molares
e3c7d0ae8a refactor: replace plantuml error message with a custom hedgedoc error alert
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-09 13:55:35 +02:00
Tilman Vatteroth
8e2d59ff3c fix(commons): replace microbundle with bash based compile script
The commons package ships wrong types because it is refering to the same files for the ESM and the CJS build.
See https://arethetypeswrong.github.io/?p=%40mrdrogdrog%2Foptional%401.1.0

This happens because microbundle can handle the generation of `.mjs` and `.cjs` from files itself but delegates the generation of types entirely to typescript by running it once. Microbundle uses the "type" field from the package.json to know if a `.js` file is meant to be mjs or cjs and generates the other type by using the specific file extension `.cjs` and `.mjs` (so if your package is a `type: module`, then `.js` file are interpreted as ECMAModule and if you have a commonjs file you need to name it `.cjs`).  But this causes a problem with typescript. If you use typescript with the newer module resolver then it expects the type declarations to be named exactly like the file you wanna import. So if you have a `.js` file it will try to look up types in a `.d.ts` file. If it is resolving a `.mjs` file it is looking for a `.d.mts` file.

This clashes with the types generated by microbundle because you can't use a `.mjs` file with a `.d.ts` file.

Running typescript multiple times can also be complicated.
When generating type declaration files, typescript takes a look at the source file extension. So a `.mts` file will generate a `.mjs` and a `.d.mts` file. A `.ts` will generate a `.js` and `.d.ts` file. It doesn't matter if you run microbundle on `.ts`, `.mts` or `.cjs` files, it will only generate the type declarations once.

How do you get the other type declaration? To solve this problem you either have to run typescript multiple times and manipulate the input or output data to have correct `.d.mts` / `.d.cts` files AND imports... or do what this PR changes.

It runs typescript multiple times but places the complied files in different directories. It then places a package.json in both directories which declares if `.js` is commonjs or ESM.
This way the resolver is happy because it can import `.js` files according to the package.json content and typescript is happy because it can find type declarations. And because package.json files are inheriting properties from other package.json files no necessary file is missing.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-30 14:56:29 +02:00
Avinash
a948493410 feat(frontend): delete revision
Signed-off-by: Avinash <avinash.kumar.cs92@gmail.com>
2023-07-24 20:05:10 +02:00
Tilman Vatteroth
34bf8f16b1 fix: format code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-19 12:36:32 +02:00
Tilman Vatteroth
4d70ccafbc fix: code formatting
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-16 10:51:51 +02:00
Philip Molares
82f534f7b0 fix(frontend): use correct translations for privacy and term of use links
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-07-09 12:30:51 +02:00
Philip Molares
7e05650888 fix(frontend): use correct translations for privacy and term of use links
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-07-08 16:38:08 +02:00
Tilman Vatteroth
25ee20c15d refactor: rename ready function to match its intent
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
354700e973 perf: add performance marker to monitor the needed time for rendering
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 10:44:48 +02:00
Tilman Vatteroth
a303bb261f perf: use deferred value hook to increase performance
The useDeferredValue hook renders the state change in the background and only applies it if the current value is the newest one.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 10:44:48 +02:00
Tilman Vatteroth
30b374ee5d fix: better apple keyboard detection
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-02 17:54:23 +02:00
Erik Michelson
d10c6d3290 refactor: move help entries into new global app bar
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-07-02 17:54:23 +02:00
Erik Michelson
74b92f2bbb enhancement(icon): add title attribute for icons
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-07-02 17:54:23 +02:00
Erik Michelson
9030bbd454 refactor: move version info modal
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-07-02 17:54:23 +02:00
Tilman Vatteroth
ff004a5a63 refactor: extract shortcuts from help modal
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-02 17:54:23 +02:00
Erik Michelson
ae37bd36f9 refactor: move settings dialog to global dialogs
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-07-02 17:54:23 +02:00
Erik Michelson
5b64392a98 refactor: move motd modal
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-07-02 17:54:23 +02:00
Erik Michelson
fa819c290a refactor: move cheatsheet to global components
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-07-02 17:54:23 +02:00
Tilman Vatteroth
c94db0c1ff fix: flexsearch types
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-02 17:40:39 +02:00
Philip Molares
7a365acdb9 refactor(frontend): make terminology of cheatsheet more clear
Also add additional documentation to explain how cheatsheets work

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-07-02 16:38:16 +02:00
Philip Molares
81927b88f2 feat(frontend): add search in cheatsheet view
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-07-02 16:38:16 +02:00
Erik Michelson
aacdc2a046 fix(deletion-modal): include note title fallback
The note deletion modal previously only used the set title of
the note. This commit changes the dialog to use the result of
useNoteTitle() which contains a fallback string.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-06-30 15:38:53 +02:00
Tilman Vatteroth
f4a1999a8b fix(communication): send ready event when both sides are ready
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-28 21:50:48 +02:00
Avinash
09aef381c1 fix(frontend): readOnly permits codemirror select text
Signed-off-by: Avinash <avinash.kumar.cs92@gmail.com>
2023-06-28 09:06:15 +02:00
Tilman Vatteroth
76242330fd fix(frontend): improve performance by caching translated texts
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-26 23:56:44 +02:00
Tilman Vatteroth
ced4cd953c fix(frontend): improve performance by reducing array constructions
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-26 23:56:44 +02:00
Tilman Vatteroth
13a8eedb50 fix(frontend): fix event emitter leak in realtime status
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-26 00:01:57 +02:00
Tilman Vatteroth
f870ea0d76 fix: forward remaining properties in additional icon component
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-21 22:42:24 +02:00
Tilman Vatteroth
e4492c947a feat: replace placeholder icons of gitlab, matrix and discourse
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-21 22:14:13 +02:00
Tilman Vatteroth
6529d4f20a fix(profile): fix dark mode on profile page
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-08 12:00:24 +02:00
Tilman Vatteroth
90f5ed5606 fix(ui): text color of slideshow button
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-08 11:29:16 +02:00
Tilman Vatteroth
545e84fb9f feat(renderer-iframe): add prop to show a wait spinner on page load
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-08 11:29:16 +02:00
Tilman Vatteroth
f5bcb048cf fix: hide scrollbars in slide show full screen rendering
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-08 11:29:16 +02:00
Tilman Vatteroth
efac46858c fix: move dark mode and transparent body hook into renderer
These hooks are only necessary for the document and simple renderer. The slideshow handles theming itself.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-08 11:29:16 +02:00
Tilman Vatteroth
b04b5cc3e1 feat: add doAfterRendering method to markdown renderer extension
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-07 10:59:29 +02:00
Tilman Vatteroth
450d70961a refactor(toc): rename css classes
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-07 10:59:29 +02:00
Avinash
6babc8997c refactor(frontend): deduplicated username field
Signed-off-by: Avinash <avinash.kumar.cs92@gmail.com>
2023-06-05 22:15:07 +02:00
Tilman Vatteroth
0993372290 fix: replace dark mode hack with bootstrap's own dark mode
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-04 22:38:50 +02:00
Tilman Vatteroth
3f42798965 refactor: replace logo svgs with components
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-04 22:38:50 +02:00
Philip Molares
e13055736a feat(frontend): handle username in lowercase
When handling usernames for login and registering with local or permissions, this makes sure that the username is always in lowercase.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-04 21:55:19 +02:00
Tilman Vatteroth
db6276e019 fix: remove redundant variable
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-04 10:30:22 +02:00
Tilman Vatteroth
753c6e593f refactor: remove isomorphic-ws
The package caused some issues while working on other features.
Mostly because bundlers have been unable to determine the correct
websocket constructor.
So I replaced it with a more object-oriented approach.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-02 17:40:25 +02:00
Tilman Vatteroth
14ba7ea9ce refactor: extract visual part of the toolbar-button component and use it in all buttons components
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-02 17:35:46 +02:00
Tilman Vatteroth
71e5d00f55 refactor: extract height monitor hook
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-01 13:46:19 +02:00
Tilman Vatteroth
4d9792bcb9 refactor: reorganize files in commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-31 23:42:46 +02:00
Tilman Vatteroth
db43e1db3f refactor: move frontmatter parser into commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
4d0a2cb79e refactor: change return type of frontmatter extractor to use undefined
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
77f858bff8 fix: remove redundant note detail props
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
d57e6261da fix: height of reveal rendering
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-24 21:16:10 +02:00
Tilman Vatteroth
0c03e03a95 fix: update test snapshots
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-21 22:31:52 +02:00
Tilman Vatteroth
4eb341308a feat: add concat-css-classes helper method
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-21 22:31:52 +02:00
Tilman Vatteroth
1df6eb7bf5 feat: add replace property to redirect
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-14 13:44:36 +02:00
Philip Molares
472e775fd2 fix(frontend): new note button doesn't use /new anymore
This led to problems, if user clicked the back button in their browser. This implementation doesn't add functional routes in between new notes, but pushes the new note directly in the history.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-05-14 13:44:36 +02:00
Philip Molares
eff6c53860 fix(frontend): use tabs instead of pills for settings modal
This way the button don't look so strange and this is more like the class is intended.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-05-13 14:12:53 +02:00
Tilman Vatteroth
40e9478c67 fix: use html entity for branding separation dash
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-10 16:59:59 +02:00
Tilman Vatteroth
c68fbea606 fix: migrate code to html-to-react v2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-10 16:30:38 +02:00
Tilman Vatteroth
d29e840bc6 fix(realtime): allow realtime user status updates from users that have read-only access
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-09 20:33:23 +02:00
Tilman Vatteroth
29afcce555 fix(editor): catch error when refreshing note metadata
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-09 12:31:49 +02:00
Philip Molares
757345d318 fix(frontend): remove parenthesis around •
This was the way it was in HedgeDoc 1. It was deemed to be better than the parenthesis version in a debug session.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-05-07 22:42:38 +02:00
Tilman Vatteroth
340adbe69a refactor: extract scroll hooks
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-07 21:43:52 +02:00
Tilman Vatteroth
bded420cab refactor: rename EditorDocumentRenderer to RendererPane
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-07 21:43:52 +02:00
Tilman Vatteroth
4d48aa613d refactor: rename render-iframe to renderer-iframe
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-07 21:43:52 +02:00
Tilman Vatteroth
aef0211092 refactor: move render-iframe to commons
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-07 21:43:52 +02:00
Tilman Vatteroth
18206c0615 test: add unit tests for custom branding
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-07 21:40:30 +02:00