There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-44a2e962-02eb-4943-98cd-8e9547ccbaa1 XWIKI-23927 Open

Add the possibility to add link types by extension in Blocknote

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-403ec18f-54f6-49e3-b80d-f79da5bde795 Marius Dumitru Florea on 05/Nov/26 16:37
 

Implemented in PR 6125 (commit 3094d74). Summary of the changes:

  • New @xwiki/platform-link-type-api package: the editor-independent contract of a link target type (LinkTargetType, registered under the linkTargetTypeRole role), the LinkData / LinkTarget types and the LinkTargetTypeManager, which lists the registered link target types and converts link targets from and to link URLs and resource references.
  • New @xwiki/platform-link-type-default package: the built-in link target types (page, attachment, email, path, UNC path, URL), independent of Vue. Path and UNC path links now keep the type of their reference when edited.
  • New @xwiki/platform-link-type-ui package: the Vue forms of the built-in link target types, registered under the linkTargetTypeFormRole role.
  • The link modal builds its link type selector from the registered link target types and renders the form registered for the selected type. A link target type registered without a form is edited with a plain text field.
  • Links to a resource that no link target type supports (e.g. an interwiki link) are edited as is, with a plain text field for their reference, instead of being converted to page or URL links.
  • Integrations can exclude link target types from new links (excludedLinkTargetTypes); XWiki BlockNote excludes path and UNC path.
  • The select component of the design system API accepts items with a value distinct from their label (SelectItem).

An extension can now add a new kind of link by binding a LinkTargetType (and optionally a LinkTargetTypeForm) in the dependency injection container. The @beta link conversion functions and link types previously exported by @xwiki/platform-link-modal-ui were removed in favor of the new packages.