Commit graph

237 commits

Author SHA1 Message Date
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
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
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
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
mrdrogdrog
5f4cc63eb4
Deduplicate code (#217)
* Deduplicate code

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-06-20 20:32:44 +02:00
Philip Molares
ab2a73c6a8 added support for markdown-it-footnote
this makes it possible to use footnotes
2020-06-20 20:26:27 +02:00