diff --git a/frontend/src/components/visual-editor/form/PluginMessageForm.tsx b/frontend/src/components/visual-editor/form/PluginMessageForm.tsx index 9bbb3d3d..cf9edf90 100644 --- a/frontend/src/components/visual-editor/form/PluginMessageForm.tsx +++ b/frontend/src/components/visual-editor/form/PluginMessageForm.tsx @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Hexastack. All rights reserved. + * Copyright © 2025 Hexastack. All rights reserved. * * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. @@ -16,8 +16,8 @@ import { useFind } from "@/hooks/crud/useFind"; import { EntityType } from "@/services/types"; import { IBlockAttributes } from "@/types/block.types"; import { StdPluginMessage } from "@/types/message.types"; - import { getNamespace } from "@/utils/string"; + import { useBlock } from "./BlockFormProvider"; const PluginMessageForm = () => { diff --git a/frontend/src/components/visual-editor/form/inputs/triggers/OutcomeInput.tsx b/frontend/src/components/visual-editor/form/inputs/triggers/OutcomeInput.tsx index 0864106c..a5b04bc9 100644 --- a/frontend/src/components/visual-editor/form/inputs/triggers/OutcomeInput.tsx +++ b/frontend/src/components/visual-editor/form/inputs/triggers/OutcomeInput.tsx @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Hexastack. All rights reserved. + * Copyright © 2025 Hexastack. All rights reserved. * * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. @@ -22,9 +22,9 @@ import { useTranslate } from "@/hooks/useTranslate"; import { theme } from "@/layout/themes/theme"; import { EntityType } from "@/services/types"; import { IBlock, PayloadPattern } from "@/types/block.types"; - import { PayloadType } from "@/types/message.types"; import { getNamespace } from "@/utils/string"; + import { useBlock } from "../../BlockFormProvider"; type PayloadOption = PayloadPattern & { @@ -76,7 +76,6 @@ export const OutcomeInput = ({ defaultValue, onChange }: OutcomeInputProps) => { ), [block?.previousBlocks, getBlockFromCache], ); - const isOptionsReady = !defaultValue || options.find((o) => o.value === defaultValue.value); diff --git a/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx b/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx index 0772d4cc..6fdfba6e 100644 --- a/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx +++ b/frontend/src/components/visual-editor/hooks/useVisualEditor.tsx @@ -256,7 +256,7 @@ const VisualEditorProvider: React.FC = ({ const createNode = (payload: any) => { payload.position = payload.position || getCentroid(); payload.category = payload.category || selectedCategoryId; - console.log("====", payload); + return createBlock(payload, { onSuccess({ id }) { addNode({