♻️ (builder) Remove barrel export and flatten folder arch
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import { useEventListener } from '@chakra-ui/react'
|
||||
import assert from 'assert'
|
||||
import {
|
||||
useGraph,
|
||||
ConnectingIds,
|
||||
Coordinates,
|
||||
useGroupsCoordinates,
|
||||
} from '../../providers'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { colors } from '@/lib/theme'
|
||||
import React, { useMemo, useState } from 'react'
|
||||
import { computeConnectingEdgePath, computeEdgePathToMouse } from '../../utils'
|
||||
import { useEndpoints } from '../../providers/EndpointsProvider'
|
||||
import { Coordinates } from '@dnd-kit/utilities'
|
||||
import { computeConnectingEdgePath } from '../../helpers/computeConnectingEdgePath'
|
||||
import { computeEdgePathToMouse } from '../../helpers/computeEdgePathToMouth'
|
||||
import { useGraph } from '../../providers/GraphProvider'
|
||||
import { useGroupsCoordinates } from '../../providers/GroupsCoordinateProvider'
|
||||
import { ConnectingIds } from '../../types'
|
||||
|
||||
export const DrawingEdge = () => {
|
||||
const { graphPosition, setConnectingIds, connectingIds } = useGraph()
|
||||
|
||||
@@ -6,15 +6,16 @@ import {
|
||||
useColorModeValue,
|
||||
theme,
|
||||
} from '@chakra-ui/react'
|
||||
import { useGroupsCoordinates } from '../../providers'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useWorkspace } from '@/features/workspace'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
|
||||
import React, { useMemo } from 'react'
|
||||
import { byId, isDefined } from '@typebot.io/lib'
|
||||
import { isProPlan } from '@/features/billing'
|
||||
import { AnswersCount } from '@/features/analytics'
|
||||
import { computeSourceCoordinates, computeDropOffPath } from '../../utils'
|
||||
import { useEndpoints } from '../../providers/EndpointsProvider'
|
||||
import { useGroupsCoordinates } from '../../providers/GroupsCoordinateProvider'
|
||||
import { AnswersCount } from '@/features/analytics/types'
|
||||
import { isProPlan } from '@/features/billing/helpers/isProPlan'
|
||||
import { computeDropOffPath } from '../../helpers/computeDropOffPath'
|
||||
import { computeSourceCoordinates } from '../../helpers/computeSourceCoordinates'
|
||||
|
||||
type Props = {
|
||||
groupId: string
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
import { Coordinates, useGraph, useGroupsCoordinates } from '../../providers'
|
||||
import React, { useMemo, useState } from 'react'
|
||||
import { Edge as EdgeProps } from '@typebot.io/schemas'
|
||||
import { Portal, useColorMode, useDisclosure } from '@chakra-ui/react'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { EdgeMenu } from './EdgeMenu'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { colors } from '@/lib/theme'
|
||||
import { getAnchorsPosition, computeEdgePath } from '../../utils'
|
||||
import { useEndpoints } from '../../providers/EndpointsProvider'
|
||||
|
||||
export type AnchorsPositionProps = {
|
||||
sourcePosition: Coordinates
|
||||
targetPosition: Coordinates
|
||||
sourceType: 'right' | 'left'
|
||||
totalSegments: number
|
||||
}
|
||||
import { computeEdgePath } from '../../helpers/computeEdgePath'
|
||||
import { getAnchorsPosition } from '../../helpers/getAnchorsPosition'
|
||||
import { useGraph } from '../../providers/GraphProvider'
|
||||
import { useGroupsCoordinates } from '../../providers/GroupsCoordinateProvider'
|
||||
import { EdgeMenu } from './EdgeMenu'
|
||||
|
||||
type Props = {
|
||||
edge: EdgeProps
|
||||
|
||||
@@ -2,10 +2,10 @@ import { chakra, useColorMode } from '@chakra-ui/react'
|
||||
import { colors } from '@/lib/theme'
|
||||
import { Edge as EdgeProps } from '@typebot.io/schemas'
|
||||
import React from 'react'
|
||||
import { AnswersCount } from '@/features/analytics/types'
|
||||
import { DrawingEdge } from './DrawingEdge'
|
||||
import { DropOffEdge } from './DropOffEdge'
|
||||
import { Edge } from './Edge'
|
||||
import { AnswersCount } from '@/features/analytics'
|
||||
|
||||
type Props = {
|
||||
edges: EdgeProps[]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { Edges } from './Edges'
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
useColorModeValue,
|
||||
useEventListener,
|
||||
} from '@chakra-ui/react'
|
||||
import { useGraph, useGroupsCoordinates } from '../../providers'
|
||||
import { Source } from '@typebot.io/schemas'
|
||||
import React, {
|
||||
useEffect,
|
||||
@@ -14,6 +13,8 @@ import React, {
|
||||
useState,
|
||||
} from 'react'
|
||||
import { useEndpoints } from '../../providers/EndpointsProvider'
|
||||
import { useGraph } from '../../providers/GraphProvider'
|
||||
import { useGroupsCoordinates } from '../../providers/GroupsCoordinateProvider'
|
||||
|
||||
const endpointHeight = 32
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import React, {
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { useGraph } from '../../providers'
|
||||
import { useEndpoints } from '../../providers/EndpointsProvider'
|
||||
import { useGraph } from '../../providers/GraphProvider'
|
||||
|
||||
const endpointHeight = 20
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
export { SourceEndpoint } from './SourceEndpoint'
|
||||
export { TargetEndpoint } from './TargetEndpoint'
|
||||
@@ -1,24 +1,21 @@
|
||||
import { Flex, FlexProps, useEventListener } from '@chakra-ui/react'
|
||||
import React, { useRef, useMemo, useEffect, useState } from 'react'
|
||||
import {
|
||||
blockWidth,
|
||||
Coordinates,
|
||||
graphPositionDefaultValue,
|
||||
useGraph,
|
||||
useGroupsCoordinates,
|
||||
useBlockDnd,
|
||||
} from '../providers'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { DraggableBlockType, PublicTypebot, Typebot } from '@typebot.io/schemas'
|
||||
import { useDebounce } from 'use-debounce'
|
||||
import GraphElements from './GraphElements'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import { useUser } from '@/features/account'
|
||||
import { useUser } from '@/features/account/hooks/useUser'
|
||||
import { ZoomButtons } from './ZoomButtons'
|
||||
import { AnswersCount } from '@/features/analytics'
|
||||
import { headerHeight } from '@/features/editor'
|
||||
import { useGesture } from '@use-gesture/react'
|
||||
import { GraphNavigation } from '@typebot.io/prisma'
|
||||
import { AnswersCount } from '@/features/analytics/types'
|
||||
import { headerHeight } from '@/features/editor/constants'
|
||||
import { graphPositionDefaultValue, blockWidth } from '../constants'
|
||||
import { useBlockDnd } from '../providers/GraphDndProvider'
|
||||
import { useGraph } from '../providers/GraphProvider'
|
||||
import { useGroupsCoordinates } from '../providers/GroupsCoordinateProvider'
|
||||
import { Coordinates } from '../types'
|
||||
|
||||
const maxScale = 2
|
||||
const minScale = 0.3
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { AnswersCount } from '@/features/analytics'
|
||||
import { AnswersCount } from '@/features/analytics/types'
|
||||
import { Edge, Group } from '@typebot.io/schemas'
|
||||
import React, { memo } from 'react'
|
||||
import { EndpointsProvider } from '../providers/EndpointsProvider'
|
||||
import { Edges } from './Edges'
|
||||
import { GroupNode } from './Nodes/GroupNode'
|
||||
import { Edges } from './edges/Edges'
|
||||
import { GroupNode } from './nodes/group'
|
||||
|
||||
type Props = {
|
||||
edges: Edge[]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { BlockNodeContent } from './BlockNodeContent'
|
||||
@@ -1 +0,0 @@
|
||||
export { SettingsPopoverContent } from './SettingsPopoverContent'
|
||||
@@ -1 +0,0 @@
|
||||
export { BlockNodesList } from './BlockNodesList'
|
||||
@@ -1 +0,0 @@
|
||||
export { ItemNodeContent } from './ItemNodeContent'
|
||||
@@ -1 +0,0 @@
|
||||
export { ItemNodesList } from './ItemNodesList'
|
||||
@@ -18,27 +18,27 @@ import {
|
||||
LogicBlockType,
|
||||
} from '@typebot.io/schemas'
|
||||
import { isBubbleBlock, isDefined, isTextBubbleBlock } from '@typebot.io/lib'
|
||||
import { BlockNodeContent } from './BlockNodeContent/BlockNodeContent'
|
||||
import { BlockIcon, useTypebot } from '@/features/editor'
|
||||
import { SettingsPopoverContent } from './SettingsPopoverContent'
|
||||
import { BlockNodeContent } from './BlockNodeContent'
|
||||
import { BlockSettings, SettingsPopoverContent } from './SettingsPopoverContent'
|
||||
import { BlockNodeContextMenu } from './BlockNodeContextMenu'
|
||||
import { SourceEndpoint } from '../../Endpoints/SourceEndpoint'
|
||||
import { SourceEndpoint } from '../../endpoints/SourceEndpoint'
|
||||
import { useRouter } from 'next/router'
|
||||
import { SettingsModal } from './SettingsPopoverContent/SettingsModal'
|
||||
import { BlockSettings } from './SettingsPopoverContent/SettingsPopoverContent'
|
||||
import { TargetEndpoint } from '../../Endpoints'
|
||||
import { MediaBubblePopoverContent } from './MediaBubblePopoverContent'
|
||||
import { ContextMenu } from '@/components/ContextMenu'
|
||||
import { TextBubbleEditor } from '@/features/blocks/bubbles/textBubble'
|
||||
import { TextBubbleEditor } from '@/features/blocks/bubbles/textBubble/components/TextBubbleEditor'
|
||||
import { BlockIcon } from '@/features/editor/components/BlockIcon'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import {
|
||||
NodePosition,
|
||||
useGraph,
|
||||
useBlockDnd,
|
||||
useDragDistance,
|
||||
ParentModalProvider,
|
||||
} from '../../../providers'
|
||||
import { hasDefaultConnector } from '../../../utils'
|
||||
import { setMultipleRefs } from '@/utils/helpers'
|
||||
} from '@/features/graph/providers/GraphDndProvider'
|
||||
import { useGraph } from '@/features/graph/providers/GraphProvider'
|
||||
import { ParentModalProvider } from '@/features/graph/providers/ParentModalProvider'
|
||||
import { hasDefaultConnector } from '@/features/typebot/helpers/hasDefaultConnector'
|
||||
import { setMultipleRefs } from '@/helpers/setMultipleRefs'
|
||||
import { TargetEndpoint } from '../../endpoints/TargetEndpoint'
|
||||
import { SettingsModal } from './SettingsModal'
|
||||
|
||||
export const BlockNode = ({
|
||||
block,
|
||||
@@ -8,37 +8,37 @@ import {
|
||||
IntegrationBlockType,
|
||||
BlockIndices,
|
||||
} from '@typebot.io/schemas'
|
||||
import { ItemNodesList } from '../../ItemNode'
|
||||
import { TextBubbleContent } from '@/features/blocks/bubbles/textBubble'
|
||||
import { ImageBubbleContent } from '@/features/blocks/bubbles/image'
|
||||
import { VideoBubbleContent } from '@/features/blocks/bubbles/video'
|
||||
import { EmbedBubbleContent } from '@/features/blocks/bubbles/embed'
|
||||
import { TextInputNodeContent } from '@/features/blocks/inputs/textInput'
|
||||
import { NumberNodeContent } from '@/features/blocks/inputs/number'
|
||||
import { EmailInputNodeContent } from '@/features/blocks/inputs/emailInput'
|
||||
import { UrlNodeContent } from '@/features/blocks/inputs/url'
|
||||
import { PhoneNodeContent } from '@/features/blocks/inputs/phone'
|
||||
import { DateNodeContent } from '@/features/blocks/inputs/date'
|
||||
import { SetVariableContent } from '@/features/blocks/logic/setVariable'
|
||||
import { WebhookContent } from '@/features/blocks/integrations/webhook'
|
||||
import { ChatwootBlockNodeLabel } from '@/features/blocks/integrations/chatwoot'
|
||||
import { RedirectNodeContent } from '@/features/blocks/logic/redirect'
|
||||
import { PabblyConnectContent } from '@/features/blocks/integrations/pabbly'
|
||||
import { PaymentInputContent } from '@/features/blocks/inputs/payment'
|
||||
import { RatingInputContent } from '@/features/blocks/inputs/rating'
|
||||
import { FileInputContent } from '@/features/blocks/inputs/fileUpload'
|
||||
import { TypebotLinkNode } from '@/features/blocks/logic/typebotLink'
|
||||
import { GoogleSheetsNodeContent } from '@/features/blocks/integrations/googleSheets'
|
||||
import { GoogleAnalyticsNodeContent } from '@/features/blocks/integrations/googleAnalytics/components/GoogleAnalyticsNodeContent'
|
||||
import { ZapierContent } from '@/features/blocks/integrations/zapier'
|
||||
import { SendEmailContent } from '@/features/blocks/integrations/sendEmail'
|
||||
import { MakeComContent } from '@/features/blocks/integrations/makeCom'
|
||||
import { AudioBubbleNode } from '@/features/blocks/bubbles/audio'
|
||||
import { WaitNodeContent } from '@/features/blocks/logic/wait/components/WaitNodeContent'
|
||||
import { ScriptNodeContent } from '@/features/blocks/logic/script/components/ScriptNodeContent'
|
||||
import { ButtonsBlockNode } from '@/features/blocks/inputs/buttons/components/ButtonsBlockNode'
|
||||
import { JumpNodeBody } from '@/features/blocks/logic/jump/components/JumpNodeBody'
|
||||
import { OpenAINodeBody } from '@/features/blocks/integrations/openai/components/OpenAINodeBody'
|
||||
import { AudioBubbleNode } from '@/features/blocks/bubbles/audio/components/AudioBubbleNode'
|
||||
import { EmbedBubbleContent } from '@/features/blocks/bubbles/embed/components/EmbedBubbleContent'
|
||||
import { ImageBubbleContent } from '@/features/blocks/bubbles/image/components/ImageBubbleContent'
|
||||
import { TextBubbleContent } from '@/features/blocks/bubbles/textBubble/components/TextBubbleContent'
|
||||
import { VideoBubbleContent } from '@/features/blocks/bubbles/video/components/VideoBubbleContent'
|
||||
import { DateNodeContent } from '@/features/blocks/inputs/date/components/DateNodeContent'
|
||||
import { EmailInputNodeContent } from '@/features/blocks/inputs/emailInput/components/EmailInputNodeContent'
|
||||
import { FileInputContent } from '@/features/blocks/inputs/fileUpload/components/FileInputContent'
|
||||
import { NumberNodeContent } from '@/features/blocks/inputs/number/components/NumberNodeContent'
|
||||
import { PaymentInputContent } from '@/features/blocks/inputs/payment/components/PaymentInputContent'
|
||||
import { PhoneNodeContent } from '@/features/blocks/inputs/phone/components/PhoneNodeContent'
|
||||
import { RatingInputContent } from '@/features/blocks/inputs/rating/components/RatingInputContent'
|
||||
import { TextInputNodeContent } from '@/features/blocks/inputs/textInput/components/TextInputNodeContent'
|
||||
import { UrlNodeContent } from '@/features/blocks/inputs/url/components/UrlNodeContent'
|
||||
import { GoogleSheetsNodeContent } from '@/features/blocks/integrations/googleSheets/components/GoogleSheetsNodeContent'
|
||||
import { MakeComContent } from '@/features/blocks/integrations/makeCom/components/MakeComContent'
|
||||
import { PabblyConnectContent } from '@/features/blocks/integrations/pabbly/components/PabblyConnectContent'
|
||||
import { SendEmailContent } from '@/features/blocks/integrations/sendEmail/components/SendEmailContent'
|
||||
import { WebhookContent } from '@/features/blocks/integrations/webhook/components/WebhookContent'
|
||||
import { ZapierContent } from '@/features/blocks/integrations/zapier/components/ZapierContent'
|
||||
import { RedirectNodeContent } from '@/features/blocks/logic/redirect/components/RedirectNodeContent'
|
||||
import { SetVariableContent } from '@/features/blocks/logic/setVariable/components/SetVariableContent'
|
||||
import { TypebotLinkNode } from '@/features/blocks/logic/typebotLink/components/TypebotLinkNode'
|
||||
import { ItemNodesList } from '../item/ItemNodesList'
|
||||
import { GoogleAnalyticsNodeBody } from '@/features/blocks/integrations/googleAnalytics/components/GoogleAnalyticsNodeBody'
|
||||
import { ChatwootNodeBody } from '@/features/blocks/integrations/chatwoot/components/ChatwootNodeBody'
|
||||
|
||||
type Props = {
|
||||
block: Block | StartBlock
|
||||
@@ -155,7 +155,7 @@ export const BlockNodeContent = ({ block, indices }: Props): JSX.Element => {
|
||||
}
|
||||
case IntegrationBlockType.GOOGLE_ANALYTICS: {
|
||||
return (
|
||||
<GoogleAnalyticsNodeContent
|
||||
<GoogleAnalyticsNodeBody
|
||||
action={
|
||||
block.options?.action
|
||||
? `Track "${block.options?.action}" `
|
||||
@@ -180,7 +180,7 @@ export const BlockNodeContent = ({ block, indices }: Props): JSX.Element => {
|
||||
return <SendEmailContent block={block} />
|
||||
}
|
||||
case IntegrationBlockType.CHATWOOT: {
|
||||
return <ChatwootBlockNodeLabel block={block} />
|
||||
return <ChatwootNodeBody block={block} />
|
||||
}
|
||||
case IntegrationBlockType.OPEN_AI: {
|
||||
return (
|
||||
@@ -1,6 +1,6 @@
|
||||
import { MenuList, MenuItem } from '@chakra-ui/react'
|
||||
import { CopyIcon, TrashIcon } from '@/components/icons'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { BlockIndices } from '@typebot.io/schemas'
|
||||
|
||||
type Props = { indices: BlockIndices }
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlockIcon } from '@/features/editor'
|
||||
import { BlockIcon } from '@/features/editor/components/BlockIcon'
|
||||
import { StackProps, HStack, useColorModeValue } from '@chakra-ui/react'
|
||||
import { StartBlock, Block, BlockIndices } from '@typebot.io/schemas'
|
||||
import { BlockNodeContent } from './BlockNodeContent/BlockNodeContent'
|
||||
import { BlockNodeContent } from './BlockNodeContent'
|
||||
|
||||
export const BlockNodeOverlay = ({
|
||||
block,
|
||||
@@ -1,17 +1,17 @@
|
||||
import { useEventListener, Stack, Portal } from '@chakra-ui/react'
|
||||
import { DraggableBlock, DraggableBlockType, Block } from '@typebot.io/schemas'
|
||||
import {
|
||||
computeNearestPlaceholderIndex,
|
||||
useBlockDnd,
|
||||
Coordinates,
|
||||
useGraph,
|
||||
} from '../../../providers'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { BlockNode } from './BlockNode'
|
||||
import { BlockNodeOverlay } from './BlockNodeOverlay'
|
||||
import { PlaceholderNode } from '../PlaceholderNode'
|
||||
import { isDefined } from '@typebot.io/lib'
|
||||
import {
|
||||
useBlockDnd,
|
||||
computeNearestPlaceholderIndex,
|
||||
} from '@/features/graph/providers/GraphDndProvider'
|
||||
import { useGraph } from '@/features/graph/providers/GraphProvider'
|
||||
import { Coordinates } from '@dnd-kit/utilities'
|
||||
|
||||
type Props = {
|
||||
groupId: string
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ImageUploadContent } from '@/components/ImageUploadContent'
|
||||
import { AudioBubbleForm } from '@/features/blocks/bubbles/audio/components/AudioBubbleForm'
|
||||
import { EmbedUploadContent } from '@/features/blocks/bubbles/embed'
|
||||
import { VideoUploadContent } from '@/features/blocks/bubbles/video'
|
||||
import { EmbedUploadContent } from '@/features/blocks/bubbles/embed/components/EmbedUploadContent'
|
||||
import { VideoUploadContent } from '@/features/blocks/bubbles/video/components/VideoUploadContent'
|
||||
import {
|
||||
Portal,
|
||||
PopoverContent,
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useParentModal } from '@/features/graph'
|
||||
import { useParentModal } from '@/features/graph/providers/ParentModalProvider'
|
||||
import {
|
||||
Modal,
|
||||
ModalOverlay,
|
||||
@@ -19,25 +19,6 @@ import {
|
||||
BlockWithOptions,
|
||||
} from '@typebot.io/schemas'
|
||||
import { useRef } from 'react'
|
||||
import { DateInputSettingsBody } from '@/features/blocks/inputs/date'
|
||||
import { EmailInputSettingsBody } from '@/features/blocks/inputs/emailInput'
|
||||
import { FileInputSettings } from '@/features/blocks/inputs/fileUpload'
|
||||
import { NumberInputSettingsBody } from '@/features/blocks/inputs/number'
|
||||
import { PaymentSettings } from '@/features/blocks/inputs/payment'
|
||||
import { PhoneNumberSettingsBody } from '@/features/blocks/inputs/phone'
|
||||
import { RatingInputSettings } from '@/features/blocks/inputs/rating'
|
||||
import { TextInputSettingsBody } from '@/features/blocks/inputs/textInput'
|
||||
import { UrlInputSettingsBody } from '@/features/blocks/inputs/url'
|
||||
import { GoogleAnalyticsSettings } from '@/features/blocks/integrations/googleAnalytics'
|
||||
import { GoogleSheetsSettingsBody } from '@/features/blocks/integrations/googleSheets'
|
||||
import { SendEmailSettings } from '@/features/blocks/integrations/sendEmail'
|
||||
import { WebhookSettings } from '@/features/blocks/integrations/webhook'
|
||||
import { ZapierSettings } from '@/features/blocks/integrations/zapier'
|
||||
import { RedirectSettings } from '@/features/blocks/logic/redirect'
|
||||
import { SetVariableSettings } from '@/features/blocks/logic/setVariable'
|
||||
import { TypebotLinkForm } from '@/features/blocks/logic/typebotLink'
|
||||
import { ButtonsBlockSettings } from '@/features/blocks/inputs/buttons'
|
||||
import { ChatwootSettingsForm } from '@/features/blocks/integrations/chatwoot'
|
||||
import { HelpDocButton } from './HelpDocButton'
|
||||
import { WaitSettings } from '@/features/blocks/logic/wait/components/WaitSettings'
|
||||
import { ScriptSettings } from '@/features/blocks/logic/script/components/ScriptSettings'
|
||||
@@ -45,6 +26,25 @@ import { JumpSettings } from '@/features/blocks/logic/jump/components/JumpSettin
|
||||
import { MakeComSettings } from '@/features/blocks/integrations/makeCom/components/MakeComSettings'
|
||||
import { PabblyConnectSettings } from '@/features/blocks/integrations/pabbly/components/PabblyConnectSettings'
|
||||
import { OpenAISettings } from '@/features/blocks/integrations/openai/components/OpenAISettings'
|
||||
import { ButtonsBlockSettings } from '@/features/blocks/inputs/buttons/components/ButtonsBlockSettings'
|
||||
import { FileInputSettings } from '@/features/blocks/inputs/fileUpload/components/FileInputSettings'
|
||||
import { PaymentSettings } from '@/features/blocks/inputs/payment/components/PaymentSettings'
|
||||
import { RatingInputSettings } from '@/features/blocks/inputs/rating/components/RatingInputSettings'
|
||||
import { TextInputSettings } from '@/features/blocks/inputs/textInput/components/TextInputSettings'
|
||||
import { GoogleAnalyticsSettings } from '@/features/blocks/integrations/googleAnalytics/components/GoogleAnalyticsSettings'
|
||||
import { SendEmailSettings } from '@/features/blocks/integrations/sendEmail/components/SendEmailSettings'
|
||||
import { WebhookSettings } from '@/features/blocks/integrations/webhook/components/WebhookSettings'
|
||||
import { ZapierSettings } from '@/features/blocks/integrations/zapier/components/ZapierSettings'
|
||||
import { RedirectSettings } from '@/features/blocks/logic/redirect/components/RedirectSettings'
|
||||
import { SetVariableSettings } from '@/features/blocks/logic/setVariable/components/SetVariableSettings'
|
||||
import { TypebotLinkForm } from '@/features/blocks/logic/typebotLink/components/TypebotLinkForm'
|
||||
import { NumberInputSettings } from '@/features/blocks/inputs/number/components/NumberInputSettings'
|
||||
import { EmailInputSettings } from '@/features/blocks/inputs/emailInput/components/EmailInputSettings'
|
||||
import { UrlInputSettings } from '@/features/blocks/inputs/url/components/UrlInputSettings'
|
||||
import { DateInputSettings } from '@/features/blocks/inputs/date/components/DateInputSettings'
|
||||
import { PhoneInputSettings } from '@/features/blocks/inputs/phone/components/PhoneInputSettings'
|
||||
import { GoogleSheetsSettings } from '@/features/blocks/integrations/googleSheets/components/GoogleSheetsSettings'
|
||||
import { ChatwootSettings } from '@/features/blocks/integrations/chatwoot/components/ChatwootSettings'
|
||||
|
||||
type Props = {
|
||||
block: BlockWithOptions
|
||||
@@ -105,7 +105,7 @@ export const BlockSettings = ({
|
||||
switch (block.type) {
|
||||
case InputBlockType.TEXT: {
|
||||
return (
|
||||
<TextInputSettingsBody
|
||||
<TextInputSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
/>
|
||||
@@ -113,7 +113,7 @@ export const BlockSettings = ({
|
||||
}
|
||||
case InputBlockType.NUMBER: {
|
||||
return (
|
||||
<NumberInputSettingsBody
|
||||
<NumberInputSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
/>
|
||||
@@ -121,7 +121,7 @@ export const BlockSettings = ({
|
||||
}
|
||||
case InputBlockType.EMAIL: {
|
||||
return (
|
||||
<EmailInputSettingsBody
|
||||
<EmailInputSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
/>
|
||||
@@ -129,7 +129,7 @@ export const BlockSettings = ({
|
||||
}
|
||||
case InputBlockType.URL: {
|
||||
return (
|
||||
<UrlInputSettingsBody
|
||||
<UrlInputSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
/>
|
||||
@@ -137,7 +137,7 @@ export const BlockSettings = ({
|
||||
}
|
||||
case InputBlockType.DATE: {
|
||||
return (
|
||||
<DateInputSettingsBody
|
||||
<DateInputSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
/>
|
||||
@@ -145,7 +145,7 @@ export const BlockSettings = ({
|
||||
}
|
||||
case InputBlockType.PHONE: {
|
||||
return (
|
||||
<PhoneNumberSettingsBody
|
||||
<PhoneInputSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
/>
|
||||
@@ -231,7 +231,7 @@ export const BlockSettings = ({
|
||||
}
|
||||
case IntegrationBlockType.GOOGLE_SHEETS: {
|
||||
return (
|
||||
<GoogleSheetsSettingsBody
|
||||
<GoogleSheetsSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
blockId={block.id}
|
||||
@@ -270,7 +270,7 @@ export const BlockSettings = ({
|
||||
}
|
||||
case IntegrationBlockType.CHATWOOT: {
|
||||
return (
|
||||
<ChatwootSettingsForm
|
||||
<ChatwootSettings
|
||||
options={block.options}
|
||||
onOptionsChange={updateOptions}
|
||||
/>
|
||||
@@ -1,6 +1,6 @@
|
||||
import { chakra, Text, TextProps } from '@chakra-ui/react'
|
||||
import React from 'react'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { byId } from '@typebot.io/lib'
|
||||
|
||||
type Props = {
|
||||
@@ -8,22 +8,24 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import React, { memo, useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { Group } from '@typebot.io/schemas'
|
||||
import {
|
||||
Coordinates,
|
||||
useGraph,
|
||||
useGroupsCoordinates,
|
||||
useBlockDnd,
|
||||
} from '../../../providers'
|
||||
import { BlockNodesList } from '../BlockNode/BlockNodesList'
|
||||
import { BlockNodesList } from '../block/BlockNodesList'
|
||||
import { isDefined, isEmpty, isNotDefined } from '@typebot.io/lib'
|
||||
import { useTypebot, RightPanel, useEditor } from '@/features/editor'
|
||||
import { GroupNodeContextMenu } from './GroupNodeContextMenu'
|
||||
import { useDebounce } from 'use-debounce'
|
||||
import { ContextMenu } from '@/components/ContextMenu'
|
||||
import { setMultipleRefs } from '@/utils/helpers'
|
||||
import { useDrag } from '@use-gesture/react'
|
||||
import { GroupFocusToolbar } from './GroupFocusToolbar'
|
||||
import { useOutsideClick } from '@/hooks/useOutsideClick'
|
||||
import {
|
||||
RightPanel,
|
||||
useEditor,
|
||||
} from '@/features/editor/providers/EditorProvider'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { useBlockDnd } from '@/features/graph/providers/GraphDndProvider'
|
||||
import { useGraph } from '@/features/graph/providers/GraphProvider'
|
||||
import { useGroupsCoordinates } from '@/features/graph/providers/GroupsCoordinateProvider'
|
||||
import { setMultipleRefs } from '@/helpers/setMultipleRefs'
|
||||
import { Coordinates } from '@/features/graph/types'
|
||||
|
||||
type Props = {
|
||||
group: Group
|
||||
@@ -1,6 +1,6 @@
|
||||
import { MenuList, MenuItem } from '@chakra-ui/react'
|
||||
import { CopyIcon, TrashIcon } from '@/components/icons'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
|
||||
export const GroupNodeContextMenu = ({
|
||||
groupIndex,
|
||||
@@ -1,19 +1,19 @@
|
||||
import { Flex, useColorModeValue } from '@chakra-ui/react'
|
||||
import {
|
||||
Coordinates,
|
||||
useGraph,
|
||||
NodePosition,
|
||||
useDragDistance,
|
||||
} from '../../../providers'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { ChoiceInputBlock, Item, ItemIndices } from '@typebot.io/schemas'
|
||||
import React, { useRef, useState } from 'react'
|
||||
import { SourceEndpoint } from '../../Endpoints/SourceEndpoint'
|
||||
import { SourceEndpoint } from '../../endpoints/SourceEndpoint'
|
||||
import { ItemNodeContent } from './ItemNodeContent'
|
||||
import { ItemNodeContextMenu } from './ItemNodeContextMenu'
|
||||
import { ContextMenu } from '@/components/ContextMenu'
|
||||
import { setMultipleRefs } from '@/utils/helpers'
|
||||
import { isDefined } from '@typebot.io/lib'
|
||||
import { Coordinates } from '@/features/graph/types'
|
||||
import {
|
||||
NodePosition,
|
||||
useDragDistance,
|
||||
} from '@/features/graph/providers/GraphDndProvider'
|
||||
import { useGraph } from '@/features/graph/providers/GraphProvider'
|
||||
import { setMultipleRefs } from '@/helpers/setMultipleRefs'
|
||||
|
||||
type Props = {
|
||||
item: Item
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ButtonsItemNode } from '@/features/blocks/inputs/buttons'
|
||||
import { ConditionItemNode } from '@/features/blocks/logic/condition'
|
||||
import { ButtonsItemNode } from '@/features/blocks/inputs/buttons/components/ButtonsItemNode'
|
||||
import { ConditionItemNode } from '@/features/blocks/logic/condition/components/ConditionItemNode'
|
||||
import { Item, ItemIndices, ItemType } from '@typebot.io/schemas'
|
||||
import React from 'react'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { MenuList, MenuItem } from '@chakra-ui/react'
|
||||
import { TrashIcon } from '@/components/icons'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { ItemIndices } from '@typebot.io/schemas'
|
||||
|
||||
type Props = {
|
||||
@@ -6,13 +6,7 @@ import {
|
||||
useColorModeValue,
|
||||
useEventListener,
|
||||
} from '@chakra-ui/react'
|
||||
import {
|
||||
computeNearestPlaceholderIndex,
|
||||
useBlockDnd,
|
||||
Coordinates,
|
||||
useGraph,
|
||||
} from '../../../providers'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import {
|
||||
BlockIndices,
|
||||
BlockWithItems,
|
||||
@@ -21,9 +15,15 @@ import {
|
||||
} from '@typebot.io/schemas'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
import { ItemNode } from './ItemNode'
|
||||
import { SourceEndpoint } from '../../Endpoints'
|
||||
import { PlaceholderNode } from '../PlaceholderNode'
|
||||
import { isDefined } from '@typebot.io/lib'
|
||||
import {
|
||||
useBlockDnd,
|
||||
computeNearestPlaceholderIndex,
|
||||
} from '@/features/graph/providers/GraphDndProvider'
|
||||
import { useGraph } from '@/features/graph/providers/GraphProvider'
|
||||
import { Coordinates } from '@dnd-kit/utilities'
|
||||
import { SourceEndpoint } from '../../endpoints/SourceEndpoint'
|
||||
|
||||
type Props = {
|
||||
block: BlockWithItems
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Stack, IconButton, useColorModeValue } from '@chakra-ui/react'
|
||||
import { PlusIcon, MinusIcon } from '@/components/icons'
|
||||
import { headerHeight } from '@/features/editor'
|
||||
import { headerHeight } from '@/features/editor/constants'
|
||||
|
||||
type Props = {
|
||||
onZoomInClick: () => void
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { Graph } from './Graph'
|
||||
Reference in New Issue
Block a user