build: 🩹 Fix build
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { DashboardFolder } from '.prisma/client'
|
||||
import { DashboardFolder } from 'db'
|
||||
import {
|
||||
Flex,
|
||||
Heading,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DashboardFolder } from '.prisma/client'
|
||||
import { DashboardFolder } from 'db'
|
||||
import {
|
||||
Button,
|
||||
Editable,
|
||||
|
@ -19,7 +19,7 @@ export const ChatEmbedCode = ({
|
||||
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
publishId: typebot?.publicId ?? '',
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
}),
|
||||
|
@ -21,7 +21,7 @@ export const ContainerEmbedCode = ({
|
||||
|
||||
const snippet = prettier.format(
|
||||
parseSnippet({
|
||||
publishId: typebot?.publicId ?? '',
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
}),
|
||||
@ -38,7 +38,7 @@ type SnippetProps = IframeParams &
|
||||
Pick<ContainerEmbedCodeProps, 'widthLabel' | 'heightLabel'>
|
||||
|
||||
const parseSnippet = ({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
@ -48,7 +48,7 @@ const parseSnippet = ({
|
||||
customDomain,
|
||||
hiddenVariables,
|
||||
backgroundColor,
|
||||
publishId,
|
||||
url,
|
||||
})
|
||||
return `${typebotJsHtml}
|
||||
<div id="typebot-container" style="width: ${embedProps.widthLabel}; height: ${embedProps.heightLabel};"></div>
|
||||
|
@ -16,7 +16,7 @@ export const PopupEmbedCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
publishId: typebot?.publicId ?? '',
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
|
||||
delay,
|
||||
}),
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ export const StandardReactDiv = ({
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
parseContainerSnippet({
|
||||
publishId: typebot?.publicId ?? '',
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
}),
|
||||
@ -35,14 +35,14 @@ type SnippetProps = IframeParams &
|
||||
Pick<StandardReactDivProps, 'widthLabel' | 'heightLabel'>
|
||||
|
||||
const parseContainerSnippet = ({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
...embedProps
|
||||
}: SnippetProps): string => {
|
||||
const jsCode = parseInitContainerCode({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
@ -67,7 +67,7 @@ export const PopupReactCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
parsePopupSnippet({
|
||||
publishId: typebot?.publicId ?? '',
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
|
||||
delay,
|
||||
}),
|
||||
{
|
||||
@ -79,14 +79,14 @@ export const PopupReactCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
}
|
||||
|
||||
const parsePopupSnippet = ({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
delay,
|
||||
}: PopupParams): string => {
|
||||
const jsCode = parseInitPopupCode({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
@ -114,7 +114,7 @@ export const ChatReactCode = ({
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
parseBubbleSnippet({
|
||||
publishId: typebot?.publicId ?? '',
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
}),
|
||||
@ -127,7 +127,7 @@ export const ChatReactCode = ({
|
||||
}
|
||||
|
||||
const parseBubbleSnippet = ({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
@ -135,7 +135,7 @@ const parseBubbleSnippet = ({
|
||||
button,
|
||||
}: BubbleParams): string => {
|
||||
const jsCode = parseInitBubbleCode({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
|
@ -76,7 +76,7 @@ const parseBubbleParams = ({
|
||||
})
|
||||
|
||||
export const parseInitContainerCode = ({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
backgroundColor,
|
||||
hiddenVariables,
|
||||
@ -89,14 +89,14 @@ export const parseInitContainerCode = ({
|
||||
})
|
||||
return prettier.format(
|
||||
`Typebot.initContainer("typebot-container", {
|
||||
url: "${process.env.NEXT_PUBLIC_VIEWER_URL}/${publishId}",${bgColorString}${customDomainString}${hiddenVariablesString}
|
||||
url: "${url}",${bgColorString}${customDomainString}${hiddenVariablesString}
|
||||
});`,
|
||||
{ parser: 'babel', plugins: [parserBabel] }
|
||||
)
|
||||
}
|
||||
|
||||
export const parseInitPopupCode = ({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
hiddenVariables,
|
||||
backgroundColor,
|
||||
@ -110,13 +110,13 @@ export const parseInitPopupCode = ({
|
||||
})
|
||||
const { delayString } = parsePopupParams({ delay })
|
||||
return prettier.format(
|
||||
`var typebotCommands = Typebot.initPopup({url: "${process.env.NEXT_PUBLIC_VIEWER_URL}/${publishId}",${delayString}${bgColorString}${customDomainString}${hiddenVariablesString}});`,
|
||||
`var typebotCommands = Typebot.initPopup({url: "${url}",${delayString}${bgColorString}${customDomainString}${hiddenVariablesString}});`,
|
||||
{ parser: 'babel', plugins: [parserBabel] }
|
||||
)
|
||||
}
|
||||
|
||||
export const parseInitBubbleCode = ({
|
||||
publishId,
|
||||
url,
|
||||
customDomain,
|
||||
hiddenVariables,
|
||||
backgroundColor,
|
||||
@ -134,7 +134,7 @@ export const parseInitBubbleCode = ({
|
||||
proactiveMessage,
|
||||
})
|
||||
return prettier.format(
|
||||
`var typebotCommands = Typebot.initBubble({url: "${process.env.NEXT_PUBLIC_VIEWER_URL}/${publishId}",${bgColorString}${customDomainString}${hiddenVariablesString}${proactiveMessageString}${buttonString}});`,
|
||||
`var typebotCommands = Typebot.initBubble({url: "${url}",${bgColorString}${customDomainString}${hiddenVariablesString}${proactiveMessageString}${buttonString}});`,
|
||||
{ parser: 'babel', plugins: [parserBabel] }
|
||||
)
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
})
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
publishId: publicId,
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${publicId}`,
|
||||
})
|
||||
const headCode = `${typebotJsHtml}
|
||||
<script>
|
||||
|
@ -44,7 +44,7 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
})
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
publishId: publicId,
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${publicId}`,
|
||||
})
|
||||
const headCode = prettier.format(
|
||||
`${typebotJsHtml}<script>${jsCode}</script>`,
|
||||
|
@ -12,8 +12,7 @@ export const SupportBubble = () => {
|
||||
useEffect(() => {
|
||||
if (isCloudProdInstance())
|
||||
initBubble({
|
||||
publishId: 'typebot-support',
|
||||
viewerHost: process.env.NEXT_PUBLIC_VIEWER_URL,
|
||||
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/typebot-support`,
|
||||
backgroundColor: '#ffffff',
|
||||
button: { color: '#0042DA' },
|
||||
hiddenVariables: {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DashboardFolder } from '.prisma/client'
|
||||
import { DashboardFolder } from 'db'
|
||||
import useSWR from 'swr'
|
||||
import { fetcher } from './utils'
|
||||
import { stringify } from 'qs'
|
||||
|
Reference in New Issue
Block a user