/* * Copyright © 2024 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. * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ import BrokenImageOutlinedIcon from "@mui/icons-material/BrokenImageOutlined"; import ChatBubbleOutlineOutlinedIcon from "@mui/icons-material/ChatBubbleOutlineOutlined"; import ExtensionOutlinedIcon from "@mui/icons-material/ExtensionOutlined"; import FastForwardRoundedIcon from "@mui/icons-material/FastForwardRounded"; import MenuRoundedIcon from "@mui/icons-material/MenuRounded"; import PlayArrowRoundedIcon from "@mui/icons-material/PlayArrowRounded"; import ReplyIcon from "@mui/icons-material/Reply"; import { Chip, styled } from "@mui/material"; import { DiagramEngine, PortWidget } from "@projectstorm/react-diagrams-core"; import clsx from "clsx"; import * as React from "react"; import { FC } from "react"; import { withTranslation, WithTranslation } from "react-i18next"; import { UnifiedIcon } from "@/app-components/icons/UnifiedIcon"; import AttachmentIcon from "@/app-components/svg/toolbar/AttachmentIcon"; import ButtonsIcon from "@/app-components/svg/toolbar/ButtonsIcon"; import ListIcon from "@/app-components/svg/toolbar/ListIcon"; import PluginIcon from "@/app-components/svg/toolbar/PluginIcon"; import QuickRepliesIcon from "@/app-components/svg/toolbar/QuickRepliesIcon"; import SimpleTextIcon from "@/app-components/svg/toolbar/SimpleTextIcon"; import TriggerIcon from "@/app-components/svg/TriggerIcon"; import { IBlockFull, Pattern } from "@/types/block.types"; import { BlockPorts, BlockTypes, TBlock } from "@/types/visual-editor.types"; import { truncate } from "@/utils/text"; import { NodeModel } from "./NodeModel"; export const BLOCK_WIDTH = 360; export const BLOCK_HEIGHT = 200; export interface NodeWidgetProps { node: NodeModel; engine: DiagramEngine; color: string; } const IconContainer = styled("div")(({ theme }) => ({ display: "flex", justifyContent: "center", alignItems: "center", backgroundColor: theme.palette.background.paper, borderRadius: "100%", padding: "1px", })); export interface NodeWidgetState {} class NodeAbstractWidget extends React.Component< NodeWidgetProps & WithTranslation, NodeWidgetState > { constructor(props: NodeWidgetProps & WithTranslation) { super(props); this.state = {}; } render() { return (