@memberjunction/ng-flow-editor 0.0.1 → 4.0.0
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/dist/lib/agent-editor/agent-flow-transformer.service.d.ts +83 -0
- package/dist/lib/agent-editor/agent-flow-transformer.service.d.ts.map +1 -0
- package/dist/lib/agent-editor/agent-flow-transformer.service.js +447 -0
- package/dist/lib/agent-editor/agent-flow-transformer.service.js.map +1 -0
- package/dist/lib/agent-editor/agent-properties-panel.component.d.ts +92 -0
- package/dist/lib/agent-editor/agent-properties-panel.component.d.ts.map +1 -0
- package/dist/lib/agent-editor/agent-properties-panel.component.js +1139 -0
- package/dist/lib/agent-editor/agent-properties-panel.component.js.map +1 -0
- package/dist/lib/agent-editor/agent-step-list.component.d.ts +17 -0
- package/dist/lib/agent-editor/agent-step-list.component.d.ts.map +1 -0
- package/dist/lib/agent-editor/agent-step-list.component.js +278 -0
- package/dist/lib/agent-editor/agent-step-list.component.js.map +1 -0
- package/dist/lib/agent-editor/flow-agent-editor.component.d.ts +134 -0
- package/dist/lib/agent-editor/flow-agent-editor.component.d.ts.map +1 -0
- package/dist/lib/agent-editor/flow-agent-editor.component.js +999 -0
- package/dist/lib/agent-editor/flow-agent-editor.component.js.map +1 -0
- package/dist/lib/components/flow-editor.component.d.ts +169 -0
- package/dist/lib/components/flow-editor.component.d.ts.map +1 -0
- package/dist/lib/components/flow-editor.component.js +1090 -0
- package/dist/lib/components/flow-editor.component.js.map +1 -0
- package/dist/lib/components/flow-node.component.d.ts +50 -0
- package/dist/lib/components/flow-node.component.d.ts.map +1 -0
- package/dist/lib/components/flow-node.component.js +358 -0
- package/dist/lib/components/flow-node.component.js.map +1 -0
- package/dist/lib/components/flow-palette.component.d.ts +17 -0
- package/dist/lib/components/flow-palette.component.d.ts.map +1 -0
- package/dist/lib/components/flow-palette.component.js +110 -0
- package/dist/lib/components/flow-palette.component.js.map +1 -0
- package/dist/lib/components/flow-status-bar.component.d.ts +13 -0
- package/dist/lib/components/flow-status-bar.component.d.ts.map +1 -0
- package/dist/lib/components/flow-status-bar.component.js +81 -0
- package/dist/lib/components/flow-status-bar.component.js.map +1 -0
- package/dist/lib/components/flow-toolbar.component.d.ts +25 -0
- package/dist/lib/components/flow-toolbar.component.d.ts.map +1 -0
- package/dist/lib/components/flow-toolbar.component.js +192 -0
- package/dist/lib/components/flow-toolbar.component.js.map +1 -0
- package/dist/lib/flow-editor.module.d.ts +19 -0
- package/dist/lib/flow-editor.module.d.ts.map +1 -0
- package/dist/lib/flow-editor.module.js +84 -0
- package/dist/lib/flow-editor.module.js.map +1 -0
- package/dist/lib/interfaces/flow-types.d.ts +153 -0
- package/dist/lib/interfaces/flow-types.d.ts.map +1 -0
- package/dist/lib/interfaces/flow-types.js +6 -0
- package/dist/lib/interfaces/flow-types.js.map +1 -0
- package/dist/lib/services/flow-layout.service.d.ts +21 -0
- package/dist/lib/services/flow-layout.service.d.ts.map +1 -0
- package/dist/lib/services/flow-layout.service.js +76 -0
- package/dist/lib/services/flow-layout.service.js.map +1 -0
- package/dist/lib/services/flow-state.service.d.ts +37 -0
- package/dist/lib/services/flow-state.service.d.ts.map +1 -0
- package/dist/lib/services/flow-state.service.js +89 -0
- package/dist/lib/services/flow-state.service.js.map +1 -0
- package/dist/public-api.d.ts +14 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +22 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +51 -6
- package/README.md +0 -45
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core interfaces for the generic flow editor.
|
|
3
|
+
* These types are entity-agnostic — consumers map their domain data to/from these.
|
|
4
|
+
*/
|
|
5
|
+
/** Position on the canvas */
|
|
6
|
+
export interface FlowPosition {
|
|
7
|
+
X: number;
|
|
8
|
+
Y: number;
|
|
9
|
+
}
|
|
10
|
+
/** Size dimensions */
|
|
11
|
+
export interface FlowSize {
|
|
12
|
+
Width: number;
|
|
13
|
+
Height: number;
|
|
14
|
+
}
|
|
15
|
+
/** A port (connector) on a node */
|
|
16
|
+
export interface FlowNodePort {
|
|
17
|
+
ID: string;
|
|
18
|
+
Direction: 'input' | 'output';
|
|
19
|
+
Side?: 'left' | 'right' | 'top' | 'bottom' | 'auto';
|
|
20
|
+
Multiple?: boolean;
|
|
21
|
+
Disabled?: boolean;
|
|
22
|
+
Label?: string;
|
|
23
|
+
/** Category string for connection validation (matched against FlowNodePort on targets) */
|
|
24
|
+
Category?: string;
|
|
25
|
+
}
|
|
26
|
+
/** A small info badge displayed on a node */
|
|
27
|
+
export interface FlowNodeBadge {
|
|
28
|
+
Label: string;
|
|
29
|
+
Value: string;
|
|
30
|
+
Icon?: string;
|
|
31
|
+
Color?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Visual status of a node */
|
|
34
|
+
export type FlowNodeStatus = 'default' | 'success' | 'error' | 'warning' | 'running' | 'disabled' | 'pending';
|
|
35
|
+
/** A node in the flow graph */
|
|
36
|
+
export interface FlowNode {
|
|
37
|
+
ID: string;
|
|
38
|
+
Type: string;
|
|
39
|
+
Label: string;
|
|
40
|
+
Subtitle?: string;
|
|
41
|
+
Icon?: string;
|
|
42
|
+
IconColor?: string;
|
|
43
|
+
Status: FlowNodeStatus;
|
|
44
|
+
StatusMessage?: string;
|
|
45
|
+
Badges?: FlowNodeBadge[];
|
|
46
|
+
Position: FlowPosition;
|
|
47
|
+
Size?: FlowSize;
|
|
48
|
+
Ports: FlowNodePort[];
|
|
49
|
+
Collapsed?: boolean;
|
|
50
|
+
Selected?: boolean;
|
|
51
|
+
Locked?: boolean;
|
|
52
|
+
IsStartNode?: boolean;
|
|
53
|
+
/** Opaque data payload — consumers store domain-specific data here */
|
|
54
|
+
Data?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
/** Visual style for a connection line */
|
|
57
|
+
export type FlowConnectionStyle = 'solid' | 'dashed' | 'dotted';
|
|
58
|
+
/** A connection (edge) between two nodes */
|
|
59
|
+
export interface FlowConnection {
|
|
60
|
+
ID: string;
|
|
61
|
+
SourceNodeID: string;
|
|
62
|
+
SourcePortID: string;
|
|
63
|
+
TargetNodeID: string;
|
|
64
|
+
TargetPortID: string;
|
|
65
|
+
Label?: string;
|
|
66
|
+
LabelDetail?: string;
|
|
67
|
+
/** Font Awesome icon class shown before the label text (e.g., 'fa-check') */
|
|
68
|
+
LabelIcon?: string;
|
|
69
|
+
/** Color for the label icon */
|
|
70
|
+
LabelIconColor?: string;
|
|
71
|
+
Condition?: string;
|
|
72
|
+
Priority?: number;
|
|
73
|
+
Style?: FlowConnectionStyle;
|
|
74
|
+
Color?: string;
|
|
75
|
+
Animated?: boolean;
|
|
76
|
+
Selected?: boolean;
|
|
77
|
+
/** Opaque data payload — consumers store domain-specific data here */
|
|
78
|
+
Data?: Record<string, unknown>;
|
|
79
|
+
}
|
|
80
|
+
/** Configuration for a node type displayed in the palette */
|
|
81
|
+
export interface FlowNodeTypeConfig {
|
|
82
|
+
/** Unique type identifier (e.g., 'Action', 'Prompt') */
|
|
83
|
+
Type: string;
|
|
84
|
+
/** Display label */
|
|
85
|
+
Label: string;
|
|
86
|
+
/** Font Awesome icon class (e.g., 'fa-bolt') */
|
|
87
|
+
Icon: string;
|
|
88
|
+
/** Hex color for the node header */
|
|
89
|
+
Color: string;
|
|
90
|
+
/** Default ports created when this node type is added */
|
|
91
|
+
DefaultPorts?: FlowNodePort[];
|
|
92
|
+
/** Palette category for grouping (e.g., 'Steps', 'Loops') */
|
|
93
|
+
Category?: string;
|
|
94
|
+
/** Whether this type can be dragged from the palette (default true) */
|
|
95
|
+
Draggable?: boolean;
|
|
96
|
+
/** Maximum number of instances allowed (0 = unlimited, default 0) */
|
|
97
|
+
MaxInstances?: number;
|
|
98
|
+
}
|
|
99
|
+
/** Emitted when a new node is added from the palette */
|
|
100
|
+
export interface FlowNodeAddedEvent {
|
|
101
|
+
Node: FlowNode;
|
|
102
|
+
DropPosition: FlowPosition;
|
|
103
|
+
}
|
|
104
|
+
/** Emitted when a node is moved on the canvas */
|
|
105
|
+
export interface FlowNodeMovedEvent {
|
|
106
|
+
NodeID: string;
|
|
107
|
+
OldPosition: FlowPosition;
|
|
108
|
+
NewPosition: FlowPosition;
|
|
109
|
+
}
|
|
110
|
+
/** Emitted when a new connection is drawn */
|
|
111
|
+
export interface FlowConnectionCreatedEvent {
|
|
112
|
+
SourceNodeID: string;
|
|
113
|
+
SourcePortID: string;
|
|
114
|
+
TargetNodeID: string;
|
|
115
|
+
TargetPortID: string;
|
|
116
|
+
}
|
|
117
|
+
/** Emitted when an existing connection is reassigned (endpoint dragged to a different node) */
|
|
118
|
+
export interface FlowConnectionReassignedEvent {
|
|
119
|
+
ConnectionID: string;
|
|
120
|
+
OldSourceNodeID: string;
|
|
121
|
+
OldSourcePortID: string;
|
|
122
|
+
OldTargetNodeID: string;
|
|
123
|
+
OldTargetPortID: string;
|
|
124
|
+
NewSourceNodeID: string;
|
|
125
|
+
NewSourcePortID: string;
|
|
126
|
+
NewTargetNodeID: string;
|
|
127
|
+
NewTargetPortID: string;
|
|
128
|
+
}
|
|
129
|
+
/** Emitted when the selection state changes */
|
|
130
|
+
export interface FlowSelectionChangedEvent {
|
|
131
|
+
SelectedNodeIDs: string[];
|
|
132
|
+
SelectedConnectionIDs: string[];
|
|
133
|
+
}
|
|
134
|
+
/** Emitted when empty canvas is clicked */
|
|
135
|
+
export interface FlowCanvasClickEvent {
|
|
136
|
+
Position: FlowPosition;
|
|
137
|
+
}
|
|
138
|
+
/** Context menu target type */
|
|
139
|
+
export type FlowContextMenuTarget = 'node' | 'connection';
|
|
140
|
+
/** Context menu action */
|
|
141
|
+
export type FlowContextMenuAction = 'edit' | 'remove';
|
|
142
|
+
/** A complete snapshot of the flow state */
|
|
143
|
+
export interface FlowSnapshot {
|
|
144
|
+
Nodes: FlowNode[];
|
|
145
|
+
Connections: FlowConnection[];
|
|
146
|
+
}
|
|
147
|
+
/** Direction for auto-layout */
|
|
148
|
+
export type FlowLayoutDirection = 'horizontal' | 'vertical';
|
|
149
|
+
/** Result of an auto-layout operation */
|
|
150
|
+
export interface FlowLayoutResult {
|
|
151
|
+
Positions: Map<string, FlowPosition>;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=flow-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-types.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/flow-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,sBAAsB;AACtB,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,mCAAmC;AACnC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,8BAA8B;AAC9B,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAE9G,+BAA+B;AAC/B,MAAM,WAAW,QAAQ;IACvB,E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xB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,+CAA+C;AAC/C,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,+BAA+B;AAC/B,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,YAAY,CAAC;AAE1D,0BAA0B;AAC1B,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAMtD,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;AAMD,gCAAgC;AAChC,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE5D,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-types.js","sourceRoot":"","sources":["../../../src/lib/interfaces/flow-types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FlowNode, FlowConnection, FlowLayoutDirection, FlowLayoutResult } from '../interfaces/flow-types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Auto-layout service using dagre for directed graph layout.
|
|
5
|
+
* Calculates optimal node positions for clean flow visualization.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FlowLayoutService {
|
|
8
|
+
private static readonly DEFAULT_NODE_WIDTH;
|
|
9
|
+
private static readonly DEFAULT_NODE_HEIGHT;
|
|
10
|
+
private static readonly NODE_SEPARATION;
|
|
11
|
+
private static readonly RANK_SEPARATION;
|
|
12
|
+
/**
|
|
13
|
+
* Calculate optimal positions for all nodes using dagre layout.
|
|
14
|
+
* Returns a map of node ID → new position.
|
|
15
|
+
*/
|
|
16
|
+
CalculateLayout(nodes: FlowNode[], connections: FlowConnection[], direction?: FlowLayoutDirection): FlowLayoutResult;
|
|
17
|
+
private currentPositions;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowLayoutService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FlowLayoutService>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=flow-layout.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-layout.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/flow-layout.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAgB,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;;AAEzH;;;GAGG;AACH,qBACa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAO;IACjD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAO;IAClD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAM;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAO;IAE9C;;;OAGG;IACH,eAAe,CACb,KAAK,EAAE,QAAQ,EAAE,EACjB,WAAW,EAAE,cAAc,EAAE,EAC7B,SAAS,GAAE,mBAAgC,GAC1C,gBAAgB;IAqDnB,OAAO,CAAC,gBAAgB;yCAnEb,iBAAiB;6CAAjB,iBAAiB;CA0E7B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Auto-layout service using dagre for directed graph layout.
|
|
5
|
+
* Calculates optimal node positions for clean flow visualization.
|
|
6
|
+
*/
|
|
7
|
+
export class FlowLayoutService {
|
|
8
|
+
static DEFAULT_NODE_WIDTH = 220;
|
|
9
|
+
static DEFAULT_NODE_HEIGHT = 100;
|
|
10
|
+
static NODE_SEPARATION = 60;
|
|
11
|
+
static RANK_SEPARATION = 100;
|
|
12
|
+
/**
|
|
13
|
+
* Calculate optimal positions for all nodes using dagre layout.
|
|
14
|
+
* Returns a map of node ID → new position.
|
|
15
|
+
*/
|
|
16
|
+
CalculateLayout(nodes, connections, direction = 'vertical') {
|
|
17
|
+
// Dynamic import dagre to avoid issues if not installed
|
|
18
|
+
let dagre;
|
|
19
|
+
try {
|
|
20
|
+
dagre = require('@dagrejs/dagre');
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
console.warn('FlowLayoutService: @dagrejs/dagre not available, returning current positions');
|
|
24
|
+
return this.currentPositions(nodes);
|
|
25
|
+
}
|
|
26
|
+
const graph = new dagre.graphlib.Graph();
|
|
27
|
+
graph.setGraph({
|
|
28
|
+
rankdir: direction === 'horizontal' ? 'LR' : 'TB',
|
|
29
|
+
nodesep: FlowLayoutService.NODE_SEPARATION,
|
|
30
|
+
ranksep: FlowLayoutService.RANK_SEPARATION,
|
|
31
|
+
marginx: 40,
|
|
32
|
+
marginy: 40
|
|
33
|
+
});
|
|
34
|
+
graph.setDefaultEdgeLabel(() => ({}));
|
|
35
|
+
// Add nodes
|
|
36
|
+
for (const node of nodes) {
|
|
37
|
+
const width = node.Size?.Width ?? FlowLayoutService.DEFAULT_NODE_WIDTH;
|
|
38
|
+
const height = node.Size?.Height ?? FlowLayoutService.DEFAULT_NODE_HEIGHT;
|
|
39
|
+
graph.setNode(node.ID, { width, height });
|
|
40
|
+
}
|
|
41
|
+
// Add edges
|
|
42
|
+
for (const conn of connections) {
|
|
43
|
+
if (graph.hasNode(conn.SourceNodeID) && graph.hasNode(conn.TargetNodeID)) {
|
|
44
|
+
graph.setEdge(conn.SourceNodeID, conn.TargetNodeID);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
dagre.layout(graph);
|
|
48
|
+
const positions = new Map();
|
|
49
|
+
for (const node of nodes) {
|
|
50
|
+
const layoutNode = graph.node(node.ID);
|
|
51
|
+
if (layoutNode) {
|
|
52
|
+
// dagre returns center positions; convert to top-left
|
|
53
|
+
const width = node.Size?.Width ?? FlowLayoutService.DEFAULT_NODE_WIDTH;
|
|
54
|
+
const height = node.Size?.Height ?? FlowLayoutService.DEFAULT_NODE_HEIGHT;
|
|
55
|
+
positions.set(node.ID, {
|
|
56
|
+
X: layoutNode.x - width / 2,
|
|
57
|
+
Y: layoutNode.y - height / 2
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return { Positions: positions };
|
|
62
|
+
}
|
|
63
|
+
currentPositions(nodes) {
|
|
64
|
+
const positions = new Map();
|
|
65
|
+
for (const node of nodes) {
|
|
66
|
+
positions.set(node.ID, { ...node.Position });
|
|
67
|
+
}
|
|
68
|
+
return { Positions: positions };
|
|
69
|
+
}
|
|
70
|
+
static ɵfac = function FlowLayoutService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FlowLayoutService)(); };
|
|
71
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FlowLayoutService, factory: FlowLayoutService.ɵfac });
|
|
72
|
+
}
|
|
73
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FlowLayoutService, [{
|
|
74
|
+
type: Injectable
|
|
75
|
+
}], null, null); })();
|
|
76
|
+
//# sourceMappingURL=flow-layout.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-layout.service.js","sourceRoot":"","sources":["../../../src/lib/services/flow-layout.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAG3C;;;GAGG;AAEH,MA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IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAClC,CAAC;2GAzEU,iBAAiB;gEAAjB,iBAAiB,WAAjB,iBAAiB;;iFAAjB,iBAAiB;cAD7B,UAAU"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FlowNode, FlowConnection, FlowSnapshot } from '../interfaces/flow-types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Snapshot-based undo/redo state management for the flow editor.
|
|
5
|
+
* Stores complete state snapshots on each change for reliable undo/redo.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FlowStateService {
|
|
8
|
+
private undoStack;
|
|
9
|
+
private redoStack;
|
|
10
|
+
private maxStackSize;
|
|
11
|
+
get CanUndo(): boolean;
|
|
12
|
+
get CanRedo(): boolean;
|
|
13
|
+
get UndoCount(): number;
|
|
14
|
+
get RedoCount(): number;
|
|
15
|
+
/**
|
|
16
|
+
* Push the current state before making a change.
|
|
17
|
+
* Call this BEFORE modifying nodes/connections so the previous state is saved.
|
|
18
|
+
*/
|
|
19
|
+
PushState(nodes: FlowNode[], connections: FlowConnection[]): void;
|
|
20
|
+
/**
|
|
21
|
+
* Undo the last change. Returns the previous state snapshot.
|
|
22
|
+
* The caller must pass the CURRENT state so it can be pushed to redo.
|
|
23
|
+
*/
|
|
24
|
+
Undo(currentNodes: FlowNode[], currentConnections: FlowConnection[]): FlowSnapshot | null;
|
|
25
|
+
/**
|
|
26
|
+
* Redo the last undone change. Returns the restored state snapshot.
|
|
27
|
+
* The caller must pass the CURRENT state so it can be pushed to undo.
|
|
28
|
+
*/
|
|
29
|
+
Redo(currentNodes: FlowNode[], currentConnections: FlowConnection[]): FlowSnapshot | null;
|
|
30
|
+
/** Clear all undo/redo history */
|
|
31
|
+
Clear(): void;
|
|
32
|
+
private createSnapshot;
|
|
33
|
+
private cloneNode;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowStateService, never>;
|
|
35
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FlowStateService>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=flow-state.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-state.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/flow-state.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;;AAElF;;;GAGG;AACH,qBACa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,YAAY,CAAM;IAE1B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAI;IAUjE;;;OAGG;IACH,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,YAAY,GAAG,IAAI;IAUzF;;;OAGG;IACH,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,YAAY,GAAG,IAAI;IAUzF,kCAAkC;IAClC,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,SAAS;yCA5EN,gBAAgB;6CAAhB,gBAAgB;CAsF5B"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Snapshot-based undo/redo state management for the flow editor.
|
|
5
|
+
* Stores complete state snapshots on each change for reliable undo/redo.
|
|
6
|
+
*/
|
|
7
|
+
export class FlowStateService {
|
|
8
|
+
undoStack = [];
|
|
9
|
+
redoStack = [];
|
|
10
|
+
maxStackSize = 50;
|
|
11
|
+
get CanUndo() {
|
|
12
|
+
return this.undoStack.length > 0;
|
|
13
|
+
}
|
|
14
|
+
get CanRedo() {
|
|
15
|
+
return this.redoStack.length > 0;
|
|
16
|
+
}
|
|
17
|
+
get UndoCount() {
|
|
18
|
+
return this.undoStack.length;
|
|
19
|
+
}
|
|
20
|
+
get RedoCount() {
|
|
21
|
+
return this.redoStack.length;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Push the current state before making a change.
|
|
25
|
+
* Call this BEFORE modifying nodes/connections so the previous state is saved.
|
|
26
|
+
*/
|
|
27
|
+
PushState(nodes, connections) {
|
|
28
|
+
const snapshot = this.createSnapshot(nodes, connections);
|
|
29
|
+
this.undoStack.push(snapshot);
|
|
30
|
+
if (this.undoStack.length > this.maxStackSize) {
|
|
31
|
+
this.undoStack.shift();
|
|
32
|
+
}
|
|
33
|
+
// Any new action clears the redo stack
|
|
34
|
+
this.redoStack = [];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Undo the last change. Returns the previous state snapshot.
|
|
38
|
+
* The caller must pass the CURRENT state so it can be pushed to redo.
|
|
39
|
+
*/
|
|
40
|
+
Undo(currentNodes, currentConnections) {
|
|
41
|
+
if (!this.CanUndo) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
// Push current state to redo
|
|
45
|
+
this.redoStack.push(this.createSnapshot(currentNodes, currentConnections));
|
|
46
|
+
// Pop and return previous state
|
|
47
|
+
return this.undoStack.pop();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Redo the last undone change. Returns the restored state snapshot.
|
|
51
|
+
* The caller must pass the CURRENT state so it can be pushed to undo.
|
|
52
|
+
*/
|
|
53
|
+
Redo(currentNodes, currentConnections) {
|
|
54
|
+
if (!this.CanRedo) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
// Push current state to undo
|
|
58
|
+
this.undoStack.push(this.createSnapshot(currentNodes, currentConnections));
|
|
59
|
+
// Pop and return redo state
|
|
60
|
+
return this.redoStack.pop();
|
|
61
|
+
}
|
|
62
|
+
/** Clear all undo/redo history */
|
|
63
|
+
Clear() {
|
|
64
|
+
this.undoStack = [];
|
|
65
|
+
this.redoStack = [];
|
|
66
|
+
}
|
|
67
|
+
createSnapshot(nodes, connections) {
|
|
68
|
+
return {
|
|
69
|
+
Nodes: nodes.map(n => this.cloneNode(n)),
|
|
70
|
+
Connections: connections.map(c => ({ ...c, Data: c.Data ? { ...c.Data } : undefined }))
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
cloneNode(node) {
|
|
74
|
+
return {
|
|
75
|
+
...node,
|
|
76
|
+
Position: { ...node.Position },
|
|
77
|
+
Size: node.Size ? { ...node.Size } : undefined,
|
|
78
|
+
Ports: node.Ports.map(p => ({ ...p })),
|
|
79
|
+
Badges: node.Badges ? node.Badges.map(b => ({ ...b })) : undefined,
|
|
80
|
+
Data: node.Data ? { ...node.Data } : undefined
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
static ɵfac = function FlowStateService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FlowStateService)(); };
|
|
84
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FlowStateService, factory: FlowStateService.ɵfac });
|
|
85
|
+
}
|
|
86
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FlowStateService, [{
|
|
87
|
+
type: Injectable
|
|
88
|
+
}], null, null); })();
|
|
89
|
+
//# sourceMappingURL=flow-state.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-state.service.js","sourceRoot":"","sources":["../../../src/lib/services/flow-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AAC,EAAE,CAAC,CAAC;YACtC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YAClE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;SAC/C,CAAC;IACJ,CAAC;0GArFU,gBAAgB;gEAAhB,gBAAgB,WAAhB,gBAAgB;;iFAAhB,gBAAgB;cAD5B,UAAU"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './lib/flow-editor.module';
|
|
2
|
+
export * from './lib/interfaces/flow-types';
|
|
3
|
+
export * from './lib/services/flow-state.service';
|
|
4
|
+
export * from './lib/services/flow-layout.service';
|
|
5
|
+
export * from './lib/components/flow-editor.component';
|
|
6
|
+
export * from './lib/components/flow-node.component';
|
|
7
|
+
export * from './lib/components/flow-palette.component';
|
|
8
|
+
export * from './lib/components/flow-toolbar.component';
|
|
9
|
+
export * from './lib/components/flow-status-bar.component';
|
|
10
|
+
export * from './lib/agent-editor/flow-agent-editor.component';
|
|
11
|
+
export * from './lib/agent-editor/agent-properties-panel.component';
|
|
12
|
+
export * from './lib/agent-editor/agent-step-list.component';
|
|
13
|
+
export * from './lib/agent-editor/agent-flow-transformer.service';
|
|
14
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,0BAA0B,CAAC;AAGzC,cAAc,6BAA6B,CAAC;AAG5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AAGnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAG3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of @memberjunction/ng-flow-editor
|
|
3
|
+
*/
|
|
4
|
+
// Module
|
|
5
|
+
export * from './lib/flow-editor.module';
|
|
6
|
+
// Interfaces
|
|
7
|
+
export * from './lib/interfaces/flow-types';
|
|
8
|
+
// Services
|
|
9
|
+
export * from './lib/services/flow-state.service';
|
|
10
|
+
export * from './lib/services/flow-layout.service';
|
|
11
|
+
// Generic Components
|
|
12
|
+
export * from './lib/components/flow-editor.component';
|
|
13
|
+
export * from './lib/components/flow-node.component';
|
|
14
|
+
export * from './lib/components/flow-palette.component';
|
|
15
|
+
export * from './lib/components/flow-toolbar.component';
|
|
16
|
+
export * from './lib/components/flow-status-bar.component';
|
|
17
|
+
// Agent Editor Components
|
|
18
|
+
export * from './lib/agent-editor/flow-agent-editor.component';
|
|
19
|
+
export * from './lib/agent-editor/agent-properties-panel.component';
|
|
20
|
+
export * from './lib/agent-editor/agent-step-list.component';
|
|
21
|
+
export * from './lib/agent-editor/agent-flow-transformer.service';
|
|
22
|
+
//# sourceMappingURL=public-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,0BAA0B,CAAC;AAEzC,aAAa;AACb,cAAc,6BAA6B,CAAC;AAE5C,WAAW;AACX,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AAEnD,qBAAqB;AACrB,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAE3D,0BAA0B;AAC1B,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-flow-editor",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "MemberJunction: Generic visual flow editor component powered by Foblex Flow, with an agent-specific Flow Agent Editor",
|
|
5
|
+
"main": "./dist/public-api.js",
|
|
6
|
+
"typings": "./dist/public-api.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"/dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
+
"build": "ngc"
|
|
13
|
+
},
|
|
5
14
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
15
|
+
"angular",
|
|
16
|
+
"flow-editor",
|
|
17
|
+
"workflow",
|
|
18
|
+
"node-based",
|
|
19
|
+
"foblex",
|
|
20
|
+
"visual-editor",
|
|
21
|
+
"memberjunction"
|
|
22
|
+
],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@angular/compiler": "21.1.3",
|
|
27
|
+
"@angular/compiler-cli": "21.1.3",
|
|
28
|
+
"sass": "^1.97.3"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@angular/common": "21.1.3",
|
|
32
|
+
"@angular/core": "21.1.3",
|
|
33
|
+
"@angular/forms": "21.1.3",
|
|
34
|
+
"@angular/platform-browser": "21.1.3"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@dagrejs/dagre": "^1.1.8",
|
|
38
|
+
"@foblex/2d": "1.2.2",
|
|
39
|
+
"@foblex/flow": "^18.0.0",
|
|
40
|
+
"@foblex/mediator": "1.1.3",
|
|
41
|
+
"@foblex/platform": "1.0.4",
|
|
42
|
+
"@foblex/utils": "1.1.1",
|
|
43
|
+
"@memberjunction/core": "4.0.0",
|
|
44
|
+
"@memberjunction/core-entities": "4.0.0",
|
|
45
|
+
"@memberjunction/global": "4.0.0",
|
|
46
|
+
"@memberjunction/ng-code-editor": "4.0.0",
|
|
47
|
+
"rxjs": "^7.8.2",
|
|
48
|
+
"tslib": "^2.8.1"
|
|
49
|
+
},
|
|
50
|
+
"sideEffects": false,
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/MemberJunction/MJ"
|
|
54
|
+
}
|
|
10
55
|
}
|
package/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# @memberjunction/ng-flow-editor
|
|
2
|
-
|
|
3
|
-
## ⚠️ IMPORTANT NOTICE ⚠️
|
|
4
|
-
|
|
5
|
-
**This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
|
|
6
|
-
|
|
7
|
-
This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
This package exists to:
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@memberjunction/ng-flow-editor`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
-
|
|
16
|
-
## What is OIDC Trusted Publishing?
|
|
17
|
-
|
|
18
|
-
OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
|
|
19
|
-
|
|
20
|
-
## Setup Instructions
|
|
21
|
-
|
|
22
|
-
To properly configure OIDC trusted publishing for this package:
|
|
23
|
-
|
|
24
|
-
1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
28
|
-
|
|
29
|
-
## DO NOT USE THIS PACKAGE
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|