♻️ Re-organize workspace folders

This commit is contained in:
Baptiste Arnaud
2023-03-15 08:35:16 +01:00
parent 25c367901f
commit cbc8194f19
987 changed files with 2716 additions and 2770 deletions

View File

@@ -10,7 +10,7 @@ import { useGroupsCoordinates } from '../../providers'
import { useTypebot } from '@/features/editor'
import { useWorkspace } from '@/features/workspace'
import React, { useMemo } from 'react'
import { byId, isDefined } from 'utils'
import { byId, isDefined } from '@typebot.io/lib'
import { isProPlan } from '@/features/billing'
import { AnswersCount } from '@/features/analytics'
import { computeSourceCoordinates, computeDropOffPath } from '../../utils'

View File

@@ -1,6 +1,6 @@
import { Coordinates, useGraph, useGroupsCoordinates } from '../../providers'
import React, { useMemo, useState } from 'react'
import { Edge as EdgeProps } from 'models'
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'

View File

@@ -1,6 +1,6 @@
import { chakra, useColorMode } from '@chakra-ui/react'
import { colors } from '@/lib/theme'
import { Edge as EdgeProps } from 'models'
import { Edge as EdgeProps } from '@typebot.io/schemas'
import React from 'react'
import { DrawingEdge } from './DrawingEdge'
import { DropOffEdge } from './DropOffEdge'

View File

@@ -5,7 +5,7 @@ import {
useEventListener,
} from '@chakra-ui/react'
import { useGraph, useGroupsCoordinates } from '../../providers'
import { Source } from 'models'
import { Source } from '@typebot.io/schemas'
import React, {
useEffect,
useLayoutEffect,

View File

@@ -9,7 +9,7 @@ import {
useBlockDnd,
} from '../providers'
import { useTypebot } from '@/features/editor'
import { DraggableBlockType, PublicTypebot, Typebot } from 'models'
import { DraggableBlockType, PublicTypebot, Typebot } from '@typebot.io/schemas'
import { useDebounce } from 'use-debounce'
import GraphElements from './GraphElements'
import { createId } from '@paralleldrive/cuid2'
@@ -18,7 +18,7 @@ import { ZoomButtons } from './ZoomButtons'
import { AnswersCount } from '@/features/analytics'
import { headerHeight } from '@/features/editor'
import { useGesture } from '@use-gesture/react'
import { GraphNavigation } from 'db'
import { GraphNavigation } from '@typebot.io/prisma'
const maxScale = 2
const minScale = 0.3

View File

@@ -1,5 +1,5 @@
import { AnswersCount } from '@/features/analytics'
import { Edge, Group } from 'models'
import { Edge, Group } from '@typebot.io/schemas'
import React, { memo } from 'react'
import { EndpointsProvider } from '../providers/EndpointsProvider'
import { Edges } from './Edges'

View File

@@ -16,8 +16,8 @@ import {
TextBubbleContent,
TextBubbleBlock,
LogicBlockType,
} from 'models'
import { isBubbleBlock, isDefined, isTextBubbleBlock } from 'utils'
} 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'

View File

@@ -7,7 +7,7 @@ import {
LogicBlockType,
IntegrationBlockType,
BlockIndices,
} from 'models'
} from '@typebot.io/schemas'
import { ItemNodesList } from '../../ItemNode'
import { TextBubbleContent } from '@/features/blocks/bubbles/textBubble'
import { ImageBubbleContent } from '@/features/blocks/bubbles/image'

View File

@@ -1,7 +1,7 @@
import { chakra, Text, TextProps } from '@chakra-ui/react'
import React from 'react'
import { useTypebot } from '@/features/editor'
import { byId } from 'utils'
import { byId } from '@typebot.io/lib'
type Props = {
variableId: string

View File

@@ -1,7 +1,7 @@
import { MenuList, MenuItem } from '@chakra-ui/react'
import { CopyIcon, TrashIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { BlockIndices } from 'models'
import { BlockIndices } from '@typebot.io/schemas'
type Props = { indices: BlockIndices }
export const BlockNodeContextMenu = ({ indices }: Props) => {

View File

@@ -1,6 +1,6 @@
import { BlockIcon } from '@/features/editor'
import { StackProps, HStack, useColorModeValue } from '@chakra-ui/react'
import { StartBlock, Block, BlockIndices } from 'models'
import { StartBlock, Block, BlockIndices } from '@typebot.io/schemas'
import { BlockNodeContent } from './BlockNodeContent/BlockNodeContent'
export const BlockNodeOverlay = ({

View File

@@ -1,5 +1,5 @@
import { useEventListener, Stack, Portal } from '@chakra-ui/react'
import { DraggableBlock, DraggableBlockType, Block } from 'models'
import { DraggableBlock, DraggableBlockType, Block } from '@typebot.io/schemas'
import {
computeNearestPlaceholderIndex,
useBlockDnd,
@@ -11,7 +11,7 @@ import { useTypebot } from '@/features/editor'
import { BlockNode } from './BlockNode'
import { BlockNodeOverlay } from './BlockNodeOverlay'
import { PlaceholderNode } from '../PlaceholderNode'
import { isDefined } from 'utils'
import { isDefined } from '@typebot.io/lib'
type Props = {
groupId: string

View File

@@ -13,7 +13,7 @@ import {
BubbleBlockContent,
BubbleBlockType,
TextBubbleBlock,
} from 'models'
} from '@typebot.io/schemas'
import { useRef } from 'react'
type Props = {

View File

@@ -5,7 +5,7 @@ import {
InputBlockType,
IntegrationBlockType,
LogicBlockType,
} from 'models'
} from '@typebot.io/schemas'
import React from 'react'
type HelpDocButtonProps = {

View File

@@ -17,7 +17,7 @@ import {
Block,
BlockOptions,
BlockWithOptions,
} from 'models'
} from '@typebot.io/schemas'
import { useRef } from 'react'
import { DateInputSettingsBody } from '@/features/blocks/inputs/date'
import { EmailInputSettingsBody } from '@/features/blocks/inputs/emailInput'

View File

@@ -7,7 +7,7 @@ import {
useColorModeValue,
} from '@chakra-ui/react'
import React, { memo, useCallback, useEffect, useRef, useState } from 'react'
import { Group } from 'models'
import { Group } from '@typebot.io/schemas'
import {
Coordinates,
useGraph,
@@ -15,7 +15,7 @@ import {
useBlockDnd,
} from '../../../providers'
import { BlockNodesList } from '../BlockNode/BlockNodesList'
import { isDefined, isEmpty, isNotDefined } from 'utils'
import { isDefined, isEmpty, isNotDefined } from '@typebot.io/lib'
import { useTypebot, RightPanel, useEditor } from '@/features/editor'
import { GroupNodeContextMenu } from './GroupNodeContextMenu'
import { useDebounce } from 'use-debounce'

View File

@@ -6,14 +6,14 @@ import {
useDragDistance,
} from '../../../providers'
import { useTypebot } from '@/features/editor'
import { ChoiceInputBlock, Item, ItemIndices } from 'models'
import { ChoiceInputBlock, Item, ItemIndices } from '@typebot.io/schemas'
import React, { useRef, useState } from 'react'
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 'utils'
import { isDefined } from '@typebot.io/lib'
type Props = {
item: Item

View File

@@ -1,6 +1,6 @@
import { ButtonsItemNode } from '@/features/blocks/inputs/buttons'
import { ConditionItemNode } from '@/features/blocks/logic/condition'
import { Item, ItemIndices, ItemType } from 'models'
import { Item, ItemIndices, ItemType } from '@typebot.io/schemas'
import React from 'react'
type Props = {

View File

@@ -1,7 +1,7 @@
import { MenuList, MenuItem } from '@chakra-ui/react'
import { TrashIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { ItemIndices } from 'models'
import { ItemIndices } from '@typebot.io/schemas'
type Props = {
indices: ItemIndices

View File

@@ -13,12 +13,17 @@ import {
useGraph,
} from '../../../providers'
import { useTypebot } from '@/features/editor'
import { BlockIndices, BlockWithItems, LogicBlockType, Item } from 'models'
import {
BlockIndices,
BlockWithItems,
LogicBlockType,
Item,
} 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 'utils'
import { isDefined } from '@typebot.io/lib'
type Props = {
block: BlockWithItems

View File

@@ -1,5 +1,5 @@
import { useEventListener } from '@chakra-ui/react'
import { DraggableBlock, DraggableBlockType, Item } from 'models'
import { DraggableBlock, DraggableBlockType, Item } from '@typebot.io/schemas'
import {
createContext,
Dispatch,

View File

@@ -1,4 +1,4 @@
import { Group, Edge, IdMap, Source, Block, Target } from 'models'
import { Group, Edge, IdMap, Source, Block, Target } from '@typebot.io/schemas'
import {
createContext,
Dispatch,

View File

@@ -1,4 +1,4 @@
import { Group } from 'models'
import { Group } from '@typebot.io/schemas'
import {
ReactNode,
useState,

View File

@@ -36,7 +36,7 @@ import {
LogicBlockType,
defaultWaitOptions,
defaultScriptOptions,
} from 'models'
} from '@typebot.io/schemas'
import {
stubLength,
blockWidth,
@@ -54,7 +54,7 @@ import {
isChoiceInput,
isConditionBlock,
isDefined,
} from 'utils'
} from '@typebot.io/lib'
const roundSize = 20