@flowuent-org/diagramming-core 1.4.3 → 1.4.4

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.
@@ -113,15 +113,13 @@ export const automationDefaultNodes = [
113
113
  // Configuration cards for dynamic display
114
114
  configurationCards: [
115
115
  {
116
- icon: '⚙️',
116
+ type: 'model',
117
117
  label: 'GPT-5 Thinking mini · v1',
118
- iconColor: '#ffffff',
119
- },
120
- {
121
- icon: '🗄️',
122
- label: 'KB: CNN_Homepage_Titles (18 items)',
123
- iconColor: '#10b981',
124
118
  },
119
+ // {
120
+ // type: 'knowledgeBase',
121
+ // label: 'KB: CNN_Homepage_Titles (18 items)',
122
+ // },
125
123
  ],
126
124
  // AI Suggestions count and data
127
125
  aiSuggestionsCount: 2,
@@ -244,20 +242,18 @@ export const automationDefaultNodes = [
244
242
  ignored: 0,
245
243
  },
246
244
  // AI Reasoning data
247
- aiReasoning: {
248
- text: 'Analyzed the selected headline for key components and promises',
249
- },
245
+ // aiReasoning: {
246
+ // text: 'Analyzed the selected headline for key components and promises',
247
+ // },
250
248
  // Configuration cards for dynamic display
251
249
  configurationCards: [
252
250
  {
253
- icon: '🧠',
251
+ type: 'model',
254
252
  label: 'GPT-5 Thinking mini · v1',
255
- iconColor: '#ffffff',
256
253
  },
257
254
  {
258
- icon: '📚',
255
+ type: 'knowledgeBase',
259
256
  label: 'KB: CNN_Articles (18 items)',
260
- iconColor: '#10b981',
261
257
  },
262
258
  ],
263
259
  // AI Suggestions count
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowuent-org/diagramming-core",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,6 +24,8 @@ import { useSearch } from '../../contexts/SearchContext';
24
24
  import { getStatusColor } from './statusColors';
25
25
  import { ApiNodeIcon } from '../../icons';
26
26
  import { AutomationNodeHeaderSection } from './AutomationNodeHeader';
27
+ import { AutomationConfigurationCardsSection } from './AutomationNodeConfigDisplay';
28
+ import { AutomationConfigurationCard } from '../../types/automation-node-data-types';
27
29
 
28
30
  interface AutomationApiNodeProps {
29
31
  data: {
@@ -49,11 +51,7 @@ interface AutomationApiNodeProps {
49
51
  partial: number;
50
52
  ignored: number;
51
53
  };
52
- configurationCards?: Array<{
53
- icon: string;
54
- label: string;
55
- iconColor: string;
56
- }>;
54
+ configurationCards?: AutomationConfigurationCard[];
57
55
  aiSuggestionsCount?: number; // Number of AI suggestions available
58
56
  aiSuggestions?: AISuggestion[]; // AI suggestions data
59
57
  [key: string]: any;
@@ -476,30 +474,9 @@ export const AutomationApiNode: React.FC<AutomationApiNodeProps> = ({ data, sele
476
474
  </>
477
475
  )}
478
476
 
479
- {/* Configuration Cards */}
480
- {data.formData?.configurationCards?.map((card: any, index: number) => (
481
- <Box key={index} sx={{
482
- backgroundColor: '#1F2937',
483
- borderRadius: '6px',
484
- padding: '8px 12px',
485
- mb: 1,
486
- display: 'flex',
487
- alignItems: 'center',
488
- gap: 1,
489
- border: '1px solid #374151'
490
- }}>
491
- <Box sx={{ color: card.iconColor || '#ffffff', fontSize: '16px' }}>
492
- {card.icon}
493
- </Box>
494
- <Typography variant="body2" sx={{
495
- color: '#ffffff',
496
- fontSize: '11px',
497
- fontWeight: 500
498
- }}>
499
- {card.label}
500
- </Typography>
501
- </Box>
502
- ))}
477
+ <AutomationConfigurationCardsSection
478
+ configurationCards={data.formData?.configurationCards}
479
+ />
503
480
 
504
481
  {/* Last Run Info */}
505
482
  <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, mt: 1 }}>
@@ -24,6 +24,11 @@ import { useSearch } from '../../contexts/SearchContext';
24
24
  import { getStatusColor } from './statusColors';
25
25
  import { ArticleAnalyzerIcon, FormattingNodeIcon } from '../../icons';
26
26
  import { AutomationNodeHeaderSection } from './AutomationNodeHeader';
27
+ import {
28
+ AutomationAIReasoningSection,
29
+ AutomationConfigurationCardsSection,
30
+ } from './AutomationNodeConfigDisplay';
31
+ import { AutomationConfigurationCard, AutomationAIReasoning } from '../../types/automation-node-data-types';
27
32
 
28
33
  interface AutomationFormattingNodeProps {
29
34
  data: {
@@ -52,14 +57,8 @@ interface AutomationFormattingNodeProps {
52
57
  partial: number;
53
58
  ignored: number;
54
59
  };
55
- aiReasoning?: {
56
- text: string;
57
- };
58
- configurationCards?: Array<{
59
- icon: string;
60
- label: string;
61
- iconColor: string;
62
- }>;
60
+ aiReasoning?: AutomationAIReasoning;
61
+ configurationCards?: AutomationConfigurationCard[];
63
62
  aiSuggestionsCount?: number; // Number of AI suggestions available
64
63
  [key: string]: any;
65
64
  }; // Include formData for configuration
@@ -394,48 +393,7 @@ export const AutomationFormattingNode: React.FC<AutomationFormattingNodeProps> =
394
393
  </Box>
395
394
  </Box>
396
395
 
397
- {/* AI Reasoning Section */}
398
- <Box sx={{
399
- backgroundColor: '#1F2937',
400
- borderRadius: '8px',
401
- padding: '12px',
402
- mb: 2,
403
- border: '1px solid #374151'
404
- }}>
405
- {/* AI Reasoning Header */}
406
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 1 }}>
407
- <Box sx={{ color: '#34D399', fontSize: '16px' }}>
408
- 🧠
409
- </Box>
410
- <Typography variant="body2" sx={{
411
- color: '#34D399',
412
- fontSize: '12px',
413
- fontWeight: 600
414
- }}>
415
- {t('automation.formattingNode.aiReasoning')}
416
- </Typography>
417
- </Box>
418
-
419
- {/* AI Reasoning Description */}
420
- <Box sx={{
421
- backgroundColor: 'transparent',
422
- borderRadius: '4px',
423
- padding: '8px',
424
- border: '1px solid #4B5563',
425
- minHeight: '40px',
426
- display: 'flex',
427
- alignItems: 'center'
428
- }}>
429
- <Typography variant="body2" sx={{
430
- color: '#9CA3AF',
431
- fontSize: '12px',
432
- lineHeight: 1.4,
433
- margin: 0
434
- }}>
435
- {data.formData?.aiReasoning?.text || t('automation.formattingNode.aiReasoningDefault')}
436
- </Typography>
437
- </Box>
438
- </Box>
396
+ <AutomationAIReasoningSection aiReasoning={data.formData?.aiReasoning} />
439
397
 
440
398
  {data.status === 'Completed' && (data.formData?.executionResult || data.formData?.schemaMatch) && (
441
399
  <>
@@ -520,30 +478,9 @@ export const AutomationFormattingNode: React.FC<AutomationFormattingNodeProps> =
520
478
  </>
521
479
  )}
522
480
 
523
- {/* Configuration Cards */}
524
- {data.formData?.configurationCards?.map((card: any, index: number) => (
525
- <Box key={index} sx={{
526
- backgroundColor: '#1F2937',
527
- borderRadius: '6px',
528
- padding: '8px 12px',
529
- mb: 1,
530
- display: 'flex',
531
- alignItems: 'center',
532
- gap: 1,
533
- border: '1px solid #374151'
534
- }}>
535
- <Box sx={{ color: card.iconColor || '#ffffff', fontSize: '16px' }}>
536
- {card.icon}
537
- </Box>
538
- <Typography variant="body2" sx={{
539
- color: '#ffffff',
540
- fontSize: '11px',
541
- fontWeight: 500
542
- }}>
543
- {card.label}
544
- </Typography>
545
- </Box>
546
- ))}
481
+ <AutomationConfigurationCardsSection
482
+ configurationCards={data.formData?.configurationCards}
483
+ />
547
484
 
548
485
  {/* Last Run Info */}
549
486
  <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, mt: 1 }}>
@@ -0,0 +1,132 @@
1
+ import React from 'react';
2
+ import { Box, Typography } from '@mui/material';
3
+ import { useTranslation } from 'react-i18next';
4
+ import {
5
+ AutomationAIReasoning,
6
+ AutomationConfigurationCard,
7
+ AutomationConfigurationCardType,
8
+ } from '../../types/automation-node-data-types';
9
+
10
+ const CONFIGURATION_CARD_ICONS: Record<
11
+ AutomationConfigurationCardType,
12
+ { icon: string; defaultColor: string }
13
+ > = {
14
+ model: { icon: '⚙️', defaultColor: '#ffffff' },
15
+ knowledgeBase: { icon: '🗄️', defaultColor: '#10b981' },
16
+ };
17
+
18
+ interface AutomationAIReasoningSectionProps {
19
+ aiReasoning?: AutomationAIReasoning;
20
+ }
21
+
22
+ export const AutomationAIReasoningSection: React.FC<
23
+ AutomationAIReasoningSectionProps
24
+ > = ({ aiReasoning }) => {
25
+ const { t } = useTranslation();
26
+ const text = aiReasoning?.text?.trim();
27
+
28
+ if (!text) {
29
+ return null;
30
+ }
31
+
32
+ return (
33
+ <Box
34
+ sx={{
35
+ backgroundColor: '#1F2937',
36
+ borderRadius: '8px',
37
+ padding: '12px',
38
+ mb: 2,
39
+ border: '1px solid #374151',
40
+ }}
41
+ >
42
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 1 }}>
43
+ <Box sx={{ color: '#34D399', fontSize: '16px' }}>🧠</Box>
44
+ <Typography
45
+ variant="body2"
46
+ sx={{ color: '#34D399', fontSize: '12px', fontWeight: 600 }}
47
+ >
48
+ {t('automation.formattingNode.aiReasoning')}
49
+ </Typography>
50
+ </Box>
51
+
52
+ <Box
53
+ sx={{
54
+ backgroundColor: 'transparent',
55
+ borderRadius: '4px',
56
+ padding: '8px',
57
+ border: '1px solid #4B5563',
58
+ minHeight: '40px',
59
+ display: 'flex',
60
+ alignItems: 'center',
61
+ }}
62
+ >
63
+ <Typography
64
+ variant="body2"
65
+ sx={{
66
+ color: '#9CA3AF',
67
+ fontSize: '12px',
68
+ lineHeight: 1.4,
69
+ margin: 0,
70
+ }}
71
+ >
72
+ {text}
73
+ </Typography>
74
+ </Box>
75
+ </Box>
76
+ );
77
+ };
78
+
79
+ interface AutomationConfigurationCardsSectionProps {
80
+ configurationCards?: AutomationConfigurationCard[];
81
+ }
82
+
83
+ export const AutomationConfigurationCardsSection: React.FC<
84
+ AutomationConfigurationCardsSectionProps
85
+ > = ({ configurationCards }) => {
86
+ const configuredCards = (configurationCards ?? []).filter(
87
+ (card) => card.type && card.label?.trim(),
88
+ );
89
+
90
+ if (configuredCards.length === 0) {
91
+ return null;
92
+ }
93
+
94
+ return (
95
+ <>
96
+ {configuredCards.map((card, index) => {
97
+ const iconConfig = CONFIGURATION_CARD_ICONS[card.type];
98
+
99
+ return (
100
+ <Box
101
+ key={`${card.type}-${index}`}
102
+ sx={{
103
+ backgroundColor: '#1F2937',
104
+ borderRadius: '6px',
105
+ padding: '8px 12px',
106
+ mb: 1,
107
+ display: 'flex',
108
+ alignItems: 'center',
109
+ gap: 1,
110
+ border: '1px solid #374151',
111
+ }}
112
+ >
113
+ <Box
114
+ sx={{
115
+ color: card.iconColor || iconConfig.defaultColor,
116
+ fontSize: '16px',
117
+ }}
118
+ >
119
+ {iconConfig.icon}
120
+ </Box>
121
+ <Typography
122
+ variant="body2"
123
+ sx={{ color: '#ffffff', fontSize: '11px', fontWeight: 500 }}
124
+ >
125
+ {card.label}
126
+ </Typography>
127
+ </Box>
128
+ );
129
+ })}
130
+ </>
131
+ );
132
+ };
@@ -1,4 +1,16 @@
1
1
  // Automation Node Data Types
2
+ export type AutomationConfigurationCardType = 'model' | 'knowledgeBase';
3
+
4
+ export interface AutomationConfigurationCard {
5
+ type: AutomationConfigurationCardType;
6
+ label: string;
7
+ iconColor?: string;
8
+ }
9
+
10
+ export interface AutomationAIReasoning {
11
+ text: string;
12
+ }
13
+
2
14
  export interface AutomationNodeFormData {
3
15
  nodeId: string;
4
16
  title: string;
@@ -26,6 +38,13 @@ export interface AutomationNodeFormData {
26
38
  value: string | number | boolean;
27
39
  }>;
28
40
  };
41
+ aiReasoning?: AutomationAIReasoning;
42
+ configurationCards?: AutomationConfigurationCard[];
43
+ schemaMatch?: {
44
+ matched: number;
45
+ partial: number;
46
+ ignored: number;
47
+ };
29
48
  // Execution result storage
30
49
  executionResult?: {
31
50
  success: boolean;