Age | Commit message (Collapse) | Author |
|
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
transformation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
|
|
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>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
This is more relyable then parsing the window location query for dir:
* ?dir does not change when navigating between files right now
* ?dir is not present when the viewer is used from within other apps.
We used to fallback to the viewer state which solved the latter.
However it is easier and less error prone
to just rely on viewer state in the first place.
Signed-off-by: Azul <azul@riseup.net>
|
|
This way they also work if the viewer was opened from other apps
than the file app.
Also move the `relPath` param into the fragment.
It is only used to remember the relative path
for generating the short markdown form from the link.
Signed-off-by: Azul <azul@riseup.net>
|
|
Signed-off-by: Azul <azul@riseup.net>
|
|
The markdown we create for links to local files looks like this:
```
[Check this out!](subdir/file.md?fileid=123)
```
Turn this into a link like this
```
<a href="?dir=/current&openfile=123&relPath=subdir/file.md">
Check this out!
</a>
```
The `relPath` part of the url is needed
to convert it back to the original markdown.
Includes a test.
Next steps:
* open links to local files in same tab.
* change dir param according to relative Path.
Signed-off-by: Azul <azul@riseup.net>
|
|
The short relative links used in markdown
need to be converted to working urls in the href attributes.
In order to properly serialize the content
the full urls in html need to be converted to relative links as well.
This commit splits out the href handling into a new helper.
This way it can be easily tested.
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>
|
|
includes a unit test for turning the src in markdown
into a src for html that can be resolved by nextcloud
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>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|