@oneuptime/common 10.0.39 → 10.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/AnalyticsModels/Index.ts +4 -0
- package/Models/AnalyticsModels/Profile.ts +687 -0
- package/Models/AnalyticsModels/ProfileSample.ts +547 -0
- package/Models/DatabaseModels/Dashboard.ts +357 -0
- package/Models/DatabaseModels/DashboardDomain.ts +658 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/StatusPage.ts +41 -0
- package/Server/API/DashboardAPI.ts +408 -0
- package/Server/API/DashboardDomainAPI.ts +235 -0
- package/Server/API/StatusPageAPI.ts +36 -2
- package/Server/API/TelemetryAPI.ts +393 -0
- package/Server/EnvironmentConfig.ts +12 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.ts +97 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.ts +50 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.ts +59 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Middleware/UserAuthorization.ts +96 -1
- package/Server/Services/DashboardDomainService.ts +647 -0
- package/Server/Services/DashboardService.ts +174 -3
- package/Server/Services/IncidentService.ts +295 -50
- package/Server/Services/IncidentStateTimelineService.ts +1 -0
- package/Server/Services/Index.ts +6 -0
- package/Server/Services/MonitorService.ts +5 -0
- package/Server/Services/ProfileAggregationService.ts +559 -0
- package/Server/Services/ProfileSampleService.ts +11 -0
- package/Server/Services/ProfileService.ts +11 -0
- package/Server/Services/TelemetryUsageBillingService.ts +77 -3
- package/Server/Services/WorkspaceNotificationSummaryService.ts +15 -1
- package/Server/Types/Billing/MeteredPlan/AllMeteredPlans.ts +9 -0
- package/Server/Utils/Cookie.ts +48 -0
- package/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.ts +34 -0
- package/Server/Utils/Monitor/DataToProcess.ts +3 -1
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +299 -0
- package/Server/Utils/Profile/PprofEncoder.ts +225 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +53 -16
- package/Server/Utils/Workspace/Slack/Slack.ts +26 -6
- package/ServiceRoute.ts +2 -0
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +2 -0
- package/Types/CookieName.ts +1 -0
- package/Types/Dashboard/Chart/ChartType.ts +5 -0
- package/Types/Dashboard/DashboardComponentType.ts +4 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +10 -0
- package/Types/Dashboard/DashboardComponents/DashboardChartComponent.ts +1 -2
- package/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.ts +17 -0
- package/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts +15 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.ts +14 -0
- package/Types/Dashboard/DashboardComponents/DashboardTextComponent.ts +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.ts +13 -0
- package/Types/Dashboard/DashboardComponents/DashboardValueComponent.ts +2 -0
- package/Types/Dashboard/DashboardTemplates.ts +964 -0
- package/Types/Dashboard/DashboardVariable.ts +23 -0
- package/Types/Dashboard/DashboardViewConfig.ts +59 -0
- package/Types/Dashboard/MasterPassword.ts +10 -0
- package/Types/Icon/IconProp.ts +1 -0
- package/Types/Incident/IncidentMetricType.ts +3 -0
- package/Types/MeteredPlan/ProductType.ts +1 -0
- package/Types/Metrics/MetricQueryConfigData.ts +3 -0
- package/Types/Monitor/CriteriaFilter.ts +3 -0
- package/Types/Monitor/KubernetesAlertTemplates.ts +78 -7
- package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +20 -0
- package/Types/Monitor/MonitorStep.ts +25 -0
- package/Types/Monitor/MonitorStepProfileMonitor.ts +96 -0
- package/Types/Monitor/MonitorType.ts +11 -0
- package/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.ts +12 -0
- package/Types/Permission.ts +87 -0
- package/Types/Telemetry/TelemetryType.ts +1 -0
- package/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.ts +1 -0
- package/UI/Components/Button/Button.tsx +1 -1
- package/UI/Components/Card/Card.tsx +8 -4
- package/UI/Components/Charts/Area/AreaChart.tsx +4 -0
- package/UI/Components/Charts/Bar/BarChart.tsx +4 -0
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +26 -0
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +26 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +26 -0
- package/UI/Components/Charts/Line/LineChart.tsx +4 -0
- package/UI/Components/Charts/Types/ReferenceLineProps.ts +6 -0
- package/UI/Components/Icon/Icon.tsx +33 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +13 -10
- package/UI/Components/MoreMenu/MoreMenu.tsx +15 -2
- package/UI/Components/MoreMenu/MoreMenuItem.tsx +4 -4
- package/UI/Components/Workflow/Component.tsx +450 -209
- package/UI/Components/Workflow/ComponentPortViewer.tsx +57 -20
- package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +65 -25
- package/UI/Components/Workflow/ComponentSettingsModal.tsx +202 -37
- package/UI/Components/Workflow/ComponentsModal.tsx +180 -93
- package/UI/Components/Workflow/Workflow.tsx +105 -9
- package/UI/Config.ts +9 -0
- package/Utils/Dashboard/Components/DashboardChartComponent.ts +53 -22
- package/Utils/Dashboard/Components/DashboardGaugeComponent.ts +124 -0
- package/Utils/Dashboard/Components/DashboardLogStreamComponent.ts +110 -0
- package/Utils/Dashboard/Components/DashboardTableComponent.ts +86 -0
- package/Utils/Dashboard/Components/DashboardTextComponent.ts +32 -7
- package/Utils/Dashboard/Components/DashboardTraceListComponent.ts +86 -0
- package/Utils/Dashboard/Components/DashboardValueComponent.ts +39 -3
- package/Utils/Dashboard/Components/Index.ts +28 -0
- package/Utils/ValueFormatter.ts +170 -0
- package/build/dist/Models/AnalyticsModels/Index.js +4 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/Profile.js +621 -0
- package/build/dist/Models/AnalyticsModels/Profile.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/ProfileSample.js +497 -0
- package/build/dist/Models/AnalyticsModels/ProfileSample.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Dashboard.js +365 -0
- package/build/dist/Models/DatabaseModels/Dashboard.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DashboardDomain.js +691 -0
- package/build/dist/Models/DatabaseModels/DashboardDomain.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +42 -0
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Server/API/DashboardAPI.js +293 -0
- package/build/dist/Server/API/DashboardAPI.js.map +1 -0
- package/build/dist/Server/API/DashboardDomainAPI.js +124 -0
- package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -0
- package/build/dist/Server/API/StatusPageAPI.js +26 -2
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +222 -0
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +4 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +41 -0
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Services/DashboardDomainService.js +595 -0
- package/build/dist/Server/Services/DashboardDomainService.js.map +1 -0
- package/build/dist/Server/Services/DashboardService.js +117 -3
- package/build/dist/Server/Services/DashboardService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +231 -55
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +6 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +5 -2
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/ProfileAggregationService.js +356 -0
- package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -0
- package/build/dist/Server/Services/ProfileSampleService.js +9 -0
- package/build/dist/Server/Services/ProfileSampleService.js.map +1 -0
- package/build/dist/Server/Services/ProfileService.js +9 -0
- package/build/dist/Server/Services/ProfileService.js.map +1 -0
- package/build/dist/Server/Services/TelemetryUsageBillingService.js +61 -4
- package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +13 -1
- package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
- package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +8 -0
- package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
- package/build/dist/Server/Utils/Cookie.js +36 -0
- package/build/dist/Server/Utils/Cookie.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js +34 -0
- package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +173 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Profile/PprofEncoder.js +129 -0
- package/build/dist/Server/Utils/Profile/PprofEncoder.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +36 -14
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +23 -6
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/ServiceRoute.js +1 -0
- package/build/dist/ServiceRoute.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +2 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/CookieName.js +1 -0
- package/build/dist/Types/CookieName.js.map +1 -1
- package/build/dist/Types/Dashboard/Chart/ChartType.js +5 -0
- package/build/dist/Types/Dashboard/Chart/ChartType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponentType.js +4 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js +853 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardVariable.js +7 -0
- package/build/dist/Types/Dashboard/DashboardVariable.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardViewConfig.js +50 -1
- package/build/dist/Types/Dashboard/DashboardViewConfig.js.map +1 -1
- package/build/dist/Types/Dashboard/MasterPassword.js +5 -0
- package/build/dist/Types/Dashboard/MasterPassword.js.map +1 -0
- package/build/dist/Types/Icon/IconProp.js +1 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/Incident/IncidentMetricType.js +3 -0
- package/build/dist/Types/Incident/IncidentMetricType.js.map +1 -1
- package/build/dist/Types/MeteredPlan/ProductType.js +1 -0
- package/build/dist/Types/MeteredPlan/ProductType.js.map +1 -1
- package/build/dist/Types/Metrics/MetricQueryConfigData.js +1 -0
- package/build/dist/Types/Metrics/MetricQueryConfigData.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +2 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +58 -7
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +15 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js +59 -0
- package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorType.js +10 -0
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js +2 -0
- package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js.map +1 -0
- package/build/dist/Types/Permission.js +75 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetryType.js +1 -0
- package/build/dist/Types/Telemetry/TelemetryType.js.map +1 -1
- package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js +1 -0
- package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js.map +1 -1
- package/build/dist/UI/Components/Button/Button.js +1 -1
- package/build/dist/UI/Components/Button/Button.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +4 -4
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +5 -2
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +5 -2
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +6 -3
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js +2 -0
- package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js.map +1 -0
- package/build/dist/UI/Components/Icon/Icon.js +11 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +12 -9
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js +8 -2
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js +4 -4
- package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Component.js +311 -143
- package/build/dist/UI/Components/Workflow/Component.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentPortViewer.js +44 -18
- package/build/dist/UI/Components/Workflow/ComponentPortViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +48 -22
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +127 -21
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +107 -52
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Workflow.js +87 -12
- package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
- package/build/dist/UI/Config.js +3 -1
- package/build/dist/UI/Config.js.map +1 -1
- package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js +50 -21
- package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js.map +1 -1
- package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js +104 -0
- package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js +91 -0
- package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js +70 -0
- package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js +28 -7
- package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js.map +1 -1
- package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js +70 -0
- package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js +34 -3
- package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js.map +1 -1
- package/build/dist/Utils/Dashboard/Components/Index.js +16 -0
- package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
- package/build/dist/Utils/ValueFormatter.js +132 -0
- package/build/dist/Utils/ValueFormatter.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import Icon, { ThickProp } from "../Icon/Icon";
|
|
2
|
-
import Pill from "../Pill/Pill";
|
|
3
2
|
import Tooltip from "../Tooltip/Tooltip";
|
|
4
|
-
import { Green } from "../../../Types/BrandColors";
|
|
5
3
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
6
4
|
import {
|
|
7
5
|
ComponentType,
|
|
@@ -17,106 +15,272 @@ export interface ComponentProps {
|
|
|
17
15
|
selected: boolean;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
type CategoryColorScheme = {
|
|
19
|
+
bg: string;
|
|
20
|
+
border: string;
|
|
21
|
+
headerBg: string;
|
|
22
|
+
headerText: string;
|
|
23
|
+
iconColor: string;
|
|
24
|
+
selectedBorder: string;
|
|
25
|
+
selectedShadow: string;
|
|
26
|
+
handleBg: string;
|
|
27
|
+
handleBorder: string;
|
|
28
|
+
};
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
const getCategoryColors: (
|
|
31
|
+
category: string,
|
|
32
|
+
componentType: ComponentType,
|
|
33
|
+
) => CategoryColorScheme = (
|
|
34
|
+
category: string,
|
|
35
|
+
componentType: ComponentType,
|
|
36
|
+
): CategoryColorScheme => {
|
|
37
|
+
if (componentType === ComponentType.Trigger) {
|
|
38
|
+
return {
|
|
39
|
+
bg: "#fefce8",
|
|
40
|
+
border: "#fde68a",
|
|
41
|
+
headerBg: "linear-gradient(135deg, #f59e0b, #d97706)",
|
|
42
|
+
headerText: "#ffffff",
|
|
43
|
+
iconColor: "#ffffff",
|
|
44
|
+
selectedBorder: "#f59e0b",
|
|
45
|
+
selectedShadow: "0 0 0 3px rgba(245, 158, 11, 0.2)",
|
|
46
|
+
handleBg: "#f59e0b",
|
|
47
|
+
handleBorder: "#d97706",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
25
50
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
const lowerCategory: string = category.toLowerCase();
|
|
52
|
+
|
|
53
|
+
if (lowerCategory.includes("condition") || lowerCategory.includes("logic")) {
|
|
54
|
+
return {
|
|
55
|
+
bg: "#faf5ff",
|
|
56
|
+
border: "#e9d5ff",
|
|
57
|
+
headerBg: "linear-gradient(135deg, #a855f7, #7c3aed)",
|
|
58
|
+
headerText: "#ffffff",
|
|
59
|
+
iconColor: "#ffffff",
|
|
60
|
+
selectedBorder: "#a855f7",
|
|
61
|
+
selectedShadow: "0 0 0 3px rgba(168, 85, 247, 0.2)",
|
|
62
|
+
handleBg: "#a855f7",
|
|
63
|
+
handleBorder: "#7c3aed",
|
|
64
|
+
};
|
|
29
65
|
}
|
|
30
66
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
67
|
+
if (lowerCategory.includes("api") || lowerCategory.includes("webhook")) {
|
|
68
|
+
return {
|
|
69
|
+
bg: "#eff6ff",
|
|
70
|
+
border: "#bfdbfe",
|
|
71
|
+
headerBg: "linear-gradient(135deg, #3b82f6, #2563eb)",
|
|
72
|
+
headerText: "#ffffff",
|
|
73
|
+
iconColor: "#ffffff",
|
|
74
|
+
selectedBorder: "#3b82f6",
|
|
75
|
+
selectedShadow: "0 0 0 3px rgba(59, 130, 246, 0.2)",
|
|
76
|
+
handleBg: "#3b82f6",
|
|
77
|
+
handleBorder: "#2563eb",
|
|
78
|
+
};
|
|
79
|
+
}
|
|
44
80
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
81
|
+
if (
|
|
82
|
+
lowerCategory.includes("slack") ||
|
|
83
|
+
lowerCategory.includes("discord") ||
|
|
84
|
+
lowerCategory.includes("teams") ||
|
|
85
|
+
lowerCategory.includes("telegram") ||
|
|
86
|
+
lowerCategory.includes("email") ||
|
|
87
|
+
lowerCategory.includes("notification")
|
|
88
|
+
) {
|
|
89
|
+
return {
|
|
90
|
+
bg: "#ecfdf5",
|
|
91
|
+
border: "#a7f3d0",
|
|
92
|
+
headerBg: "linear-gradient(135deg, #10b981, #059669)",
|
|
93
|
+
headerText: "#ffffff",
|
|
94
|
+
iconColor: "#ffffff",
|
|
95
|
+
selectedBorder: "#10b981",
|
|
96
|
+
selectedShadow: "0 0 0 3px rgba(16, 185, 129, 0.2)",
|
|
97
|
+
handleBg: "#10b981",
|
|
98
|
+
handleBorder: "#059669",
|
|
99
|
+
};
|
|
100
|
+
}
|
|
50
101
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
)
|
|
102
|
+
if (
|
|
103
|
+
lowerCategory.includes("code") ||
|
|
104
|
+
lowerCategory.includes("javascript") ||
|
|
105
|
+
lowerCategory.includes("custom")
|
|
106
|
+
) {
|
|
107
|
+
return {
|
|
108
|
+
bg: "#fef2f2",
|
|
109
|
+
border: "#fecaca",
|
|
110
|
+
headerBg: "linear-gradient(135deg, #ef4444, #dc2626)",
|
|
111
|
+
headerText: "#ffffff",
|
|
112
|
+
iconColor: "#ffffff",
|
|
113
|
+
selectedBorder: "#ef4444",
|
|
114
|
+
selectedShadow: "0 0 0 3px rgba(239, 68, 68, 0.2)",
|
|
115
|
+
handleBg: "#ef4444",
|
|
116
|
+
handleBorder: "#dc2626",
|
|
117
|
+
};
|
|
118
|
+
}
|
|
56
119
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
120
|
+
if (lowerCategory.includes("json") || lowerCategory.includes("util")) {
|
|
121
|
+
return {
|
|
122
|
+
bg: "#f0fdf4",
|
|
123
|
+
border: "#bbf7d0",
|
|
124
|
+
headerBg: "linear-gradient(135deg, #22c55e, #16a34a)",
|
|
125
|
+
headerText: "#ffffff",
|
|
126
|
+
iconColor: "#ffffff",
|
|
127
|
+
selectedBorder: "#22c55e",
|
|
128
|
+
selectedShadow: "0 0 0 3px rgba(34, 197, 94, 0.2)",
|
|
129
|
+
handleBg: "#22c55e",
|
|
130
|
+
handleBorder: "#16a34a",
|
|
131
|
+
};
|
|
132
|
+
}
|
|
65
133
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
134
|
+
if (
|
|
135
|
+
lowerCategory.includes("schedule") ||
|
|
136
|
+
lowerCategory.includes("cron") ||
|
|
137
|
+
lowerCategory.includes("timer")
|
|
138
|
+
) {
|
|
139
|
+
return {
|
|
140
|
+
bg: "#fff7ed",
|
|
141
|
+
border: "#fed7aa",
|
|
142
|
+
headerBg: "linear-gradient(135deg, #f97316, #ea580c)",
|
|
143
|
+
headerText: "#ffffff",
|
|
144
|
+
iconColor: "#ffffff",
|
|
145
|
+
selectedBorder: "#f97316",
|
|
146
|
+
selectedShadow: "0 0 0 3px rgba(249, 115, 22, 0.2)",
|
|
147
|
+
handleBg: "#f97316",
|
|
148
|
+
handleBorder: "#ea580c",
|
|
149
|
+
};
|
|
150
|
+
}
|
|
69
151
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
152
|
+
// Default / database models
|
|
153
|
+
return {
|
|
154
|
+
bg: "#f8fafc",
|
|
155
|
+
border: "#e2e8f0",
|
|
156
|
+
headerBg: "linear-gradient(135deg, #6366f1, #4f46e5)",
|
|
157
|
+
headerText: "#ffffff",
|
|
158
|
+
iconColor: "#ffffff",
|
|
159
|
+
selectedBorder: "#6366f1",
|
|
160
|
+
selectedShadow: "0 0 0 3px rgba(99, 102, 241, 0.2)",
|
|
161
|
+
handleBg: "#6366f1",
|
|
162
|
+
handleBorder: "#4f46e5",
|
|
163
|
+
};
|
|
164
|
+
};
|
|
73
165
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
166
|
+
type GetPortPositionFunction = (
|
|
167
|
+
portCount: number,
|
|
168
|
+
totalPorts: number,
|
|
169
|
+
isLabel: boolean,
|
|
170
|
+
) => React.CSSProperties;
|
|
77
171
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
172
|
+
const getPortPosition: GetPortPositionFunction = (
|
|
173
|
+
portCount: number,
|
|
174
|
+
totalPorts: number,
|
|
175
|
+
isLabel: boolean,
|
|
176
|
+
): React.CSSProperties => {
|
|
177
|
+
if (portCount === 1 && totalPorts === 1) {
|
|
178
|
+
return isLabel ? { left: 120 } : {};
|
|
179
|
+
}
|
|
81
180
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
181
|
+
if (portCount === 1 && totalPorts === 2) {
|
|
182
|
+
return { left: isLabel ? 70 : 80 };
|
|
183
|
+
}
|
|
85
184
|
|
|
86
|
-
|
|
87
|
-
return {};
|
|
88
|
-
}
|
|
185
|
+
if (portCount === 2 && totalPorts === 2) {
|
|
186
|
+
return { left: isLabel ? 170 : 180 };
|
|
187
|
+
}
|
|
89
188
|
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
height: "0.75rem",
|
|
94
|
-
width: "0.75rem",
|
|
95
|
-
};
|
|
189
|
+
if (portCount === 1 && totalPorts === 3) {
|
|
190
|
+
return { left: isLabel ? 40 : 50 };
|
|
191
|
+
}
|
|
96
192
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
verticalAlign: "middle",
|
|
105
|
-
borderColor: isHovering ? "#94a3b8" : "#cbd5e1",
|
|
106
|
-
borderRadius: "0.25rem",
|
|
107
|
-
borderWidth: "2px",
|
|
108
|
-
backgroundColor: "white",
|
|
109
|
-
};
|
|
193
|
+
if (portCount === 2 && totalPorts === 3) {
|
|
194
|
+
return isLabel ? { left: 120 } : {};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (portCount === 3 && totalPorts === 3) {
|
|
198
|
+
return { left: isLabel ? 200 : 210 };
|
|
199
|
+
}
|
|
110
200
|
|
|
111
|
-
|
|
112
|
-
|
|
201
|
+
return {};
|
|
202
|
+
};
|
|
113
203
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
204
|
+
const Node: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
205
|
+
const [isHovering, setIsHovering] = useState<boolean>(false);
|
|
206
|
+
|
|
207
|
+
const colors: CategoryColorScheme = getCategoryColors(
|
|
208
|
+
props.data.metadata.category || "",
|
|
209
|
+
props.data.metadata.componentType,
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
// Placeholder node
|
|
213
|
+
if (props.data.nodeType === NodeType.PlaceholderNode) {
|
|
214
|
+
return (
|
|
215
|
+
<div
|
|
216
|
+
className="cursor-pointer"
|
|
217
|
+
onMouseOver={() => {
|
|
218
|
+
setIsHovering(true);
|
|
219
|
+
}}
|
|
220
|
+
onMouseOut={() => {
|
|
221
|
+
setIsHovering(false);
|
|
222
|
+
}}
|
|
223
|
+
style={{
|
|
224
|
+
width: "16rem",
|
|
225
|
+
borderRadius: "12px",
|
|
226
|
+
border: `2px dashed ${isHovering ? "#94a3b8" : "#cbd5e1"}`,
|
|
227
|
+
backgroundColor: isHovering ? "#f8fafc" : "#ffffff",
|
|
228
|
+
padding: "1.5rem",
|
|
229
|
+
display: "flex",
|
|
230
|
+
flexDirection: "column",
|
|
231
|
+
alignItems: "center",
|
|
232
|
+
justifyContent: "center",
|
|
233
|
+
gap: "0.75rem",
|
|
234
|
+
transition: "all 0.2s ease",
|
|
235
|
+
minHeight: "7rem",
|
|
236
|
+
}}
|
|
237
|
+
onClick={() => {
|
|
238
|
+
if (props.data.onClick) {
|
|
239
|
+
props.data.onClick(props.data);
|
|
240
|
+
}
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
<div
|
|
244
|
+
style={{
|
|
245
|
+
width: "2.5rem",
|
|
246
|
+
height: "2.5rem",
|
|
247
|
+
borderRadius: "50%",
|
|
248
|
+
backgroundColor: isHovering ? "#e2e8f0" : "#f1f5f9",
|
|
249
|
+
display: "flex",
|
|
250
|
+
alignItems: "center",
|
|
251
|
+
justifyContent: "center",
|
|
252
|
+
transition: "all 0.2s ease",
|
|
253
|
+
}}
|
|
254
|
+
>
|
|
255
|
+
<Icon
|
|
256
|
+
icon={IconProp.Add}
|
|
257
|
+
style={{
|
|
258
|
+
color: isHovering ? "#64748b" : "#94a3b8",
|
|
259
|
+
width: "1.25rem",
|
|
260
|
+
height: "1.25rem",
|
|
261
|
+
transition: "all 0.2s ease",
|
|
262
|
+
}}
|
|
263
|
+
/>
|
|
264
|
+
</div>
|
|
265
|
+
<p
|
|
266
|
+
style={{
|
|
267
|
+
color: isHovering ? "#64748b" : "#94a3b8",
|
|
268
|
+
fontSize: "0.8125rem",
|
|
269
|
+
fontWeight: 500,
|
|
270
|
+
textAlign: "center",
|
|
271
|
+
margin: 0,
|
|
272
|
+
transition: "all 0.2s ease",
|
|
273
|
+
}}
|
|
274
|
+
>
|
|
275
|
+
{props.data.metadata.description || "Click to add trigger"}
|
|
276
|
+
</p>
|
|
277
|
+
</div>
|
|
278
|
+
);
|
|
118
279
|
}
|
|
119
280
|
|
|
281
|
+
// Regular node
|
|
282
|
+
const hasError: boolean = Boolean(props.data.error);
|
|
283
|
+
|
|
120
284
|
return (
|
|
121
285
|
<div
|
|
122
286
|
className="cursor-pointer"
|
|
@@ -127,8 +291,27 @@ const Node: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
127
291
|
setIsHovering(false);
|
|
128
292
|
}}
|
|
129
293
|
style={{
|
|
130
|
-
|
|
131
|
-
|
|
294
|
+
width: "16rem",
|
|
295
|
+
borderRadius: "12px",
|
|
296
|
+
border: `2px solid ${
|
|
297
|
+
hasError
|
|
298
|
+
? "#fca5a5"
|
|
299
|
+
: props.selected
|
|
300
|
+
? colors.selectedBorder
|
|
301
|
+
: isHovering
|
|
302
|
+
? colors.selectedBorder
|
|
303
|
+
: colors.border
|
|
304
|
+
}`,
|
|
305
|
+
backgroundColor: "#ffffff",
|
|
306
|
+
overflow: "visible",
|
|
307
|
+
boxShadow: props.selected
|
|
308
|
+
? colors.selectedShadow
|
|
309
|
+
: isHovering
|
|
310
|
+
? `0 8px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 10px -6px rgba(0, 0, 0, 0.05)`
|
|
311
|
+
: `0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.05)`,
|
|
312
|
+
transition: "all 0.2s ease",
|
|
313
|
+
transform: isHovering ? "translateY(-1px)" : "none",
|
|
314
|
+
position: "relative",
|
|
132
315
|
}}
|
|
133
316
|
onClick={() => {
|
|
134
317
|
if (props.data.onClick) {
|
|
@@ -136,42 +319,7 @@ const Node: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
136
319
|
}
|
|
137
320
|
}}
|
|
138
321
|
>
|
|
139
|
-
|
|
140
|
-
{props.data.metadata.componentType === ComponentType.Trigger &&
|
|
141
|
-
props.data.nodeType !== NodeType.PlaceholderNode &&
|
|
142
|
-
!props.data.isPreview && <Pill text="Trigger" color={Green} />}
|
|
143
|
-
</div>
|
|
144
|
-
{!props.data.isPreview &&
|
|
145
|
-
props.data.error &&
|
|
146
|
-
props.data.nodeType !== NodeType.PlaceholderNode && (
|
|
147
|
-
<div
|
|
148
|
-
style={{
|
|
149
|
-
width: "20px",
|
|
150
|
-
height: "20px",
|
|
151
|
-
borderRadius: "100px",
|
|
152
|
-
color: "#ef4444",
|
|
153
|
-
position: "absolute",
|
|
154
|
-
top: "0px",
|
|
155
|
-
left: "220px",
|
|
156
|
-
cursor: "pointer",
|
|
157
|
-
}}
|
|
158
|
-
onClick={() => {}}
|
|
159
|
-
>
|
|
160
|
-
<Icon
|
|
161
|
-
icon={IconProp.Alert}
|
|
162
|
-
style={{
|
|
163
|
-
color: "#ef4444",
|
|
164
|
-
width: "1rem",
|
|
165
|
-
height: "1rem",
|
|
166
|
-
textAlign: "center",
|
|
167
|
-
margin: "auto",
|
|
168
|
-
marginTop: "2px",
|
|
169
|
-
}}
|
|
170
|
-
thick={ThickProp.Thick}
|
|
171
|
-
/>
|
|
172
|
-
</div>
|
|
173
|
-
)}
|
|
174
|
-
|
|
322
|
+
{/* In Ports (top handles) */}
|
|
175
323
|
{!props.data.isPreview &&
|
|
176
324
|
props.data.metadata.componentType !== ComponentType.Trigger && (
|
|
177
325
|
<div>
|
|
@@ -187,7 +335,12 @@ const Node: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
187
335
|
isConnectable={true}
|
|
188
336
|
position={Position.Top}
|
|
189
337
|
style={{
|
|
190
|
-
|
|
338
|
+
background: colors.handleBg,
|
|
339
|
+
height: "10px",
|
|
340
|
+
width: "10px",
|
|
341
|
+
border: `2px solid ${colors.handleBorder}`,
|
|
342
|
+
top: "-5px",
|
|
343
|
+
transition: "all 0.15s ease",
|
|
191
344
|
...getPortPosition(
|
|
192
345
|
i + 1,
|
|
193
346
|
props.data.metadata.inPorts.length,
|
|
@@ -200,117 +353,205 @@ const Node: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
200
353
|
</div>
|
|
201
354
|
)}
|
|
202
355
|
|
|
356
|
+
{/* Error indicator */}
|
|
357
|
+
{!props.data.isPreview && hasError && (
|
|
358
|
+
<div
|
|
359
|
+
style={{
|
|
360
|
+
position: "absolute",
|
|
361
|
+
top: "8px",
|
|
362
|
+
right: "8px",
|
|
363
|
+
zIndex: 10,
|
|
364
|
+
width: "22px",
|
|
365
|
+
height: "22px",
|
|
366
|
+
borderRadius: "50%",
|
|
367
|
+
backgroundColor: "#fef2f2",
|
|
368
|
+
display: "flex",
|
|
369
|
+
alignItems: "center",
|
|
370
|
+
justifyContent: "center",
|
|
371
|
+
border: "1px solid #fecaca",
|
|
372
|
+
}}
|
|
373
|
+
>
|
|
374
|
+
<Icon
|
|
375
|
+
icon={IconProp.Alert}
|
|
376
|
+
style={{
|
|
377
|
+
color: "#ef4444",
|
|
378
|
+
width: "0.75rem",
|
|
379
|
+
height: "0.75rem",
|
|
380
|
+
}}
|
|
381
|
+
thick={ThickProp.Thick}
|
|
382
|
+
/>
|
|
383
|
+
</div>
|
|
384
|
+
)}
|
|
385
|
+
|
|
386
|
+
{/* Header bar with gradient */}
|
|
203
387
|
<div
|
|
204
388
|
style={{
|
|
205
|
-
|
|
389
|
+
background: colors.headerBg,
|
|
390
|
+
padding: "0.625rem 0.875rem",
|
|
206
391
|
display: "flex",
|
|
207
|
-
|
|
392
|
+
alignItems: "center",
|
|
393
|
+
gap: "0.5rem",
|
|
394
|
+
borderRadius: "10px 10px 0 0",
|
|
208
395
|
}}
|
|
209
396
|
>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
397
|
+
{props.data.metadata.iconProp && (
|
|
398
|
+
<div
|
|
399
|
+
style={{
|
|
400
|
+
width: "1.75rem",
|
|
401
|
+
height: "1.75rem",
|
|
402
|
+
borderRadius: "6px",
|
|
403
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)",
|
|
404
|
+
display: "flex",
|
|
405
|
+
alignItems: "center",
|
|
406
|
+
justifyContent: "center",
|
|
407
|
+
flexShrink: 0,
|
|
408
|
+
}}
|
|
409
|
+
>
|
|
217
410
|
<Icon
|
|
218
411
|
icon={props.data.metadata.iconProp}
|
|
219
412
|
style={{
|
|
220
|
-
color:
|
|
221
|
-
width: "
|
|
222
|
-
height: "
|
|
223
|
-
textAlign: "center",
|
|
224
|
-
margin: "auto",
|
|
413
|
+
color: colors.iconColor,
|
|
414
|
+
width: "0.875rem",
|
|
415
|
+
height: "0.875rem",
|
|
225
416
|
}}
|
|
226
417
|
/>
|
|
227
|
-
|
|
228
|
-
|
|
418
|
+
</div>
|
|
419
|
+
)}
|
|
420
|
+
<span
|
|
421
|
+
style={{
|
|
422
|
+
color: colors.headerText,
|
|
423
|
+
fontSize: "0.8125rem",
|
|
424
|
+
fontWeight: 600,
|
|
425
|
+
letterSpacing: "0.01em",
|
|
426
|
+
overflow: "hidden",
|
|
427
|
+
textOverflow: "ellipsis",
|
|
428
|
+
whiteSpace: "nowrap",
|
|
429
|
+
}}
|
|
430
|
+
>
|
|
431
|
+
{props.data.metadata.title}
|
|
432
|
+
</span>
|
|
433
|
+
</div>
|
|
434
|
+
|
|
435
|
+
{/* Body */}
|
|
436
|
+
<div
|
|
437
|
+
style={{
|
|
438
|
+
padding: "0.75rem 0.875rem",
|
|
439
|
+
backgroundColor: colors.bg,
|
|
440
|
+
minHeight: "3rem",
|
|
441
|
+
borderRadius:
|
|
442
|
+
!props.data.metadata.outPorts ||
|
|
443
|
+
props.data.metadata.outPorts.length === 0
|
|
444
|
+
? "0 0 10px 10px"
|
|
445
|
+
: undefined,
|
|
446
|
+
}}
|
|
447
|
+
>
|
|
448
|
+
{/* Component ID badge */}
|
|
449
|
+
{!props.data.isPreview && props.data.id && (
|
|
450
|
+
<div
|
|
229
451
|
style={{
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
452
|
+
display: "inline-flex",
|
|
453
|
+
alignItems: "center",
|
|
454
|
+
backgroundColor: "#ffffff",
|
|
455
|
+
border: "1px solid #e2e8f0",
|
|
456
|
+
borderRadius: "6px",
|
|
457
|
+
padding: "0.125rem 0.5rem",
|
|
458
|
+
marginBottom: "0.5rem",
|
|
235
459
|
}}
|
|
236
460
|
>
|
|
237
|
-
|
|
238
|
-
</p>
|
|
239
|
-
{!props.data.isPreview && props.data.id && (
|
|
240
|
-
<p
|
|
461
|
+
<span
|
|
241
462
|
style={{
|
|
242
|
-
color:
|
|
243
|
-
fontSize: "0.
|
|
244
|
-
|
|
463
|
+
color: "#64748b",
|
|
464
|
+
fontSize: "0.6875rem",
|
|
465
|
+
fontWeight: 500,
|
|
466
|
+
fontFamily:
|
|
467
|
+
'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace',
|
|
245
468
|
}}
|
|
246
469
|
>
|
|
247
|
-
|
|
248
|
-
</
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
470
|
+
{props.data.id.trim()}
|
|
471
|
+
</span>
|
|
472
|
+
</div>
|
|
473
|
+
)}
|
|
474
|
+
|
|
475
|
+
{/* Description */}
|
|
476
|
+
<p
|
|
477
|
+
style={{
|
|
478
|
+
color: "#64748b",
|
|
479
|
+
fontSize: "0.75rem",
|
|
480
|
+
lineHeight: "1.125rem",
|
|
481
|
+
margin: 0,
|
|
482
|
+
display: "-webkit-box",
|
|
483
|
+
WebkitLineClamp: 2,
|
|
484
|
+
WebkitBoxOrient: "vertical",
|
|
485
|
+
overflow: "hidden",
|
|
486
|
+
}}
|
|
487
|
+
>
|
|
488
|
+
{props.data.metadata.description}
|
|
489
|
+
</p>
|
|
262
490
|
</div>
|
|
263
491
|
|
|
492
|
+
{/* Out ports section */}
|
|
264
493
|
{!props.data.isPreview &&
|
|
265
|
-
props.data.
|
|
494
|
+
props.data.metadata.outPorts &&
|
|
495
|
+
props.data.metadata.outPorts.length > 0 && (
|
|
266
496
|
<>
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
497
|
+
{/* Port labels */}
|
|
498
|
+
<div
|
|
499
|
+
style={{
|
|
500
|
+
borderTop: `1px solid ${colors.border}`,
|
|
501
|
+
padding: "0.375rem 0.875rem",
|
|
502
|
+
display: "flex",
|
|
503
|
+
justifyContent:
|
|
504
|
+
props.data.metadata.outPorts.length === 1
|
|
505
|
+
? "center"
|
|
506
|
+
: "space-between",
|
|
507
|
+
backgroundColor: "#ffffff",
|
|
508
|
+
borderRadius: "0 0 10px 10px",
|
|
509
|
+
}}
|
|
510
|
+
>
|
|
511
|
+
{props.data.metadata.outPorts.map((port: Port, i: number) => {
|
|
512
|
+
return (
|
|
513
|
+
<Tooltip key={i} text={port.description || ""}>
|
|
514
|
+
<span
|
|
279
515
|
style={{
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
props.data.metadata.outPorts.length,
|
|
284
|
-
false,
|
|
285
|
-
),
|
|
516
|
+
color: "#94a3b8",
|
|
517
|
+
fontSize: "0.6875rem",
|
|
518
|
+
fontWeight: 500,
|
|
286
519
|
}}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
520
|
+
>
|
|
521
|
+
{port.title}
|
|
522
|
+
</span>
|
|
523
|
+
</Tooltip>
|
|
524
|
+
);
|
|
525
|
+
})}
|
|
290
526
|
</div>
|
|
527
|
+
|
|
528
|
+
{/* Bottom handles */}
|
|
291
529
|
<div>
|
|
292
|
-
{props.data.metadata.outPorts
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
530
|
+
{props.data.metadata.outPorts.map((port: Port, i: number) => {
|
|
531
|
+
return (
|
|
532
|
+
<Handle
|
|
533
|
+
key={i}
|
|
534
|
+
type="source"
|
|
535
|
+
id={port.id}
|
|
536
|
+
onConnect={(_params: Connection) => {}}
|
|
537
|
+
isConnectable={true}
|
|
538
|
+
position={Position.Bottom}
|
|
539
|
+
style={{
|
|
540
|
+
background: colors.handleBg,
|
|
541
|
+
height: "10px",
|
|
542
|
+
width: "10px",
|
|
543
|
+
border: `2px solid ${colors.handleBorder}`,
|
|
544
|
+
bottom: "-5px",
|
|
545
|
+
transition: "all 0.15s ease",
|
|
546
|
+
...getPortPosition(
|
|
547
|
+
i + 1,
|
|
548
|
+
props.data.metadata.outPorts.length,
|
|
549
|
+
false,
|
|
550
|
+
),
|
|
551
|
+
}}
|
|
552
|
+
/>
|
|
553
|
+
);
|
|
554
|
+
})}
|
|
314
555
|
</div>
|
|
315
556
|
</>
|
|
316
557
|
)}
|