Age | Commit message (Collapse) | Author |
|
Signed-off-by: Luka Trovic <luka@nextcloud.com>
|
|
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Signed-off-by: Jonas <jonas@freesources.org>
|
|
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
|
|
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
|
|
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
|
|
It was added to ensure the trailing paragraph extension of tiptap
does not trigger an autosave without other changes.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Removed the erroneous replacement of escaped brackets with
plain brackets as this breaks valid markdown.
Added a test case for this.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Added a markdown-it and tiptap extension to tag special, unknown,
markdown syntax which would be escaped by prosemirror-markdown on save.
The tagged part is not touched while saving if they are not modified manually.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Switch to @hedgedoc/markdown-it-task-lists to fix
parsing of task lists, namely allowing any whitespace
inside the brackets, as by the github markdown specs.
Doing this as markdown-it-task-lists seems orphaned,
while hedgedoc is maintained and the bug is fixed there.
This required adjusting the task-list testcase as the output is slightly different.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Adjusted test cases to test whitespace characters are
not touched.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
`vite dev` will load all imports in imported files.
So for now it is better to not bundle multiple files in indexes.
Signed-off-by: Max <max@nextcloud.com>
|
|
Public Preview only has one route - it does not make use of the fileId.
Signed-off-by: Max <max@nextcloud.com>
|
|
If no session is established we cannot use the text endpoint.
Use the dav endpoints instead.
The ImageResolver now needs the fileId of the text file
to compute the relative path to the image inside the attachments folder.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Prepare for injecting the image resolver.
Make it easy to test the logic of which url to query for an image.
Signed-off-by: Max <max@nextcloud.com>
|
|
transformation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
|
|
Also test for it being shown and triggering the deleteNode
when editing.
Signed-off-by: Max <max@nextcloud.com>
|
|
Prosemirror expects colspan, rowspan and the like to calculate the table layout.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Also make sure that table rows are rendered on one line each.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Each node is responsible for rendering its markdown content.
This splits the responsibility and simplifies the `toMarkdown` functions a lot.
At the same time it makes it harder to beautify the entire table
because every cell only knows about itself - not about the rest of the column.
To work around this we can introduce padding attributes for TableCell and TableHeader.
These need to be updated when the content of the table changes.
They will also allow us to preserve the original padding from a markdown file.
Signed-off-by: Max <max@nextcloud.com>
|
|
First take at parsing and serializing markdown tables.
Use TableHead and TableBody nodes to mimic the markdown table structure
with a single heading line on top and multiple td lines following.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
define info, warn, error and success containers
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
See #2018.
Use tiptap TaskList and TaskItem.
Markdown-it happily mixes tasks and bullet points in the same list.
Tiptap lists are strictly separated.
Split bullet and tasks into BulletList and TaskList in markdown-io.
Just like this will turn into three different lists:
* one
- two
+ three
This will now also turn into three different lists
with the middle one being a task list:
* first list
* [ ] todo
* [x] done
* third list
Signed-off-by: Max <max@nextcloud.com>
|
|
https://github.com/DerpgonCz/text into DerpgonCz-fix/master/image_data_urls
|
|
Importing `core-js/stable` as recommended by
https://babeljs.io/docs/en/babel-polyfill
It is also not listed in our package.json.
So far it was provided as a dependency of `emoji-mart-vue-fast`
via `@nextcloud/vue`.
Signed-off-by: Max <max@nextcloud.com>
|
|
Also drop @tiptap/starter-kit as we are not using it anymore.
Signed-off-by: Max <max@nextcloud.com>
|
|
Migrate the entire editor to tiptap v2.
Some changes were introduces that go beyond just using the new tiptap API:
*Collaboration*
Port tiptap1 collaboration.
We still want to use our session and sync mechanism.
*Serialization*
Add Markdown extension to handle serialization.
Tiptap config extensions are not automatically added
to the prosemirror schema anymore.
The extension adds the `toMarkdown` config value to the prosemirror schema.
With the new naming scheme tiptap nodes for a number of elements
do not match the prosemirror names.
Camelcase the marks and nodes from `defaultMarkdownSerializer`
so they match the tiptap names.
*Menubar*
* Specify args for isActive function directly rather than setting a function.
* Make use of the editor instance inside the MenuBar component.
* Use the editor rather than slots for command, focused etc.
* disable icons based on editor.can
* Show menubar as long as submenus are open.
When opening a submenu of the menubar
keep track of the open menu even for the image and the remaining action menu.
Also refocus the editor whenever a submenu is closed.
*MenuBubble*
Let tippy handle the positioning
Tippy is really good at positioning the menu bubble.
Remove all our workarounds and let it do its thing.
In order for this to work the content of the MenuBubble
actually needs to live inside the tippy-content.
Tippy bases its calculations on the width of tippy-content.
So if we have the content hanging in a separate div
with absolute positioning
tippy-content will be 0x0 px and not represent the actual width
of the menu bubble.
*Upgrade image node and ImageView.*
Quite a bit of the syntax changed.
We now need a wrapping `<node-view-wrapper>` element.
Pretty good docs at https://tiptap.dev/guide/node-views/vue#render-a-vue-component
We also need to handle the async action.
It will run the action on it's own.
So in `clickIcon()` we need to test if the action returned anything.
Tiptap v1 had inline images.
v2 keeps them outside of paragraphs by default.
Configure Image node to use inline images as markdownit creates inline images right now.
*Trailing Node*
Tiptap v2 does not ship the trailing node extension anymore.
Included the one from the demos and turned it from typescript into javascript.
*Tests*
In order to isolate some problems tests were added.
The tests in Undeline.spec.js were green right from the beginning.
They are not related to the fix and only helped isolate the problem.
Also introduced a cypress test for Lists
that tests the editor
without rendering the page and logging in.
It is very fast and fairly easy to write.
*Refactorings*
* Split marks into separate files.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Michal Junek <michal@junek.pw>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
|
|
Preserve urls that start with `core/preview` no matter if `hasPreview` is in there or not.
Also do not add a duplicate `/` in dav urls.
`this.filePath` already starts with a `/`.
Add a test for dav paths and fix some others that were broken by #1800.
Signed-off-by: Azul <azul@riseup.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
We moved away from querying `getCurrentDirectory` and instead
send it to the node as a prop.
Do that in the tests to make sure `ImageViews` have `options.currentDirectory` set.
Signed-off-by: Azul <azul@riseup.net>
|
|
Looks like the [accessor to state] was removed from the Viewer api
and replaced with [separate getters].
So we need to replace `OCA.Viewer.state.file` with `OCA.Viewer.file`.
Fixes #1676
[accessor to state]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1L52-L63)
[separate getters]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1R79-R81)
Signed-off-by: Azul <azul@riseup.net>
|