* 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>
* 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>
* 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
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>
* 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
* 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
As seen in multiple PRs that renovate raised today, the @testing-library/ packages are not bundled in the 'packages:jsTest' pre-defined group. As they aren't relevant to be separated, this commit changes the config of renovate to treat them as one big PR in the future.
* 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
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>
* 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
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>
* 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>
* 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