@flowuent-org/diagramming-core 1.1.7 → 1.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowuent-org/diagramming-core",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,117 +1,117 @@
1
- export * from './lib/externals';
2
- export * from './lib/i18n';
3
- export * from './lib/templates/systemFlow';
4
- export * from './lib/theme';
5
- export * from './lib/atoms/AddNodeAnchor';
6
- export * from './lib/atoms/AddParallelColButton';
7
- export * from './lib/atoms/BendpointNode';
8
- export * from './lib/atoms/CardBlockTypeSelector';
9
- export * from './lib/atoms/CardMainContent';
10
- export * from './lib/atoms/FloatingConnectionLine';
11
- export * from './lib/atoms/MarkerSelector';
12
- export * from './lib/atoms/PropertyInput';
13
- export * from './lib/atoms/StyledBox';
14
- export * from './lib/contexts/CardDataProvider';
15
- export * from './lib/contexts/DiagramProvider';
16
- export * from './lib/contexts/diagramStoreTypes';
17
- export * from './lib/contexts/onConnect';
18
- export * from './lib/contexts/onDragStart';
19
- export * from './lib/contexts/onNodeDragEnd';
20
- export * from './lib/contexts/onNodesChange';
21
- export * from './lib/contexts/setContentHeight';
22
- export * from './lib/contexts/setDiagramType';
23
- export * from './lib/contexts/setEdges';
24
- export * from './lib/contexts/setEdgeShapeType';
25
- export * from './lib/contexts/setNodes';
26
- export * from './lib/contexts/setNodeSetting';
27
- export * from './lib/contexts/setPannable';
28
- export * from './lib/contexts/setSelectedEdge';
29
- export * from './lib/contexts/setSelectedNode';
30
- export * from './lib/contexts/undo';
31
- export * from './lib/contexts/updateNodeSetting';
32
- export * from './lib/hooks/customUseReactFlow';
33
- export * from './lib/hooks/updateNodes';
34
- export * from './lib/hooks/useDragCallbacks';
35
- export * from './lib/hooks/useModalControls';
36
- export * from './lib/hooks/useWorkflowNodeActiont';
37
- export * from './lib/hooks/useAutoRegisterFunctions';
38
- export * from './lib/molecules/AddingBlock';
39
- export * from './lib/molecules/animated-add-button';
40
- export * from './lib/molecules/Block';
41
- export * from './lib/molecules/BlockProvider';
42
- export * from './lib/molecules/BlockWrapper';
43
- export * from './lib/molecules/DraggablePane';
44
- export * from './lib/molecules/EntityNodeBlocks';
45
- export * from './lib/molecules/json-viewer';
46
- export * from './lib/molecules/SideHandles';
47
- export * from './lib/molecules/StencilItem';
48
- export * from './lib/molecules/WorkflowNodeActionButtons';
49
- export * from './lib/organisms/AddNodeView';
50
- export * from './lib/organisms/DownloadPanel';
51
- export * from './lib/organisms/EdgeModal';
52
- export * from './lib/organisms/NodeContextMenu';
53
- export * from './lib/organisms/SmartDynamicForm';
54
- export * from './lib/organisms/Stencil';
55
- export * from './lib/organisms/UseDiagramStore';
56
- export * from './lib/organisms/ConditionRuleGroup';
57
- export * from './lib/organisms/WorkflowNode';
58
- export * from './lib/templates/DiagramContainer';
59
- export * from './lib/templates/DiagramContent';
60
- export * from './lib/templates/Diagramming';
61
- export type { DiagrammingPageRef } from './lib/templates/Diagramming';
62
- export * from './lib/templates/PageLinks';
63
- export * from './lib/types/card-node';
64
- export * from './lib/types/collaboration-types';
65
- export * from './lib/types/colors';
66
- export * from './lib/types/edge-types';
67
- export * from './lib/types/hooks.types';
68
- export * from './lib/types/node-types';
69
- export * from './lib/types/SmartDynamicFormField';
70
- export * from './lib/types/stencil-item';
71
- export * from './lib/types/structures';
72
- export * from './lib/types/workflow-content-dynamic-form-type';
73
- export * from './lib/types/FunctionSignature';
74
- export * from './lib/utils/add-new-block';
75
- export * from './lib/utils/add-new-node';
76
- export * from './lib/utils/addToHistory';
77
- export * from './lib/utils/closestPoint';
78
- export * from './lib/utils/color-options';
79
- export * from './lib/utils/compress-img';
80
- export * from './lib/utils/constant-lengths';
81
- export * from './lib/utils/create-updated';
82
- export * from './lib/utils/createHistoryChange';
83
- export * from './lib/utils/edge-hooks';
84
- export * from './lib/utils/elkLayout';
85
- export * from './lib/utils/event-hooks';
86
- export * from './lib/utils/event-store';
87
- export * from './lib/utils/flow-node-hooks';
88
- export * from './lib/utils/flow-to-js';
89
- export * from './lib/utils/helpers.types';
90
- export * from './lib/utils/logger';
91
- export * from './lib/utils/model-hooks';
92
- export * from './lib/utils/node-hooks';
93
- export { useHistory, useHistoryIndex } from './lib/contexts/DiagramProvider';
94
- export * from './lib/utils/object';
95
- export * from './lib/utils/nodeutils';
96
- export * from './lib/utils/utilities';
97
- export * from './lib/utils/vhToPixels';
98
- export * from './lib/utils/nodeOrderByEdges';
99
- export * from './lib/assets/markers/markers.param';
100
- export * from './lib/assets/markers/markers.type';
101
- export * from './lib/organisms/Card/card.params';
102
- export * from './lib/organisms/Card/card.types';
103
- export * from './lib/organisms/Card/EntityNode';
104
- export * from './lib/organisms/CustomEdge/custom-edge-generator';
105
- export * from './lib/organisms/CustomEdge/custom-edge.params';
106
- export * from './lib/organisms/CustomEdge/custom-edge.type';
107
- export * from './lib/organisms/PropertiesPane';
108
- export * from './lib/organisms/HistoryPane';
109
- //export * from './lib/types/workflow-node-data-types';
110
- export * from './lib/templates/node-forms/NodeForm';
111
- export { AutomationExecutionEngine } from './lib/utils/AutomationExecutionEngine';
112
- export type {
113
- AutomationLog,
114
- AutomationResult,
115
- } from './lib/utils/AutomationExecutionEngine';
116
- export * from './lib/components/automation';
117
- export * from './lib/types/automation-node-data-types';
1
+ export * from './lib/externals';
2
+ export * from './lib/i18n';
3
+ export * from './lib/templates/systemFlow';
4
+ export * from './lib/theme';
5
+ export * from './lib/atoms/AddNodeAnchor';
6
+ export * from './lib/atoms/AddParallelColButton';
7
+ export * from './lib/atoms/BendpointNode';
8
+ export * from './lib/atoms/CardBlockTypeSelector';
9
+ export * from './lib/atoms/CardMainContent';
10
+ export * from './lib/atoms/FloatingConnectionLine';
11
+ export * from './lib/atoms/MarkerSelector';
12
+ export * from './lib/atoms/PropertyInput';
13
+ export * from './lib/atoms/StyledBox';
14
+ export * from './lib/contexts/CardDataProvider';
15
+ export * from './lib/contexts/DiagramProvider';
16
+ export * from './lib/contexts/diagramStoreTypes';
17
+ export * from './lib/contexts/onConnect';
18
+ export * from './lib/contexts/onDragStart';
19
+ export * from './lib/contexts/onNodeDragEnd';
20
+ export * from './lib/contexts/onNodesChange';
21
+ export * from './lib/contexts/setContentHeight';
22
+ export * from './lib/contexts/setDiagramType';
23
+ export * from './lib/contexts/setEdges';
24
+ export * from './lib/contexts/setEdgeShapeType';
25
+ export * from './lib/contexts/setNodes';
26
+ export * from './lib/contexts/setNodeSetting';
27
+ export * from './lib/contexts/setPannable';
28
+ export * from './lib/contexts/setSelectedEdge';
29
+ export * from './lib/contexts/setSelectedNode';
30
+ export * from './lib/contexts/undo';
31
+ export * from './lib/contexts/updateNodeSetting';
32
+ export * from './lib/hooks/customUseReactFlow';
33
+ export * from './lib/hooks/updateNodes';
34
+ export * from './lib/hooks/useDragCallbacks';
35
+ export * from './lib/hooks/useModalControls';
36
+ export * from './lib/hooks/useWorkflowNodeActiont';
37
+ export * from './lib/hooks/useAutoRegisterFunctions';
38
+ export * from './lib/molecules/AddingBlock';
39
+ export * from './lib/molecules/animated-add-button';
40
+ export * from './lib/molecules/Block';
41
+ export * from './lib/molecules/BlockProvider';
42
+ export * from './lib/molecules/BlockWrapper';
43
+ export * from './lib/molecules/DraggablePane';
44
+ export * from './lib/molecules/EntityNodeBlocks';
45
+ export * from './lib/molecules/json-viewer';
46
+ export * from './lib/molecules/SideHandles';
47
+ export * from './lib/molecules/StencilItem';
48
+ export * from './lib/molecules/WorkflowNodeActionButtons';
49
+ export * from './lib/organisms/AddNodeView';
50
+ export * from './lib/organisms/DownloadPanel';
51
+ export * from './lib/organisms/EdgeModal';
52
+ export * from './lib/organisms/NodeContextMenu';
53
+ export * from './lib/organisms/SmartDynamicForm';
54
+ export * from './lib/organisms/Stencil';
55
+ export * from './lib/organisms/UseDiagramStore';
56
+ export * from './lib/organisms/ConditionRuleGroup';
57
+ export * from './lib/organisms/WorkflowNode';
58
+ export * from './lib/templates/DiagramContainer';
59
+ export * from './lib/templates/DiagramContent';
60
+ export * from './lib/templates/Diagramming';
61
+ export type { DiagrammingPageRef } from './lib/templates/Diagramming';
62
+ export * from './lib/templates/PageLinks';
63
+ export * from './lib/types/card-node';
64
+ export * from './lib/types/collaboration-types';
65
+ export * from './lib/types/colors';
66
+ export * from './lib/types/edge-types';
67
+ export * from './lib/types/hooks.types';
68
+ export * from './lib/types/node-types';
69
+ export * from './lib/types/SmartDynamicFormField';
70
+ export * from './lib/types/stencil-item';
71
+ export * from './lib/types/structures';
72
+ export * from './lib/types/workflow-content-dynamic-form-type';
73
+ export * from './lib/types/FunctionSignature';
74
+ export * from './lib/utils/add-new-block';
75
+ export * from './lib/utils/add-new-node';
76
+ export * from './lib/utils/addToHistory';
77
+ export * from './lib/utils/closestPoint';
78
+ export * from './lib/utils/color-options';
79
+ export * from './lib/utils/compress-img';
80
+ export * from './lib/utils/constant-lengths';
81
+ export * from './lib/utils/create-updated';
82
+ export * from './lib/utils/createHistoryChange';
83
+ export * from './lib/utils/edge-hooks';
84
+ export * from './lib/utils/elkLayout';
85
+ export * from './lib/utils/event-hooks';
86
+ export * from './lib/utils/event-store';
87
+ export * from './lib/utils/flow-node-hooks';
88
+ export * from './lib/utils/flow-to-js';
89
+ export * from './lib/utils/helpers.types';
90
+ export * from './lib/utils/logger';
91
+ export * from './lib/utils/model-hooks';
92
+ export * from './lib/utils/node-hooks';
93
+ export { useHistory, useHistoryIndex } from './lib/contexts/DiagramProvider';
94
+ export * from './lib/utils/object';
95
+ export * from './lib/utils/nodeutils';
96
+ export * from './lib/utils/utilities';
97
+ export * from './lib/utils/vhToPixels';
98
+ export * from './lib/utils/nodeOrderByEdges';
99
+ export * from './lib/assets/markers/markers.param';
100
+ export * from './lib/assets/markers/markers.type';
101
+ export * from './lib/organisms/Card/card.params';
102
+ export * from './lib/organisms/Card/card.types';
103
+ export * from './lib/organisms/Card/EntityNode';
104
+ export * from './lib/organisms/CustomEdge/custom-edge-generator';
105
+ export * from './lib/organisms/CustomEdge/custom-edge.params';
106
+ export * from './lib/organisms/CustomEdge/custom-edge.type';
107
+ export * from './lib/organisms/PropertiesPane';
108
+ export * from './lib/organisms/HistoryPane';
109
+ //export * from './lib/types/workflow-node-data-types';
110
+ export * from './lib/templates/node-forms/NodeForm';
111
+ export { AutomationExecutionEngine } from './lib/utils/AutomationExecutionEngine';
112
+ export type {
113
+ AutomationLog,
114
+ AutomationResult,
115
+ } from './lib/utils/AutomationExecutionEngine';
116
+ export * from './lib/components/automation';
117
+ export * from './lib/types/automation-node-data-types';
@@ -1,6 +1,6 @@
1
1
  import { CssBaseline, ThemeProvider } from '@mui/material';
2
- import React, { forwardRef, useImperativeHandle } from 'react';
3
- import { Edge, Background, BackgroundVariant } from '@xyflow/react';
2
+ import React, { forwardRef, useImperativeHandle, useEffect } from 'react';
3
+ import { Edge, Background, BackgroundVariant, Node } from '@xyflow/react';
4
4
  import FloatingConnectionLine from '../atoms/FloatingConnectionLine';
5
5
  import { DiagramStoreProvider, useDiagram } from '../contexts/DiagramProvider';
6
6
  import { theme } from '../theme';
@@ -9,6 +9,7 @@ import DiagramTypes from '../types/diagram-types';
9
9
  import edgeTypes, { defaultEdgeOptions } from '../types/edge-types';
10
10
  import nodeTypes from '../types/node-types';
11
11
  import { useAutoRegisterVariables } from '../hooks/useAutoRegisterVariables';
12
+ import { orderNodesByEdges, NodeOrderResult } from '../utils/nodeOrderByEdges';
12
13
 
13
14
  import {
14
15
  ConditionBuilderState,
@@ -42,10 +43,17 @@ export interface DiagrammingPageRef {
42
43
  getSelectedNode: () => string | null;
43
44
  getNodes: () => any[];
44
45
  getEdges: () => any[];
46
+ // Get ordered nodes based on edge connections (arrow direction)
47
+ getNodeOrder: () => NodeOrderResult;
45
48
  }
46
49
 
47
50
  // Internal component that exposes undo/redo functionality
48
- const DiagrammingPageInternal = forwardRef<DiagrammingPageRef, { children?: React.ReactNode; className?: string; showAutomationExecutionPanel?: boolean }>(({ children, className, showAutomationExecutionPanel }, ref) => {
51
+ const DiagrammingPageInternal = forwardRef<DiagrammingPageRef, {
52
+ children?: React.ReactNode;
53
+ className?: string;
54
+ showAutomationExecutionPanel?: boolean;
55
+ onNodeOrderChange?: (nodeOrder: NodeOrderResult) => void;
56
+ }>(({ children, className, showAutomationExecutionPanel, onNodeOrderChange }, ref) => {
49
57
  const undo = useDiagram((state) => state.undo);
50
58
  const redo = useDiagram((state) => state.redo);
51
59
  const reset = useDiagram((state) => state.reset);
@@ -56,6 +64,14 @@ const DiagrammingPageInternal = forwardRef<DiagrammingPageRef, { children?: Reac
56
64
  const selectedNode = useDiagram((state) => state.selectedNode);
57
65
  const setNodes = useDiagram((state) => state.setNodes);
58
66
 
67
+ // Send node order to parent project whenever nodes/edges change
68
+ useEffect(() => {
69
+ if (nodes.length > 0 && edges.length > 0 && onNodeOrderChange) {
70
+ const nodeOrder = orderNodesByEdges(nodes, edges);
71
+ onNodeOrderChange(nodeOrder);
72
+ }
73
+ }, [nodes, edges, onNodeOrderChange]);
74
+
59
75
  useImperativeHandle(ref, () => ({
60
76
  undo,
61
77
  redo,
@@ -84,6 +100,8 @@ const DiagrammingPageInternal = forwardRef<DiagrammingPageRef, { children?: Reac
84
100
  getSelectedNode: () => selectedNode,
85
101
  getNodes: () => nodes,
86
102
  getEdges: () => edges,
103
+ // Get ordered nodes based on edge connections
104
+ getNodeOrder: () => orderNodesByEdges(nodes, edges),
87
105
  }));
88
106
 
89
107
  return (
@@ -127,6 +145,8 @@ export interface DiagrammingPageProps {
127
145
  enableNodeJsonPopover?: boolean;
128
146
  // New: control visibility of automation execution panel
129
147
  showAutomationExecutionPanel?: boolean;
148
+ // New: callback to receive node order based on arrow/edge connections
149
+ onNodeOrderChange?: (nodeOrder: NodeOrderResult) => void;
130
150
  }
131
151
 
132
152
  export const DiagrammingPage = forwardRef<DiagrammingPageRef, DiagrammingPageProps>(({
@@ -145,7 +165,8 @@ export const DiagrammingPage = forwardRef<DiagrammingPageRef, DiagrammingPagePro
145
165
  conditionBuilderStates,
146
166
  onNodeSelect: onNodeSelectProp,
147
167
  enableNodeJsonPopover: enableNodeJsonPopoverProp,
148
- showAutomationExecutionPanel
168
+ showAutomationExecutionPanel,
169
+ onNodeOrderChange
149
170
  }, ref) => {
150
171
  return (
151
172
  <ThemeProvider theme={theme}>
@@ -169,7 +190,12 @@ export const DiagrammingPage = forwardRef<DiagrammingPageRef, DiagrammingPagePro
169
190
  {/* Variable registration handler */}
170
191
  <VariableRegistrationHandler />
171
192
 
172
- <DiagrammingPageInternal ref={ref} className={className} showAutomationExecutionPanel={showAutomationExecutionPanel}>
193
+ <DiagrammingPageInternal
194
+ ref={ref}
195
+ className={className}
196
+ showAutomationExecutionPanel={showAutomationExecutionPanel}
197
+ onNodeOrderChange={onNodeOrderChange}
198
+ >
173
199
  {children}
174
200
  </DiagrammingPageInternal>
175
201
  </DiagramStoreProvider>