⚡ (engine) Improve engine overall robustness
This commit is contained in:
@ -98,9 +98,7 @@ export const SharePage = () => {
|
||||
</Heading>
|
||||
{typebot && (
|
||||
<EditableUrl
|
||||
hostname={
|
||||
getViewerUrl({ isBuilder: true }) ?? 'https://typebot.io'
|
||||
}
|
||||
hostname={getViewerUrl() ?? 'https://typebot.io'}
|
||||
pathname={publicId}
|
||||
isValid={checkIfPublicIdIsValid}
|
||||
onPathnameChange={handlePublicIdChange}
|
||||
|
@ -20,9 +20,9 @@ export const ChatEmbedCode = ({
|
||||
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${typebot?.publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${
|
||||
typebot?.publicId
|
||||
}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
}),
|
||||
|
@ -22,9 +22,9 @@ export const ContainerEmbedCode = ({
|
||||
|
||||
const snippet = prettier.format(
|
||||
parseSnippet({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${typebot?.publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${
|
||||
typebot?.publicId
|
||||
}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
}),
|
||||
|
@ -13,9 +13,9 @@ export const IframeEmbedCode = ({
|
||||
heightLabel,
|
||||
}: Props & FlexProps) => {
|
||||
const { typebot } = useTypebot()
|
||||
const src = `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${typebot?.publicId}`
|
||||
const src = `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${
|
||||
typebot?.publicId
|
||||
}`
|
||||
const code = `<iframe src="${src}" width="${widthLabel}" height="${heightLabel}" style="border: none"></iframe>`
|
||||
|
||||
return <CodeEditor value={code} lang="html" isReadOnly />
|
||||
|
@ -17,9 +17,9 @@ export const PopupEmbedCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${typebot?.publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${
|
||||
typebot?.publicId
|
||||
}`,
|
||||
delay,
|
||||
}),
|
||||
{
|
||||
|
@ -20,9 +20,9 @@ export const StandardReactDiv = ({
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
parseContainerSnippet({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${typebot?.publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${
|
||||
typebot?.publicId
|
||||
}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
}),
|
||||
@ -70,9 +70,9 @@ export const PopupReactCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
parsePopupSnippet({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${typebot?.publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${
|
||||
typebot?.publicId
|
||||
}`,
|
||||
delay,
|
||||
}),
|
||||
{
|
||||
@ -119,9 +119,9 @@ export const ChatReactCode = ({
|
||||
const { typebot } = useTypebot()
|
||||
const snippet = prettier.format(
|
||||
parseBubbleSnippet({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${typebot?.publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${
|
||||
typebot?.publicId
|
||||
}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
}),
|
||||
|
@ -40,9 +40,7 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
})
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${publicId}`,
|
||||
})
|
||||
const headCode = `${typebotJsHtml}
|
||||
<script>
|
||||
|
@ -48,15 +48,13 @@ export const NotionModal = ({
|
||||
pr="4.5rem"
|
||||
type={'text'}
|
||||
defaultValue={`${
|
||||
env('VIEWER_INTERNAL_URL') ??
|
||||
getViewerUrl({ isBuilder: true })
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl()
|
||||
}/${publicId}`}
|
||||
/>
|
||||
<InputRightElement width="4.5rem">
|
||||
<CopyButton
|
||||
textToCopy={`${
|
||||
env('VIEWER_INTERNAL_URL') ??
|
||||
getViewerUrl({ isBuilder: true })
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl()
|
||||
}/${publicId}`}
|
||||
/>
|
||||
</InputRightElement>
|
||||
|
@ -45,9 +45,7 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
})
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
url: `${
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl({ isBuilder: true })
|
||||
}/${publicId}`,
|
||||
url: `${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}/${publicId}`,
|
||||
})
|
||||
const headCode = prettier.format(
|
||||
`${typebotJsHtml}<script>${jsCode}</script>`,
|
||||
|
@ -58,15 +58,13 @@ export const WordpressModal = ({
|
||||
pr="4.5rem"
|
||||
type={'text'}
|
||||
defaultValue={`${
|
||||
env('VIEWER_INTERNAL_URL') ??
|
||||
getViewerUrl({ isBuilder: true })
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl()
|
||||
}/${publicId}`}
|
||||
/>
|
||||
<InputRightElement width="4.5rem">
|
||||
<CopyButton
|
||||
textToCopy={`${
|
||||
env('VIEWER_INTERNAL_URL') ??
|
||||
getViewerUrl({ isBuilder: true })
|
||||
env('VIEWER_INTERNAL_URL') ?? getViewerUrl()
|
||||
}/${publicId}`}
|
||||
/>
|
||||
</InputRightElement>
|
||||
|
Reference in New Issue
Block a user