@ -12,7 +12,7 @@ import { useEffect, useState } from 'react'
|
||||
import { sendRequest } from 'utils'
|
||||
import { PackageIcon } from './icons'
|
||||
|
||||
const intervalDuration = 1000 * 60 // 30 seconds
|
||||
const intervalDuration = 1000 * 60
|
||||
|
||||
export const NewVersionPopup = () => {
|
||||
const { typebot, save } = useTypebot()
|
||||
|
@ -68,6 +68,7 @@ export const ChatChunk = (props: Props) => {
|
||||
{(message) => (
|
||||
<HostBubble
|
||||
message={message}
|
||||
typingEmulation={props.settings.typingEmulation}
|
||||
onTransitionEnd={displayNextMessage}
|
||||
/>
|
||||
)}
|
||||
|
@ -9,6 +9,7 @@ import type {
|
||||
EmbedBubbleContent,
|
||||
ImageBubbleContent,
|
||||
TextBubbleContent,
|
||||
TypingEmulation,
|
||||
VideoBubbleContent,
|
||||
} from 'models'
|
||||
import { BubbleBlockType } from 'models/features/blocks/bubbles/enums'
|
||||
@ -16,6 +17,7 @@ import { Match, Switch } from 'solid-js'
|
||||
|
||||
type Props = {
|
||||
message: ChatMessage
|
||||
typingEmulation: TypingEmulation
|
||||
onTransitionEnd: () => void
|
||||
}
|
||||
|
||||
@ -29,6 +31,7 @@ export const HostBubble = (props: Props) => {
|
||||
<Match when={props.message.type === BubbleBlockType.TEXT}>
|
||||
<TextBubble
|
||||
content={props.message.content as Omit<TextBubbleContent, 'richText'>}
|
||||
typingEmulation={props.typingEmulation}
|
||||
onTransitionEnd={onTransitionEnd}
|
||||
/>
|
||||
</Match>
|
||||
|
@ -5,8 +5,8 @@ import { computeTypingDuration } from '../utils/computeTypingDuration'
|
||||
|
||||
type Props = {
|
||||
content: Pick<TextBubbleContent, 'html' | 'plainText'>
|
||||
typingEmulation: TypingEmulation
|
||||
onTransitionEnd: () => void
|
||||
typingEmulation?: TypingEmulation
|
||||
}
|
||||
|
||||
export const showAnimationDuration = 400
|
||||
@ -29,7 +29,10 @@ export const TextBubble = (props: Props) => {
|
||||
|
||||
onMount(() => {
|
||||
if (!isTyping) return
|
||||
const typingDuration = computeTypingDuration(
|
||||
const typingDuration =
|
||||
props.typingEmulation?.enabled === false
|
||||
? 0
|
||||
: computeTypingDuration(
|
||||
props.content.plainText,
|
||||
props.typingEmulation ?? defaultTypingEmulation
|
||||
)
|
||||
|
Reference in New Issue
Block a user