-
Notifications
You must be signed in to change notification settings - Fork 95
Add link picker in RichContentEditable with tribute #3708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add link picker in RichContentEditable with tribute #3708
Conversation
b9c35a9 to
b38b93c
Compare
b38b93c to
e106eb3
Compare
|
Uncommited l10n changes. Run |
We have an awesome github command for this now (which should probably be mentioned in the L10n check). |
|
/l10n-update |
And which doesn't seem to work anymore, whereas it did just last week 🙈 Edit: Seems it was just a bit slow 🙂 |
|
/rebase |
5513c16 to
950e0af
Compare
|
@julien-nc Mind to rebase? |
|
@ShGKme Maybe yiiz can also have a look since this would be relevant for Talk with nextcloud/spreed#4333 :) |
mejo-
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, didn't test though.
| }, | ||
| methods: { | ||
| getLink(item) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
/l10n-update |
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
31ef0ff to
0ba0a00
Compare
|
/l10n-update |
Signed-off-by: nextcloud-command <[email protected]>
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