Closed FahimNsr closed 11 months ago
@FahimNsr Without further description it's a little hard to imagine what the idea behind this feature was?
I think its for entering links that are not convered by the other tabs.
For example
isSuitableFor: (link: ILink) => !link.href.startsWith('asset://') && !link.href.startsWith('mailto:')
&& !link.href.startsWith('node://') && !link.href.startsWith('tel:')
&& !link.href.startsWith('http://') && !link.href.startsWith('https://'),
we only handle links with protocols we dont know.
But there is a catch. If we enter a link still starting with a known protocol, but continue to write something the default implementation doesnt cover, like adding an anchor to asset uris: asset://456877568#anchor
. When opening the editor the next time this link will be opened in the asset editor again, which leads to loss of the anchor.
... this is just an edgecase we need to be aware of.
For cases like relative urls, fragments and unknown protocols it would work:
somepage/foo.html
#foo
myprotocol://foo.de
but we should rather focus on your real usecase ;) I dont think an editor knows about every detail of the uri specification and knows what to put in there.
I understand the feature and think that it is a valid usecase a description in the pr would be nice to really get the use-case. The drawback @mhsdesign mentioned is valid but i think we can live with that. In the end this is for the cases we did not plan for so using it to edit protocols that have a dedicated dialog is your own fault.
It might make sense to have this as opt-in feature that has to be enabled.
@mficzel IMO it would have been ideal to disable this editor by default. This was released in a minor version and so everyone updating will have an additional link editor they might not need. Not a problem in my WIP project but just as a feedback regarding versioning. Thanks!
@lorenzulrich i agree especially cause its such an edgecase feature and some editors might use it as footgun.
I thought we agreed on this? ^^
It might make sense to have this as opt-in feature that has to be enabled.
im a bit unhappy that this was merged so eagerly by @andrehoffmann30 ... but nothing a followup fix cant solve ;)
So @andrehoffmann30 and martin rediscussed this again, and sorry for my hard words previously but we agreed to keep this feature
Custom Link
The
CustomLink
link type allows the editor to add a link in any format. With this you give the editor an escape hatch if the other link types are insufficient for the desired use case. As any other link type theCustomLink
can be deactivated via the configuration. If you want to deactivate theCustomLink
link type globally you can use a preset and a mixin, which is than used as a supertype in all link generating node types:Define the preset:
Use the preset in your link property, mixin or node type