@flowuent-org/diagramming-core 1.2.0 → 1.2.1

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.
@@ -1,146 +1,145 @@
1
- import React from 'react';
2
- import { Box, IconButton, Tooltip } from '@mui/material';
3
- import {
4
- IconLayoutGrid,
5
- IconMessage,
6
- IconPlus,
7
- IconCopy,
8
- IconTrash,
9
- } from '@tabler/icons-react';
10
-
11
- interface NodeActionButtonsProps {
12
- selected?: boolean;
13
- onLayout?: () => void;
14
- onOpenAIAssistant?: (buttonElement: HTMLElement) => void;
15
- onAddToGroup?: () => void;
16
- onDuplicate?: () => void;
17
- onDelete?: () => void;
18
- }
19
-
20
- export const NodeActionButtons: React.FC<NodeActionButtonsProps> = ({
21
- selected,
22
- onLayout,
23
- onOpenAIAssistant,
24
- onAddToGroup,
25
- onDuplicate,
26
- onDelete,
27
- }) => {
28
- if (!selected) return null;
29
-
30
- return (
31
- <Box
32
- sx={{
33
- position: 'absolute',
34
- left: '100%',
35
- top: '50%',
36
- transform: 'translateY(-50%)',
37
- marginLeft: '12px',
38
- display: 'flex',
39
- flexDirection: 'column',
40
- gap: 0.5,
41
- backgroundColor: 'rgba(15, 15, 35, 0.95)',
42
- borderRadius: '12px',
43
- border: '1px solid rgba(255, 255, 255, 0.1)',
44
- p: 0.5,
45
- zIndex: 1000,
46
- boxShadow: '0 4px 20px rgba(0, 0, 0, 0.3)',
47
- }}
48
- onClick={(e) => e.stopPropagation()}
49
- >
50
- <Tooltip title="Layout" placement="right">
51
- <IconButton
52
- size="small"
53
- onClick={(e) => {
54
- e.stopPropagation();
55
- onLayout?.();
56
- }}
57
- sx={{
58
- color: 'rgba(255, 255, 255, 0.6)',
59
- '&:hover': {
60
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
61
- color: '#fff',
62
- },
63
- }}
64
- >
65
- <IconLayoutGrid size={18} />
66
- </IconButton>
67
- </Tooltip>
68
- <Tooltip title="Node AI Assistant" placement="right">
69
- <IconButton
70
- size="small"
71
- data-node-ai-assistant-button
72
- onClick={(e) => {
73
- e.stopPropagation();
74
- onOpenAIAssistant?.(e.currentTarget);
75
- }}
76
- sx={{
77
- color: 'rgba(255, 255, 255, 0.6)',
78
- '&:hover': {
79
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
80
- color: '#fff',
81
- },
82
- }}
83
- >
84
- <IconMessage size={18} />
85
- </IconButton>
86
- </Tooltip>
87
- <Tooltip title="Add to Group" placement="right">
88
- <IconButton
89
- size="small"
90
- onClick={(e) => {
91
- e.stopPropagation();
92
- onAddToGroup?.();
93
- }}
94
- sx={{
95
- color: 'rgba(255, 255, 255, 0.6)',
96
- '&:hover': {
97
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
98
- color: '#fff',
99
- },
100
- }}
101
- >
102
- <IconPlus size={18} />
103
- </IconButton>
104
- </Tooltip>
105
- <Tooltip title="Duplicate" placement="right">
106
- <IconButton
107
- size="small"
108
- onClick={(e) => {
109
- e.stopPropagation();
110
- onDuplicate?.();
111
- }}
112
- sx={{
113
- color: 'rgba(255, 255, 255, 0.6)',
114
- '&:hover': {
115
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
116
- color: '#fff',
117
- },
118
- }}
119
- >
120
- <IconCopy size={18} />
121
- </IconButton>
122
- </Tooltip>
123
- <Tooltip title="Delete" placement="right">
124
- <IconButton
125
- size="small"
126
- onClick={(e) => {
127
- e.stopPropagation();
128
- onDelete?.();
129
- }}
130
- sx={{
131
- color: 'rgba(255, 255, 255, 0.6)',
132
- '&:hover': {
133
- backgroundColor: 'rgba(239, 68, 68, 0.2)',
134
- color: '#EF4444',
135
- },
136
- }}
137
- >
138
- <IconTrash size={18} />
139
- </IconButton>
140
- </Tooltip>
141
- </Box>
142
- );
143
- };
144
-
145
- export default NodeActionButtons;
146
-
1
+ import React from 'react';
2
+ import { Box, IconButton, Tooltip } from '@mui/material';
3
+ import {
4
+ IconLayoutGrid,
5
+ IconMessage,
6
+ IconPlus,
7
+ IconCopy,
8
+ IconTrash,
9
+ } from '@tabler/icons-react';
10
+
11
+ interface NodeActionButtonsProps {
12
+ selected?: boolean;
13
+ onLayout?: () => void;
14
+ onAddNote?: () => void;
15
+ onAddToGroup?: () => void;
16
+ onDuplicate?: () => void;
17
+ onDelete?: () => void;
18
+ }
19
+
20
+ export const NodeActionButtons: React.FC<NodeActionButtonsProps> = ({
21
+ selected,
22
+ onLayout,
23
+ onAddNote,
24
+ onAddToGroup,
25
+ onDuplicate,
26
+ onDelete,
27
+ }) => {
28
+ if (!selected) return null;
29
+
30
+ return (
31
+ <Box
32
+ sx={{
33
+ position: 'absolute',
34
+ left: '100%',
35
+ top: '50%',
36
+ transform: 'translateY(-50%)',
37
+ marginLeft: '12px',
38
+ display: 'flex',
39
+ flexDirection: 'column',
40
+ gap: 0.5,
41
+ backgroundColor: 'rgba(15, 15, 35, 0.95)',
42
+ borderRadius: '12px',
43
+ border: '1px solid rgba(255, 255, 255, 0.1)',
44
+ p: 0.5,
45
+ zIndex: 1000,
46
+ boxShadow: '0 4px 20px rgba(0, 0, 0, 0.3)',
47
+ }}
48
+ onClick={(e) => e.stopPropagation()}
49
+ >
50
+ <Tooltip title="Layout" placement="right">
51
+ <IconButton
52
+ size="small"
53
+ onClick={(e) => {
54
+ e.stopPropagation();
55
+ onLayout?.();
56
+ }}
57
+ sx={{
58
+ color: 'rgba(255, 255, 255, 0.6)',
59
+ '&:hover': {
60
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
61
+ color: '#fff',
62
+ },
63
+ }}
64
+ >
65
+ <IconLayoutGrid size={18} />
66
+ </IconButton>
67
+ </Tooltip>
68
+ <Tooltip title="Add Note" placement="right">
69
+ <IconButton
70
+ size="small"
71
+ onClick={(e) => {
72
+ e.stopPropagation();
73
+ onAddNote?.();
74
+ }}
75
+ sx={{
76
+ color: 'rgba(255, 255, 255, 0.6)',
77
+ '&:hover': {
78
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
79
+ color: '#fff',
80
+ },
81
+ }}
82
+ >
83
+ <IconMessage size={18} />
84
+ </IconButton>
85
+ </Tooltip>
86
+ <Tooltip title="Add to Group" placement="right">
87
+ <IconButton
88
+ size="small"
89
+ onClick={(e) => {
90
+ e.stopPropagation();
91
+ onAddToGroup?.();
92
+ }}
93
+ sx={{
94
+ color: 'rgba(255, 255, 255, 0.6)',
95
+ '&:hover': {
96
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
97
+ color: '#fff',
98
+ },
99
+ }}
100
+ >
101
+ <IconPlus size={18} />
102
+ </IconButton>
103
+ </Tooltip>
104
+ <Tooltip title="Duplicate" placement="right">
105
+ <IconButton
106
+ size="small"
107
+ onClick={(e) => {
108
+ e.stopPropagation();
109
+ onDuplicate?.();
110
+ }}
111
+ sx={{
112
+ color: 'rgba(255, 255, 255, 0.6)',
113
+ '&:hover': {
114
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
115
+ color: '#fff',
116
+ },
117
+ }}
118
+ >
119
+ <IconCopy size={18} />
120
+ </IconButton>
121
+ </Tooltip>
122
+ <Tooltip title="Delete" placement="right">
123
+ <IconButton
124
+ size="small"
125
+ onClick={(e) => {
126
+ e.stopPropagation();
127
+ onDelete?.();
128
+ }}
129
+ sx={{
130
+ color: 'rgba(255, 255, 255, 0.6)',
131
+ '&:hover': {
132
+ backgroundColor: 'rgba(239, 68, 68, 0.2)',
133
+ color: '#EF4444',
134
+ },
135
+ }}
136
+ >
137
+ <IconTrash size={18} />
138
+ </IconButton>
139
+ </Tooltip>
140
+ </Box>
141
+ );
142
+ };
143
+
144
+ export default NodeActionButtons;
145
+
@@ -1,20 +1,12 @@
1
- export { AutomationStartNode } from './AutomationStartNode';
2
- export { AutomationApiNode } from './AutomationApiNode';
3
- export { AutomationFormattingNode } from './AutomationFormattingNode';
4
- export { AutomationSheetsNode } from './AutomationSheetsNode';
5
- export { AutomationEndNode } from './AutomationEndNode';
6
- export { AutomationNoteNode } from './AutomationNoteNode';
7
- export { AutomationExecutionPanel } from './AutomationExecutionPanel';
8
- export { AutomationAISuggestionNode } from './AutomationAISuggestionNode';
9
- export { AISuggestionsModal, showAISuggestionsModal } from './AISuggestionsModal';
10
- export { AISuggestionsPanel } from './AISuggestionsPanel';
11
- export { NodeActionButtons } from './NodeActionButtons';
12
- export { NodeAIAssistantPopup, showNodeAIAssistantPopup } from './NodeAIAssistantPopup';
13
- export type { AISuggestion } from './AISuggestionsModal';
14
- export {
15
- setNodeAIAssistantEndpoint,
16
- setNodeAIAssistantHeaders,
17
- getNodeAIAssistantEndpoint,
18
- getNodeAIAssistantHeaders,
19
- configureNodeAIAssistant,
20
- } from '../../utils/nodeAIAssistantConfig';
1
+ export { AutomationStartNode } from './AutomationStartNode';
2
+ export { AutomationApiNode } from './AutomationApiNode';
3
+ export { AutomationFormattingNode } from './AutomationFormattingNode';
4
+ export { AutomationSheetsNode } from './AutomationSheetsNode';
5
+ export { AutomationEndNode } from './AutomationEndNode';
6
+ export { AutomationNoteNode } from './AutomationNoteNode';
7
+ export { AutomationExecutionPanel } from './AutomationExecutionPanel';
8
+ export { AutomationAISuggestionNode } from './AutomationAISuggestionNode';
9
+ export { AISuggestionsModal, showAISuggestionsModal } from './AISuggestionsModal';
10
+ export { AISuggestionsPanel } from './AISuggestionsPanel';
11
+ export { NodeActionButtons } from './NodeActionButtons';
12
+ export type { AISuggestion } from './AISuggestionsModal';