Introduce bot v2 in builder (#328)

Also, the new engine is the default for updated typebots for viewer

Closes #211
This commit is contained in:
Baptiste Arnaud
2023-02-21 15:25:14 +01:00
committed by GitHub
parent 527dc8a5b1
commit debdac12ff
208 changed files with 4462 additions and 5236 deletions

View File

@@ -64,6 +64,7 @@ export const BlockNode = ({
setFocusedGroupId,
previewingEdge,
isReadOnly,
previewingBlock,
} = useGraph()
const { mouseOverBlock, setMouseOverBlock } = useBlockDnd()
const { typebot, updateBlock } = useTypebot()
@@ -76,7 +77,10 @@ export const BlockNode = ({
)
const blockRef = useRef<HTMLDivElement | null>(null)
const isPreviewing = isConnecting || previewingEdge?.to.blockId === block.id
const isPreviewing =
isConnecting ||
previewingEdge?.to.blockId === block.id ||
previewingBlock?.id === block.id
const onDrag = (position: NodePosition) => {
if (block.type === 'start' || !onMouseDown) return

View File

@@ -61,6 +61,7 @@ const NonMemoizedDraggableGroupNode = ({
connectingIds,
setConnectingIds,
previewingEdge,
previewingBlock,
isReadOnly,
focusedGroupId,
setFocusedGroupId,
@@ -91,6 +92,7 @@ const NonMemoizedDraggableGroupNode = ({
}, [group.title])
const isPreviewing =
previewingBlock?.groupId === group.id ||
previewingEdge?.from.groupId === group.id ||
(previewingEdge?.to.groupId === group.id &&
isNotDefined(previewingEdge.to.blockId))