// @subframe/sync-disable // @ts-nocheck "use client"; /* * Documentation: * Node Workflow Engine — https://app.subframe.com/f023064a5ca0/library?component=Node+Workflow+Engine_e75d1b96-38eb-4380-aef0-a320a2d99e5c */ import React from "react"; import { FeatherAlertCircle } from "@subframe/core"; import { FeatherArrowRightLeft } from "@subframe/core"; import { FeatherBellRing } from "@subframe/core"; import { FeatherCalendar } from "@subframe/core"; import { FeatherCalendarClock } from "@subframe/core"; import { FeatherCalendarPlus } from "@subframe/core"; import { FeatherCalendarX } from "@subframe/core"; import { FeatherCheck } from "@subframe/core"; import { FeatherClipboardCheck } from "@subframe/core"; import { FeatherClipboardList } from "@subframe/core"; import { FeatherClock } from "@subframe/core"; import { FeatherFilter } from "@subframe/core"; import { FeatherFolderPlus } from "@subframe/core"; import { FeatherGitBranch } from "@subframe/core"; import { FeatherGitMerge } from "@subframe/core"; import { FeatherGitPullRequest } from "@subframe/core"; import { FeatherGlobe } from "@subframe/core"; import { FeatherInbox } from "@subframe/core"; import { FeatherMail } from "@subframe/core"; import { FeatherMailX } from "@subframe/core"; import { FeatherPlus } from "@subframe/core"; import { FeatherRepeat } from "@subframe/core"; import { FeatherSignpost } from "@subframe/core"; import { FeatherSquareCheck } from "@subframe/core"; import { FeatherStickyNote } from "@subframe/core"; import { FeatherTimer } from "@subframe/core"; import { FeatherTrophy } from "@subframe/core"; import { FeatherUserCheck } from "@subframe/core"; import { FeatherUserCog } from "@subframe/core"; import { FeatherUserPen } from "@subframe/core"; import { FeatherUserPlus } from "@subframe/core"; import { FeatherVariable } from "@subframe/core"; import { FeatherWebhook } from "@subframe/core"; import { FeatherZap } from "@subframe/core"; import * as SubframeCore from "@subframe/core"; import * as SubframeUtils from "../../utils"; export interface KatalogProps extends React.HTMLAttributes { className?: string; } const Katalog = React.forwardRef(function Katalog( { className, ...otherProps }: KatalogProps, ref ) { return (
Auslöser
Aktionen: Daten & CRM
Aktionen: Kommunikation
Aktionen: Aufgaben
Logik
Integration
); }); export interface NodeItemProps extends Omit, "title"> { art?: | "ausloeser" | "aktion" | "logik" | "multi-logik-3" | "multi-logik-4" | "ereignis"; farbe?: "gruen" | "violett" | "blau" | "rot" | "amber" | "grau"; status?: "standard" | "laeuft" | "fehler" | "erfolgreich"; icon?: React.ReactNode; title?: React.ReactNode; beschreibung?: React.ReactNode; ausgewaehlt?: boolean; inaktiv?: boolean; portLabel1?: React.ReactNode; portLabel2?: React.ReactNode; connectedOutputPorts?: number[]; onInputPortClick?: () => void; onOutputPortClick?: (port: number) => void; onAddAfter?: (port: number) => void; className?: string; } const NodeItem = React.forwardRef( function NodeItem( { art = "aktion", farbe = "blau", status = "standard", icon = , title, beschreibung, ausgewaehlt = false, inaktiv = false, portLabel1, portLabel2, connectedOutputPorts = [], onInputPortClick, onOutputPortClick, onAddAfter, className, ...otherProps }: NodeItemProps, ref ) { return (
onInputPortClick?.()} />
onInputPortClick?.()} />
{icon ? ( {icon} ) : null}
onOutputPortClick?.(1)} onAddClick={() => onAddAfter?.(1)} />
onOutputPortClick?.(2)} onAddClick={() => onAddAfter?.(2)} />
onOutputPortClick?.(3)} onAddClick={() => onAddAfter?.(3)} />
onOutputPortClick?.(4)} onAddClick={() => onAddAfter?.(4)} />
{title} {beschreibung}
); } ); export interface PortProps extends React.HTMLAttributes { label?: React.ReactNode; richtung?: "keine" | "rechts" | "oben" | "unten"; portType?: "input" | "output"; portIndex?: number; connected?: boolean; onPortClick?: React.MouseEventHandler; onAddClick?: React.MouseEventHandler; className?: string; } const Port = React.forwardRef(function Port( { label, richtung = "keine", portType, portIndex, connected = false, onPortClick, onAddClick, className, ...otherProps }: PortProps, ref ) { const handlePortClick: React.MouseEventHandler = (event) => { event.stopPropagation(); onPortClick?.(event); }; const handleAddClick: React.MouseEventHandler = (event) => { event.stopPropagation(); onAddClick?.(event); }; return (
); }); export interface StatusBadgeProps extends React.HTMLAttributes { status?: "fehler" | "laeuft" | "erfolgreich"; className?: string; } const StatusBadge = React.forwardRef( function StatusBadge( { status = "erfolgreich", className, ...otherProps }: StatusBadgeProps, ref ) { return (
{status === "fehler" ? ( ) : ( )}
); } ); export interface NodeWorkflowEngineRootProps extends Omit, "title"> { art?: | "neuer-kontakt" | "kontakt-geaendert" | "neue-anfrage" | "lead-qualifiziert" | "projekt-gewonnen" | "status-gewechselt" | "projekt-angelegt" | "deadline-naht" | "email-eingegangen" | "email-unzustellbar" | "formular-abgeschickt" | "termin-gebucht" | "termin-storniert" | "ereignis-erstellt" | "zeitplan" | "webhook-empfangen" | "kontakt-aendern" | "notiz-anlegen" | "benachrichtigung-senden" | "aufgabe-anlegen" | "aufgabe-zuweisen" | "wenn-dann" | "warten" | "schleife" | "oder" | "und" | "switch" | "wert-setzen" | "filter" | "http-anfrage" | "pds-synchronisieren"; onInputPortClick?: () => void; onOutputPortClick?: (port: number) => void; onAddAfter?: (port: number) => void; connectedOutputPorts?: number[]; title?: React.ReactNode; beschreibung?: React.ReactNode; className?: string; } const NodeWorkflowEngineRoot = React.forwardRef< HTMLDivElement, NodeWorkflowEngineRootProps >(function NodeWorkflowEngineRoot( { art = "neuer-kontakt", onInputPortClick, onOutputPortClick, onAddAfter, connectedOutputPorts = [], title, beschreibung, className, ...otherProps }: NodeWorkflowEngineRootProps, ref ) { return (
) : art === "http-anfrage" ? ( ) : art === "filter" ? ( ) : art === "wert-setzen" ? ( ) : art === "switch" ? ( ) : art === "und" ? ( ) : art === "oder" ? ( ) : art === "schleife" ? ( ) : art === "warten" ? ( ) : art === "wenn-dann" ? ( ) : art === "aufgabe-zuweisen" ? ( ) : art === "aufgabe-anlegen" ? ( ) : art === "benachrichtigung-senden" ? ( ) : art === "notiz-anlegen" ? ( ) : art === "kontakt-aendern" ? ( ) : art === "webhook-empfangen" ? ( ) : art === "zeitplan" ? ( ) : art === "ereignis-erstellt" ? ( ) : art === "termin-storniert" ? ( ) : art === "termin-gebucht" ? ( ) : art === "formular-abgeschickt" ? ( ) : art === "email-unzustellbar" ? ( ) : art === "email-eingegangen" ? ( ) : art === "deadline-naht" ? ( ) : art === "projekt-angelegt" ? ( ) : art === "status-gewechselt" ? ( ) : art === "projekt-gewonnen" ? ( ) : art === "lead-qualifiziert" ? ( ) : art === "neue-anfrage" ? ( ) : art === "kontakt-geaendert" ? ( ) : ( ) } title={ title ?? (art === "pds-synchronisieren" ? "PDS synchronisieren" : art === "http-anfrage" ? "HTTP-Anfrage" : art === "filter" ? "Filter" : art === "wert-setzen" ? "Wert setzen" : art === "switch" ? "Switch" : art === "und" ? "Und" : art === "oder" ? "Oder" : art === "schleife" ? "Schleife" : art === "warten" ? "Warten" : art === "wenn-dann" ? "Wenn-Dann" : art === "aufgabe-zuweisen" ? "Aufgabe zuweisen" : art === "aufgabe-anlegen" ? "Aufgabe anlegen" : art === "benachrichtigung-senden" ? "Benachrichtigung senden" : art === "notiz-anlegen" ? "Notiz anlegen" : art === "kontakt-aendern" ? "Kontakt ändern" : art === "webhook-empfangen" ? "Webhook empfangen" : art === "zeitplan" ? "Zeitplan" : art === "ereignis-erstellt" ? "Ereignis erstellt" : art === "termin-storniert" ? "Termin storniert" : art === "termin-gebucht" ? "Termin gebucht" : art === "formular-abgeschickt" ? "Formular abgeschickt" : art === "email-unzustellbar" ? "E-Mail unzustellbar" : art === "email-eingegangen" ? "E-Mail eingegangen" : art === "deadline-naht" ? "Deadline naht" : art === "projekt-angelegt" ? "Projekt angelegt" : art === "status-gewechselt" ? "Status gewechselt" : art === "projekt-gewonnen" ? "Projekt gewonnen" : art === "lead-qualifiziert" ? "Lead qualifiziert" : art === "neue-anfrage" ? "Neue Anfrage" : art === "kontakt-geaendert" ? "Kontakt geändert" : "Neuer Kontakt") } beschreibung={ beschreibung ?? (art === "pds-synchronisieren" ? "Daten mit PDS austauschen" : art === "http-anfrage" ? "Externen Dienst aufrufen" : art === "filter" ? "Datensätze filtern" : art === "wert-setzen" ? "Variable setzen oder lesen" : art === "switch" ? "Mehrere Pfade verzweigen" : art === "und" ? "Wenn alle Bedingungen zutreffen" : art === "oder" ? "Wenn mind. eine Bedingung zutrifft" : art === "schleife" ? "Für jedes Element wiederholen" : art === "warten" ? "Pausiert, z. B. 3 Tage" : art === "wenn-dann" ? "Verzweigt nach Bedingung" : art === "aufgabe-zuweisen" ? "Person oder Team zuordnen" : art === "aufgabe-anlegen" ? "Neue Aufgabe erstellen" : art === "benachrichtigung-senden" ? "E-Mail, Push oder intern" : art === "notiz-anlegen" ? "Notiz am Datensatz speichern" : art === "kontakt-aendern" ? "Datensatz aktualisieren" : art === "webhook-empfangen" ? "Wenn ein externes System ruft" : art === "zeitplan" ? "Zu festen Zeiten, z. B. montags 8 Uhr" : art === "ereignis-erstellt" ? "Wenn ein Kalender-Eintrag entsteht" : art === "termin-storniert" ? "Wenn ein Termin abgesagt wird" : art === "termin-gebucht" ? "Wenn ein Termin gebucht wird" : art === "formular-abgeschickt" ? "Wenn ein Formular eingeht" : art === "email-unzustellbar" ? "Wenn eine Kampagnen-Mail bounct" : art === "email-eingegangen" ? "Wenn eine E-Mail ankommt" : art === "deadline-naht" ? "Wenn eine Frist bald abläuft" : art === "projekt-angelegt" ? "Wenn ein Projekt erstellt wird" : art === "status-gewechselt" ? "Wenn eine Karte die Spalte wechselt" : art === "projekt-gewonnen" ? "Wenn ein Projekt gewonnen wird" : art === "lead-qualifiziert" ? "Wenn ein Lead qualifiziert wird" : art === "neue-anfrage" ? "Wenn eine Anfrage eingeht" : art === "kontakt-geaendert" ? "Wenn sich Kontaktdaten ändern" : "Wenn ein Kontakt angelegt wird") } inaktiv={false} portLabel1={ art === "und" ? "Ja" : art === "oder" ? "Ja" : art === "schleife" ? "Weiter" : art === "wenn-dann" ? "Ja" : "1" } portLabel2={ art === "und" ? "Nein" : art === "oder" ? "Nein" : art === "schleife" ? "Fertig" : art === "wenn-dann" ? "Nein" : "2" } onInputPortClick={onInputPortClick} onOutputPortClick={onOutputPortClick} onAddAfter={onAddAfter} connectedOutputPorts={connectedOutputPorts} />
); }); export const NodeWorkflowEngine = Object.assign(NodeWorkflowEngineRoot, { Katalog, NodeItem, Port, StatusBadge, });