♻️ (builder) Remove barrel export and flatten folder arch

This commit is contained in:
Baptiste Arnaud
2023-03-15 11:51:30 +01:00
parent cbc8194f19
commit 44d7a0bcb8
498 changed files with 1542 additions and 1786 deletions

View File

@@ -1,2 +0,0 @@
export * from './AudioBubbleNode'
export * from './AudioBubbleIcon'

View File

@@ -1 +0,0 @@
export * from './components'

View File

@@ -1,3 +0,0 @@
export { EmbedBubbleContent } from './components/EmbedBubbleContent'
export { EmbedUploadContent } from './components/EmbedUploadContent'
export { EmbedBubbleIcon } from './components/EmbedBubbleIcon'

View File

@@ -1,2 +0,0 @@
export { ImageBubbleContent } from './components/ImageBubbleContent'
export { ImageBubbleIcon } from './components/ImageBubbleIcon'

View File

@@ -1,9 +1,9 @@
import { Flex } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { TextBubbleBlock } from '@typebot.io/schemas'
import React from 'react'
import { parseVariableHighlight } from '@/utils/helpers'
import { isEmpty } from '@typebot.io/lib'
import { parseVariableHtmlTags } from '@/features/variables/helpers/parseVariableHtmlTags'
type Props = {
block: TextBubbleBlock
@@ -11,7 +11,6 @@ type Props = {
export const TextBubbleContent = ({ block }: Props) => {
const { typebot } = useTypebot()
if (!typebot) return <></>
return (
<Flex
w="90%"
@@ -22,7 +21,7 @@ export const TextBubbleContent = ({ block }: Props) => {
dangerouslySetInnerHTML={{
__html: isEmpty(block.content.plainText)
? `<p>Click to edit...</p>`
: parseVariableHighlight(block.content.html, typebot),
: parseVariableHtmlTags(block.content.html, typebot?.variables ?? []),
}}
/>
)

View File

@@ -8,7 +8,6 @@ import React, { useEffect, useRef, useState } from 'react'
import { Plate, PlateProvider, usePlateEditorRef } from '@udecode/plate-core'
import { editorStyle, platePlugins } from '@/lib/plate'
import { BaseEditor, BaseSelection, Transforms } from 'slate'
import { ToolBar } from './ToolBar'
import {
defaultTextBubbleContent,
TextBubbleContent,
@@ -16,11 +15,12 @@ import {
} from '@typebot.io/schemas'
import { ReactEditor } from 'slate-react'
import { serializeHtml } from '@udecode/plate-serializer-html'
import { parseHtmlStringToPlainText } from '../../utils'
import { parseHtmlStringToPlainText } from '../utils'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { colors } from '@/lib/theme'
import { useOutsideClick } from '@/hooks/useOutsideClick'
import { selectEditor, TElement } from '@udecode/plate-common'
import { TextEditorToolBar } from './TextEditorToolBar'
type TextBubbleEditorContentProps = {
id: string
@@ -130,7 +130,9 @@ const TextBubbleEditorContent = ({
},
}}
>
<ToolBar onVariablesButtonClick={() => setIsVariableDropdownOpen(true)} />
<TextEditorToolBar
onVariablesButtonClick={() => setIsVariableDropdownOpen(true)}
/>
<Plate
id={id}
editableProps={{

View File

@@ -1 +0,0 @@
export { TextBubbleEditor } from './TextBubbleEditor'

View File

@@ -24,7 +24,10 @@ type Props = {
onVariablesButtonClick: () => void
} & StackProps
export const ToolBar = ({ onVariablesButtonClick, ...props }: Props) => {
export const TextEditorToolBar = ({
onVariablesButtonClick,
...props
}: Props) => {
const editor = usePlateEditorRef()
const handleVariablesButtonMouseDown = (e: React.MouseEvent) => {
e.stopPropagation()

View File

@@ -1,3 +0,0 @@
export { TextBubbleEditor } from './components/TextBubbleEditor'
export { TextBubbleContent } from './components/TextBubbleContent'
export { TextBubbleIcon } from './components/TextBubbleIcon'

View File

@@ -1,3 +0,0 @@
export { VideoUploadContent } from './components/VideoUploadContent'
export { VideoBubbleContent } from './components/VideoBubbleContent'
export { VideoBubbleIcon } from './components/VideoBubbleIcon'

View File

@@ -1,9 +1,9 @@
import { BlockIndices, ChoiceInputBlock } from '@typebot.io/schemas'
import React from 'react'
import { ItemNodesList } from '@/features/graph/components/Nodes/ItemNode'
import { Stack, Tag, Text, Wrap } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { SetVariableLabel } from '@/components/SetVariableLabel'
import { ItemNodesList } from '@/features/graph/components/nodes/item/ItemNodesList'
type Props = {
block: ChoiceInputBlock

View File

@@ -7,7 +7,7 @@ import {
Flex,
} from '@chakra-ui/react'
import { PlusIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { ButtonItem, ItemIndices, ItemType } from '@typebot.io/schemas'
import React, { useRef, useState } from 'react'
import { isNotDefined } from '@typebot.io/lib'

View File

@@ -1,3 +0,0 @@
export * from './ButtonsItemNode'
export * from './ButtonsIcon'
export * from './ButtonsBlockSettings'

View File

@@ -1 +0,0 @@
export * from './components'

View File

@@ -5,15 +5,12 @@ import { FormLabel, Stack } from '@chakra-ui/react'
import { DateInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type DateInputSettingsBodyProps = {
type Props = {
options: DateInputOptions
onOptionsChange: (options: DateInputOptions) => void
}
export const DateInputSettingsBody = ({
options,
onOptionsChange,
}: DateInputSettingsBodyProps) => {
export const DateInputSettings = ({ options, onOptionsChange }: Props) => {
const handleFromChange = (from: string) =>
onOptionsChange({ ...options, labels: { ...options?.labels, from } })
const handleToChange = (to: string) =>

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
type Props = {
variableId?: string

View File

@@ -1,3 +0,0 @@
export { DateInputSettingsBody } from './components/DateInputSettingsBody'
export { DateNodeContent } from './components/DateNodeContent'
export { DateInputIcon } from './components/DateInputIcon'

View File

@@ -1,7 +1,7 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { EmailInputBlock } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
type Props = {
variableId?: string

View File

@@ -4,15 +4,12 @@ import { FormLabel, Stack } from '@chakra-ui/react'
import { EmailInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type EmailInputSettingsBodyProps = {
type Props = {
options: EmailInputOptions
onOptionsChange: (options: EmailInputOptions) => void
}
export const EmailInputSettingsBody = ({
options,
onOptionsChange,
}: EmailInputSettingsBodyProps) => {
export const EmailInputSettings = ({ options, onOptionsChange }: Props) => {
const handlePlaceholderChange = (placeholder: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, placeholder } })
const handleButtonLabelChange = (button: string) =>

View File

@@ -1,3 +0,0 @@
export { EmailInputSettingsBody } from './components/EmailInputSettingsBody'
export { EmailInputNodeContent } from './components/EmailInputNodeContent'
export { EmailInputIcon } from './components/EmailInputIcon'

View File

@@ -1,4 +1,4 @@
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
import { Text } from '@chakra-ui/react'
import { FileInputOptions } from '@typebot.io/schemas'

View File

@@ -1,3 +0,0 @@
export { FileInputSettings } from './components/FileInputSettings'
export { FileInputContent } from './components/FileInputContent'
export { FileInputIcon } from './components/FileInputIcon'

View File

@@ -1,29 +1,23 @@
import { TextInput, NumberInput } from '@/components/inputs'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { removeUndefinedFields } from '@/utils/helpers'
import { FormLabel, Stack } from '@chakra-ui/react'
import { NumberInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type NumberInputSettingsBodyProps = {
type Props = {
options: NumberInputOptions
onOptionsChange: (options: NumberInputOptions) => void
}
export const NumberInputSettingsBody = ({
options,
onOptionsChange,
}: NumberInputSettingsBodyProps) => {
export const NumberInputSettings = ({ options, onOptionsChange }: Props) => {
const handlePlaceholderChange = (placeholder: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, placeholder } })
const handleButtonLabelChange = (button: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, button } })
const handleMinChange = (min?: number) =>
onOptionsChange(removeUndefinedFields({ ...options, min }))
const handleMaxChange = (max?: number) =>
onOptionsChange(removeUndefinedFields({ ...options, max }))
const handleBlockChange = (block?: number) =>
onOptionsChange(removeUndefinedFields({ ...options, block }))
const handleMinChange = (min?: number) => onOptionsChange({ ...options, min })
const handleMaxChange = (max?: number) => onOptionsChange({ ...options, max })
const handleStepChange = (step?: number) =>
onOptionsChange({ ...options, step })
const handleVariableChange = (variable?: Variable) => {
onOptionsChange({ ...options, variableId: variable?.id })
}
@@ -55,7 +49,7 @@ export const NumberInputSettingsBody = ({
<NumberInput
label="Step:"
defaultValue={options.step}
onValueChange={handleBlockChange}
onValueChange={handleStepChange}
withVariableButton={false}
/>
<Stack>

View File

@@ -1,7 +1,7 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { NumberInputBlock } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
type Props = {
variableId?: string

View File

@@ -1,3 +0,0 @@
export { NumberInputSettingsBody } from './components/NumberInputSettingsBody'
export { NumberNodeContent } from './components/NumberNodeContent'
export { NumberInputIcon } from './components/NumberInputIcon'

View File

@@ -13,9 +13,9 @@ import {
import { DropdownList } from '@/components/DropdownList'
import { PaymentInputOptions, PaymentProvider } from '@typebot.io/schemas'
import React, { ChangeEvent } from 'react'
import { currencies } from './currencies'
import { currencies } from '../currencies'
import { StripeConfigModal } from './StripeConfigModal'
import { CredentialsDropdown } from '@/features/credentials'
import { CredentialsDropdown } from '@/features/credentials/components/CredentialsDropdown'
import { TextInput } from '@/components/inputs'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'

View File

@@ -1 +0,0 @@
export { PaymentSettings } from './PaymentSettings'

View File

@@ -13,9 +13,8 @@ import {
Text,
HStack,
} from '@chakra-ui/react'
import { useUser } from '@/features/account'
import React, { useState } from 'react'
import { useWorkspace } from '@/features/workspace'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import { useToast } from '@/hooks/useToast'
import { TextInput } from '@/components/inputs'
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'
@@ -23,6 +22,7 @@ import { TextLink } from '@/components/TextLink'
import { StripeCredentials } from '@typebot.io/schemas'
import { trpc } from '@/lib/trpc'
import { isNotEmpty } from '@typebot.io/lib'
import { useUser } from '@/features/account/hooks/useUser'
type Props = {
isOpen: boolean

View File

@@ -1,3 +0,0 @@
export { PaymentSettings } from './components/PaymentSettings'
export { PaymentInputContent } from './components/PaymentInputContent'
export { PaymentInputIcon } from './components/PaymentInputIcon'

View File

@@ -5,15 +5,12 @@ import { PhoneNumberInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
import { CountryCodeSelect } from './CountryCodeSelect'
type PhoneNumberSettingsBodyProps = {
type Props = {
options: PhoneNumberInputOptions
onOptionsChange: (options: PhoneNumberInputOptions) => void
}
export const PhoneNumberSettingsBody = ({
options,
onOptionsChange,
}: PhoneNumberSettingsBodyProps) => {
export const PhoneInputSettings = ({ options, onOptionsChange }: Props) => {
const handlePlaceholderChange = (placeholder: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, placeholder } })
const handleButtonLabelChange = (button: string) =>

View File

@@ -1,7 +1,7 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { PhoneNumberInputOptions } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
type Props = {
variableId?: string

View File

@@ -1 +0,0 @@
export { PhoneNumberSettingsBody } from './PhoneNumberSettingsBody'

View File

@@ -1,3 +0,0 @@
export { PhoneNumberSettingsBody } from './components/PhoneNumberSettingsBody'
export { PhoneNodeContent } from './components/PhoneNodeContent'
export { PhoneInputIcon } from './components/PhoneInputIcon'

View File

@@ -1,4 +1,4 @@
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
import { Text } from '@chakra-ui/react'
import { RatingInputBlock } from '@typebot.io/schemas'

View File

@@ -6,15 +6,12 @@ import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
import { TextInput } from '@/components/inputs'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
type RatingInputSettingsProps = {
type Props = {
options: RatingInputOptions
onOptionsChange: (options: RatingInputOptions) => void
}
export const RatingInputSettings = ({
options,
onOptionsChange,
}: RatingInputSettingsProps) => {
export const RatingInputSettings = ({ options, onOptionsChange }: Props) => {
const handleLengthChange = (length: number) =>
onOptionsChange({ ...options, length })

View File

@@ -1,3 +0,0 @@
export { RatingInputSettings } from './components/RatingInputSettings'
export { RatingInputContent } from './components/RatingInputContent'
export { RatingInputIcon } from './components/RatingInputIcon'

View File

@@ -1,7 +1,7 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { TextInputOptions } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
type Props = {
placeholder: TextInputOptions['labels']['placeholder']

View File

@@ -5,15 +5,12 @@ import { FormLabel, Stack } from '@chakra-ui/react'
import { TextInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type TextInputSettingsBodyProps = {
type Props = {
options: TextInputOptions
onOptionsChange: (options: TextInputOptions) => void
}
export const TextInputSettingsBody = ({
options,
onOptionsChange,
}: TextInputSettingsBodyProps) => {
export const TextInputSettings = ({ options, onOptionsChange }: Props) => {
const handlePlaceholderChange = (placeholder: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, placeholder } })
const handleButtonLabelChange = (button: string) =>

View File

@@ -1,3 +0,0 @@
export { TextInputSettingsBody } from './components/TextInputSettingsBody'
export { TextInputNodeContent } from './components/TextInputNodeContent'
export { TextInputIcon } from './components/TextInputIcon'

View File

@@ -4,15 +4,12 @@ import { FormLabel, Stack } from '@chakra-ui/react'
import { UrlInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type UrlInputSettingsBodyProps = {
type Props = {
options: UrlInputOptions
onOptionsChange: (options: UrlInputOptions) => void
}
export const UrlInputSettingsBody = ({
options,
onOptionsChange,
}: UrlInputSettingsBodyProps) => {
export const UrlInputSettings = ({ options, onOptionsChange }: Props) => {
const handlePlaceholderChange = (placeholder: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, placeholder } })
const handleButtonLabelChange = (button: string) =>

View File

@@ -1,7 +1,7 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { UrlInputOptions } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
type Props = {
variableId?: string

View File

@@ -1,3 +0,0 @@
export { UrlInputSettingsBody } from './components/UrlInputSettingsBody'
export { UrlNodeContent } from './components/UrlNodeContent'
export { UrlInputIcon } from './components/UrlInputIcon'

View File

@@ -5,7 +5,7 @@ type Props = {
block: ChatwootBlock
}
export const ChatwootBlockNodeLabel = ({ block }: Props) =>
export const ChatwootNodeBody = ({ block }: Props) =>
block.options.task === 'Close widget' ? (
<Text>Close Chatwoot</Text>
) : block.options.websiteToken.length === 0 ? (

View File

@@ -16,7 +16,7 @@ type Props = {
onOptionsChange: (options: ChatwootOptions) => void
}
export const ChatwootSettingsForm = ({ options, onOptionsChange }: Props) => {
export const ChatwootSettings = ({ options, onOptionsChange }: Props) => {
const updateTask = (task: (typeof chatwootTasks)[number]) => {
onOptionsChange({ ...options, task })
}

View File

@@ -1,3 +0,0 @@
export { ChatwootLogo } from './components/ChatwootLogo'
export { ChatwootBlockNodeLabel } from './components/ChatwootBlockNodeLabel'
export { ChatwootSettingsForm } from './components/ChatwootSettingsForm'

View File

@@ -6,7 +6,7 @@ type Props = {
action: GoogleAnalyticsOptions['action']
}
export const GoogleAnalyticsNodeContent = ({ action }: Props) => (
export const GoogleAnalyticsNodeBody = ({ action }: Props) => (
<Text color={action ? 'currentcolor' : 'gray.500'} noOfLines={1}>
{action ? `Track "${action}"` : 'Configure...'}
</Text>

View File

@@ -1,2 +0,0 @@
export { GoogleAnalyticsSettings } from './components/GoogleAnalyticsSettings'
export { GoogleAnalyticsLogo } from './components/GoogleAnalyticsLogo'

View File

@@ -12,12 +12,12 @@ import {
ModalFooter,
Flex,
} from '@chakra-ui/react'
import { useWorkspace } from '@/features/workspace'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import Link from 'next/link'
import React from 'react'
import { AlertInfo } from '@/components/AlertInfo'
import { GoogleLogo } from '@/components/GoogleLogo'
import { getGoogleSheetsConsentScreenUrlQuery } from '../../queries/getGoogleSheetsConsentScreenUrlQuery'
import { getGoogleSheetsConsentScreenUrlQuery } from '../queries/getGoogleSheetsConsentScreenUrlQuery'
type Props = {
isOpen: boolean

View File

@@ -1,6 +1,6 @@
import { Divider, Stack, Text, useDisclosure } from '@chakra-ui/react'
import { DropdownList } from '@/components/DropdownList'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import {
Cell,
defaultGoogleSheetsGetOptions,
@@ -21,12 +21,12 @@ import { CellWithValueStack } from './CellWithValueStack'
import { CellWithVariableIdStack } from './CellWithVariableIdStack'
import { GoogleSheetConnectModal } from './GoogleSheetsConnectModal'
import { TableListItemProps, TableList } from '@/components/TableList'
import { CredentialsDropdown } from '@/features/credentials'
import { useSheets } from '../../hooks/useSheets'
import { Sheet } from '../../types'
import { CredentialsDropdown } from '@/features/credentials/components/CredentialsDropdown'
import { RowsFilterTableList } from './RowsFilterTableList'
import { createId } from '@paralleldrive/cuid2'
import { useWorkspace } from '@/features/workspace'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import { useSheets } from '../hooks/useSheets'
import { Sheet } from '../types'
type Props = {
options: GoogleSheetsOptions
@@ -34,7 +34,7 @@ type Props = {
blockId: string
}
export const GoogleSheetsSettingsBody = ({
export const GoogleSheetsSettings = ({
options,
onOptionsChange,
blockId,

View File

@@ -1,2 +0,0 @@
export * from './RowsFilterComparisonItem'
export * from './RowsFilterTableList'

View File

@@ -1 +0,0 @@
export { GoogleSheetsSettingsBody } from './GoogleSheetsSettingsBody'

View File

@@ -1,7 +1,7 @@
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'
import { Select } from '@/components/inputs/Select'
import { HStack, Input } from '@chakra-ui/react'
import { Sheet } from '../../types'
import { Sheet } from '../types'
type Props = {
sheets: Sheet[]

View File

@@ -1,6 +1,6 @@
import { Select } from '@/components/inputs/Select'
import { Input, Tooltip } from '@chakra-ui/react'
import { useSpreadsheets } from '../../hooks/useSpreadsheets'
import { useSpreadsheets } from '../hooks/useSpreadsheets'
type Props = {
credentialsId: string

View File

@@ -1,5 +1,5 @@
import { stringify } from 'qs'
import { fetcher } from '@/utils/helpers'
import { fetcher } from '@/helpers/fetcher'
import useSWR from 'swr'
import { Sheet } from '../types'

View File

@@ -1,5 +1,5 @@
import { stringify } from 'qs'
import { fetcher } from '@/utils/helpers'
import { fetcher } from '@/helpers/fetcher'
import useSWR from 'swr'
import { Spreadsheet } from '../types'

View File

@@ -1,3 +0,0 @@
export { GoogleSheetsSettingsBody } from './components/GoogleSheetsSettingsBody'
export { GoogleSheetsNodeContent } from './components/GoogleSheetsNodeContent'
export { GoogleSheetsLogo } from './components/GoogleSheetsLogo'

View File

@@ -1,5 +1,5 @@
import { Text } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { MakeComBlock } from '@typebot.io/schemas'
import { byId, isNotDefined } from '@typebot.io/lib'

View File

@@ -1,6 +1,6 @@
import { Alert, AlertIcon, Button, Link, Stack, Text } from '@chakra-ui/react'
import { ExternalLinkIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { MakeComBlock, Webhook, WebhookOptions } from '@typebot.io/schemas'
import React, { useCallback, useEffect, useState } from 'react'
import { byId } from '@typebot.io/lib'

View File

@@ -1,3 +0,0 @@
export * from './MakeComLogo'
export * from './MakeComContent'
export * from './MakeComSettings'

View File

@@ -1 +0,0 @@
export * from './components'

View File

@@ -1,6 +1,6 @@
import { TextInput } from '@/components/inputs/TextInput'
import { TextLink } from '@/components/TextLink'
import { useWorkspace } from '@/features/workspace'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import { useToast } from '@/hooks/useToast'
import { trpc } from '@/lib/trpc'
import {

View File

@@ -1,5 +1,5 @@
import { SetVariableLabel } from '@/components/SetVariableLabel'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { Stack, Text } from '@chakra-ui/react'
import {
ChatCompletionOpenAIOptions,

View File

@@ -1,6 +1,6 @@
import { Stack, useDisclosure } from '@chakra-ui/react'
import React from 'react'
import { CredentialsDropdown } from '@/features/credentials'
import { CredentialsDropdown } from '@/features/credentials/components/CredentialsDropdown'
import {
ChatCompletionOpenAIOptions,
CreateImageOpenAIOptions,

View File

@@ -1,5 +1,5 @@
import { Text } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { PabblyConnectBlock } from '@typebot.io/schemas'
import { byId, isNotDefined } from '@typebot.io/lib'

View File

@@ -1,6 +1,6 @@
import { Alert, AlertIcon, Button, Link, Stack, Text } from '@chakra-ui/react'
import { ExternalLinkIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import {
PabblyConnectBlock,
Webhook,

View File

@@ -1,2 +0,0 @@
export * from './PabblyConnectContent'
export * from './PabblyConnectLogo'

View File

@@ -1 +0,0 @@
export * from './components'

View File

@@ -14,7 +14,7 @@ import { env, isNotEmpty } from '@typebot.io/lib'
import { SmtpConfigModal } from './SmtpConfigModal'
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { CredentialsDropdown } from '@/features/credentials'
import { CredentialsDropdown } from '@/features/credentials/components/CredentialsDropdown'
import { TextInput, Textarea } from '@/components/inputs'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'

View File

@@ -1 +0,0 @@
export { SendEmailSettings } from './SendEmailSettings'

View File

@@ -8,13 +8,13 @@ import {
ModalFooter,
Button,
} from '@chakra-ui/react'
import { useUser } from '@/features/account'
import { useUser } from '@/features/account/hooks/useUser'
import React, { useState } from 'react'
import { isNotDefined } from '@typebot.io/lib'
import { SmtpConfigForm } from './SmtpConfigForm'
import { useWorkspace } from '@/features/workspace'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import { useToast } from '@/hooks/useToast'
import { testSmtpConfig } from '../../queries/testSmtpConfigQuery'
import { testSmtpConfig } from '../queries/testSmtpConfigQuery'
import { SmtpCredentials } from '@typebot.io/schemas'
import { trpc } from '@/lib/trpc'

View File

@@ -1,3 +0,0 @@
export { SendEmailSettings } from './components/SendEmailSettings'
export { SendEmailContent } from './components/SendEmailContent'
export { SendEmailIcon } from './components/SendEmailIcon'

View File

@@ -1,13 +1,13 @@
import { getLinkedTypebots } from '@/features/blocks/logic/typebotLink/api'
import prisma from '@/lib/prisma'
import { canReadTypebots } from '@/utils/api/dbRules'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { canReadTypebots } from '@/helpers/databaseRules'
import { authenticatedProcedure } from '@/helpers/server/trpc'
import { TRPCError } from '@trpc/server'
import { Typebot, Webhook } from '@typebot.io/schemas'
import { z } from 'zod'
import { parseResultExample } from '../utils'
import { getLinkedTypebots } from '@/features/blocks/logic/typebotLink/helpers/getLinkedTypebots'
import { parseResultExample } from '../helpers/parseResultExample'
export const getResultExampleProcedure = authenticatedProcedure
export const getResultExample = authenticatedProcedure
.meta({
openapi: {
method: 'GET',

View File

@@ -1 +0,0 @@
export * from './router'

View File

@@ -1,12 +1,12 @@
import prisma from '@/lib/prisma'
import { canReadTypebots } from '@/utils/api/dbRules'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { canReadTypebots } from '@/helpers/databaseRules'
import { authenticatedProcedure } from '@/helpers/server/trpc'
import { TRPCError } from '@trpc/server'
import { Group, Typebot, Webhook, WebhookBlock } from '@typebot.io/schemas'
import { byId, isWebhookBlock, parseGroupTitle } from '@typebot.io/lib'
import { z } from 'zod'
export const listWebhookBlocksProcedure = authenticatedProcedure
export const listWebhookBlocks = authenticatedProcedure
.meta({
openapi: {
method: 'GET',

View File

@@ -1,4 +0,0 @@
export * from './getResultExampleProcedure'
export * from './listWebhookBlocksProcedure'
export * from './subscribeWebhookProcedure'
export * from './unsubscribeWebhookProcedure'

View File

@@ -1,14 +1,12 @@
import { router } from '@/utils/server/trpc'
import {
listWebhookBlocksProcedure,
subscribeWebhookProcedure,
unsubscribeWebhookProcedure,
getResultExampleProcedure,
} from './procedures'
import { router } from '@/helpers/server/trpc'
import { getResultExample } from './getResultExample'
import { listWebhookBlocks } from './listWebhookBlocks'
import { subscribeWebhook } from './subscribeWebhook'
import { unsubscribeWebhook } from './unsubscribeWebhook'
export const webhookRouter = router({
listWebhookBlocks: listWebhookBlocksProcedure,
getResultExample: getResultExampleProcedure,
subscribeWebhook: subscribeWebhookProcedure,
unsubscribeWebhook: unsubscribeWebhookProcedure,
listWebhookBlocks,
getResultExample,
subscribeWebhook,
unsubscribeWebhook,
})

View File

@@ -1,12 +1,12 @@
import prisma from '@/lib/prisma'
import { canWriteTypebots } from '@/utils/api/dbRules'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { canWriteTypebots } from '@/helpers/databaseRules'
import { authenticatedProcedure } from '@/helpers/server/trpc'
import { TRPCError } from '@trpc/server'
import { Typebot, Webhook, WebhookBlock } from '@typebot.io/schemas'
import { byId, isWebhookBlock } from '@typebot.io/lib'
import { z } from 'zod'
export const subscribeWebhookProcedure = authenticatedProcedure
export const subscribeWebhook = authenticatedProcedure
.meta({
openapi: {
method: 'POST',

View File

@@ -1,12 +1,12 @@
import prisma from '@/lib/prisma'
import { canWriteTypebots } from '@/utils/api/dbRules'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { canWriteTypebots } from '@/helpers/databaseRules'
import { authenticatedProcedure } from '@/helpers/server/trpc'
import { TRPCError } from '@trpc/server'
import { Typebot, Webhook, WebhookBlock } from '@typebot.io/schemas'
import { byId, isWebhookBlock } from '@typebot.io/lib'
import { z } from 'zod'
export const unsubscribeWebhookProcedure = authenticatedProcedure
export const unsubscribeWebhook = authenticatedProcedure
.meta({
openapi: {
method: 'POST',

View File

@@ -1 +0,0 @@
export * from './parseResultExample'

View File

@@ -2,7 +2,7 @@ import { DropdownList } from '@/components/DropdownList'
import { CodeEditor } from '@/components/inputs/CodeEditor'
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
import { TableList, TableListItemProps } from '@/components/TableList'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { useToast } from '@/hooks/useToast'
import {
Stack,
@@ -25,14 +25,11 @@ import {
} from '@typebot.io/schemas'
import { useState, useMemo } from 'react'
import { executeWebhook } from '../queries/executeWebhookQuery'
import { convertVariablesForTestToVariables } from '../utils/convertVariablesForTestToVariables'
import { getDeepKeys } from '../utils/getDeepKeys'
import {
QueryParamsInputs,
HeadersInputs,
} from './WebhookSettings/KeyValueInputs'
import { DataVariableInputs } from './WebhookSettings/ResponseMappingInputs'
import { VariableForTestInputs } from './WebhookSettings/VariableForTestInputs'
import { convertVariablesForTestToVariables } from '../helpers/convertVariablesForTestToVariables'
import { getDeepKeys } from '../helpers/getDeepKeys'
import { QueryParamsInputs, HeadersInputs } from './KeyValueInputs'
import { DataVariableInputs } from './ResponseMappingInputs'
import { VariableForTestInputs } from './VariableForTestInputs'
type Props = {
blockId: string

View File

@@ -1,5 +1,5 @@
import { Stack, Text } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { WebhookBlock } from '@typebot.io/schemas'
import { byId } from '@typebot.io/lib'
import { SetVariableLabel } from '@/components/SetVariableLabel'

View File

@@ -1,10 +1,10 @@
import React, { useState } from 'react'
import { Spinner, Stack } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { WebhookOptions, Webhook, WebhookBlock } from '@typebot.io/schemas'
import { byId } from '@typebot.io/lib'
import { TextInput } from '@/components/inputs'
import { WebhookAdvancedConfigForm } from '../WebhookAdvancedConfigForm'
import { WebhookAdvancedConfigForm } from './WebhookAdvancedConfigForm'
type Props = {
block: WebhookBlock

View File

@@ -1 +0,0 @@
export { WebhookSettings } from './WebhookSettings'

View File

@@ -1,4 +0,0 @@
export { duplicateWebhookQuery } from './queries/duplicateWebhookQuery'
export { WebhookSettings } from './components/WebhookSettings'
export { WebhookContent } from './components/WebhookContent'
export { WebhookIcon } from './components/WebhookIcon'

View File

@@ -1,5 +1,5 @@
import { Text } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { ZapierBlock } from '@typebot.io/schemas'
import { byId, isNotDefined } from '@typebot.io/lib'

View File

@@ -1,6 +1,6 @@
import { Alert, AlertIcon, Button, Link, Stack, Text } from '@chakra-ui/react'
import { ExternalLinkIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { Webhook, WebhookOptions, ZapierBlock } from '@typebot.io/schemas'
import React, { useCallback, useEffect, useState } from 'react'
import { byId } from '@typebot.io/lib'

Some files were not shown because too many files have changed in this diff Show More