Age | Commit message (Collapse) | Author |
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
When typing dead keys (like diacritics), the browser is in composition
mode[1] until the accompanioning character is typed. This breaks author
annotations.
We have to hold back the transaction when in composition and only apply
it afterwards, as suggested at [2]. So check for `view.composing` before
applying the transaction.
Fixes: #2871
[1] https://w3c.github.io/uievents/#events-compositionevents
[2] https://discuss.prosemirror.net/t/plugins-and-characters-with-a-diacritic/2674/3
Signed-off-by: Jonas <jonas@freesources.org>
|
|
`prosemirror-markdown` uses `params` attribute for the language hint
whereas `tiptap` uses the `language` attribute.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
Fixes: #3110
Signed-off-by: Jonas <jonas@freesources.org>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Address review feedback
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Luka Trovic <luka@nextcloud.com>
|
|
Show word count as last element of the overflow menu,
which now will be always shown. The word count
is updated when the menu is openend as the
tiptap word count is not reactive.
Modified ActionList: Added a named slot for adding
elements that should always shown as the last elements.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Ref.: https://github.com/ueberdosis/tiptap/pull/3239
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
Signed-off-by: Jonas <jonas@freesources.org>
|
|
Signed-off-by: Jonas <jonas@freesources.org>
|
|
Signed-off-by: Luka Trovic <luka@nextcloud.com>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Luka Trovic <luka@nextcloud.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: Luka Trovic <luka@nextcloud.com>
|
|
Signed-off-by: Luka Trovic <luka@nextcloud.com>
|
|
Signed-off-by: Luka Trovic <luka@nextcloud.com>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
|
|
This adds support for parsing files containing FrontMatter and editing
it as like a code block.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
Signed-off-by: Raul <raul@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
|
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>
|
|
Adjusted test cases to test whitespace characters are
not touched.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
|
The dependency needs to be provided as an option since
https://github.com/ueberdosis/tiptap/commit/39f5e4c31ee6f53b4d4ae11faf8bf86f97e874ad
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>
|
|
Add an `EditableTable` node that has all the buttons for changing the table.
Use it in the Editor while keeping the plain `Table` in RichtextReader.
Signed-off-by: Max <max@nextcloud.com>
|
|
Table node views include @nextcloud/vue elements
that currently do not play well with vite.
Destinguish between EditableTable (with the node views)
and Table (without the node views)
and use the latter for RichtextReader.
Signed-off-by: Max <max@nextcloud.com>
|
|
We now provide $imageResolver to lookup images.
Signed-off-by: Max <max@nextcloud.com>
|
|
The Prosemirror plugin with the `handleClick` handler
only customizes the prosemirror handling of the click event.
In read only mode we are not in a content-editable section.
So clicking a link will cause the browser to open the url with a page reload.
Allow overwriting this behavior by handling all link clicks via prosemirror.
Set `onClick` option on the `Link` mark to customize the behavior.
Emit a `click-link` event from `ReadOnlyEditor` with info about the event
and the attributes of the link mark.
Find the link that was clicked based on the clicked marks
rather than the element in the event.
This way we can get access to the attributes of the mark
without relying on the selection or even changing it.
Also add plugin key to link click handler
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
Introduce a `Plaintext` tiptap extension
that bundles all the extensions used for plain text editing.
This allows calling `Editor.new` directly with just a few extensions.
No need to rely on `createEditor` from the editor factory anymore.
Also prevent error messages about undefined callbacks
because no callbacks were handed to `createEditor` in `ReadOnlyEditor`.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Max <max@nextcloud.com>
|
|
transformation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
As recommended in @nextcloud/eslint-config@8.0.0
https://github.com/nextcloud/eslint-config/pull/292
Signed-off-by: Max <max@nextcloud.com>
|
|
Cypress tests were failing because they triggered editor.focus on a read only doc.
Focus seems to cause sendable steps - maybe because the current cursor changes.
Prevent this on various levels:
* Do not autofocus read only docs.
* Do not send steps to read only docs.
* Handle server response with 403 without content gracefully when sending steps.
The last originated here:
https://github.com/nextcloud/text/blob/master/lib/Service/ApiService.php#L158
So wither the session was not valid or the document read only.
Not entirely sure what best to do in this situation.
Logging to console.error for now.
Signed-off-by: Max <max@nextcloud.com>
|
|
* Autofix `vue/first-attribute-linebreak`.
* Explicitely import `Store` from `vuex`.
* Allow importing default with the same name as named for tiptap extensions.
This is the way used in tiptap documentation:
`import Document from '@tiptap/extension-document'`
Disable `import/no-named-as-default` - but only for the lines in question.
Signed-off-by: Max <max@nextcloud.com>
|
|
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
|
Adds emoji autocompletion by typing `:<search_string>`.
It utilizes the emoji functions from nextcloud-vue[1] and the TipTap
suggestions extension.
[1] https://github.com/nextcloud/nextcloud-vue/pull/1474
Signed-off-by: Jonas <jonas@freesources.org>
|
|
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: Jonas Meurer <jonas@freesources.org>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Jonas Meurer <jonas@freesources.org>
|