diff --git a/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleForm.tsx b/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleForm.tsx index 6698a11ba..cc8471862 100644 --- a/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleForm.tsx +++ b/apps/builder/src/features/blocks/bubbles/audio/components/AudioBubbleForm.tsx @@ -3,21 +3,25 @@ import { AudioBubbleContent } from '@typebot.io/schemas' import { TextInput } from '@/components/inputs' import { useState } from 'react' import { UploadButton } from '@/components/ImageUploadContent/UploadButton' +import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel' type Props = { fileUploadPath: string content: AudioBubbleContent - onSubmit: (content: AudioBubbleContent) => void + onContentChange: (content: AudioBubbleContent) => void } export const AudioBubbleForm = ({ fileUploadPath, content, - onSubmit, + onContentChange, }: Props) => { const [currentTab, setCurrentTab] = useState<'link' | 'upload'>('link') - const submit = (url: string) => onSubmit({ url }) + const updateUrl = (url: string) => onContentChange({ ...content, url }) + + const updateAutoPlay = (isAutoplayEnabled: boolean) => + onContentChange({ ...content, isAutoplayEnabled }) return ( @@ -37,31 +41,38 @@ export const AudioBubbleForm = ({ Embed link - - {currentTab === 'upload' && ( - - - Choose a file - - - )} - {currentTab === 'link' && ( - <> - - - Works with .MP3s and .WAVs - - - )} + + + {currentTab === 'upload' && ( + + + Choose a file + + + )} + {currentTab === 'link' && ( + <> + + + Works with .MP3s and .WAVs + + + )} + + ) diff --git a/apps/builder/src/features/graph/components/nodes/block/MediaBubblePopoverContent.tsx b/apps/builder/src/features/graph/components/nodes/block/MediaBubblePopoverContent.tsx index 6b7989511..594f9cd24 100644 --- a/apps/builder/src/features/graph/components/nodes/block/MediaBubblePopoverContent.tsx +++ b/apps/builder/src/features/graph/components/nodes/block/MediaBubblePopoverContent.tsx @@ -77,7 +77,7 @@ export const MediaBubbleContent = ({ ) } diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index eceb3f9cf..d0c19cae4 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.1.14", + "version": "0.1.15", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/components/Bot.tsx b/packages/embeds/js/src/components/Bot.tsx index c9bff6f05..5485e90ee 100644 --- a/packages/embeds/js/src/components/Bot.tsx +++ b/packages/embeds/js/src/components/Bot.tsx @@ -74,7 +74,10 @@ export const Bot = (props: BotProps & { class?: string }) => { return setError(new Error("The bot you're looking for doesn't exist.")) } - if (!data) return setError(new Error("Error! Couldn't initiate the chat.")) + if (!data) { + if (error) console.error(error) + return setError(new Error("Error! Couldn't initiate the chat.")) + } if (data.resultId && typebotIdFromProps) setResultInStorage(data.typebot.settings.general.rememberUser?.storage)( diff --git a/packages/embeds/js/src/components/bubbles/HostBubble.tsx b/packages/embeds/js/src/components/bubbles/HostBubble.tsx index 087cf4b65..d3b6bddaf 100644 --- a/packages/embeds/js/src/components/bubbles/HostBubble.tsx +++ b/packages/embeds/js/src/components/bubbles/HostBubble.tsx @@ -55,7 +55,7 @@ export const HostBubble = (props: Props) => { diff --git a/packages/embeds/js/src/features/blocks/bubbles/audio/components/AudioBubble.tsx b/packages/embeds/js/src/features/blocks/bubbles/audio/components/AudioBubble.tsx index f9e5616a7..7d54cc236 100644 --- a/packages/embeds/js/src/features/blocks/bubbles/audio/components/AudioBubble.tsx +++ b/packages/embeds/js/src/features/blocks/bubbles/audio/components/AudioBubble.tsx @@ -4,7 +4,7 @@ import type { AudioBubbleContent } from '@typebot.io/schemas' import { createSignal, onCleanup, onMount } from 'solid-js' type Props = { - url: AudioBubbleContent['url'] + content: AudioBubbleContent onTransitionEnd: (offsetTop?: number) => void } @@ -50,8 +50,8 @@ export const AudioBubble = (props: Props) => {