Commit graph

549 commits

Author SHA1 Message Date
Tilman Vatteroth
9a62f27303 Remove unnecessary assertion
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-05-08 22:45:08 +02:00
Tilman Vatteroth
a48b4f60bb
Change schema of url environment variables (#1237)
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-05-05 22:33:30 +02:00
Erik Michelson
3887de4309
The History PR: III - Editor integration (#1158)
* Update history on editor load and title change

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Add pinning to history from sidebar

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Add CHANGELOG entry

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Only update local history entries

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Update property names to match backend ones

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Show error notification on failure

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Apply requested changes from review

- rename use hook to reflect the situation that only local entries will be updated
- extract the update ready check from the hook
- rename vars to make comparison more clear

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-05-04 20:35:08 +02:00
Erik Michelson
726b084509
Fix task list checkboxes for numbered lists (#1233)
* Fix replacer regex

This regex handles the replacement of the [ ] with [x] and reverse.
Until now it was build to check for an unordered list beginning with "*" or "-".
This change permits "+" as well as digits followed by a dot (ordered lists).

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Add cypress tests for task lists

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Add bracket syntax for numbered lists

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-05-04 20:34:16 +02:00
Tilman Vatteroth
eac288cebc Fix spinner visibility on intro-page
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-05-03 22:49:06 +02:00
Tilman Vatteroth
0264e9a420
Fetch banner.txt from public URL instead of config (#1216) 2021-05-03 19:57:55 +00:00
Tilman Vatteroth
e1d096ba1d
Don't show error if no intro.md was found (#1221) 2021-05-03 19:56:44 +00:00
Tilman Vatteroth
2c5a03b3ee
Restructures + New Evironment Variables (#1230)
* Use document base uri for react router

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Rename getAndSetUser to fetchAndSetUser

Getter should be reserved for simple get functions.
Everything that does a bit more logic should use a more meaningful verb.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Rename getFrontPageContent to fetchFrontPageContent

Getter should be reserved for simple get functions.
Everything that does a bit more logic should use a more meaningful verb.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Reformat code

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Use PUBLIC_URL env var in index.html

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Introduce new environment variables

For better testing (especially if you have multiple endpoints) this commit introduces
REACT_APP_BACKEND_BASE_URL, REACT_APP_FRONTEND_ASSETS_URL and REACT_APP_CUSTOMIZE_ASSETS_URL

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Remove redundant license information

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Remove redundant license information

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Fix rebase issues

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Remove unused file

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Correct parameter

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Fix run tasks

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Force use of bash

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Fix link to cypress picture

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* revert change

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* fix url

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Remove license info

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Revert rebase issues

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Add missing banner code

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Fix test url

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Useless change to trigger github

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Don't set backend base url because this break the mock mode detection

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

Co-authored-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 22:38:43 +02:00
Philip Molares
9cf7980334
Fix Communication between frontend and backend (#1201)
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-05-01 21:01:42 +00:00
Philip Molares
f01a821810
Reuse: Fix typo in HedgeDoc Icon Usage Guidelines (#1215)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 22:04:43 +02:00
Erik Michelson
003658dc4d
The History PR: II - Add URL params (#1157)
* Add location state dependency

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Split toolbar state into single location states

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Add CHANGELOG entry

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Pin dependency

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Use react state for view because of side-effects

The locationState was resetted on each search or tags filter update because these updates pushed a change to the location thus resulting in loss of the location state for the view.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Remove unneeded import

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Change CHANGELOG entry

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Removed unnecessary typecast

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-04-24 23:25:01 +02:00
Erik Michelson
8e5a667d18
The History PR: I - Move to redux (#1156) 2021-04-22 22:46:24 +02:00
Philip Molares
bba2b207c4
TablePicker: Change table cells in picker (#1202)
- Fix error that the border of table cells was invisible in dark mode
- Add margin to table cells
- Add full border to table cells
- Change border-color while hovering over table cells

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 12:55:51 +02:00
Tilman Vatteroth
bfcb617eeb Use module build of markmap-lib
If we use the default import then webpack will use the "browser"
bundle which relies on CDN lazy loading of dependencies.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-04-15 22:18:12 +02:00
Tilman Vatteroth
64fe7233e7 Fix code highlight indentation
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-04-15 22:14:02 +02:00
Philip Molares
29d9d49f5a
Change api route to /api/private (#1189) 2021-04-15 22:10:15 +02:00
Erik Michelson
7a21a26166
Disallow data and javascript URIs (#1186)
* Disallow data and javascript URIs

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-04-11 22:48:31 +02:00
renovate[bot]
ab9f89f39f
Update dependency vega to v5.20.2 (#1152)
* Update dependency vega to v5.20.2

Signed-off-by: Renovate Bot <bot@renovateapp.com>

* Add type to error object

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

Add renovate group for vega

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

Update vega code

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Regenerate yarn.lock

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-04-10 15:27:42 +00:00
Tilman Vatteroth
af887877aa
Add context for iframe communicator in editor page (#1146)
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-04-03 12:59:14 +02:00
Tilman Vatteroth
a86789dbef
Add toasts (#1073)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-03-11 20:51:11 +01:00
Erik Michelson
0b4a0afa16
Add table formatting on paste of detected table (#957) 2021-03-10 22:52:20 +01:00
Tilman Vatteroth
107f0f6fa3
Code improvements (#1086)
* Extract code into hook
* Refactor code to remove let
* Reformat code
* Extract version-info-modal into components
* Use main block in landinglayout
* Add fixedWidth and classname attribute to IconButton

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-03-10 22:45:05 +01:00
Erik Michelson
6d2dde477c
Add one-click login if possible (#1043) 2021-03-09 23:00:14 +01:00
Tilman Vatteroth
a6c80ac1f0 Extract code into hook
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-03-09 22:40:24 +01:00
Erik Michelson
a1698047a8
Set sanitized note title as filename for download (#1057) 2021-02-22 23:36:09 +01:00
Erik Michelson
7dd91c7b46
Change top slide mode button dynamically to read-only-mode (#1056) 2021-02-22 22:54:28 +01:00
Erik Michelson
f9809a4edf
Add e2e tests for diagrams and embeddings (#1025) 2021-02-22 22:27:59 +01:00
Tilman Vatteroth
d9292e4db0
Merge basic and full markdown renderer (#1040)
The original idea of the basic-markdown-renderer and the full-markdown-renderer was to reduce the complexity. The basic markdown renderer should just render markdown code and the full markdown renderer should implement all the special hedgedoc stuff like the embeddings.
While developing other aspects of the software I noticed, that it makes more sense to split the markdown-renderer by the view and not by the features. E.g.: The slide markdown renderer must translate <hr> into <sections> for the slides and the document markdown renderer must provide precise scroll positions. But both need e.g. the ability to show a youtube video.

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-17 21:58:21 +00:00
Tilman Vatteroth
37234f9c09
Improve key compare in rendering (#1027)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-10 16:10:57 +01:00
Tilman Vatteroth
ae38ab007a Don't show i18n messages in production mode
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-10 13:58:04 +01:00
Tilman Vatteroth
8a2d26f718
Remove custom abcjs types (#1024)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-08 21:19:02 +01:00
Tilman Vatteroth
47f5e7653b
Readd legacy pdf short code markdown it plugin (#1023)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-08 20:03:49 +01:00
Tilman Vatteroth
5b1940f0ba
Add quote extra markdown it plugin (#1020)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-08 18:29:02 +01:00
Tilman Vatteroth
7f6e0e53a7
Add custom intro page by fetching markdown content from a file (#697)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-08 15:03:11 +01:00
Tilman Vatteroth
e12dc523f8
Adjust editor config (#976)
* Adjust editor config

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2021-02-03 22:13:04 +01:00
Tilman Vatteroth
0180c75e55
Remove wider mode #999
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-02 22:13:31 +00:00
Tilman Vatteroth
f7be49bbc3
Fix document renderer sizing issues (3/4) (#998)
* Rework renderer columns

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-02 21:53:43 +01:00
Tilman Vatteroth
123f959fb3
Move and rename files (2/4) (#987)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-02 00:03:47 +01:00
Tilman Vatteroth
1b7abf9f27
Reorganize redux and hooks (1/4) (#985)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-01 22:55:49 +01:00
Tilman Vatteroth
add741a677
Remove PDF embedding (#1000)
* Remove PDF embedding
* Add pdf deprecation to CHANGELOG.md

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-31 21:36:16 +01:00
Tilman Vatteroth
c862ca341f
Use currentColor in SVGs (#997)
If you include a SVG directly into the DOM (what we do here), then currentColor is the current text color. This is way more convenient than changing the SVG file.
This doesn't work if you load the SVG with an IMG-Tag.

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-31 19:42:31 +01:00
Philip Molares
4c1f081399 ABCFrame text-color is always black
fixes #977

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-26 23:57:51 +01:00
Tilman Vatteroth
0627e0f551
Replace document bar with sidebar (#937)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-24 21:39:47 +01:00
Tilman Vatteroth
586969f368
Wrap markdown rendering in iframe (#837)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-24 20:50:51 +01:00
Tilman Vatteroth
bd31076928
Update abc js to version 6-beta (#975)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-23 22:12:56 +01:00
Tilman Vatteroth
1777ba848f
Collected minor changes from #837 (#962)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-23 21:01:53 +00:00
Tilman Vatteroth
c9168fcaa7
Limit attributes for external links (#950)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-16 09:08:23 +01:00
Philip Molares
d838b2c2d4
Removed some types as the package comes with it own types now (#949) 2021-01-15 23:16:39 +01:00
Tilman Vatteroth
908a5ce984
Rewrite tests (#948)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-15 21:54:43 +00:00
Tilman Vatteroth
9f6b1a9a46
Fix counter continue in highlighted-fence-replacer.tsx (#943)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-13 11:52:06 +01:00
Philip Molares
7be64bc582
added a spoiler container (#947)
changed toolbar to insert the new spoiler container
changed tests accordingly

References:
https://github.com/markdown-it/markdown-it-container
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-13 11:45:33 +01:00
Philip Molares
9330adf564
fixed title extraction to exclude latex code, but include rendered latex (#946)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-12 18:18:56 +01:00
Tilman Vatteroth
3db6bcf892
Improve tests (#944)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-11 22:22:11 +00:00
Tilman Vatteroth
cb5283b1bf
Don't show "create table" overlay if modal is showing (#942)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-11 18:49:08 +01:00
renovate[bot]
faf953d0fa
Update dependency react-bootstrap to v1.4.3 (#928)
* Update dependency react-bootstrap to v1.4.3

Signed-off-by: Renovate Bot <bot@renovateapp.com>

* Fix as ToggleButtons require now enums instead of booleans

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Remove memo

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-09 15:30:20 +01:00
renovate[bot]
1b90cc4c6e
Update dependency js-yaml to v4 (#934)
* Update dependency js-yaml to v4

Signed-off-by: Renovate Bot <bot@renovateapp.com>

* Replace yaml.safeLoad with yaml.load as its safe now by default

Signed-off-by: Erik Michelson <github@erik.michelson.eu>

* Update @types/js-yaml

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Regenerate yarn.lock

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-09 15:12:43 +01:00
Tilman Vatteroth
a6996d9414
Limit lightbox size (#923)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-08 09:36:19 +01:00
Tilman Vatteroth
005597e880
Use original markdown-it-anchor (#914)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-07 16:52:00 +00:00
Erik Michelson
527df561ef
Fix yaml metadata and document title not resetting on deletion (#915) 2021-01-07 17:38:06 +01:00
Philip Molares
bac52ddb7a
fixed toolbarButtonUtils.test.ts (#920)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-07 17:25:16 +01:00
Philip Molares
45cd5a9b89
added shortcut for addLink (ctrl+k) (#921)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-07 17:21:02 +01:00
Tilman Vatteroth
4459dc742f
Move yaml-array warning to documentrenderpane (#916)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-07 16:24:06 +01:00
Tilman Vatteroth
dc8ac6e3d8 Use yaml-array in demo content
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-07 16:11:21 +01:00
Tilman Vatteroth
28600d6508
Change copyright year from 2020 to 2021 (#917)
* Change copyright year from 2020 to 2021

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Change copyright year in jetbrains copyright template

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-06 21:37:59 +01:00
Tilman Vatteroth
887c3b9dd3
Feature/browserstack (#902)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-06 13:09:33 +01:00
Erik Michelson
b2cf2f134e
Add ability to use yaml-array for tags (#874) 2021-01-04 13:01:34 +01:00
Tilman Vatteroth
bf42b9c460
Minor fixes (#911)
* Replace full links

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Use dark mode hook

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add overflow for graphviz and abc

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Cap max height of toc overlay

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Remove extension from css import

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix hook

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-03 00:19:10 +01:00
Tilman Vatteroth
528e67e11e
Open links always in new tabs (#912)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-03 00:06:13 +01:00
Tilman Vatteroth
dfc2524bd7
Add test mode (#898)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-29 17:13:07 +01:00
Tilman Vatteroth
58803f93ab
Regenerate yarn.lock (#893)
* Regenerate yarn.lock

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* migrate fontsource package

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Correct link to source sans pro

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-26 17:37:55 +01:00
Tilman Vatteroth
53053813bd
update markdown-it-anchor (#892)
* update markdown-it-anchor
* Update markdown-it-types
* Regenerate yarn.lock

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-26 16:56:46 +01:00
Tilman Vatteroth
91fcc4fe40
Improvement/update better task list (#878)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-24 10:27:22 +01:00
Tilman Vatteroth
6dc6adf270 Remove first draw hook
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-24 10:16:48 +01:00
Tilman Vatteroth
23a1e30c3a Replace youtube link with a working one
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-23 20:38:35 +01:00
Erik Michelson
95c563255d
Add support for editor-mode URL parameters (#873) 2020-12-22 21:45:11 +01:00
Erik Michelson
721c8c0e5a
Enhance share dialog (#860) 2020-12-22 21:17:40 +01:00
Tilman Vatteroth
1c6e6e10fb
Replace codimd with hedgedoc (#875)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-22 17:27:26 +01:00
Philip Molares
1b563f7f89
fix pasting text (#871)
* fix onPast bug in editor

the event was prevented, if event.clipboardData.files was defined. This always the case. Now we check if this filelist object has at least on entry to start the onPaste handler for file uploads.

Signed-off-by: Philip Molares <philip.molares@udo.edu>

* added e2e test that verifies that pasting text still works

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-12-21 11:58:43 +01:00
Erik Michelson
c5ad0e6eca
Fix bug that pathname is always empty (#859) 2020-12-17 23:30:18 +01:00
Philip Molares
0c0841639a
added upload functionality (#758)
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-12-16 23:07:09 +01:00
Tilman Vatteroth
8ce344512c
Use fira code in editor (#695)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-14 23:58:46 +01:00
Tilman Vatteroth
79171a8456
Move highres image (#857)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-13 16:31:55 +01:00
Tilman Vatteroth
c5af44909c
Update markmap (#834)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-12 13:45:10 +01:00
Philip Molares
48d78d9839
fixed table-picker.tsx (#836)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-12-11 23:41:07 +01:00
Tilman Vatteroth
fee1605636
Add custom language list for highlight js without 1c (#809)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-12-07 21:36:14 +01:00
Philip Molares
64edb05204
removed the f9 shortcut to sort all lines in a pad (#814)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-12-02 22:45:55 +01:00
Philip Molares
e0dbb05572
changed calls to cy.route to cy.intercept (#806)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-11-30 12:31:54 +01:00
Tilman Vatteroth
bc7ff07256
Extract windows location code into hook (#808)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-30 10:09:04 +01:00
Philip Molares
a24ef18dd4
added table overlay to table toolbar button. (#763)
Co-authored by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-11-29 13:17:40 +01:00
Tilman Vatteroth
0d480d509b
Replace source * pro files with npm package (#793)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-29 10:08:27 +01:00
Tilman Vatteroth
74fd6d0630
Split scss vars for themes (#802)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-28 22:08:18 +01:00
renovate[bot]
fda558d649
Update dependency markdown-it-anchor to v6 (#642)
* Update dependency markdown-it-anchor to v6
* Set initial slug-count offset on duplicate headings to 1 instead of 2

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-11-26 22:05:17 +01:00
Philip Molares
63de77ccdd fixed avatar url as we moved it in the reuse pr
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-11-25 14:58:40 +01:00
Philip Molares
c09aaf010c
use types from markdown-it-toc-done-right plugin (#665)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-11-23 12:40:54 +01:00
Philip Molares
f3bf7cd105
Added reuse information (#782)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-11-22 21:50:07 +01:00
mrdrogdrog
42cbb51bfa
Feature/hedgedoc logo (#606) 2020-11-15 21:37:39 +01:00
Philip Molares
62d95a5704
fix anchor links (#754) 2020-11-15 21:23:24 +01:00
renovate[bot]
8b8eff7b46
Update dependency emoji-picker-element to v1.3.0 (#744)
* Update dependency emoji-picker-element to v1.3.0

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-07 17:41:37 +01:00
renovate[bot]
7fffd9458e
Update dependency markmap-lib to v0.10.1 (#745)
* Update dependency markmap-lib to v0.10.1

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-07 17:18:32 +01:00
mrdrogdrog
e73661d406
Refactor emoji code (#720)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-04 21:33:52 +01:00
Philip Molares
0e058e16e2
move taskLists from full to basic renderer (#725) 2020-11-01 21:38:17 +01:00
Philip Molares
c9fe4e4887
moved alertContainer to basic renderer from full renderer (#736) 2020-10-31 20:22:55 +01:00
renovate[bot]
433985f508
Update dependency eslint-config-standard to v16 (#735)
* Update dependency eslint-config-standard to v16
* disable useless message
* replace regex

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-31 10:33:51 +01:00
mrdrogdrog
1690a7bdcf
Improvement/move document content into redux (#691) 2020-10-28 22:15:00 +01:00
Tilman Vatteroth
0750695e2f extract scroll code from renderer into hook
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-28 21:49:18 +01:00
mrdrogdrog
4603e3988a
Extract view mode shortcut code into hook (#688) 2020-10-28 11:35:24 +01:00
mrdrogdrog
c6d2aa76ca
extract code into useFirstDraw hook (#689) 2020-10-28 11:34:21 +01:00
mrdrogdrog
819b36a137
Use editor-preference-select for spell check (#694) 2020-10-28 11:32:44 +01:00
Tilman Vatteroth
5197d0512b Disable check box if no onTaskCheckedChange is provided
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-28 11:29:27 +01:00
Tilman Vatteroth
0eabfc3bb3 Fix font-color in flowchart
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-28 11:28:50 +01:00
Tilman Vatteroth
9554d6d3b3 Use bare version of markdown-it-emoji
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-28 11:28:23 +01:00
mrdrogdrog
460badb97b
Update multiple packages (#719)
* Update multiple packages

- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- eslint-config-react-app
- eslint-config-standard
- react-scripts

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* fix type

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* deduplicate code

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Disable test because it doesn't work

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* repair service worker

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Lazy load mermaid

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* use show error

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* fix tsconfig in cypress

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* fix import integration test

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-25 21:17:59 +01:00
renovate[bot]
47f84f1933
Update dependency markmap-lib to v0.9.2 (#707)
* Update dependency markmap-lib to v0.9.2

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-25 11:58:40 +01:00
renovate[bot]
8e60c1750f
Update dependency flowchart.js to v1.15.0 (#680)
* Update dependency flowchart.js to v1.15.0

* Remove custom types

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Adjust code to new types

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-17 18:50:08 +02:00
mrdrogdrog
8a8c043081
Set background or alternative colors for diagrams (#667) 2020-10-13 20:58:39 +02:00
mrdrogdrog
d5ee2f6d54
Update flowchart js (#674) 2020-10-13 15:55:15 +02:00
mrdrogdrog
0d2c2fe0ee
Replace empty components with hooks (#666) 2020-10-12 22:33:23 +02:00
Erik Michelson
9e9108ec9a
Add read-only view (/s/note) (#563)
* Update Link classes to allow tooltips/titles

* Added read-only-view, Move note title extraction into separate file

(cherry picked from commit be23083ca3966f26b1b841d5cf4f21e299c8a55a)
(cherry picked from commit cbc595d3fc336b0a649c396dfae30fa08082384c)

* Optimized look of document-infobar

(cherry picked from commit 0176668b156da3fd7c534161a839ca0e3495119c)

# Conflicts:
#	src/components/editor/document-bar/document-info/document-info-time-line.tsx

* Show help-button only in Editor-variant of AppBar

(cherry picked from commit 3c26e1619c774fe162cb3d8fae9e79ced92c9c3e)

* Update CHANGELOG

(cherry picked from commit d0d29e7d408515cc8f86df45d13fff60d741873e)

* Move motd-banner to top of page

(cherry picked from commit 43a9a274bf5da3fdf640ec905ab38153c81b014b)

* Refactor isInline to size property

(cherry picked from commit cb4ee74b7c97ec9711946f28924e9c890b752ea3)

# Conflicts:
#	src/components/editor/document-bar/document-info/document-info-time-line.tsx

* Add size attribute to user-avatar

(cherry picked from commit 9629b58911b9d4f3aed81ef8c271fbc8e5a15aa4)

* Add mode-enum to app-bar

(cherry picked from commit 08f95be58974468c1e2897b475e5e3235b79c230)

* Split DocumentRenderPane into scrollable- and non-scrollable variant

(cherry picked from commit 44dd27edfd967745c548f7ae1fd2047e812cdc22)

* Removed unnecessary className
2020-10-12 21:58:00 +02:00
Philip Molares
36679753d7
updated flowchart.js to 1.14.2 (#671)
using types from the package instead of our own
2020-10-11 21:03:23 +02:00
mrdrogdrog
02ae83ba5e
Updates twemoji.ttf with a new version that is built for twemoji 13 (#664)
* Updates twemoji.ttf with a new version that is built for twemoji 13
* Rename font
2020-10-11 12:57:19 +02:00
mrdrogdrog
417a5dc798
Activate markdown folding (#668)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-11 12:55:17 +02:00
Erik Michelson
5574f09ef5
Replace emoji-mart with emoji-picker-element (#620)
* Change dependencies

* Use emoji-picker-element instead of emoji-mart

* Optimize emoji-picker appeareance and data-source

* Add twemoji font to emoji-picker

* Add missing useEffect dependency

* Add emoji-shortcode map

* Include emoji-data into bundle and remove dynamic fetch

* Rename shortcode-map

* Fix emoji-picker being hidden on second attempt to open it

* Add support for skin-tone short-codes

* Remove whitespace line

* Don't reinitialize the picker on every open

* Fixed linting and test issues

* Update CHANGELOG entry
2020-10-10 23:12:17 +02:00
Philip Molares
fe40d7247d
added missing button-inside css file in MarkmapFrame (#663) 2020-10-10 12:24:19 +02:00
Erik Michelson
053edb9ace
Add access token management to profile (#653)
* Add mock-files, API calls and overall tokens-UI

* Added ability to add tokens

* Added token deletion feature (based on timestamp)

* Replace mock-method by real API code

* Add cypress tests

* Added CHANGELOG information

* Un-access-ify i18n

* Set unique react-element key to timestamp of token-creation

* Remove 'now' from changelog

* Use @mrdrogdrog's suggestion for the info label
2020-10-10 11:38:32 +02:00
Erik Michelson
729ad652b3
Added markdown-file import (#645)
* Added markdown-file import

* Reset file input after read, don't add unnecessary blank lines

* Add cypress-file-upload dependency

* Add cypress tests for md file importing

* Added CHANGELOG entry
2020-10-09 21:26:04 +02:00
Philip Molares
c1d4ac1014
Markmap make mouse input toggle (#655)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-10-09 19:32:06 +02:00
Philip Molares
0670cddb0b
markdown-it-configurator (#626)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-10-08 22:24:42 +02:00
renovate[bot]
07364ff07b
Update dependency markmap-lib to v0.9.1 (#637)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: mrdrogdrog <mr.drogdrog@gmail.com>
2020-10-07 12:21:03 +02:00
Philip Molares
b094fe1de6
added js as an extra highlighted language (#646) 2020-10-06 14:20:23 +02:00
Philip Molares
9f7a106834
added markdown export (#627) 2020-10-06 12:43:17 +02:00
Philip Molares
4984008aff
fixed help modal width (#644)
after we added tabs in the help modal, the modal doesn't need to be xl anymore as it has way to much empty space that way.
2020-10-06 12:41:47 +02:00
Erik Michelson
9b6fca29e8
Add common download helper (#628)
* Refactor download functions into a common helper function

* Removed unused import
2020-10-03 22:38:46 +02:00
Philip Molares
460aef6ffe
added 'gitlab snippet' item to import and export menus (#624) 2020-10-03 20:38:22 +02:00
Philip Molares
20e296cb9b
replaces moment with luxon (#621) 2020-10-02 14:00:29 +02:00
mrdrogdrog
733df9b94a
replace allowedChars with not-whitespace (#617) 2020-09-30 23:58:31 +02:00
Philip Molares
1ab9b58031
Extract clean title from first heading (#616)
* removed first-header-extractor
get first heading from markdown rende
* don't remove editor or renderer just hide them
this way both are always up to date and can be shown very fast
* extracted image alt attribute into first title. too
* added tests as suggested by @mrdrogdrog
2020-09-30 23:50:32 +02:00
Tilman Vatteroth
192f66d169 Use right clear error
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-30 23:38:36 +02:00
Erik Michelson
091b225672
Add caching of user-data (#568)
* Add caching of user-data for 600 seconds

* Make cache-entry interface commonly usable

* Extract revision types

* Remove revision-cache rule

* Use seconds as cache-time interval (Date.now uses milliseconds)

* Fix import error

* Extract cache logic into common cache-class

* Add cache class that was forgotten to commit in last commit

* Start adding unit tests

* Fix bug detected during unit-testing

* Add unit tests for cache

* Made entry-limit test more explicit

* Renamed files to lower-case starting letter
2020-09-30 23:37:57 +02:00
Erik Michelson
0f31c3b0b4
Autocompletion and toolbar button for collapsable blocks (#615)
* Add autocompletion for <details construct

* Add toolbar button for <details>-construct

* Added CHANGELOG notice
2020-09-30 23:35:10 +02:00
mrdrogdrog
2b6ba82b4b
Set wasmfolder (#619) 2020-09-30 23:22:17 +02:00
mrdrogdrog
5381f8ed90
Fix render pane scrolling (#613) 2020-09-30 20:31:04 +02:00
Erik Michelson
01a68b1efe
Change element.io links to matrix.to links (#614)
* Change element.io links to matrix.to links

Following to the discussion in codimd/server#496, this commit changes element.io links to matrix.to in the new react-client as well.

* Updated cypress test for new link
2020-09-30 18:19:17 +02:00
mrdrogdrog
101292da92
Feature/lazy load components (#590) 2020-09-26 09:54:17 +02:00
Philip Molares
9c38655a92
fixed highlight fence in regard to '=' (showLines) and '!' (wrapLines) (#594)
this was just a simple index problem. The 0. entry of a regex result is the whole string and not the first capture group

added e2e tests to fix this in the future
cypress does currently not support copy to clipboard in firefox so this part of the test is commented out (for the time being)
2020-09-22 23:17:19 +02:00
mrdrogdrog
985abe230e
Remove unused prop (#589)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-20 22:55:31 +02:00
Philip Molares
8e8190b800
Add copy-to-clipboard-button to all code blocks (#566)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: mrdrogdrog <mr.drogdrog@gmail.com>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-19 22:24:49 +02:00
Philip Molares
005c80ff55
added markmap support to the markdown-renderer (#572)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-19 20:34:44 +02:00
Philip Molares
cac9b7ea37
Expand image button (#570)
added full-screen image modal when clicking on img's

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-09-19 20:12:57 +02:00
Philip Molares
553cd3577d
add vega-lite diagram (#574)
added vega-lite diagrams
Update CHANGELOG.md

Co-authored-by: mrdrogdrog <mr.drogdrog@gmail.com>
2020-09-19 19:34:24 +02:00
Philip Molares
b772a0ab8f
removed unnecessary export of GeneralLinkProp (#569) 2020-09-16 15:49:15 +02:00
renovate[bot]
d57f6577a5
Update dependency markdown-it-deflist to v2.1.0 (#561)
* Update dependency markdown-it-deflist to v2.1.0

* Include end line number into key

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Update src/components/markdown-renderer/utils/html-react-transformer.tsx

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-15 21:23:06 +02:00
Erik Michelson
8842fff06f
Add info message on empty toc (#567) 2020-09-15 10:22:49 +02:00
Philip Molares
5972932d33
Feature/d3 graphviz (#564)
added graphviz diagrams via d3-graphviz
added craco and webpack-copy-plugin to copy wasm files

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-15 09:26:44 +02:00
Philip Molares
44637c753e
Add dark mode (#554) 2020-09-13 18:04:02 +02:00
Erik Michelson
be2428f22c
Extract URLs in extra file and change riot link to element-link (#551)
* Update matrix chat link to new element URL

* Correct other usages of the element link

* Extracted static external links into separate file
2020-09-13 16:38:53 +02:00
renovate[bot]
ca2bd1d90f
Update dependency @types/codemirror to v0.0.98 (#557)
* Update dependency @types/codemirror to v0.0.98

* Remove cm-full-screen custom types as they're now included in @types

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-09-12 16:20:56 +02:00
Erik Michelson
f636e5ec10
Save editor preferences to localStorage (#541 / #553)
* Added editor-preferences to redux store

* Add local-storage saving and retrieval of EditorConfig

* Change import to be in a single line

* Add equality check to redux-selector (as suggested by @mrdrogdrog)

* Save and load editor-config to/from localStorage
2020-09-09 11:22:52 +02:00
mrdrogdrog
a86d4cbc58
modularize renderer (#552) 2020-09-08 21:49:42 +02:00
Philip Molares
ac00bc98c0
build new permissions modal (#532)
build new permissions modal

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-08 18:16:13 +02:00
Erik Michelson
d500ebcd19 Replace MathJax with KaTex in our test note-content 2020-09-07 20:34:29 +02:00
Philip Molares
2d3d587c78
added error boundary (#540)
added error boundary
this prevents any faulty components to completely crash the app and instead shows this page with some help about what to do and where to report bugs.
2020-09-07 20:18:03 +02:00
Erik Michelson
79469c5ddc
Show warning if note is longer than configured maximum length (#534)
* Add maximum document length config option

* Show remaining characters in tooltip of status-bar length-info

* Remove unnecessary checkDocumentLength function

* Add max-length warning

* Update translation wording

* Set dialog to medium size

* Add coloring to status-bar length info

* Improve wording in warning modal

* Add cypress e2e tests

I included the cypress-commands package and set the language level to ES6 to allow easier testing e.g. of element attributes.

* Changed way how the modal-advice was styled and positioned

* Show warning modal only on first length exceeding

* Improved length tooltip by adding messages when exceeding or reaching limit
2020-09-05 16:36:46 +02:00
mrdrogdrog
e58e53a116
Remove keys from replacers (#539) 2020-09-05 10:34:43 +02:00
mrdrogdrog
63b24fa5bf
Feature/sequence diagram (#538) 2020-09-05 08:23:20 +02:00
mrdrogdrog
119c9512e7
Add abcjs (#537) 2020-09-05 08:17:15 +02:00
Philip Molares
a1d48002dd
added mermaid diagram (#525)
added mermaid diagram

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-09-04 13:28:14 +02:00
Tilman Vatteroth
ed523ec5ba Add markdown body to cheatsheet
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-03 22:03:38 +02:00
Erik Michelson
a99bb62f12
Replace history-menu icon from bars to vertical dots (#531)
* Replace bars-icon with ellipsis-h-icon

* Replace horizontal icon with vertical one
2020-09-03 15:45:49 +02:00
Erik Michelson
d597438c42
Add revisions dialog (#485)
* Add mock files

Note that revisions-list needs to be called revisions in the reality to be confirm with the API spec, but our mocking solution doesn't allow that...

* Add revisions API calls

* Fix line endings in mock files

* Extend CommonModal to accept size and additionalClasses

* Clarify variable name in API request

* Add react-diff-viewer as dependency

* Add revision chooser modal

* Fix type of route params

* Added and updated mock files

* Added user-icon list per revision

* Added translation to alt text of avatars

* Updated mock file to remove inconsistencies

* Add caching for revisions

* Sort mock file revisions-list descending by timestamp

* Pre-select first/newest revision on first modal open

* Regenerated yarn.lock file from scratch

* Applied requested changes in variable names and line lengths

* User UserAvatar component instead of manually set image

* Move revision-modal-list-entry to own component

* Removed unnecessary return statements
2020-09-02 22:57:44 +02:00
mrdrogdrog
0fecda027c
Fix missed code (#530)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-02 21:57:31 +02:00
mrdrogdrog
0e912d64dd
Rename codimd to hedgedoc (#434)
Rename codimd to hedgedoc
2020-09-02 21:17:26 +02:00
mrdrogdrog
3a0e35a9f3
Improve render performance (#511)
Massive improvement of render performance by:
- replacing the codimd-line-marker with an in-memory map
- an observation of the changed markdown code to identify changed lines
- a unique react-key calculation
2020-09-02 20:51:47 +02:00
mrdrogdrog
df7c4cb19e
adjust some review suggestions (#528) 2020-09-02 16:45:25 +02:00
Jakob Klepp
528e7e5904
Add clickable todos (#283) 2020-09-02 13:44:13 +02:00
Erik Michelson
0f30803529
Replace editor toolbar dividers with css pseudo-selector (#527)
* Remove useless divider-spans from toolbar and change css-selector

The use of extra divider elements is not needed as we can set the css-after pseudo-class to the button groups with the same styling.
This way we can reduce the amount of elements in the DOM by a hand full.

* Use scss syntax and include one rule into another more common one
2020-09-01 22:28:37 +02:00
Philip Molares
db4f2a4478
add missing autocompletions (#514)
* added missing autocompletions:
- code-block
- container
- header
- image
- link
- pdf

* added extraTags ([name=], [time=], [color=]) to the link autocompletion, because they trigger on the same characters
added getUser in /redux/user/methods to retrive the current user outside of .tsx files
improve the regexps on several autocompletion

* renamed hints to auto
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-01 22:28:08 +02:00
Philip Molares
2decfc1fa2 added title attribute to images
fixes #518
2020-09-01 10:55:20 +02:00
Erik Michelson
84df2ea1cf
Add 'yarn lint' command and run it in GH actions (#517)
* Add 'yarn lint' command and run it in GH actions

* Move linting to own workflow

* Remove linting from build-workflow

* Solve linting warnings

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-31 12:48:58 +02:00
mrdrogdrog
a41d3d1515
Correct use selector (#515) 2020-08-30 21:24:34 +02:00
Tilman Vatteroth
971421925a Remove TOC replacer
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-30 12:57:17 +02:00
Philip Molares
33648f1645
Added flowchart diagrams (#510)
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: mrdrogdrog <mr.drogdrog@gmail.com>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-08-29 23:56:27 +02:00
Philip Molares
d482065d72
Feature/csv table (#500)
- added csv-replacer
- changed highlghted-code plugin:
     each replacer extracts what he need from the data-extra attribute now
- changed CHANGELOG.md

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-08-29 15:55:42 +02:00
mrdrogdrog
ef36123377
Replace MathJax with KaTeX (#497)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-27 15:13:35 +02:00
Erik Michelson
db080e29d3
Fix editor being filled with €-symbols when pressing the editor-mode-shortcut (#493)
This fix needs a little bit of explanation. Normally the 'keyUp' prevent is preferred because it fires after being sure, that not some buttons more belong to the shortcut. Additionally some platforms set the key-property of the 'keyDown'-event to the composition result of the key-combination thus resolving under certain environments to '€' while in other environments to 'e'.
The browser's event flow is as following: keyDown -> keyPress -> textInput -> keyUp.
As the keyUp-event is too late (after textinput) and the keyPress-event does not work properly with the modifiers, we felt compelled to use 'keyDown' and watch for 'e' as well as '€' key-properties. If some other keyboard locale does output different characters than these two, that person got a problem - meaning no functionality of the shortcut. But still better than nothing.
2020-08-27 14:32:06 +02:00
mrdrogdrog
7f04db9389
Reduce space between editor toolbar buttons (#494) 2020-08-27 10:48:29 +02:00
Philip Molares
36af0dc841 fixed shortcuts for macs 2020-08-26 22:36:05 +02:00
Philip Molares
9439855b08 fixed "PDF does not work. Why?" link in export menu
this also opens a new tab
2020-08-26 22:31:53 +02:00
Tilman Vatteroth
34ceef9d98 Add key prop to shortcut listgroup
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-26 22:01:29 +02:00
mrdrogdrog
52fb372b9b
Fix scroll bugs (#487)
* Check line presence before calculating position
* Fix jump bug
2020-08-26 21:59:03 +02:00
Philip Molares
8a9c2c923d
added viewMode shortcuts (#486)
added viewMode shortcuts
2020-08-26 21:42:05 +02:00
Tilman Vatteroth
058b6ab97a Add fork-awesome-stack.tsx and extract types
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-26 21:28:46 +02:00
Philip Molares
dfdc652503
Restructure help dialog (#484)
- restructured help dialog
- moved isMac function to editor util
- added notice to CHANGELOG.md

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2020-08-26 18:49:46 +02:00
mrdrogdrog
c95a7e0fba
Add sync scroll button (#481)
* Add disable sync scroll button

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-25 21:36:25 +02:00
Tilman Vatteroth
1f18a1ebce Move line number marker to markdown-renderer folder
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-22 21:18:58 +02:00
mrdrogdrog
73007ef597
Added synced scrolling (#386)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-19 23:01:38 +02:00
mrdrogdrog
fc2ba5fb07
Replace gravatar image with local image (#433)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-19 21:28:53 +02:00
Philip Molares
13b7854c65
made the addCodeFences function also work without selections (#428)
* made the addCodeFences function also work without selections
changed tests accordingly

* add codeFence change in CHANGELOG.md
2020-08-19 21:26:22 +02:00
mrdrogdrog
0fadc09f2b
Restructure repository (#426)
organized repository 

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Philip Molares <git@molar.es>
2020-08-16 16:02:26 +02:00
Erik Michelson
8377722e1a
Restructure editor user interface (#399)
* Replaced connection indicator in editor top bar with user-menu

* Added basic layout of bottom document bar

* Fixed margins between elements

* Reorganized document-bar

* Added dividers into toolbar

* Move files from task-bar to document-bar and remove test file

* moved connection-indicator components into its own folder

* moved document bar to the top

* moved connection-indicator once again

* Change design

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* New idea for timestamps

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add css

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Revert "Add css"

This reverts commit 6780aa05

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Revert "New idea for timestamps"

This reverts commit bf2891e1

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* split import / export

* Made version input field to a common component

* added read-only modal
added document-time
added placeholder text for permissions

* remove flex-nowrap from editor toolbar

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add codimd permission menu

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Move permission picker to the right

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* add use memo

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add user-select-none to documenttime component

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* added status-bar

* fixed status-bar

* Add document info mock

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* changed published to share in i18n

* reordered document bar
moved share modal in it's own component

* changed the divider color in the toolbar

* Add details to document info

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add pin mock button

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Restructure toolbar after rebase and extract EmojiPicker+Button into component

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Correct linue number output

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add some space into status bar

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Cleanup code to make ESLint happy

* Fix Toc button position

* Added link to presentation mode button

* Cache codemirror props

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix code blocks not being completely visible

* Improve document info modal

- The document info timeline always wrapped the received moment.js-object into a new moment.js object instead of directly using the given one.
- The timestamps were configured to be displayed without suffix, but this is necessary to support valid translation grammar.
- There was no margin between the icons and the texts.

* Highlighted user name in document-info modal

* Add avatar icon to document-info modal

* Improved english translation of the share-info

* Improve performance of copyable-fields by using useCallback

* Add translation keys for pin-to-history button

* Forwarded note title to editor-menu for deletion modal info

* Add placeholders to translations

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* change translation

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Change permission dropdown to permission button

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix translations of emoji-picker and preferences

* remove unused imports

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add alt attribute

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix share button and i18n files

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix use of i18n keys

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Use modal-body

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* useCallback

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Use more specific i18n key

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add a new entry and move i18n key for usercontribution

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix i18nkey für shareLink

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* remove unused i18nkey

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Rename component DocumentInfo to DocumentInfoButton

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Extract revision button code into own component

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* wrap buttons in navbar-nav

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* organize imports

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* organize imports

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Added editor-preferences modal

* Added functionality to preferences modal

* Activated search and replace feature in CodeMirror

* pdf export unavailability notice (#403)

* added pdf export unavailability notice with link to FAQ
as many users ask all the time why this was removed and when they'll get it back, this seemed like a fine solution in the meantime.

Co-authored-by: Erik Michelson <github@erik.michelson.eu>

* Refactored editor-preferences to just use one generic select component

* Fixed warnings regarding duplicated controlId and missing useCb-deps

* Reorganized translation keys

* Fixed i18n indentation for POEditor.com

* Added translation key for 'avatar of ...'

* Remove fragment

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Use user-avatar in document-info-line.tsx

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Revert changes in user-avatar and solve the problem otherwise

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Removed unnecessary import

* Removed another unnecessary import

* Refactored EditorPreferenceSelect to use enum and automatic type conversions

* Remove unused CodeMirror reference

* Fix spacing problem

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Increate size of image

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* fixed share-link's space around the copyable-field

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Philip Molares <git@molar.es>
2020-08-15 17:27:46 +02:00
Philip Molares
d15ab657a6
Added toolbar e2e tests (#409)
* added toolbar e2e test
changed addTable function

* fixed toolbar unit test

* added emoji to toolbar e2e tests
added selection with link to toolbar e2e tests
2020-08-15 01:39:48 +02:00
Philip Molares
c15f0d9900
Add Emoji/FA Autocompletion (#387)
added emoji/fork-awesome autocompletion
added autocompletion e2e test

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-08-14 13:58:59 +02:00
Tilman Vatteroth
cf64110134 Use twitter emojis for markdown-it-emoji
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-09 10:16:24 +02:00
mrdrogdrog
1cf5a3d375
Insert short code instead of native emoji (#397) 2020-08-09 10:15:58 +02:00
Tilman Vatteroth
1ba4859489 Fix word break in renderer
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-09 10:14:39 +02:00
Tilman Vatteroth
749345ec57 Disable markdown it debug output in production
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-08 23:15:07 +02:00
Philip Molares
c410a58573
Add emoji picker (#329)
* Added emoji-mart as emoji-picker
* Fixed JSON to TypeScript-object parsing
* added fork awesome to emoji-picker
added ForkAwesomeIcons enum, because it's not possible to iterate over a typescript type consisting of strings [1]. This is a bit unfortunate since we now have two lists of all the fork awesome icons, but sadly it can not be done another way.
added fork awesome as a custom category to the emoji picker.

[1]: https://stackoverflow.com/questions/40863488/how-to-iterate-over-a-custom-literal-type-in-typescript
* made picker close, when clicking away
added react-use dependency for useClickAway hook
* Fixed emoji-picker loading images from unpkg instead of using font
* fixed addEmoji function
added tests
* Extract customIcons into useMemo

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-07 18:54:37 +02:00
Philip Molares
fc2e2bd592
Add codemirror keybindings and addons (#311)
* added codemirror addons
- fullScreen
- autorefresh
added a default:
- extraKeys

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: mrdrogdrog <mr.drogdrog@gmail.com>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-08-06 13:43:48 +02:00
Erik Michelson
dbce0181a4
Add register via username and refactor email-login to username-login (#313)
* Added config option to enable/disable the email signup

* Added register API call

* Added register button and error handling

* Show register button only if enabled in config

* Renamed login handler, added dir-attribute, removed obsolete css class

* Added separate registration page, changed email-login to internal-login

As an username is sufficient for registration, this commit changes the email-login into an username-based login. This login method is now called "internal" in the code.
This commit also introduces a new registration page instead of using the same form as for login.

* Added information texts below form fields

* Added error differentiation

* Added CHANGELOG entry

* Replace "magic string" with Enum representation

* Removed password-field to DOM rewrite

With the value attribute set, the password would be written to the DOM while typing. That's bad practise as attackers could read that password (e.g. with dirty CSS-hacks).

* Fixed backendConfig to config renaming

* Fixed links on register page being external links

* Refactored error handling to use string-enum that corresponds with i18n keys

* Fix chrome warnings regarding autocomplete and duplicated id

* Refactor login action buttons to use callbacks and handle promises directly

* Remove unnecessary async function

* Added promise chaining
2020-08-04 23:13:12 +02:00
Jakob Klepp
fe2f7403aa
Add plantuml support (#327)
* Add plantuml support
* Enable PlantUML rendering only if plantumlServer config is set
* Show warning box when plantuml is enabled but no server is configured
2020-08-04 11:15:23 +02:00
Erik Michelson
c21503848f
Fix me-API-request to use fetch-config and API-path (#381)
* Move mocked me-API-response into API dir

* Update me-API request to use API path and fetch-config
2020-08-03 23:40:04 +02:00
mrdrogdrog
57baf2fab5
Add key to image replacer (#379)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-03 20:06:57 +02:00
mrdrogdrog
512bca02e7
Improve css in preparation for the sync scroll (#380)
* Improve css in preparation for the sync scroll

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Remove scroll behaviour

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-08-03 20:06:32 +02:00
Tilman Vatteroth
4356d39ea7 Move editor test content into separate file
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-07-30 22:08:54 +02:00
Philip Molares
d0fc96b929
rework how the frontend is started (#361)
renamed frontend-config to api-url
renamed backend-config to config
removed api call to set frontend-config as the frontend either know where the backend is as it is delivered by it or get's this information via the enviroment variable REACT_APP_BACKEND
always start the client on Port 3001 as the backend will run on 3000 during development. changed the port on multiple occasions to accommodate for this
added package.json script 'start:dev'
changed README to better explain how to run backend and frontend side-by-side
2020-07-29 22:58:01 +02:00
Tilman Vatteroth
287d2e2729 Use twemoji in editor
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-07-29 22:55:13 +02:00
Erik Michelson
9c19bb1d9d
Add support for image-proxies by (optional) piping of image urls through the backend (#315)
* Added config property for image proxies

* Added API call and image url replacing

* Added comment explaining why a local function is needed inside the useEffect

* Added CHANGELOG entry

* Changed wording of the CHANGELOG sentence

* Changed CHANGELOG entry

Co-Authored-By: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Removed fallback to original src

* Removed unnecessary API call for empty src URLs

* Simplify image url fetching

* Refactored imageframe to avoid rerendering of images

Co-Authored-By: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Renamed config property to useImageProxy

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-07-29 22:28:32 +02:00
Tilman Vatteroth
742c6c1efb Add key prop to asciinema
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-07-21 21:16:55 +02:00
Philip Molares
29709d2ba4
Add YAML-metadata for notes and change the document title accordingly (#310)
* Added yaml-frontmatter extracting and error handling
* add tests
* changed document-title, so the editor can change the title to the title of the yaml metadata. closes #303
* extracted first line parsing in a core rule of markdown-it
document title will now be determined like this:
1. yaml metadata title
2. opengraph title
3. first level one heading
4. 'Untitled'
* added documentTitle e2e test

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Philip Molares <philip@mauricedoepke.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: mrdrogdrog <mr.drogdrog@gmail.com>
2020-07-18 22:17:36 +02:00
Erik Michelson
8216958f91
Add Asciinema integration (#326)
* Added Asciinema integration

* Added CHANGELOG entry
2020-07-16 22:14:47 +02:00
Philip Molares
1b52bac838
readd toolbar (#302)
* added all functionality to the toolbar buttons
* added unit tests for the toolbar functions
* added unit tests to CI
* Added translated titles to buttons of toolbar

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: mrdrogdrog <mr.drogdrog@gmail.com>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-07-16 11:34:56 +02:00
Philip Molares
f0fe7f5ac2
added e2e tests (#298)
- added e2e tests for
  - banner
  - history
  - intro
  - language
  - link
- added e2e workflow
- added cypress badge to README
2020-07-16 11:22:53 +02:00
renovate[bot]
1a5d4f6db8
Update dependency react-bootstrap to v1.2.1 (#320)
* Update dependency react-bootstrap to v1.2.1

* Fixed sort-button event name

With the upgrade to Bootstrap-React 1.2.1 the ButtonProps extend now React.HTMLAttributes which in favor extends the DOMAttributes interface. This interface defines almost every possible attribute for DOM-/HTML-elements.

Our SortButtonProps interface introduced an onChange event handler with a type matching our condition. With the BS-React upgrade the onChange event must not be redefined/overriden with this type and therefore I renamed it.

* updated react-bootstrap to 1.2.2

* fixed wrong prop name in HistoryToolbar

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Philip Molares <philip.molares@udo.edu>
2020-07-15 23:34:34 +02:00
Tilman Vatteroth
bee715b8f9 Remove log message and fix null check
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-07-02 23:17:16 +02:00
Erik Michelson
e1e8a76fda
Add note deletion and removal from history modals (#299)
* Fix history element's entry menu deletion button

The note deletion button inside the EntryMenu of a history element has one button to remove the note from the user's history and one to delete the note from the system. Both buttons pointed to the history-removal.

* Added modals for note deletion and note from history removal

* Removed redundant code

* Added CHANGELOG entry

* Added note title in deletion/removal prompts

* Refactored DeleteNoteItem and RemoveNoteEntryItem into one common component

* Refactored DeleteRemoveNoteItem-component and added two composition components

* Redesigned modal dialog to make the note title more clearly readable

* Renamed the generic dropdown-with-deletion-modal-component
2020-07-01 23:28:49 +02:00
Philip Molares
b23a73ac51
added branding option (#301)
added branding option via '@ <logo>' or '@ <name>' after the CodiMD logo and text.

This was a user can personalize their CodiMD instance

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-07-01 23:20:00 +02:00
mrdrogdrog
50b04c8403
Add toc sidebar+dropdown (#272)
* Replace markdown-it-table-of-contents with markdown-it-toc-done-right

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Philip Molares <philip.molares@udo.edu>

Extract render window code

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Philip Molares <philip.molares@udo.edu>

add new package

fix stickyness

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

show toc sidebar only if there is enough space

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* add min height class

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Move markdown toc into own component

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* add sidebar buttons

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Use other button color

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Change name of component

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix merge issues and make toc work again

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* pin dependencies

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* remove blank line

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* pin dependency

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Fix anchors

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add use memo

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add change log entry for removal of custom slugify
2020-06-29 17:51:40 +02:00
Erik Michelson
8ab7776a82
Replace links to /features with /n/features (#297)
* Replaced links to /features with /n/features

It was discussed and agreed on that all notes should reside under the /n/ namespace in the future. Even if we want to redirect all pre-2.0-notes from the root namespace to the /n/ namespace, it might be better to set the internal links for the features page properly instead on relying on the redirect.

* Improved note placeholder text
2020-06-28 21:25:22 +02:00
Erik Michelson
d13adcc9c3
Refactoring of modals (#294)
* Refactored modals (added CommonModal and DeletionModal besides ErrorModal)

This change allows more code reusage by defining a common modal that has a translated title with an optional icon.

* Replace the eslint-hack with a proper TypeScript conform solution

Instead of asserting non-null and disabling eslint, the 'as ...'-syntax is used to convince the compiler that everything is fine.

* Improved property names and ShowIf-construct

* Fixed missing renamings
2020-06-28 00:00:05 +02:00
Philip Molares
fe55ef7e13 changed comment in markdown-renderer.scss file to explain why the usage of * is necessary
see https://github.com/codimd/react-client/pull/271#pullrequestreview-437942115
2020-06-27 11:23:22 +02:00
Erik Michelson
17cc691403
Fixed bug that two p-tags were encapsulated inside each other (#278)
* Fixed bug that two p-tags were encapsulated inside each other

This bug was introduced because the wider-possible-replacer replaced each element that was subject to be enlarged with a brand new p-surrounding. That surrounding got the key of the old (now inner) element and therefore casts an duplicate key exception.
This fix solves that problem by setting the 'wider-possible' class attribute directly on the selected tag instead of creating a surrounding.

* Removed unnecessary console log

* Optimized attribute assignment to not fail on elements without attribs

* Added comment describing the node.attribs assignment
2020-06-26 00:07:15 +02:00
Philip Molares
937a2e9eb9
View mode wider (#271)
made some components wider in View Mode
These objects include
- `<img>` alone in a paragraph
- `<codimd-youtube>`
- `<codimd-vimeo>`
- `<codimd-pdf>`

This can be toggled via the `wider` prop in `MarkdownRenderer`

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-25 22:38:10 +02:00
Erik Michelson
0df90c1a2a
Added click-to-load text for pdf embeddings and general option for texts on the embedding preview (#277)
* Added possibility to add a text below the icon on the preview

* Changes naming of i18nKey argument

* Rebase fixes

* Show preview image only if defined
2020-06-25 22:29:09 +02:00
Philip Molares
1db1bcf248
added image-replacer (#273)
added image-replacer

this component replaces all `<img>`'s in the markdown-it output with an ImageFrame component. This enables us to implement image proxies and other per image customization in the future.

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-25 22:25:22 +02:00
mrdrogdrog
0a48fd0aa5
Change pdf embedding size when clicked (#275)
* Add activation callback to one-click-embedding
* use activation callback to change size of pdf

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-25 21:49:15 +02:00
Tilman Vatteroth
66602d98f4 Move fonts into subdirs
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-25 21:16:58 +02:00
Tilman Vatteroth
729144eca3 Add spaces to highlighted code regex
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-25 21:16:36 +02:00
mrdrogdrog
312c86e702
Add "start with line number" and "continue line number" syntax to highlighted code blocks (#267)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-24 23:53:26 +02:00
mrdrogdrog
cdadc7b41a
Add a wrapper for linkify (#268)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-24 23:52:45 +02:00
mrdrogdrog
b74bb8e71d
Restructure replacers (#266)
* Restructure replacers

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-23 23:04:51 +02:00
mrdrogdrog
eb56da7871
Restructure highlight code to enable line wrapping (#265)
* Restructure highlight code to enable line wrapping

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-23 22:09:56 +02:00
Erik Michelson
6bf214542e
Added image resizing support via markdown-it-imsize (#262) 2020-06-23 21:44:16 +02:00
Erik Michelson
6a808e76d9
Fixed TOC only showing up to 2 levels instead of 3 (#260) 2020-06-23 21:43:52 +02:00
mrdrogdrog
a03e341f22
Add unique key to highlight codeblock line numbers (#254)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-23 00:46:22 +02:00
Philip Molares
8133d565cf
added mathjax (#250)
added markdown-it-mathjax

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Philip Molares <philip@mauricedoepke.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-23 00:38:06 +02:00
Erik Michelson
9e6edb0aeb
Add blockquote extras ([name=...], [time=...], [color=...]) (#249)
* Added regexes to replace name and time extras

* Added [color=#abc] replacements inside of blockquotes

This works with the following "algorithm":
1. Transform any [color=]-Tags with a valid css color into a codimd-quote-options element.
2. While transforming blockquotes, check if one of their paragraphs contains a codimd-quote-options element. If multiple are found, only the first one will be used.
3. Remove the codimd-quote-options element and set the border-left-color of the blockquote appropriately.

* Added correct CSS styling of blockquote extras

* Added tag icon when [color=...] is used outside a blockquote

In version 1.6 of CodiMD the [color=...] tag renders a tag-icon in the specified color when used outside of a blockquote paragraph.

* Added changelog entry

* Flip if-else in quote-options for better readability

* Flip another if-else in quote-options for better readability
2020-06-22 23:37:20 +02:00
mrdrogdrog
e03da3bd76
Feature/highlightjs (#242)
* Add highlighting for code blocks

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-22 22:39:14 +02:00
mrdrogdrog
b3899cd1a5
Extract language codes into object (#246)
* Extract language codes into object
* Restructure language search so it would find more specific language codes first.

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-21 14:09:53 +02:00
Erik Michelson
fd378cf89b
Added TOC and anchors for headings (#243)
* Added TOC support and anchors for headings

* Moved @types/markdown-it-anchor from devDependencies to dependencies

* Add subnode renderer

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Added node-replacer for toc generation

ul lists may not be nested inside a p element. Therefore replaces this replacer every p that has a div.table-of-contents inside of it with the div directly.

* Add index to replacer function

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Add TOC to example code

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Remove unused import

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

* Removed unnecessary div wrapper of toc

* Fixed toc-renderer

Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-21 14:04:37 +02:00
Tilman Vatteroth
cb2ea5fa6e Add subnode renderer
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-21 12:04:38 +02:00
mrdrogdrog
7e9a828d44
Refactor video-util.ts and rename markdown-preview (#233)
* Refactor video-util.ts
* Rename markdown-preview to markdown-renderer and refactor some methods

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-20 21:05:24 +02:00