Skip to content

Use the link picker #8714

@julien-nc

Description

@julien-nc

In case you want to use the link picker, here is how:

RenderReferenceEvent must be dispatched when loading the page. No problem here, it is already done there (to tell the apps to load their reference scripts). The reference provider list is now provided via initial state for the picker when RenderReferenceEvent is dispatched.

Then, the link picker itself. 3 ways to use it:

  • It will be included in RichContentEditable one day
  • The helper function
    This creates a Vue instance which mounts a ReferencePickerModal somewhere. The function returns a Promise which resolves with the link text and rejects if it is closed.
  • Directly with the ReferencePickerModal component (exposed by vue-richtext as well). It emits "submit" (with the link as data) and "cancel" events. You can optionally pass the initial selected provider ID in a prop.

I don't know if it makes more sense to

  1. Immediately post the generated link in the conversation
  2. or insert it in the message composition input

The second one, probably.

vokoscreenNG-2023-02-07_13-27-52.mp4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    ☑️ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions