Add link picker in RichContentEditable with tribute#3708
Merged
Conversation
b9c35a9 to
b38b93c
Compare
b38b93c to
e106eb3
Compare
juliusknorr
approved these changes
Feb 14, 2023
Contributor
|
Uncommited l10n changes. Run |
Contributor
We have an awesome github command for this now (which should probably be mentioned in the L10n check). |
Contributor
|
/l10n-update |
Contributor
And which doesn't seem to work anymore, whereas it did just last week 🙈 Edit: Seems it was just a bit slow 🙂 |
Contributor
|
/rebase |
5513c16 to
950e0af
Compare
Contributor
|
@julien-nc Mind to rebase? |
Contributor
|
@ShGKme Maybe yiiz can also have a look since this would be relevant for Talk with nextcloud/spreed#4333 :) |
mejo-
approved these changes
Feb 21, 2023
Contributor
mejo-
left a comment
There was a problem hiding this comment.
Code looks good to me, didn't test though.
| }, | ||
|
|
||
| methods: { | ||
| getLink(item) { |
Contributor
There was a problem hiding this comment.
I find it a bit confusing to have this.getLink() and global getlink() in the component, but that's only nitpicking.
950e0af to
fbaa9fa
Compare
Contributor
|
/l10n-update |
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
31ef0ff to
0ba0a00
Compare
Contributor
Author
|
/l10n-update |
Signed-off-by: nextcloud-command <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This integrates the vue-richtext's link picker in RichContentEditable with TributeJS. The trigger is "/". The item list is obtained from a vue-richtext function call.
The workflow:
As picking a link is asynchronous, I used a trick to make it work with Tribute:
A dummy invisible element is inserted immediately when opening the link picker (when selecting a tribute dropdown item). Once the picker returns the link (with a promise), the dummy element is replaced by the link.
RenderReferenceEvent. This will be documented in Nextcloud's general link reference chapter. Maybe it's worth mentioning it in RCE's doc as well.We could make this a little bit more generic (passing data and callback as RCE props) but we figured (with @juliushaertl) the link picker was strongly depending on unified search and vue-richtext and cannot really be used with other data sources anyway. What do you think?
vokoscreenNG-2023-02-01_15-50-10.mp4