Show active links in compose

This commit is contained in:
Jon Staab
2024-08-20 13:20:45 -07:00
parent d03ef264f7
commit fe8abb9efb
15 changed files with 394 additions and 13 deletions
+4 -3
View File
@@ -2,17 +2,18 @@
import cx from 'classnames'
import type {NodeViewProps} from '@tiptap/core'
import {NodeViewWrapper} from 'svelte-tiptap'
import {stripProtocol} from '@welshman/lib'
import {displayUrl} from '@welshman/lib'
import Icon from '@lib/components/Icon.svelte'
import Link from '@lib/components/Link.svelte'
export let node: NodeViewProps['node']
export let selected: NodeViewProps['selected']
</script>
<NodeViewWrapper class="inline">
<Link external href={node.attrs.url} class="link-content">
<Link external href={node.attrs.url} class={cx("link-content", {'link-content-selected': selected})}>
<Icon icon="link-round" size={3} class="inline-block translate-y-px" />
{stripProtocol(node.attrs.url)}
{displayUrl(node.attrs.url)}
</Link>
</NodeViewWrapper>