Commit graph

238 commits

Author SHA1 Message Date
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
4cb332622a feat(frontend): add build script
The build script prepares the package for a production build, builds the app, places every all needed files in a dist directory and cleans it.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-27 12:42:40 +02:00
Tilman Vatteroth
7b3c217470 fix(frontend): remove unused handler
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-27 12:42:40 +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
cdd368bc81 refactor: use application error alert in abc-frame
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:56:38 +02:00
Tilman Vatteroth
cb38d5dedf refactor: use application error alert in vega-lite-chart
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:56:38 +02:00
Tilman Vatteroth
9cf450a622 refactor: use application error alert in mermaid-chart
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:56:38 +02:00
Tilman Vatteroth
2c4d688abd refactor: use application error alert in katex-frame
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:56:38 +02:00
Tilman Vatteroth
6f0adfd717 refactor: use application error alert in graphviz-frame
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
Philip Molares
c6c972c56c fix(blockquote): remove extra color tag
Remove the extra color tag in a way that still makes us able to use the color tag in the blockquote

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-08-06 19:06:29 +02:00
Tilman Vatteroth
cbfed96398 fix: code formatting in mermaid-chart.tsx
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-06 11:55:34 +00: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
Philip Molares
1624ff9c3b feat(frontend): add useDocumentSearch hook
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
Erik Michelson
58c2cfe727 enhancement: add profiling flag to analyze run
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-06-27 11:04:27 +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
1251f2f650 fix(frontend): dont log debug messages in production build
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-26 22:42:19 +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
90df9a4e32 feat: move title and description to revision entity
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-20 11:44:38 +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