build: 👷 New compose file and entrypoints
This commit is contained in:
@ -5,6 +5,7 @@ import { BubbleParams } from 'typebot-js'
|
||||
import { parseInitBubbleCode, typebotJsHtml } from '../params'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type ChatEmbedCodeProps = {
|
||||
withStarterVariables?: boolean
|
||||
@ -20,8 +21,9 @@ export const ChatEmbedCode = ({
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
|
@ -5,6 +5,7 @@ import { parseInitContainerCode, typebotJsHtml } from '../params'
|
||||
import { IframeParams } from 'typebot-js'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type ContainerEmbedCodeProps = {
|
||||
widthLabel: string
|
||||
@ -22,8 +23,9 @@ export const ContainerEmbedCode = ({
|
||||
const snippet = prettier.format(
|
||||
parseSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { FlexProps } from '@chakra-ui/react'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type Props = {
|
||||
widthLabel: string
|
||||
@ -13,8 +14,9 @@ export const IframeEmbedCode = ({
|
||||
}: Props & FlexProps) => {
|
||||
const { typebot } = useTypebot()
|
||||
const src = `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`
|
||||
const code = `<iframe src="${src}" width="${widthLabel}" height="${heightLabel}" />`
|
||||
|
||||
|
@ -4,6 +4,7 @@ import { useTypebot } from 'contexts/TypebotContext'
|
||||
import parserHtml from 'prettier/parser-html'
|
||||
import prettier from 'prettier/standalone'
|
||||
import { PopupParams } from 'typebot-js'
|
||||
import { isEmpty } from 'utils'
|
||||
import { parseInitPopupCode, typebotJsHtml } from '../params'
|
||||
|
||||
type PopupEmbedCodeProps = {
|
||||
@ -17,8 +18,9 @@ export const PopupEmbedCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
delay,
|
||||
}),
|
||||
|
@ -10,6 +10,7 @@ import parserBabel from 'prettier/parser-babel'
|
||||
import prettier from 'prettier/standalone'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type StandardReactDivProps = { widthLabel: string; heightLabel: string }
|
||||
export const StandardReactDiv = ({
|
||||
@ -20,8 +21,9 @@ export const StandardReactDiv = ({
|
||||
const snippet = prettier.format(
|
||||
parseContainerSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
@ -71,8 +73,9 @@ export const PopupReactCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const snippet = prettier.format(
|
||||
parsePopupSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
delay,
|
||||
}),
|
||||
@ -121,8 +124,9 @@ export const ChatReactCode = ({
|
||||
const snippet = prettier.format(
|
||||
parseBubbleSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
|
@ -18,6 +18,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { createCustomDomain } from 'services/user'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
const hostnameRegex =
|
||||
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/
|
||||
@ -119,8 +120,11 @@ export const CustomDomainModal = ({
|
||||
</Stack>
|
||||
<Stack>
|
||||
<Text fontWeight="bold">Value</Text>
|
||||
<Text>{process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL}</Text>
|
||||
<Text>
|
||||
{isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL}
|
||||
</Text>
|
||||
</Stack>
|
||||
</HStack>
|
||||
) : (
|
||||
|
@ -11,6 +11,7 @@ import { PopupEmbedSettings } from 'components/share/codeSnippets/Popup/EmbedSet
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { useState } from 'react'
|
||||
import { BubbleParams } from 'typebot-js'
|
||||
import { isEmpty } from 'utils'
|
||||
import { ModalProps } from '../../EmbedButton'
|
||||
|
||||
type GtmInstructionsProps = {
|
||||
@ -40,8 +41,9 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`,
|
||||
})
|
||||
const headCode = `${typebotJsHtml}
|
||||
|
@ -16,6 +16,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { CopyButton } from 'components/shared/buttons/CopyButton'
|
||||
import { PublishFirstInfo } from 'components/shared/Info'
|
||||
import { isEmpty } from 'utils'
|
||||
import { ModalProps } from '../EmbedButton'
|
||||
|
||||
export const NotionModal = ({
|
||||
@ -45,15 +46,17 @@ export const NotionModal = ({
|
||||
pr="4.5rem"
|
||||
type={'text'}
|
||||
defaultValue={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
<InputRightElement width="4.5rem">
|
||||
<CopyButton
|
||||
textToCopy={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
</InputRightElement>
|
||||
|
@ -14,6 +14,7 @@ import { BubbleParams } from 'typebot-js'
|
||||
import { ModalProps } from '../../EmbedButton'
|
||||
import parserHtml from 'prettier/parser-html'
|
||||
import prettier from 'prettier/standalone'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type ShopifyInstructionsProps = {
|
||||
type: 'standard' | 'popup' | 'bubble'
|
||||
@ -45,8 +46,9 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`,
|
||||
})
|
||||
const headCode = prettier.format(
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
import { ExternalLinkIcon } from 'assets/icons'
|
||||
import { CopyButton } from 'components/shared/buttons/CopyButton'
|
||||
import { PublishFirstInfo } from 'components/shared/Info'
|
||||
import { isEmpty } from 'utils'
|
||||
import { ModalProps } from '../EmbedButton'
|
||||
|
||||
export const WordpressModal = ({
|
||||
@ -54,15 +55,17 @@ export const WordpressModal = ({
|
||||
pr="4.5rem"
|
||||
type={'text'}
|
||||
defaultValue={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
<InputRightElement width="4.5rem">
|
||||
<CopyButton
|
||||
textToCopy={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
</InputRightElement>
|
||||
|
Reference in New Issue
Block a user