🐛 (textBubble) Fix link parsing in text editor
This commit is contained in:
@@ -3,6 +3,7 @@ import { useTypebot } from '@/features/editor'
|
|||||||
import { TextBubbleBlock } from 'models'
|
import { TextBubbleBlock } from 'models'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { parseVariableHighlight } from '@/utils/helpers'
|
import { parseVariableHighlight } from '@/utils/helpers'
|
||||||
|
import { isEmpty } from 'utils'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
block: TextBubbleBlock
|
block: TextBubbleBlock
|
||||||
@@ -17,9 +18,9 @@ export const TextBubbleContent = ({ block }: Props) => {
|
|||||||
flexDir={'column'}
|
flexDir={'column'}
|
||||||
opacity={block.content.html === '' ? '0.5' : '1'}
|
opacity={block.content.html === '' ? '0.5' : '1'}
|
||||||
className="slate-html-container"
|
className="slate-html-container"
|
||||||
|
color={isEmpty(block.content.plainText) ? 'gray.500' : 'inherit'}
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html:
|
__html: isEmpty(block.content.plainText)
|
||||||
block.content.html === ''
|
|
||||||
? `<p>Click to edit...</p>`
|
? `<p>Click to edit...</p>`
|
||||||
: parseVariableHighlight(block.content.html, typebot),
|
: parseVariableHighlight(block.content.html, typebot),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -23,10 +23,11 @@ export const platePlugins = createPlugins(
|
|||||||
renderAfterEditable: PlateFloatingLink,
|
renderAfterEditable: PlateFloatingLink,
|
||||||
options: {
|
options: {
|
||||||
isUrl: (url: string) =>
|
isUrl: (url: string) =>
|
||||||
url.startsWith('http') ||
|
url.startsWith('http:') ||
|
||||||
url.startsWith('mailto') ||
|
url.startsWith('https:') ||
|
||||||
url.startsWith('tel') ||
|
url.startsWith('mailto:') ||
|
||||||
url.startsWith('sms'),
|
url.startsWith('tel:') ||
|
||||||
|
url.startsWith('sms:'),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ services:
|
|||||||
- ENCRYPTION_SECRET=SgVkYp2s5v8y/B?E(H+MbQeThWmZq4t6
|
- ENCRYPTION_SECRET=SgVkYp2s5v8y/B?E(H+MbQeThWmZq4t6
|
||||||
- ADMIN_EMAIL=me@email.com
|
- ADMIN_EMAIL=me@email.com
|
||||||
- NEXTAUTH_URL_INTERNAL=http://host.docker.internal:8080
|
- NEXTAUTH_URL_INTERNAL=http://host.docker.internal:8080
|
||||||
|
- GITHUB_CLIENT_ID=37a279454d016598c2df
|
||||||
|
- GITHUB_CLIENT_SECRET=4b288a509352b591cd4478e3ac901668b2f8ed03
|
||||||
typebot-viewer:
|
typebot-viewer:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
Reference in New Issue
Block a user