Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-09Add paste event handler to allow pasting markdownJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-11-09Don't apply author annotations when in compositionJonas
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>
2022-10-31Fix code blocks loosing the language hint on serializationFerdinand Thiessen
`prosemirror-markdown` uses `params` attribute for the language hint whereas `tiptap` uses the `language` attribute. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-10-27🐛 fix relative link in RichWorkspaceVinicius Reis
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-10-18Fix copy and paste of user mentionsJonas
Fixes: #3110 Signed-off-by: Jonas <jonas@freesources.org>
2022-10-12Use vue-richtext for rendering paragraph widgetJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net> Address review feedback Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-10-05feat: add tests for mentionsLuka Trovic
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-10-05Feature: Show word count in RichTextFerdinand Thiessen
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>
2022-09-30🩹 fix emoji suggestion regressionVinicius Reis
Ref.: https://github.com/ueberdosis/tiptap/pull/3239 Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-09-27♻️ use single entry from @nextcloud/vueVinicius Reis
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-09-20Load Mention extension in RichText.jsJonas
Signed-off-by: Jonas <jonas@freesources.org>
2022-09-19Use import instead of require to fix compilation with viteJonas
Signed-off-by: Jonas <jonas@freesources.org>
2022-09-13fix: add primary attribute for current userLuka Trovic
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-08-25fix: feedbackLuka Trovic
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-25Fix parsing of HTML for the mentionJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-25feat: display correct username and use ISearch to search usersLuka Trovic
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-08-25Cleanup old html renderingJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-25Use vue component for the renderingJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-25Fix lintingJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-25fix: solve markdown-it-mentions issuesLuka Trovic
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-08-25feat: enhance user mention uiLuka Trovic
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-08-25feat: add user mentions featureLuka Trovic
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-08-19Fix eslint errorsJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-17♻️ (#107): split heading logic: extractHeadingsVinicius Reis
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-07-29Add support for editing (not creating) FrontMatterFerdinand Thiessen
This adds support for parsing files containing FrontMatter and editing it as like a code block. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-07-26Only autolink URLs containing protocolRaul
Signed-off-by: Raul <raul@nextcloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-07-19Do not remove escaping from brackets, fixes #2703Ferdinand Thiessen
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>
2022-07-19Added markdown parsing rules to tag special syntax to be not modified when savedFerdinand Thiessen
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>
2022-07-15Ensure whitespaces in markdown files are preservedFerdinand Thiessen
Adjusted test cases to test whitespace characters are not touched. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-06-20fix: configure lowlight for code-block-lowlightMax
The dependency needs to be provided as an option since https://github.com/ueberdosis/tiptap/commit/39f5e4c31ee6f53b4d4ae11faf8bf86f97e874ad Signed-off-by: Max <max@nextcloud.com>
2022-06-10Bring back inline code supportJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-06-07fix: remove nodes/index.js - import directlyMax
`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>
2022-06-07fix: bring back table modification buttonsMax
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>
2022-06-07fix: bring back Tables in RichtextReaderMax
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>
2022-06-07cleanup: drop richTextOptions and currentDirectoryMax
We now provide $imageResolver to lookup images. Signed-off-by: Max <max@nextcloud.com>
2022-06-07feature: emit clickLink from `ReadOnlyEditor`Max
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>
2022-06-07WIP: first take on building package with viteMax
Signed-off-by: Max <max@nextcloud.com>
2022-06-07refactor: use Editor.new directly in ReadOnlyEditorMax
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>
2022-06-07refactor: RichText extension groups all text formattingMax
Signed-off-by: Max <max@nextcloud.com>
2022-06-07Implement toMarkdown for hard break instead of replacing after markdown ↵Julius Härtl
transformation Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-06-07Use two spaces instead of backslash to indicate hard break in markdownJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-05-03fix: specify file extensions in import statementsMax
As recommended in @nextcloud/eslint-config@8.0.0 https://github.com/nextcloud/eslint-config/pull/292 Signed-off-by: Max <max@nextcloud.com>
2022-03-02fix: do not try to send steps to a read only docMax
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>
2022-03-01lint: fix errors from @nextcloud/eslint-config@7Max
* 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>
2022-03-01Append a whitespace to inserted emojisJonas
Signed-off-by: Jonas <jonas@freesources.org> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-03-01Add emoji autocompletion (#987)Jonas
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>
2022-02-09upgrade: tiptap v2Azul
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>
2021-12-04Fix javascript linting warningsJonas Meurer
Signed-off-by: Jonas Meurer <jonas@freesources.org>
2021-08-25Apply lint fixesJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-07-15Add emoji picker to menubar (Fixes: #987)Jonas Meurer
Signed-off-by: Jonas Meurer <jonas@freesources.org>