diff --git a/apps/builder/components/share/codeSnippets/params.ts b/apps/builder/components/share/codeSnippets/params.ts index 73da88f748..a0dac4a863 100644 --- a/apps/builder/components/share/codeSnippets/params.ts +++ b/apps/builder/components/share/codeSnippets/params.ts @@ -88,7 +88,7 @@ export const parseInitContainerCode = ({ backgroundColor, }) return prettier.format( - `Typebot.initContainer("typebot-container", { + `initContainer("typebot-container", { url: "${url}",${bgColorString}${customDomainString}${hiddenVariablesString} });`, { parser: 'babel', plugins: [parserBabel] } @@ -110,7 +110,7 @@ export const parseInitPopupCode = ({ }) const { delayString } = parsePopupParams({ delay }) return prettier.format( - `var typebotCommands = Typebot.initPopup({url: "${url}",${delayString}${bgColorString}${customDomainString}${hiddenVariablesString}});`, + `var typebotCommands = initPopup({url: "${url}",${delayString}${bgColorString}${customDomainString}${hiddenVariablesString}});`, { parser: 'babel', plugins: [parserBabel] } ) } @@ -134,7 +134,7 @@ export const parseInitBubbleCode = ({ proactiveMessage, }) return prettier.format( - `var typebotCommands = Typebot.initBubble({url: "${url}",${bgColorString}${customDomainString}${hiddenVariablesString}${proactiveMessageString}${buttonString}});`, + `var typebotCommands = initBubble({url: "${url}",${bgColorString}${customDomainString}${hiddenVariablesString}${proactiveMessageString}${buttonString}});`, { parser: 'babel', plugins: [parserBabel] } ) } diff --git a/packages/typebot-js/package.json b/packages/typebot-js/package.json index 8e91ceb1b7..17db0d12cf 100644 --- a/packages/typebot-js/package.json +++ b/packages/typebot-js/package.json @@ -1,6 +1,6 @@ { "name": "typebot-js", - "version": "2.2.5", + "version": "2.2.6", "main": "dist/index.js", "unpkg": "dist/index.umd.min.js", "license": "AGPL-3.0-or-later", diff --git a/packages/typebot-js/src/embedTypes/chat/iframe.ts b/packages/typebot-js/src/embedTypes/chat/iframe.ts index 66769037d2..6abd5166f9 100644 --- a/packages/typebot-js/src/embedTypes/chat/iframe.ts +++ b/packages/typebot-js/src/embedTypes/chat/iframe.ts @@ -5,6 +5,7 @@ export const createIframeContainer = ( params: IframeParams ): HTMLIFrameElement => { const iframe = createIframe({ ...params, loadWhenVisible: true }) + iframe.style.display = 'none' return iframe } diff --git a/packages/typebot-js/src/iframe/index.ts b/packages/typebot-js/src/iframe/index.ts index bd525c4e5a..43644a1da0 100644 --- a/packages/typebot-js/src/iframe/index.ts +++ b/packages/typebot-js/src/iframe/index.ts @@ -26,7 +26,6 @@ export const createIframe = ({ iframe.classList.add('typebot-iframe') const { onNewVariableValue, onVideoPlayed } = iframeParams listenForTypebotMessages({ onNewVariableValue, onVideoPlayed }) - iframe.style.display = 'none' return iframe }