diff --git a/apps/builder/src/features/blocks/inputs/buttons/components/ButtonsItemNode.tsx b/apps/builder/src/features/blocks/inputs/buttons/components/ButtonsItemNode.tsx index 4dc9661fbb8..b495bc5755c 100644 --- a/apps/builder/src/features/blocks/inputs/buttons/components/ButtonsItemNode.tsx +++ b/apps/builder/src/features/blocks/inputs/buttons/components/ButtonsItemNode.tsx @@ -54,10 +54,7 @@ export const ButtonsItemNode = ({ item, indices, isMouseOver }: Props) => { const handlePlusClick = () => { const itemIndex = indices.itemIndex + 1 - createItem( - { blockId: item.blockId, type: ItemType.BUTTON }, - { ...indices, itemIndex } - ) + createItem({ type: ItemType.BUTTON }, { ...indices, itemIndex }) } const updateItemSettings = (settings: Omit) => { diff --git a/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemNode.tsx b/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemNode.tsx index 4e5562562e2..a2381c52d91 100644 --- a/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemNode.tsx +++ b/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemNode.tsx @@ -40,10 +40,7 @@ export const PictureChoiceItemNode = ({ const handlePlusClick = (e: React.MouseEvent) => { e.stopPropagation() const itemIndex = indices.itemIndex + 1 - createItem( - { blockId: item.blockId, type: ItemType.PICTURE_CHOICE }, - { ...indices, itemIndex } - ) + createItem({ type: ItemType.PICTURE_CHOICE }, { ...indices, itemIndex }) } const handleMouseDown = (e: React.MouseEvent) => e.stopPropagation() @@ -139,6 +136,10 @@ export const PictureChoiceItemNode = ({ )} diff --git a/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx b/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx index 33d9527ef9b..d13271ff450 100644 --- a/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx +++ b/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx @@ -17,12 +17,14 @@ import { Condition, LogicalOperator } from '@typebot.io/schemas' type Props = { typebotId: string + blockId: string item: PictureChoiceItem onItemChange: (updates: Partial) => void } export const PictureChoiceItemSettings = ({ typebotId, + blockId, item, onItemChange, }: Props) => { @@ -67,7 +69,7 @@ export const PictureChoiceItemSettings = ({ { updateImage(url) diff --git a/apps/builder/src/features/blocks/inputs/pictureChoice/pictureChoice.spec.ts b/apps/builder/src/features/blocks/inputs/pictureChoice/pictureChoice.spec.ts index 2567cb7c33b..deab9400338 100644 --- a/apps/builder/src/features/blocks/inputs/pictureChoice/pictureChoice.spec.ts +++ b/apps/builder/src/features/blocks/inputs/pictureChoice/pictureChoice.spec.ts @@ -25,7 +25,6 @@ test.describe.parallel('Picture choice input block', () => { items: [ { id: 'choice1', - blockId: 'block1', type: ItemType.PICTURE_CHOICE, }, ], diff --git a/apps/builder/src/features/blocks/logic/condition/components/ConditionItemNode.tsx b/apps/builder/src/features/blocks/logic/condition/components/ConditionItemNode.tsx index 801a3ca845d..9bee08727cf 100644 --- a/apps/builder/src/features/blocks/logic/condition/components/ConditionItemNode.tsx +++ b/apps/builder/src/features/blocks/logic/condition/components/ConditionItemNode.tsx @@ -54,7 +54,6 @@ export const ConditionItemNode = ({ item, isMouseOver, indices }: Props) => { const newItemId = createId() createItem( { - blockId: item.blockId, type: ItemType.CONDITION, id: newItemId, }, diff --git a/apps/builder/src/features/dashboard/queries/importTypebotQuery.ts b/apps/builder/src/features/dashboard/queries/importTypebotQuery.ts index 0f83cdd32dd..3176c54043b 100644 --- a/apps/builder/src/features/dashboard/queries/importTypebotQuery.ts +++ b/apps/builder/src/features/dashboard/queries/importTypebotQuery.ts @@ -117,7 +117,6 @@ const duplicateTypebot = ( ...newIds, items: block.items.map((item) => ({ ...item, - blockId: blockIdsMapping.get(item.blockId) as string, outgoingEdgeId: item.outgoingEdgeId ? (edgeIdsMapping.get(item.outgoingEdgeId) as string) : undefined, diff --git a/apps/docs/openapi/builder/_spec_.json b/apps/docs/openapi/builder/_spec_.json index cc3c2418684..afde81ba003 100644 --- a/apps/docs/openapi/builder/_spec_.json +++ b/apps/docs/openapi/builder/_spec_.json @@ -846,7 +846,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -927,7 +928,6 @@ }, "required": [ "id", - "blockId", "type" ], "additionalProperties": false @@ -1608,7 +1608,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -1695,7 +1696,6 @@ }, "required": [ "id", - "blockId", "type" ], "additionalProperties": false @@ -1826,7 +1826,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -1895,7 +1896,6 @@ }, "required": [ "id", - "blockId", "type", "content" ], @@ -2172,7 +2172,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -2192,7 +2193,6 @@ }, "required": [ "id", - "blockId", "type", "path" ], @@ -2205,7 +2205,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -2225,7 +2226,6 @@ }, "required": [ "id", - "blockId", "type", "path" ], diff --git a/apps/docs/openapi/chat/_spec_.json b/apps/docs/openapi/chat/_spec_.json index e78949b8fed..86880b13580 100644 --- a/apps/docs/openapi/chat/_spec_.json +++ b/apps/docs/openapi/chat/_spec_.json @@ -414,7 +414,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -495,7 +496,6 @@ }, "required": [ "id", - "blockId", "type" ], "additionalProperties": false @@ -1176,7 +1176,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -1263,7 +1264,6 @@ }, "required": [ "id", - "blockId", "type" ], "additionalProperties": false @@ -1394,7 +1394,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -1463,7 +1464,6 @@ }, "required": [ "id", - "blockId", "type", "content" ], @@ -1740,7 +1740,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -1760,7 +1761,6 @@ }, "required": [ "id", - "blockId", "type", "path" ], @@ -1773,7 +1773,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -1793,7 +1794,6 @@ }, "required": [ "id", - "blockId", "type", "path" ], @@ -4172,7 +4172,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -4253,7 +4254,6 @@ }, "required": [ "id", - "blockId", "type" ], "additionalProperties": false @@ -4934,7 +4934,8 @@ "type": "string" }, "blockId": { - "type": "string" + "type": "string", + "description": "Deprecated" }, "outgoingEdgeId": { "type": "string" @@ -5021,7 +5022,6 @@ }, "required": [ "id", - "blockId", "type" ], "additionalProperties": false diff --git a/packages/schemas/features/items/baseSchemas.ts b/packages/schemas/features/items/baseSchemas.ts index 5681cc4e25a..ee15ecf0cad 100644 --- a/packages/schemas/features/items/baseSchemas.ts +++ b/packages/schemas/features/items/baseSchemas.ts @@ -2,7 +2,7 @@ import { z } from 'zod' export const itemBaseSchema = z.object({ id: z.string(), - blockId: z.string(), + blockId: z.string().optional().describe('Deprecated'), outgoingEdgeId: z.string().optional(), })