@memberjunction/ng-flow-editor 5.30.1 → 5.31.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/flow-agent-editor.component.d.ts +2 -1
- package/dist/lib/agent-editor/flow-agent-editor.component.d.ts.map +1 -1
- package/dist/lib/agent-editor/flow-agent-editor.component.js +20 -18
- package/dist/lib/agent-editor/flow-agent-editor.component.js.map +1 -1
- package/package.json +6 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
2
3
|
import { MJAIAgentStepEntity, MJAIAgentStepPathEntity } from '@memberjunction/core-entities';
|
|
3
4
|
import { FlowNode, FlowConnection, FlowNodeAddedEvent, FlowConnectionCreatedEvent, FlowConnectionReassignedEvent, FlowNodeTypeConfig } from '../interfaces/flow-types';
|
|
4
5
|
import { FlowEditorComponent } from '../components/flow-editor.component';
|
|
@@ -10,7 +11,7 @@ export type AgentEditorViewMode = 'diagram' | 'list';
|
|
|
10
11
|
* Flow Agent Editor — wraps the generic FlowEditorComponent with
|
|
11
12
|
* MJ agent-specific CRUD, properties panel, and data transformation.
|
|
12
13
|
*/
|
|
13
|
-
export declare class FlowAgentEditorComponent implements OnInit, OnChanges, OnDestroy {
|
|
14
|
+
export declare class FlowAgentEditorComponent extends BaseAngularComponent implements OnInit, OnChanges, OnDestroy {
|
|
14
15
|
private cdr;
|
|
15
16
|
private transformer;
|
|
16
17
|
private elRef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-agent-editor.component.d.ts","sourceRoot":"","sources":["../../../src/lib/agent-editor/flow-agent-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAC/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I,IAAI;IAKhC,uGAAuG;IACvG,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAK1C,SAAS,CAAC,oBAAoB,IAAI,IAAI;IAYtC,SAAS,CAAC,gBAAgB,IAAI,IAAI;IASlC,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAKrC,SAAS,CAAC,sBAAsB,IAAI,IAAI;IASxC,SAAS,CAAC,qBAAqB,IAAI,IAAI;IAKvC,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,qBAAqB;IAmB7B,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI;IAY9D,SAAS,CAAC,WAAW,IAAI,IAAI;IAU7B,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,mBAAmB;IAU3B,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAKhD,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAKnD,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAOlD,OAAO,CAAC,SAAS;yCAjxBN,wBAAwB;2CAAxB,wBAAwB;CAuxBpC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, Input, Output, EventEmitter, ViewChild, ViewEncapsulation, HostListener, HostBinding } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { RunView, CompositeKey } from '@memberjunction/core';
|
|
3
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
4
|
import { UserInfoEngine } from '@memberjunction/core-entities';
|
|
4
5
|
import { AgentFlowTransformerService, AGENT_STEP_TYPE_CONFIGS } from './agent-flow-transformer.service';
|
|
5
6
|
import { UUIDsEqual } from '@memberjunction/global';
|
|
@@ -190,7 +191,7 @@ function FlowAgentEditorComponent_Conditional_29_Template(rf, ctx) { if (rf & 1)
|
|
|
190
191
|
* Flow Agent Editor — wraps the generic FlowEditorComponent with
|
|
191
192
|
* MJ agent-specific CRUD, properties panel, and data transformation.
|
|
192
193
|
*/
|
|
193
|
-
export class FlowAgentEditorComponent {
|
|
194
|
+
export class FlowAgentEditorComponent extends BaseAngularComponent {
|
|
194
195
|
cdr;
|
|
195
196
|
transformer;
|
|
196
197
|
elRef;
|
|
@@ -249,6 +250,7 @@ export class FlowAgentEditorComponent {
|
|
|
249
250
|
originalNextSibling = null;
|
|
250
251
|
backdropElement = null;
|
|
251
252
|
constructor(cdr, transformer, elRef, renderer) {
|
|
253
|
+
super();
|
|
252
254
|
this.cdr = cdr;
|
|
253
255
|
this.transformer = transformer;
|
|
254
256
|
this.elRef = elRef;
|
|
@@ -296,7 +298,7 @@ export class FlowAgentEditorComponent {
|
|
|
296
298
|
async loadStepsAndPaths() {
|
|
297
299
|
if (!this.AgentID)
|
|
298
300
|
return;
|
|
299
|
-
const rv =
|
|
301
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
300
302
|
const [stepsResult, pathsResult] = await rv.RunViews([
|
|
301
303
|
{
|
|
302
304
|
EntityName: 'MJ: AI Agent Steps',
|
|
@@ -317,7 +319,7 @@ export class FlowAgentEditorComponent {
|
|
|
317
319
|
this.deletedPathIDs = [];
|
|
318
320
|
}
|
|
319
321
|
async loadPickerData() {
|
|
320
|
-
const rv =
|
|
322
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
321
323
|
const [actionsResult, promptsResult, agentsResult] = await rv.RunViews([
|
|
322
324
|
{
|
|
323
325
|
EntityName: 'MJ: Actions',
|
|
@@ -405,8 +407,8 @@ export class FlowAgentEditorComponent {
|
|
|
405
407
|
this.syncPositionsFromCanvas();
|
|
406
408
|
// Bundle deletes and saves for steps + paths into one transaction so a partial save
|
|
407
409
|
// can never leave the flow in an inconsistent state.
|
|
408
|
-
const
|
|
409
|
-
const tg = await
|
|
410
|
+
const p = this.ProviderToUse;
|
|
411
|
+
const tg = await p.CreateTransactionGroup();
|
|
410
412
|
await this.queueRemovedEntitiesForDelete(tg);
|
|
411
413
|
for (const step of this.steps) {
|
|
412
414
|
step.TransactionGroup = tg;
|
|
@@ -452,15 +454,15 @@ export class FlowAgentEditorComponent {
|
|
|
452
454
|
}
|
|
453
455
|
}
|
|
454
456
|
async queueRemovedEntitiesForDelete(tg) {
|
|
455
|
-
const
|
|
457
|
+
const p = this.ProviderToUse;
|
|
456
458
|
for (const pathId of this.deletedPathIDs) {
|
|
457
|
-
const pathEntity = await
|
|
459
|
+
const pathEntity = await p.GetEntityObject('MJ: AI Agent Step Paths', p.CurrentUser);
|
|
458
460
|
await pathEntity.InnerLoad(CompositeKey.FromID(pathId));
|
|
459
461
|
pathEntity.TransactionGroup = tg;
|
|
460
462
|
await pathEntity.Delete();
|
|
461
463
|
}
|
|
462
464
|
for (const stepId of this.deletedStepIDs) {
|
|
463
|
-
const stepEntity = await
|
|
465
|
+
const stepEntity = await p.GetEntityObject('MJ: AI Agent Steps', p.CurrentUser);
|
|
464
466
|
await stepEntity.InnerLoad(CompositeKey.FromID(stepId));
|
|
465
467
|
stepEntity.TransactionGroup = tg;
|
|
466
468
|
await stepEntity.Delete();
|
|
@@ -470,8 +472,8 @@ export class FlowAgentEditorComponent {
|
|
|
470
472
|
async onNodeAdded(event) {
|
|
471
473
|
if (!this.AgentID)
|
|
472
474
|
return;
|
|
473
|
-
const
|
|
474
|
-
const step = await
|
|
475
|
+
const p = this.ProviderToUse;
|
|
476
|
+
const step = await p.GetEntityObject('MJ: AI Agent Steps', p.CurrentUser);
|
|
475
477
|
step.NewRecord(); // This generates a UUID immediately - available before Save()
|
|
476
478
|
step.AgentID = this.AgentID;
|
|
477
479
|
step.Name = event.Node.Label;
|
|
@@ -504,8 +506,8 @@ export class FlowAgentEditorComponent {
|
|
|
504
506
|
const exists = this.paths.some(p => UUIDsEqual(p.OriginStepID, event.SourceNodeID) && UUIDsEqual(p.DestinationStepID, event.TargetNodeID));
|
|
505
507
|
if (exists)
|
|
506
508
|
return;
|
|
507
|
-
const
|
|
508
|
-
const path = await
|
|
509
|
+
const p = this.ProviderToUse;
|
|
510
|
+
const path = await p.GetEntityObject('MJ: AI Agent Step Paths', p.CurrentUser);
|
|
509
511
|
path.NewRecord(); // Generates UUID immediately - available before Save()
|
|
510
512
|
path.OriginStepID = event.SourceNodeID;
|
|
511
513
|
path.DestinationStepID = event.TargetNodeID;
|
|
@@ -834,10 +836,10 @@ export class FlowAgentEditorComponent {
|
|
|
834
836
|
}
|
|
835
837
|
// ── Permission Check ────────────────────────────────────────
|
|
836
838
|
checkUpdatePermission() {
|
|
837
|
-
const
|
|
838
|
-
const entity =
|
|
839
|
+
const p = this.ProviderToUse;
|
|
840
|
+
const entity = p.EntityByName('MJ: AI Agents');
|
|
839
841
|
if (entity) {
|
|
840
|
-
const perms = entity.GetUserPermisions(
|
|
842
|
+
const perms = entity.GetUserPermisions(p.CurrentUser);
|
|
841
843
|
this.userCanUpdate = perms?.CanUpdate === true;
|
|
842
844
|
}
|
|
843
845
|
}
|
|
@@ -897,7 +899,7 @@ export class FlowAgentEditorComponent {
|
|
|
897
899
|
i0.ɵɵlistener("keydown.escape", function FlowAgentEditorComponent_keydown_escape_HostBindingHandler() { return ctx.onEscapeKey(); }, i0.ɵɵresolveDocument);
|
|
898
900
|
} if (rf & 2) {
|
|
899
901
|
i0.ɵɵclassProp("mj-flow-agent-editor--fullscreen", ctx.HostFullScreen);
|
|
900
|
-
} }, inputs: { AgentID: "AgentID", EditMode: "EditMode", FullScreen: "FullScreen" }, outputs: { FlowSaved: "FlowSaved", FlowChanged: "FlowChanged", FullScreenToggled: "FullScreenToggled", StepSelected: "StepSelected" }, standalone: false, features: [i0.ɵɵProvidersFeature([AgentFlowTransformerService]), i0.ɵɵNgOnChangesFeature], decls: 30, vars: 21, consts: [["flowEditor", ""], [1, "mj-agent-editor"], [1, "mj-agent-editor-toolbar"], [1, "mj-agent-editor-toolbar-left"], ["title", "Undo (Ctrl+Z)", 1, "mj-agent-editor-btn", 3, "disabled"], ["title", "Redo (Ctrl+Y)", 1, "mj-agent-editor-btn", 3, "disabled"], [1, "mj-agent-editor-toolbar-center"], [1, "mj-agent-editor-title"], [1, "fa-solid", "fa-diagram-project"], [1, "mj-agent-editor-view-toggle"], [1, "mj-agent-editor-view-btn", 3, "click"], [1, "fa-solid", "fa-list"], [1, "mj-agent-editor-mode-badge", "mj-agent-editor-mode-badge--editing"], [1, "mj-agent-editor-mode-badge", "mj-agent-editor-mode-badge--readonly"], [1, "mj-agent-editor-toolbar-right"], [1, "mj-agent-editor-status", "mj-agent-editor-status--unsaved"], [1, "mj-agent-editor-status"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--primary", 3, "disabled"], ["title", "Cancel editing", 1, "mj-agent-editor-btn"], [1, "mj-agent-editor-btn-divider"], ["title", "Edit flow", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--edit"], ["title", "Expand to full screen", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--expand"], ["title", "Close full screen (Esc)", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--close"], [1, "mj-agent-editor-loading"], [1, "mj-agent-editor-body"], [1, "mj-agent-editor-dialog-overlay"], ["title", "Undo (Ctrl+Z)", 1, "mj-agent-editor-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-rotate-left"], ["title", "Redo (Ctrl+Y)", 1, "mj-agent-editor-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-rotate-right"], [1, "fa-solid", "fa-pen"], [1, "fa-solid", "fa-lock"], [1, "fa-solid", "fa-circle"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--primary", 3, "click", "disabled"], [1, "fa-solid", 3, "ngClass"], ["title", "Cancel editing", 1, "mj-agent-editor-btn", 3, "click"], [1, "fa-solid", "fa-xmark"], ["title", "Edit flow", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--edit", 3, "click"], [1, "fa-solid", "fa-pen-to-square"], ["title", "Expand to full screen", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--expand", 3, "click"], [1, "fa-solid", "fa-up-right-and-down-left-from-center"], ["title", "Close full screen (Esc)", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--close", 3, "click"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "mj-agent-editor-diagram"], [1, "mj-agent-editor-list"], [3, "NodeSelected", "NodeAdded", "NodeRemoved", "ConnectionCreated", "ConnectionRemoved", "ConnectionReassigned", "ConnectionSelected", "NodesChanged", "ConnectionsChanged", "GridToggled", "MinimapToggled", "LegendToggled", "Nodes", "Connections", "NodeTypes", "ReadOnly", "ShowMinimap", "ShowPalette", "ShowGrid", "ShowLegend", "ShowStatusBar", "ShowToolbar", "AutoLayoutDirection"], [1, "mj-agent-editor-properties"], [3, "StepChanged", "PathChanged", "DeleteStepRequested", "DeletePathRequested", "CloseRequested", "Step", "SelectedConnection", "PathEntity", "ReadOnly", "Actions", "Prompts", "Agents", "AllSteps"], [3, "StepClicked", "Steps", "Paths", "SelectedStepID"], [1, "mj-agent-editor-dialog"], [1, "mj-agent-editor-dialog-icon"], [1, "fa-solid", "fa-triangle-exclamation"], [1, "mj-agent-editor-dialog-title"], [1, "mj-agent-editor-dialog-message"], [1, "mj-agent-editor-dialog-actions"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--primary", 3, "click"], [1, "fa-solid", "fa-floppy-disk"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--danger-outline", 3, "click"], [1, "mj-agent-editor-btn", 3, "click"]], template: function FlowAgentEditorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
902
|
+
} }, inputs: { AgentID: "AgentID", EditMode: "EditMode", FullScreen: "FullScreen" }, outputs: { FlowSaved: "FlowSaved", FlowChanged: "FlowChanged", FullScreenToggled: "FullScreenToggled", StepSelected: "StepSelected" }, standalone: false, features: [i0.ɵɵProvidersFeature([AgentFlowTransformerService]), i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 30, vars: 21, consts: [["flowEditor", ""], [1, "mj-agent-editor"], [1, "mj-agent-editor-toolbar"], [1, "mj-agent-editor-toolbar-left"], ["title", "Undo (Ctrl+Z)", 1, "mj-agent-editor-btn", 3, "disabled"], ["title", "Redo (Ctrl+Y)", 1, "mj-agent-editor-btn", 3, "disabled"], [1, "mj-agent-editor-toolbar-center"], [1, "mj-agent-editor-title"], [1, "fa-solid", "fa-diagram-project"], [1, "mj-agent-editor-view-toggle"], [1, "mj-agent-editor-view-btn", 3, "click"], [1, "fa-solid", "fa-list"], [1, "mj-agent-editor-mode-badge", "mj-agent-editor-mode-badge--editing"], [1, "mj-agent-editor-mode-badge", "mj-agent-editor-mode-badge--readonly"], [1, "mj-agent-editor-toolbar-right"], [1, "mj-agent-editor-status", "mj-agent-editor-status--unsaved"], [1, "mj-agent-editor-status"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--primary", 3, "disabled"], ["title", "Cancel editing", 1, "mj-agent-editor-btn"], [1, "mj-agent-editor-btn-divider"], ["title", "Edit flow", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--edit"], ["title", "Expand to full screen", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--expand"], ["title", "Close full screen (Esc)", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--close"], [1, "mj-agent-editor-loading"], [1, "mj-agent-editor-body"], [1, "mj-agent-editor-dialog-overlay"], ["title", "Undo (Ctrl+Z)", 1, "mj-agent-editor-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-rotate-left"], ["title", "Redo (Ctrl+Y)", 1, "mj-agent-editor-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-rotate-right"], [1, "fa-solid", "fa-pen"], [1, "fa-solid", "fa-lock"], [1, "fa-solid", "fa-circle"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--primary", 3, "click", "disabled"], [1, "fa-solid", 3, "ngClass"], ["title", "Cancel editing", 1, "mj-agent-editor-btn", 3, "click"], [1, "fa-solid", "fa-xmark"], ["title", "Edit flow", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--edit", 3, "click"], [1, "fa-solid", "fa-pen-to-square"], ["title", "Expand to full screen", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--expand", 3, "click"], [1, "fa-solid", "fa-up-right-and-down-left-from-center"], ["title", "Close full screen (Esc)", 1, "mj-agent-editor-btn", "mj-agent-editor-btn--close", 3, "click"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "mj-agent-editor-diagram"], [1, "mj-agent-editor-list"], [3, "NodeSelected", "NodeAdded", "NodeRemoved", "ConnectionCreated", "ConnectionRemoved", "ConnectionReassigned", "ConnectionSelected", "NodesChanged", "ConnectionsChanged", "GridToggled", "MinimapToggled", "LegendToggled", "Nodes", "Connections", "NodeTypes", "ReadOnly", "ShowMinimap", "ShowPalette", "ShowGrid", "ShowLegend", "ShowStatusBar", "ShowToolbar", "AutoLayoutDirection"], [1, "mj-agent-editor-properties"], [3, "StepChanged", "PathChanged", "DeleteStepRequested", "DeletePathRequested", "CloseRequested", "Step", "SelectedConnection", "PathEntity", "ReadOnly", "Actions", "Prompts", "Agents", "AllSteps"], [3, "StepClicked", "Steps", "Paths", "SelectedStepID"], [1, "mj-agent-editor-dialog"], [1, "mj-agent-editor-dialog-icon"], [1, "fa-solid", "fa-triangle-exclamation"], [1, "mj-agent-editor-dialog-title"], [1, "mj-agent-editor-dialog-message"], [1, "mj-agent-editor-dialog-actions"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--primary", 3, "click"], [1, "fa-solid", "fa-floppy-disk"], [1, "mj-agent-editor-btn", "mj-agent-editor-btn--danger-outline", 3, "click"], [1, "mj-agent-editor-btn", 3, "click"]], template: function FlowAgentEditorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
901
903
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "div", 3);
|
|
902
904
|
i0.ɵɵconditionalCreate(3, FlowAgentEditorComponent_Conditional_3_Template, 2, 1, "button", 4);
|
|
903
905
|
i0.ɵɵconditionalCreate(4, FlowAgentEditorComponent_Conditional_4_Template, 2, 1, "button", 5);
|
|
@@ -999,5 +1001,5 @@ export class FlowAgentEditorComponent {
|
|
|
999
1001
|
type: HostListener,
|
|
1000
1002
|
args: ['document:keydown.escape']
|
|
1001
1003
|
}] }); })();
|
|
1002
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FlowAgentEditorComponent, { className: "FlowAgentEditorComponent", filePath: "src/lib/agent-editor/flow-agent-editor.component.ts", lineNumber:
|
|
1004
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FlowAgentEditorComponent, { className: "FlowAgentEditorComponent", filePath: "src/lib/agent-editor/flow-agent-editor.component.ts", lineNumber: 29 }); })();
|
|
1003
1005
|
//# sourceMappingURL=flow-agent-editor.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-agent-editor.component.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/flow-agent-editor.component.ts","../../../src/lib/agent-editor/flow-agent-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EACf,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAE/E,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAwB,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAgD,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG7G,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;;ICH5C,kCACuF;IAAnD,4PAA4B;IAC9D,wBAAuC;IACzC,iBAAS;;;IAFP,0FAAiC;;;;IAKnC,kCACuF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;YAJD,yCAIC;YAGD,cAMC;YAND,+CAMC;YACD,cAMC;YAND,mEAMC;YAED,cAEC;YAFD,+CAEC;YAGD,cAMC;YAND,yFAMC;YAGD,cAKC;YALD,2CAKC;YACD,cAKC;YALD,0CAKC;YAKL,cAKC;YALD,yCAKC;YAGD,cAkFC;YAlFD,0CAkFC;YAGD,cAuBC;YAvBD,iDAuBC;;;iFDzMU,wBAAwB;cARpC,SAAS;6BACI,KAAK,YACP,sBAAsB,iBAGjB,iBAAiB,CAAC,IAAI,aAC1B,CAAC,2BAA2B,CAAC;;kBAIvC,WAAW;mBAAC,wCAAwC;;kBAGpD,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,SAAS;mBAAC,YAAY;;kBAgsBtB,YAAY;mBAAC,yBAAyB;;kFAhtB5B,wBAAwB","sourcesContent":["import {\n Component, Input, Output, EventEmitter, ViewChild, OnInit, OnChanges, OnDestroy,\n SimpleChanges, ChangeDetectorRef, ViewEncapsulation, HostListener, HostBinding,\n ElementRef, Renderer2\n} from '@angular/core';\nimport { Metadata, RunView, CompositeKey, TransactionGroupBase } from '@memberjunction/core';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { FlowNode, FlowConnection, FlowNodeAddedEvent, FlowConnectionCreatedEvent, FlowConnectionReassignedEvent, FlowNodeTypeConfig } from '../interfaces/flow-types';\nimport { FlowEditorComponent } from '../components/flow-editor.component';\nimport { AgentFlowTransformerService, AGENT_STEP_TYPE_CONFIGS } from './agent-flow-transformer.service';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/** View mode for the agent editor */\nexport type AgentEditorViewMode = 'diagram' | 'list';\n\n/**\n * Flow Agent Editor — wraps the generic FlowEditorComponent with\n * MJ agent-specific CRUD, properties panel, and data transformation.\n */\n@Component({\n standalone: false,\n selector: 'mj-flow-agent-editor',\n templateUrl: './flow-agent-editor.component.html',\n styleUrls: ['./flow-agent-editor.component.css'],\n encapsulation: ViewEncapsulation.None,\n providers: [AgentFlowTransformerService]\n})\nexport class FlowAgentEditorComponent implements OnInit, OnChanges, OnDestroy {\n // ── Host Bindings ─────────────────────────────────────────────\n @HostBinding('class.mj-flow-agent-editor--fullscreen') get HostFullScreen(): boolean { return this.FullScreen; }\n\n // ── Inputs ──────────────────────────────────────────────────\n @Input() AgentID: string | null = null;\n @Input() EditMode = true;\n @Input() FullScreen = false;\n\n // ── Outputs ─────────────────────────────────────────────────\n @Output() FlowSaved = new EventEmitter<void>();\n @Output() FlowChanged = new EventEmitter<boolean>();\n @Output() FullScreenToggled = new EventEmitter<boolean>();\n @Output() StepSelected = new EventEmitter<MJAIAgentStepEntity | null>();\n\n // ── View Children ───────────────────────────────────────────\n @ViewChild('flowEditor') protected flowEditor: FlowEditorComponent | undefined;\n\n // ── State ───────────────────────────────────────────────────\n protected nodes: FlowNode[] = [];\n protected connections: FlowConnection[] = [];\n protected nodeTypes: FlowNodeTypeConfig[] = AGENT_STEP_TYPE_CONFIGS;\n protected viewMode: AgentEditorViewMode = 'diagram';\n protected isLoading = true;\n protected isSaving = false;\n protected hasUnsavedChanges = false;\n protected lastSaved: Date | null = null;\n\n // Fullscreen self-contained edit mode\n protected fullscreenEditMode = false;\n protected showUnsavedDialog = false;\n\n // Entity data\n protected steps: MJAIAgentStepEntity[] = [];\n protected paths: MJAIAgentStepPathEntity[] = [];\n protected deletedStepIDs: string[] = [];\n protected deletedPathIDs: string[] = [];\n\n // Selected items\n protected selectedStep: MJAIAgentStepEntity | null = null;\n protected selectedConnection: FlowConnection | null = null;\n protected selectedPathEntity: MJAIAgentStepPathEntity | null = null;\n protected showPropertiesPanel = false;\n\n // Picker data (includes icon fields for node rendering)\n protected availableActions: Array<{ ID: string; Name: string; IconClass?: string | null }> = [];\n protected availablePrompts: Array<{ ID: string; Name: string }> = [];\n protected availableAgents: Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }> = [];\n\n // Permission state — cached once on init\n protected userCanUpdate = false;\n\n // User view preferences (persisted via UserInfoEngine)\n protected prefShowGrid = true;\n protected prefShowMinimap = true;\n protected prefShowLegend = true;\n\n private static readonly PREF_KEY = 'flow-editor/view-prefs';\n\n // Initial zoom state\n private needsInitialZoom = false;\n private resizeObserver: ResizeObserver | null = null;\n\n // Fullscreen DOM relocation state\n private originalParent: HTMLElement | null = null;\n private originalNextSibling: Node | null = null;\n private backdropElement: HTMLElement | null = null;\n\n constructor(\n private cdr: ChangeDetectorRef,\n private transformer: AgentFlowTransformerService,\n private elRef: ElementRef<HTMLElement>,\n private renderer: Renderer2\n ) {}\n\n // ── Lifecycle ───────────────────────────────────────────────\n\n ngOnInit(): void {\n this.loadViewPreferences();\n this.checkUpdatePermission();\n if (this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['AgentID'] && !changes['AgentID'].firstChange && this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnDestroy(): void {\n this.teardownResizeObserver();\n // Restore element to original parent if still in fullscreen\n if (this.FullScreen) {\n this.restoreFromFullscreen();\n }\n }\n\n // ── Data Loading ────────────────────────────────────────────\n\n private async loadAll(): Promise<void> {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n try {\n await Promise.all([\n this.loadStepsAndPaths(),\n this.loadPickerData()\n ]);\n this.rebuildFlowModel();\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n\n // Flag that we need an initial zoom; it will fire when the host element\n // first becomes visible (e.g. Kendo PanelBar expands)\n this.setupInitialZoomObserver();\n }\n }\n\n private async loadStepsAndPaths(): Promise<void> {\n if (!this.AgentID) return;\n const rv = new RunView();\n const [stepsResult, pathsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: AI Agent Steps',\n ExtraFilter: `AgentID='${this.AgentID}'`,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n },\n {\n EntityName: 'MJ: AI Agent Step Paths',\n ExtraFilter: `OriginStepID IN (SELECT ID FROM [__mj].[AIAgentStep] WHERE AgentID='${this.AgentID}')`,\n OrderBy: 'Priority DESC',\n ResultType: 'entity_object'\n }\n ]);\n\n this.steps = stepsResult.Success ? (stepsResult.Results as MJAIAgentStepEntity[]) : [];\n this.paths = pathsResult.Success ? (pathsResult.Results as MJAIAgentStepPathEntity[]) : [];\n this.deletedStepIDs = [];\n this.deletedPathIDs = [];\n }\n\n private async loadPickerData(): Promise<void> {\n const rv = new RunView();\n const [actionsResult, promptsResult, agentsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: Actions',\n Fields: ['ID', 'Name', 'IconClass'],\n ExtraFilter: `Status='Active'`,\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Prompts',\n Fields: ['ID', 'Name'],\n ExtraFilter: '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Agents',\n Fields: ['ID', 'Name', 'IconClass', 'LogoURL'],\n ExtraFilter: this.AgentID ? `ID <> '${this.AgentID}'` : '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n }\n ]);\n\n this.availableActions = actionsResult.Success\n ? (actionsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null }>)\n : [];\n this.availablePrompts = promptsResult.Success\n ? (promptsResult.Results as Array<{ ID: string; Name: string }>)\n : [];\n this.availableAgents = agentsResult.Success\n ? (agentsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }>)\n : [];\n }\n\n private rebuildFlowModel(): void {\n this.nodes = this.transformer.StepsToNodes(this.steps, this.availableActions, this.availableAgents);\n this.connections = this.transformer.PathsToConnections(this.paths);\n }\n\n /**\n * Observe the host element's size. When it transitions from zero to non-zero height\n * (i.e. the collapsed Kendo panel expands), trigger the initial auto-arrange or zoom-to-fit.\n */\n private setupInitialZoomObserver(): void {\n if (this.nodes.length === 0) return;\n\n this.needsInitialZoom = true;\n this.teardownResizeObserver();\n\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const height = entry.contentRect.height;\n if (height > 0 && this.needsInitialZoom) {\n this.needsInitialZoom = false;\n this.teardownResizeObserver();\n // Short delay for Foblex canvas to finish its own init after becoming visible\n setTimeout(() => this.applyInitialZoom(), 100);\n }\n }\n });\n\n this.resizeObserver.observe(this.elRef.nativeElement);\n }\n\n private applyInitialZoom(): void {\n if (!this.flowEditor || this.nodes.length === 0) return;\n const allAtOrigin = this.nodes.every(n => n.Position.X === 0 && n.Position.Y === 0);\n if (allAtOrigin) {\n this.flowEditor.AutoArrange();\n } else {\n this.flowEditor.ZoomToFit();\n }\n }\n\n private teardownResizeObserver(): void {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n // ── Save ────────────────────────────────────────────────────\n\n async Save(): Promise<void> {\n if (this.isSaving || !this.AgentID) return;\n this.isSaving = true;\n this.cdr.detectChanges();\n\n try {\n // Update positions from canvas to entities\n this.syncPositionsFromCanvas();\n\n // Bundle deletes and saves for steps + paths into one transaction so a partial save\n // can never leave the flow in an inconsistent state.\n const md = new Metadata();\n const tg = await md.CreateTransactionGroup();\n\n await this.queueRemovedEntitiesForDelete(tg);\n\n for (const step of this.steps) {\n step.TransactionGroup = tg;\n await step.Save();\n }\n\n for (const path of this.paths) {\n path.TransactionGroup = tg;\n await path.Save();\n }\n\n if (!await tg.Submit()) {\n console.error('Failed to save flow — all changes have been rolled back');\n return;\n }\n\n this.deletedPathIDs = [];\n this.deletedStepIDs = [];\n this.hasUnsavedChanges = false;\n this.lastSaved = new Date();\n\n // Exit self-contained fullscreen edit mode after successful save\n if (this.fullscreenEditMode) {\n this.fullscreenEditMode = false;\n }\n\n this.FlowSaved.emit();\n } catch (err) {\n console.error('Error saving flow:', err);\n } finally {\n this.isSaving = false;\n this.cdr.detectChanges();\n }\n }\n\n private syncPositionsFromCanvas(): void {\n this.syncPositionsToEntities();\n }\n\n /** Write current FlowNode positions back to the underlying step entities.\n * Called on every node move so that rebuildFlowModel() never loses drag changes. */\n private syncPositionsToEntities(): void {\n for (const node of this.nodes) {\n const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));\n if (step) {\n this.transformer.ApplyNodePosition(step, node);\n }\n }\n }\n\n private async queueRemovedEntitiesForDelete(tg: TransactionGroupBase): Promise<void> {\n const md = new Metadata();\n\n for (const pathId of this.deletedPathIDs) {\n const pathEntity = await md.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths');\n await pathEntity.InnerLoad(CompositeKey.FromID(pathId));\n pathEntity.TransactionGroup = tg;\n await pathEntity.Delete();\n }\n\n for (const stepId of this.deletedStepIDs) {\n const stepEntity = await md.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps');\n await stepEntity.InnerLoad(CompositeKey.FromID(stepId));\n stepEntity.TransactionGroup = tg;\n await stepEntity.Delete();\n }\n }\n\n // ── Flow Editor Event Handlers ──────────────────────────────\n\n protected async onNodeAdded(event: FlowNodeAddedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n const md = new Metadata();\n const step = await md.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps');\n step.NewRecord(); // This generates a UUID immediately - available before Save()\n step.AgentID = this.AgentID;\n step.Name = event.Node.Label;\n step.StepType = event.Node.Type as 'Action' | 'Prompt' | 'Sub-Agent' | 'ForEach' | 'While';\n step.Status = 'Active';\n step.StartingStep = this.steps.length === 0; // First step is starting step\n step.PositionX = Math.round(event.DropPosition.X);\n step.PositionY = Math.round(event.DropPosition.Y);\n step.OnErrorBehavior = 'fail';\n step.RetryCount = 0;\n step.TimeoutSeconds = 600;\n\n // Add the unsaved step to the array - it already has a UUID from NewRecord()\n // This allows connections to be drawn immediately without waiting for a database save\n this.steps.push(step);\n\n // Build a FlowNode using the entity's pre-generated ID so Foblex can track it\n const newNode = this.transformer.StepToNode(step, this.availableActions, this.availableAgents);\n this.nodes.push(newNode);\n this.markDirty();\n\n // Select the new node\n setTimeout(() => {\n this.flowEditor?.SelectNode(step.ID);\n this.onNodeSelected(newNode);\n }, 100);\n\n this.cdr.detectChanges();\n }\n\n protected async onConnectionCreated(event: FlowConnectionCreatedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n // Prevent duplicate\n const exists = this.paths.some(\n p => UUIDsEqual(p.OriginStepID, event.SourceNodeID) && UUIDsEqual(p.DestinationStepID, event.TargetNodeID)\n );\n if (exists) return;\n\n const md = new Metadata();\n const path = await md.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths');\n path.NewRecord(); // Generates UUID immediately - available before Save()\n path.OriginStepID = event.SourceNodeID;\n path.DestinationStepID = event.TargetNodeID;\n path.Priority = 0;\n\n // Add unsaved path to the array - save will happen on main Save() button\n this.paths.push(path);\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodeSelected(node: FlowNode | null): void {\n if (node) {\n this.selectedStep = this.steps.find(s => UUIDsEqual(s.ID, node.ID)) ?? null;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(this.selectedStep);\n } else {\n this.selectedStep = null;\n // Only hide the panel if no connection is currently selected.\n // When the user clicks a connection, Foblex fires NodeSelected(null) AND\n // ConnectionSelected(conn) — we must not let the null-node event hide\n // the panel that the connection event just opened.\n if (!this.selectedConnection) {\n this.showPropertiesPanel = false;\n }\n this.StepSelected.emit(null);\n }\n this.cdr.detectChanges();\n }\n\n protected onConnectionSelected(conn: FlowConnection | null): void {\n if (conn) {\n this.selectedConnection = conn;\n this.selectedPathEntity = this.paths.find(p => UUIDsEqual(p.ID, conn.ID)) ?? null;\n this.selectedStep = null;\n this.showPropertiesPanel = true;\n } else {\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n }\n this.cdr.detectChanges();\n }\n\n protected onNodeRemoved(node: FlowNode): void {\n const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));\n if (step) {\n // Track for deletion on save (only if it was previously saved)\n if (step.IsSaved) {\n this.deletedStepIDs.push(step.ID);\n // Also mark paths connected to this step for deletion\n const connectedPaths = this.paths.filter(\n p => UUIDsEqual(p.OriginStepID, step.ID) || UUIDsEqual(p.DestinationStepID, step.ID)\n );\n for (const path of connectedPaths) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n }\n }\n this.steps = this.steps.filter(s => !UUIDsEqual(s.ID, node.ID));\n this.paths = this.paths.filter(\n p => !UUIDsEqual(p.OriginStepID, node.ID) && !UUIDsEqual(p.DestinationStepID, node.ID)\n );\n this.markDirty();\n }\n }\n\n protected onConnectionRemoved(conn: FlowConnection): void {\n const path = this.paths.find(p => UUIDsEqual(p.ID, conn.ID));\n if (path) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, conn.ID));\n this.markDirty();\n }\n }\n\n protected onConnectionReassigned(event: FlowConnectionReassignedEvent): void {\n const path = this.paths.find(p => UUIDsEqual(p.ID, event.ConnectionID));\n if (!path) return;\n\n // Update the entity's origin/destination to match the new visual endpoints\n path.OriginStepID = event.NewSourceNodeID;\n path.DestinationStepID = event.NewTargetNodeID;\n\n // Rebuild all connections so sibling-based visual logic recalculates\n // (e.g., Default vs Duplicate Default labels depend on sibling analysis)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodesChanged(nodes: FlowNode[]): void {\n this.nodes = nodes;\n // Sync canvas positions back to entities immediately so that\n // any subsequent rebuildFlowModel() preserves drag changes.\n this.syncPositionsToEntities();\n this.markDirty(); \n }\n\n protected onConnectionsChanged(connections: FlowConnection[]): void {\n this.connections = connections;\n this.markDirty();\n }\n\n // ── Properties Panel Events ─────────────────────────────────\n\n protected onStepChanged(step: MJAIAgentStepEntity): void {\n // Update the corresponding flow node in-place and push to generic editor\n const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));\n if (node) {\n const newLabel = step.Name;\n const newSubtitle = this.transformer.BuildStepSubtitle(step);\n const baseStatus = this.transformer.MapStepStatus(step.Status);\n const warningMessage = (baseStatus !== 'disabled') ? this.transformer.BuildConfigWarningMessage(step) : null;\n const newStatus = warningMessage ? 'warning' : baseStatus;\n const newIsStart = step.StartingStep === true;\n\n node.Label = newLabel;\n node.Subtitle = newSubtitle;\n node.Status = newStatus;\n node.StatusMessage = warningMessage ?? undefined;\n node.IsStartNode = newIsStart;\n\n // Update input port disabled state for starting steps\n const inputPort = node.Ports.find(p => p.Direction === 'input');\n if (inputPort) {\n inputPort.Disabled = newIsStart;\n }\n\n // Re-resolve icon from picker data (handles action/agent assignment changes)\n const resolved = this.transformer.ResolveStepIcon(step, this.availableActions, this.availableAgents);\n node.Icon = resolved.Icon;\n if (!node.Data) node.Data = {};\n node.Data['LogoURL'] = resolved.LogoURL ?? null;\n\n // For loop nodes, rebuild the loop-specific Data properties so the\n // inner body card updates immediately when the user changes body type / config\n if (step.StepType === 'ForEach' || step.StepType === 'While') {\n this.updateLoopNodeData(step, node);\n }\n\n // Push visual update to the generic flow editor (creates new object ref for OnPush)\n this.flowEditor?.UpdateNode(step.ID, {\n Label: newLabel,\n Subtitle: newSubtitle,\n Status: newStatus,\n StatusMessage: warningMessage ?? undefined,\n IsStartNode: newIsStart,\n Icon: resolved.Icon,\n Data: node.Data\n });\n }\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n /** Update loop-specific data fields on a FlowNode from the step entity */\n private updateLoopNodeData(step: MJAIAgentStepEntity, node: FlowNode): void {\n if (!node.Data) node.Data = {};\n // Delegate to the transformer's public methods for consistency\n const bodyType = step.LoopBodyType;\n node.Data['LoopBodyType'] = bodyType ?? null;\n node.Data['LoopBodyName'] = this.resolveLoopBodyNameFromStep(step);\n node.Data['LoopBodyIcon'] = this.getBodyTypeIcon(bodyType);\n node.Data['LoopBodyColor'] = this.getBodyTypeColor(bodyType);\n node.Data['LoopIterationSummary'] = this.transformer.BuildLoopIterationSummary(step);\n }\n\n private resolveLoopBodyNameFromStep(step: MJAIAgentStepEntity): string | null {\n switch (step.LoopBodyType) {\n case 'Action': return step.Action ?? null;\n case 'Prompt': return step.Prompt ?? null;\n case 'Sub-Agent': return step.SubAgent ?? null;\n default: return null;\n }\n }\n\n private getBodyTypeIcon(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return 'fa-bolt';\n case 'Prompt': return 'fa-comment-dots';\n case 'Sub-Agent': return 'fa-robot';\n default: return 'fa-circle-nodes';\n }\n }\n\n private getBodyTypeColor(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return '#3B82F6';\n case 'Prompt': return '#8B5CF6';\n case 'Sub-Agent': return '#10B981';\n default: return '#6B7280';\n }\n }\n\n protected onPathChanged(path: MJAIAgentStepPathEntity): void {\n // Rebuild all connections from the same origin since always/conditional logic\n // depends on sibling paths (e.g., \"Default\" label only appears when siblings exist)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onDeleteStepRequested(step: MJAIAgentStepEntity): void {\n const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));\n if (node) {\n this.flowEditor?.SelectNode(step.ID);\n this.flowEditor?.DeleteSelected();\n }\n this.showPropertiesPanel = false;\n this.selectedStep = null;\n this.cdr.detectChanges();\n }\n\n protected onDeletePathRequested(path: MJAIAgentStepPathEntity): void {\n const conn = this.connections.find(c => UUIDsEqual(c.ID, path.ID));\n if (conn) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, path.ID));\n this.rebuildFlowModel();\n this.markDirty();\n }\n this.showPropertiesPanel = false;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.cdr.detectChanges();\n }\n\n protected onCloseProperties(): void {\n this.showPropertiesPanel = false;\n this.flowEditor?.ClearSelection();\n }\n\n // ── View & UI Controls ──────────────────────────────────────\n\n protected toggleViewMode(): void {\n this.viewMode = this.viewMode === 'diagram' ? 'list' : 'diagram';\n this.cdr.detectChanges();\n }\n\n /** Whether editing is currently allowed — combines parent EditMode + fullscreen self-contained edit */\n get isEditingActive(): boolean {\n return this.EditMode || this.fullscreenEditMode;\n }\n\n protected toggleFullscreenEditMode(): void {\n this.fullscreenEditMode = !this.fullscreenEditMode;\n this.cdr.detectChanges();\n }\n\n protected cancelFullscreenEdit(): void {\n if (this.hasUnsavedChanges) {\n // Reload to discard changes\n this.fullscreenEditMode = false;\n this.hasUnsavedChanges = false;\n this.loadAll();\n } else {\n this.fullscreenEditMode = false;\n this.cdr.detectChanges();\n }\n }\n\n protected toggleFullScreen(): void {\n if (this.FullScreen && this.hasUnsavedChanges) {\n this.showUnsavedDialog = true;\n this.cdr.detectChanges();\n return;\n }\n this.performFullscreenToggle();\n }\n\n protected onUnsavedDialogSave(): void {\n this.showUnsavedDialog = false;\n this.Save().then(() => this.performFullscreenToggle());\n }\n\n protected onUnsavedDialogDiscard(): void {\n this.showUnsavedDialog = false;\n this.hasUnsavedChanges = false;\n this.fullscreenEditMode = false;\n this.performFullscreenToggle();\n // Reload original data\n this.loadAll();\n }\n\n protected onUnsavedDialogCancel(): void {\n this.showUnsavedDialog = false;\n this.cdr.detectChanges();\n }\n\n private performFullscreenToggle(): void {\n this.FullScreen = !this.FullScreen;\n\n if (this.FullScreen) {\n this.moveToBodyForFullscreen();\n } else {\n this.fullscreenEditMode = false;\n this.restoreFromFullscreen();\n }\n\n this.FullScreenToggled.emit(this.FullScreen);\n this.cdr.detectChanges();\n // Re-fit after layout change\n setTimeout(() => this.flowEditor?.ZoomToFit(), 200);\n }\n\n private moveToBodyForFullscreen(): void {\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentElement;\n this.originalNextSibling = hostEl.nextSibling;\n\n // Create backdrop as a separate body-level element so it covers everything\n this.backdropElement = this.renderer.createElement('div');\n this.renderer.addClass(this.backdropElement, 'mj-agent-editor-backdrop');\n this.renderer.listen(this.backdropElement, 'click', () => this.toggleFullScreen());\n this.renderer.appendChild(document.body, this.backdropElement);\n\n // Move the host element to body — @HostBinding applies the fixed-position class\n this.renderer.appendChild(document.body, hostEl);\n }\n\n private restoreFromFullscreen(): void {\n // Remove backdrop\n if (this.backdropElement) {\n this.renderer.removeChild(document.body, this.backdropElement);\n this.backdropElement = null;\n }\n\n // Restore host element to original position\n if (!this.originalParent) return;\n const hostEl = this.elRef.nativeElement;\n if (this.originalNextSibling) {\n this.renderer.insertBefore(this.originalParent, hostEl, this.originalNextSibling);\n } else {\n this.renderer.appendChild(this.originalParent, hostEl);\n }\n this.originalParent = null;\n this.originalNextSibling = null;\n }\n\n protected onStepClickedInList(step: MJAIAgentStepEntity): void {\n this.selectedStep = step;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(step);\n this.cdr.detectChanges();\n }\n\n // ── Keyboard Shortcuts ─────────────────────────────────────\n\n @HostListener('document:keydown.escape')\n protected onEscapeKey(): void {\n if (this.showUnsavedDialog) {\n this.onUnsavedDialogCancel();\n } else if (this.FullScreen) {\n this.toggleFullScreen();\n }\n }\n\n // ── Permission Check ────────────────────────────────────────\n\n private checkUpdatePermission(): void {\n const md = new Metadata();\n const entity = md.EntityByName('MJ: AI Agents');\n if (entity) {\n const perms = entity.GetUserPermisions(md.CurrentUser);\n this.userCanUpdate = perms?.CanUpdate === true;\n }\n }\n\n // ── View Preference Persistence ─────────────────────────────\n\n private loadViewPreferences(): void {\n const raw = UserInfoEngine.Instance.GetSetting(FlowAgentEditorComponent.PREF_KEY);\n if (raw) {\n try {\n const prefs = JSON.parse(raw) as { grid?: boolean; minimap?: boolean; legend?: boolean };\n if (prefs.grid != null) this.prefShowGrid = prefs.grid;\n if (prefs.minimap != null) this.prefShowMinimap = prefs.minimap;\n if (prefs.legend != null) this.prefShowLegend = prefs.legend;\n } catch {\n // Ignore malformed preference data\n }\n }\n }\n\n private saveViewPreferences(): void {\n const prefs = JSON.stringify({\n grid: this.prefShowGrid,\n minimap: this.prefShowMinimap,\n legend: this.prefShowLegend\n });\n // Fire-and-forget — preference save errors are non-critical\n UserInfoEngine.Instance.SetSetting(FlowAgentEditorComponent.PREF_KEY, prefs);\n }\n\n protected onGridPrefChanged(show: boolean): void {\n this.prefShowGrid = show;\n this.saveViewPreferences();\n }\n\n protected onMinimapPrefChanged(show: boolean): void {\n this.prefShowMinimap = show;\n this.saveViewPreferences();\n }\n\n protected onLegendPrefChanged(show: boolean): void {\n this.prefShowLegend = show;\n this.saveViewPreferences();\n }\n\n // ── Helpers ─────────────────────────────────────────────────\n\n private markDirty(): void {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n this.FlowChanged.emit(true);\n }\n }\n}\n","<div class=\"mj-agent-editor\">\n\n <!-- ── Toolbar ─────────────────────────────────────────────── -->\n <div class=\"mj-agent-editor-toolbar\" [class.mj-agent-editor-toolbar--editing]=\"isEditingActive\">\n <div class=\"mj-agent-editor-toolbar-left\">\n <!-- Undo / Redo (edit mode only) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanUndo\" (click)=\"flowEditor?.Undo()\" title=\"Undo (Ctrl+Z)\">\n <i class=\"fa-solid fa-rotate-left\"></i>\n </button>\n }\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanRedo\" (click)=\"flowEditor?.Redo()\" title=\"Redo (Ctrl+Y)\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n </button>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-center\">\n <!-- Fullscreen title -->\n <span class=\"mj-agent-editor-title\">\n <i class=\"fa-solid fa-diagram-project\"></i> Flow Configuration\n </span>\n\n <!-- View Mode Toggle -->\n <div class=\"mj-agent-editor-view-toggle\">\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'diagram'\"\n (click)=\"viewMode = 'diagram'\">\n <i class=\"fa-solid fa-diagram-project\"></i> Diagram\n </button>\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\">\n <i class=\"fa-solid fa-list\"></i> List\n </button>\n </div>\n\n <!-- Mode indicator badge -->\n @if (isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--editing\">\n <i class=\"fa-solid fa-pen\"></i> Editing\n </span>\n }\n @if (!isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--readonly\">\n <i class=\"fa-solid fa-lock\"></i> Read Only\n </span>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-right\">\n <!-- Status indicators -->\n @if (hasUnsavedChanges) {\n <span class=\"mj-agent-editor-status mj-agent-editor-status--unsaved\">\n <i class=\"fa-solid fa-circle\"></i> Unsaved\n </span>\n }\n @if (lastSaved) {\n <span class=\"mj-agent-editor-status\">\n Saved {{ lastSaved | date:'shortTime' }}\n </span>\n }\n\n <!-- Save + Cancel (when editing) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\"\n [disabled]=\"isSaving || !hasUnsavedChanges\" (click)=\"Save()\">\n <i class=\"fa-solid\" [ngClass]=\"isSaving ? 'fa-spinner fa-spin' : 'fa-floppy-disk'\"></i>\n {{ isSaving ? 'Saving...' : 'Save' }}\n </button>\n }\n @if (fullscreenEditMode && !EditMode) {\n <button\n class=\"mj-agent-editor-btn\"\n (click)=\"cancelFullscreenEdit()\" title=\"Cancel editing\">\n <i class=\"fa-solid fa-xmark\"></i> Cancel\n </button>\n }\n\n @if (isEditingActive) {\n <div class=\"mj-agent-editor-btn-divider\"></div>\n }\n\n <!-- Fullscreen edit toggle (only when parent is NOT in edit mode) -->\n @if (!EditMode && !fullscreenEditMode && userCanUpdate) {\n <button\n class=\"mj-agent-editor-btn mj-agent-editor-btn--edit\"\n (click)=\"toggleFullscreenEditMode()\" title=\"Edit flow\">\n <i class=\"fa-solid fa-pen-to-square\"></i> Edit\n </button>\n }\n\n <!-- Expand / Close fullscreen -->\n @if (!FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--expand\"\n (click)=\"toggleFullScreen()\" title=\"Expand to full screen\">\n <i class=\"fa-solid fa-up-right-and-down-left-from-center\"></i> Expand\n </button>\n }\n @if (FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--close\"\n (click)=\"toggleFullScreen()\" title=\"Close full screen (Esc)\">\n <i class=\"fa-solid fa-xmark\"></i> Close\n </button>\n }\n </div>\n </div>\n\n <!-- ── Loading State ─────────────────────────────────────── -->\n @if (isLoading) {\n <div class=\"mj-agent-editor-loading\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading flow...</span>\n </div>\n }\n\n <!-- ── Main Content ──────────────────────────────────────── -->\n @if (!isLoading) {\n <div class=\"mj-agent-editor-body\">\n <!-- Diagram View -->\n @if (viewMode === 'diagram') {\n <div class=\"mj-agent-editor-diagram\">\n <mj-flow-editor #flowEditor\n [Nodes]=\"nodes\"\n [Connections]=\"connections\"\n [NodeTypes]=\"nodeTypes\"\n [ReadOnly]=\"!isEditingActive\"\n [ShowMinimap]=\"prefShowMinimap\"\n [ShowPalette]=\"isEditingActive\"\n [ShowGrid]=\"prefShowGrid\"\n [ShowLegend]=\"prefShowLegend\"\n [ShowStatusBar]=\"true\"\n [ShowToolbar]=\"true\"\n [AutoLayoutDirection]=\"'vertical'\"\n (NodeSelected)=\"onNodeSelected($event)\"\n (NodeAdded)=\"onNodeAdded($event)\"\n (NodeRemoved)=\"onNodeRemoved($event)\"\n (ConnectionCreated)=\"onConnectionCreated($event)\"\n (ConnectionRemoved)=\"onConnectionRemoved($event)\"\n (ConnectionReassigned)=\"onConnectionReassigned($event)\"\n (ConnectionSelected)=\"onConnectionSelected($event)\"\n (NodesChanged)=\"onNodesChanged($event)\"\n (ConnectionsChanged)=\"onConnectionsChanged($event)\"\n (GridToggled)=\"onGridPrefChanged($event)\"\n (MinimapToggled)=\"onMinimapPrefChanged($event)\"\n (LegendToggled)=\"onLegendPrefChanged($event)\">\n </mj-flow-editor>\n <!-- Properties Panel -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n <!-- List View -->\n @if (viewMode === 'list') {\n <div class=\"mj-agent-editor-list\">\n <mj-agent-step-list\n [Steps]=\"steps\"\n [Paths]=\"paths\"\n [SelectedStepID]=\"selectedStep?.ID || null\"\n (StepClicked)=\"onStepClickedInList($event)\">\n </mj-agent-step-list>\n <!-- Properties Panel in list mode too -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ── Unsaved Changes Dialog ──────────────────────────── -->\n @if (showUnsavedDialog) {\n <div class=\"mj-agent-editor-dialog-overlay\">\n <div class=\"mj-agent-editor-dialog\">\n <div class=\"mj-agent-editor-dialog-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h3 class=\"mj-agent-editor-dialog-title\">Unsaved Changes</h3>\n <p class=\"mj-agent-editor-dialog-message\">\n You have unsaved changes to this flow. What would you like to do?\n </p>\n <div class=\"mj-agent-editor-dialog-actions\">\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\" (click)=\"onUnsavedDialogSave()\">\n <i class=\"fa-solid fa-floppy-disk\"></i> Save & Close\n </button>\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--danger-outline\" (click)=\"onUnsavedDialogDiscard()\">\n Discard Changes\n </button>\n <button class=\"mj-agent-editor-btn\" (click)=\"onUnsavedDialogCancel()\">\n Cancel\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"flow-agent-editor.component.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/flow-agent-editor.component.ts","../../../src/lib/agent-editor/flow-agent-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EACf,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAE/E,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,YAAY,EAAwB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAgD,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG7G,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;;ICJ5C,kCACuF;IAAn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QjB,6FAAkB;YAqFlB,8FAAyB;YAwB3B,iBAAM;;YAlOiC,cAA0D;YAA1D,uEAA0D;YAG3F,eAKC;YALD,8CAKC;YACD,cAKC;YALD,8CAKC;YAYG,eAAiE;YAAjE,8EAAiE;YAKjE,eAA8D;YAA9D,2EAA8D;YAOlE,eAIC;YAJD,+CAIC;YACD,cAIC;YAJD,gDAIC;YAKD,eAIC;YAJD,iDAIC;YACD,cAIC;YAJD,yCAIC;YAGD,cAMC;YAND,+CAMC;YACD,cAMC;YAND,mEAMC;YAED,cAEC;YAFD,+CAEC;YAGD,cAMC;YAND,yFAMC;YAGD,cAKC;YALD,2CAKC;YACD,cAKC;YALD,0CAKC;YAKL,cAKC;YALD,yCAKC;YAGD,cAkFC;YAlFD,0CAkFC;YAGD,cAuBC;YAvBD,iDAuBC;;;iFDxMU,wBAAwB;cARpC,SAAS;6BACI,KAAK,YACP,sBAAsB,iBAGjB,iBAAiB,CAAC,IAAI,aAC1B,CAAC,2BAA2B,CAAC;;kBAIvC,WAAW;mBAAC,wCAAwC;;kBAGpD,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,SAAS;mBAAC,YAAY;;kBAksBtB,YAAY;mBAAC,yBAAyB;;kFAltB5B,wBAAwB","sourcesContent":["import {\n Component, Input, Output, EventEmitter, ViewChild, OnInit, OnChanges, OnDestroy,\n SimpleChanges, ChangeDetectorRef, ViewEncapsulation, HostListener, HostBinding,\n ElementRef, Renderer2\n} from '@angular/core';\nimport { RunView, CompositeKey, TransactionGroupBase } from '@memberjunction/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { FlowNode, FlowConnection, FlowNodeAddedEvent, FlowConnectionCreatedEvent, FlowConnectionReassignedEvent, FlowNodeTypeConfig } from '../interfaces/flow-types';\nimport { FlowEditorComponent } from '../components/flow-editor.component';\nimport { AgentFlowTransformerService, AGENT_STEP_TYPE_CONFIGS } from './agent-flow-transformer.service';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/** View mode for the agent editor */\nexport type AgentEditorViewMode = 'diagram' | 'list';\n\n/**\n * Flow Agent Editor — wraps the generic FlowEditorComponent with\n * MJ agent-specific CRUD, properties panel, and data transformation.\n */\n@Component({\n standalone: false,\n selector: 'mj-flow-agent-editor',\n templateUrl: './flow-agent-editor.component.html',\n styleUrls: ['./flow-agent-editor.component.css'],\n encapsulation: ViewEncapsulation.None,\n providers: [AgentFlowTransformerService]\n})\nexport class FlowAgentEditorComponent extends BaseAngularComponent implements OnInit, OnChanges, OnDestroy {\n // ── Host Bindings ─────────────────────────────────────────────\n @HostBinding('class.mj-flow-agent-editor--fullscreen') get HostFullScreen(): boolean { return this.FullScreen; }\n\n // ── Inputs ──────────────────────────────────────────────────\n @Input() AgentID: string | null = null;\n @Input() EditMode = true;\n @Input() FullScreen = false;\n\n // ── Outputs ─────────────────────────────────────────────────\n @Output() FlowSaved = new EventEmitter<void>();\n @Output() FlowChanged = new EventEmitter<boolean>();\n @Output() FullScreenToggled = new EventEmitter<boolean>();\n @Output() StepSelected = new EventEmitter<MJAIAgentStepEntity | null>();\n\n // ── View Children ───────────────────────────────────────────\n @ViewChild('flowEditor') protected flowEditor: FlowEditorComponent | undefined;\n\n // ── State ───────────────────────────────────────────────────\n protected nodes: FlowNode[] = [];\n protected connections: FlowConnection[] = [];\n protected nodeTypes: FlowNodeTypeConfig[] = AGENT_STEP_TYPE_CONFIGS;\n protected viewMode: AgentEditorViewMode = 'diagram';\n protected isLoading = true;\n protected isSaving = false;\n protected hasUnsavedChanges = false;\n protected lastSaved: Date | null = null;\n\n // Fullscreen self-contained edit mode\n protected fullscreenEditMode = false;\n protected showUnsavedDialog = false;\n\n // Entity data\n protected steps: MJAIAgentStepEntity[] = [];\n protected paths: MJAIAgentStepPathEntity[] = [];\n protected deletedStepIDs: string[] = [];\n protected deletedPathIDs: string[] = [];\n\n // Selected items\n protected selectedStep: MJAIAgentStepEntity | null = null;\n protected selectedConnection: FlowConnection | null = null;\n protected selectedPathEntity: MJAIAgentStepPathEntity | null = null;\n protected showPropertiesPanel = false;\n\n // Picker data (includes icon fields for node rendering)\n protected availableActions: Array<{ ID: string; Name: string; IconClass?: string | null }> = [];\n protected availablePrompts: Array<{ ID: string; Name: string }> = [];\n protected availableAgents: Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }> = [];\n\n // Permission state — cached once on init\n protected userCanUpdate = false;\n\n // User view preferences (persisted via UserInfoEngine)\n protected prefShowGrid = true;\n protected prefShowMinimap = true;\n protected prefShowLegend = true;\n\n private static readonly PREF_KEY = 'flow-editor/view-prefs';\n\n // Initial zoom state\n private needsInitialZoom = false;\n private resizeObserver: ResizeObserver | null = null;\n\n // Fullscreen DOM relocation state\n private originalParent: HTMLElement | null = null;\n private originalNextSibling: Node | null = null;\n private backdropElement: HTMLElement | null = null;\n\n constructor(\n private cdr: ChangeDetectorRef,\n private transformer: AgentFlowTransformerService,\n private elRef: ElementRef<HTMLElement>,\n private renderer: Renderer2\n ) {\n super();\n }\n\n // ── Lifecycle ───────────────────────────────────────────────\n\n ngOnInit(): void {\n this.loadViewPreferences();\n this.checkUpdatePermission();\n if (this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['AgentID'] && !changes['AgentID'].firstChange && this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnDestroy(): void {\n this.teardownResizeObserver();\n // Restore element to original parent if still in fullscreen\n if (this.FullScreen) {\n this.restoreFromFullscreen();\n }\n }\n\n // ── Data Loading ────────────────────────────────────────────\n\n private async loadAll(): Promise<void> {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n try {\n await Promise.all([\n this.loadStepsAndPaths(),\n this.loadPickerData()\n ]);\n this.rebuildFlowModel();\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n\n // Flag that we need an initial zoom; it will fire when the host element\n // first becomes visible (e.g. Kendo PanelBar expands)\n this.setupInitialZoomObserver();\n }\n }\n\n private async loadStepsAndPaths(): Promise<void> {\n if (!this.AgentID) return;\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const [stepsResult, pathsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: AI Agent Steps',\n ExtraFilter: `AgentID='${this.AgentID}'`,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n },\n {\n EntityName: 'MJ: AI Agent Step Paths',\n ExtraFilter: `OriginStepID IN (SELECT ID FROM [__mj].[AIAgentStep] WHERE AgentID='${this.AgentID}')`,\n OrderBy: 'Priority DESC',\n ResultType: 'entity_object'\n }\n ]);\n\n this.steps = stepsResult.Success ? (stepsResult.Results as MJAIAgentStepEntity[]) : [];\n this.paths = pathsResult.Success ? (pathsResult.Results as MJAIAgentStepPathEntity[]) : [];\n this.deletedStepIDs = [];\n this.deletedPathIDs = [];\n }\n\n private async loadPickerData(): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const [actionsResult, promptsResult, agentsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: Actions',\n Fields: ['ID', 'Name', 'IconClass'],\n ExtraFilter: `Status='Active'`,\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Prompts',\n Fields: ['ID', 'Name'],\n ExtraFilter: '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Agents',\n Fields: ['ID', 'Name', 'IconClass', 'LogoURL'],\n ExtraFilter: this.AgentID ? `ID <> '${this.AgentID}'` : '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n }\n ]);\n\n this.availableActions = actionsResult.Success\n ? (actionsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null }>)\n : [];\n this.availablePrompts = promptsResult.Success\n ? (promptsResult.Results as Array<{ ID: string; Name: string }>)\n : [];\n this.availableAgents = agentsResult.Success\n ? (agentsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }>)\n : [];\n }\n\n private rebuildFlowModel(): void {\n this.nodes = this.transformer.StepsToNodes(this.steps, this.availableActions, this.availableAgents);\n this.connections = this.transformer.PathsToConnections(this.paths);\n }\n\n /**\n * Observe the host element's size. When it transitions from zero to non-zero height\n * (i.e. the collapsed Kendo panel expands), trigger the initial auto-arrange or zoom-to-fit.\n */\n private setupInitialZoomObserver(): void {\n if (this.nodes.length === 0) return;\n\n this.needsInitialZoom = true;\n this.teardownResizeObserver();\n\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const height = entry.contentRect.height;\n if (height > 0 && this.needsInitialZoom) {\n this.needsInitialZoom = false;\n this.teardownResizeObserver();\n // Short delay for Foblex canvas to finish its own init after becoming visible\n setTimeout(() => this.applyInitialZoom(), 100);\n }\n }\n });\n\n this.resizeObserver.observe(this.elRef.nativeElement);\n }\n\n private applyInitialZoom(): void {\n if (!this.flowEditor || this.nodes.length === 0) return;\n const allAtOrigin = this.nodes.every(n => n.Position.X === 0 && n.Position.Y === 0);\n if (allAtOrigin) {\n this.flowEditor.AutoArrange();\n } else {\n this.flowEditor.ZoomToFit();\n }\n }\n\n private teardownResizeObserver(): void {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n // ── Save ────────────────────────────────────────────────────\n\n async Save(): Promise<void> {\n if (this.isSaving || !this.AgentID) return;\n this.isSaving = true;\n this.cdr.detectChanges();\n\n try {\n // Update positions from canvas to entities\n this.syncPositionsFromCanvas();\n\n // Bundle deletes and saves for steps + paths into one transaction so a partial save\n // can never leave the flow in an inconsistent state.\n const p = this.ProviderToUse;\n const tg = await p.CreateTransactionGroup();\n\n await this.queueRemovedEntitiesForDelete(tg);\n\n for (const step of this.steps) {\n step.TransactionGroup = tg;\n await step.Save();\n }\n\n for (const path of this.paths) {\n path.TransactionGroup = tg;\n await path.Save();\n }\n\n if (!await tg.Submit()) {\n console.error('Failed to save flow — all changes have been rolled back');\n return;\n }\n\n this.deletedPathIDs = [];\n this.deletedStepIDs = [];\n this.hasUnsavedChanges = false;\n this.lastSaved = new Date();\n\n // Exit self-contained fullscreen edit mode after successful save\n if (this.fullscreenEditMode) {\n this.fullscreenEditMode = false;\n }\n\n this.FlowSaved.emit();\n } catch (err) {\n console.error('Error saving flow:', err);\n } finally {\n this.isSaving = false;\n this.cdr.detectChanges();\n }\n }\n\n private syncPositionsFromCanvas(): void {\n this.syncPositionsToEntities();\n }\n\n /** Write current FlowNode positions back to the underlying step entities.\n * Called on every node move so that rebuildFlowModel() never loses drag changes. */\n private syncPositionsToEntities(): void {\n for (const node of this.nodes) {\n const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));\n if (step) {\n this.transformer.ApplyNodePosition(step, node);\n }\n }\n }\n\n private async queueRemovedEntitiesForDelete(tg: TransactionGroupBase): Promise<void> {\n const p = this.ProviderToUse;\n\n for (const pathId of this.deletedPathIDs) {\n const pathEntity = await p.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths', p.CurrentUser);\n await pathEntity.InnerLoad(CompositeKey.FromID(pathId));\n pathEntity.TransactionGroup = tg;\n await pathEntity.Delete();\n }\n\n for (const stepId of this.deletedStepIDs) {\n const stepEntity = await p.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps', p.CurrentUser);\n await stepEntity.InnerLoad(CompositeKey.FromID(stepId));\n stepEntity.TransactionGroup = tg;\n await stepEntity.Delete();\n }\n }\n\n // ── Flow Editor Event Handlers ──────────────────────────────\n\n protected async onNodeAdded(event: FlowNodeAddedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n const p = this.ProviderToUse;\n const step = await p.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps', p.CurrentUser);\n step.NewRecord(); // This generates a UUID immediately - available before Save()\n step.AgentID = this.AgentID;\n step.Name = event.Node.Label;\n step.StepType = event.Node.Type as 'Action' | 'Prompt' | 'Sub-Agent' | 'ForEach' | 'While';\n step.Status = 'Active';\n step.StartingStep = this.steps.length === 0; // First step is starting step\n step.PositionX = Math.round(event.DropPosition.X);\n step.PositionY = Math.round(event.DropPosition.Y);\n step.OnErrorBehavior = 'fail';\n step.RetryCount = 0;\n step.TimeoutSeconds = 600;\n\n // Add the unsaved step to the array - it already has a UUID from NewRecord()\n // This allows connections to be drawn immediately without waiting for a database save\n this.steps.push(step);\n\n // Build a FlowNode using the entity's pre-generated ID so Foblex can track it\n const newNode = this.transformer.StepToNode(step, this.availableActions, this.availableAgents);\n this.nodes.push(newNode);\n this.markDirty();\n\n // Select the new node\n setTimeout(() => {\n this.flowEditor?.SelectNode(step.ID);\n this.onNodeSelected(newNode);\n }, 100);\n\n this.cdr.detectChanges();\n }\n\n protected async onConnectionCreated(event: FlowConnectionCreatedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n // Prevent duplicate\n const exists = this.paths.some(\n p => UUIDsEqual(p.OriginStepID, event.SourceNodeID) && UUIDsEqual(p.DestinationStepID, event.TargetNodeID)\n );\n if (exists) return;\n\n const p = this.ProviderToUse;\n const path = await p.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths', p.CurrentUser);\n path.NewRecord(); // Generates UUID immediately - available before Save()\n path.OriginStepID = event.SourceNodeID;\n path.DestinationStepID = event.TargetNodeID;\n path.Priority = 0;\n\n // Add unsaved path to the array - save will happen on main Save() button\n this.paths.push(path);\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodeSelected(node: FlowNode | null): void {\n if (node) {\n this.selectedStep = this.steps.find(s => UUIDsEqual(s.ID, node.ID)) ?? null;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(this.selectedStep);\n } else {\n this.selectedStep = null;\n // Only hide the panel if no connection is currently selected.\n // When the user clicks a connection, Foblex fires NodeSelected(null) AND\n // ConnectionSelected(conn) — we must not let the null-node event hide\n // the panel that the connection event just opened.\n if (!this.selectedConnection) {\n this.showPropertiesPanel = false;\n }\n this.StepSelected.emit(null);\n }\n this.cdr.detectChanges();\n }\n\n protected onConnectionSelected(conn: FlowConnection | null): void {\n if (conn) {\n this.selectedConnection = conn;\n this.selectedPathEntity = this.paths.find(p => UUIDsEqual(p.ID, conn.ID)) ?? null;\n this.selectedStep = null;\n this.showPropertiesPanel = true;\n } else {\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n }\n this.cdr.detectChanges();\n }\n\n protected onNodeRemoved(node: FlowNode): void {\n const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));\n if (step) {\n // Track for deletion on save (only if it was previously saved)\n if (step.IsSaved) {\n this.deletedStepIDs.push(step.ID);\n // Also mark paths connected to this step for deletion\n const connectedPaths = this.paths.filter(\n p => UUIDsEqual(p.OriginStepID, step.ID) || UUIDsEqual(p.DestinationStepID, step.ID)\n );\n for (const path of connectedPaths) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n }\n }\n this.steps = this.steps.filter(s => !UUIDsEqual(s.ID, node.ID));\n this.paths = this.paths.filter(\n p => !UUIDsEqual(p.OriginStepID, node.ID) && !UUIDsEqual(p.DestinationStepID, node.ID)\n );\n this.markDirty();\n }\n }\n\n protected onConnectionRemoved(conn: FlowConnection): void {\n const path = this.paths.find(p => UUIDsEqual(p.ID, conn.ID));\n if (path) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, conn.ID));\n this.markDirty();\n }\n }\n\n protected onConnectionReassigned(event: FlowConnectionReassignedEvent): void {\n const path = this.paths.find(p => UUIDsEqual(p.ID, event.ConnectionID));\n if (!path) return;\n\n // Update the entity's origin/destination to match the new visual endpoints\n path.OriginStepID = event.NewSourceNodeID;\n path.DestinationStepID = event.NewTargetNodeID;\n\n // Rebuild all connections so sibling-based visual logic recalculates\n // (e.g., Default vs Duplicate Default labels depend on sibling analysis)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodesChanged(nodes: FlowNode[]): void {\n this.nodes = nodes;\n // Sync canvas positions back to entities immediately so that\n // any subsequent rebuildFlowModel() preserves drag changes.\n this.syncPositionsToEntities();\n this.markDirty(); \n }\n\n protected onConnectionsChanged(connections: FlowConnection[]): void {\n this.connections = connections;\n this.markDirty();\n }\n\n // ── Properties Panel Events ─────────────────────────────────\n\n protected onStepChanged(step: MJAIAgentStepEntity): void {\n // Update the corresponding flow node in-place and push to generic editor\n const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));\n if (node) {\n const newLabel = step.Name;\n const newSubtitle = this.transformer.BuildStepSubtitle(step);\n const baseStatus = this.transformer.MapStepStatus(step.Status);\n const warningMessage = (baseStatus !== 'disabled') ? this.transformer.BuildConfigWarningMessage(step) : null;\n const newStatus = warningMessage ? 'warning' : baseStatus;\n const newIsStart = step.StartingStep === true;\n\n node.Label = newLabel;\n node.Subtitle = newSubtitle;\n node.Status = newStatus;\n node.StatusMessage = warningMessage ?? undefined;\n node.IsStartNode = newIsStart;\n\n // Update input port disabled state for starting steps\n const inputPort = node.Ports.find(p => p.Direction === 'input');\n if (inputPort) {\n inputPort.Disabled = newIsStart;\n }\n\n // Re-resolve icon from picker data (handles action/agent assignment changes)\n const resolved = this.transformer.ResolveStepIcon(step, this.availableActions, this.availableAgents);\n node.Icon = resolved.Icon;\n if (!node.Data) node.Data = {};\n node.Data['LogoURL'] = resolved.LogoURL ?? null;\n\n // For loop nodes, rebuild the loop-specific Data properties so the\n // inner body card updates immediately when the user changes body type / config\n if (step.StepType === 'ForEach' || step.StepType === 'While') {\n this.updateLoopNodeData(step, node);\n }\n\n // Push visual update to the generic flow editor (creates new object ref for OnPush)\n this.flowEditor?.UpdateNode(step.ID, {\n Label: newLabel,\n Subtitle: newSubtitle,\n Status: newStatus,\n StatusMessage: warningMessage ?? undefined,\n IsStartNode: newIsStart,\n Icon: resolved.Icon,\n Data: node.Data\n });\n }\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n /** Update loop-specific data fields on a FlowNode from the step entity */\n private updateLoopNodeData(step: MJAIAgentStepEntity, node: FlowNode): void {\n if (!node.Data) node.Data = {};\n // Delegate to the transformer's public methods for consistency\n const bodyType = step.LoopBodyType;\n node.Data['LoopBodyType'] = bodyType ?? null;\n node.Data['LoopBodyName'] = this.resolveLoopBodyNameFromStep(step);\n node.Data['LoopBodyIcon'] = this.getBodyTypeIcon(bodyType);\n node.Data['LoopBodyColor'] = this.getBodyTypeColor(bodyType);\n node.Data['LoopIterationSummary'] = this.transformer.BuildLoopIterationSummary(step);\n }\n\n private resolveLoopBodyNameFromStep(step: MJAIAgentStepEntity): string | null {\n switch (step.LoopBodyType) {\n case 'Action': return step.Action ?? null;\n case 'Prompt': return step.Prompt ?? null;\n case 'Sub-Agent': return step.SubAgent ?? null;\n default: return null;\n }\n }\n\n private getBodyTypeIcon(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return 'fa-bolt';\n case 'Prompt': return 'fa-comment-dots';\n case 'Sub-Agent': return 'fa-robot';\n default: return 'fa-circle-nodes';\n }\n }\n\n private getBodyTypeColor(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return '#3B82F6';\n case 'Prompt': return '#8B5CF6';\n case 'Sub-Agent': return '#10B981';\n default: return '#6B7280';\n }\n }\n\n protected onPathChanged(path: MJAIAgentStepPathEntity): void {\n // Rebuild all connections from the same origin since always/conditional logic\n // depends on sibling paths (e.g., \"Default\" label only appears when siblings exist)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onDeleteStepRequested(step: MJAIAgentStepEntity): void {\n const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));\n if (node) {\n this.flowEditor?.SelectNode(step.ID);\n this.flowEditor?.DeleteSelected();\n }\n this.showPropertiesPanel = false;\n this.selectedStep = null;\n this.cdr.detectChanges();\n }\n\n protected onDeletePathRequested(path: MJAIAgentStepPathEntity): void {\n const conn = this.connections.find(c => UUIDsEqual(c.ID, path.ID));\n if (conn) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, path.ID));\n this.rebuildFlowModel();\n this.markDirty();\n }\n this.showPropertiesPanel = false;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.cdr.detectChanges();\n }\n\n protected onCloseProperties(): void {\n this.showPropertiesPanel = false;\n this.flowEditor?.ClearSelection();\n }\n\n // ── View & UI Controls ──────────────────────────────────────\n\n protected toggleViewMode(): void {\n this.viewMode = this.viewMode === 'diagram' ? 'list' : 'diagram';\n this.cdr.detectChanges();\n }\n\n /** Whether editing is currently allowed — combines parent EditMode + fullscreen self-contained edit */\n get isEditingActive(): boolean {\n return this.EditMode || this.fullscreenEditMode;\n }\n\n protected toggleFullscreenEditMode(): void {\n this.fullscreenEditMode = !this.fullscreenEditMode;\n this.cdr.detectChanges();\n }\n\n protected cancelFullscreenEdit(): void {\n if (this.hasUnsavedChanges) {\n // Reload to discard changes\n this.fullscreenEditMode = false;\n this.hasUnsavedChanges = false;\n this.loadAll();\n } else {\n this.fullscreenEditMode = false;\n this.cdr.detectChanges();\n }\n }\n\n protected toggleFullScreen(): void {\n if (this.FullScreen && this.hasUnsavedChanges) {\n this.showUnsavedDialog = true;\n this.cdr.detectChanges();\n return;\n }\n this.performFullscreenToggle();\n }\n\n protected onUnsavedDialogSave(): void {\n this.showUnsavedDialog = false;\n this.Save().then(() => this.performFullscreenToggle());\n }\n\n protected onUnsavedDialogDiscard(): void {\n this.showUnsavedDialog = false;\n this.hasUnsavedChanges = false;\n this.fullscreenEditMode = false;\n this.performFullscreenToggle();\n // Reload original data\n this.loadAll();\n }\n\n protected onUnsavedDialogCancel(): void {\n this.showUnsavedDialog = false;\n this.cdr.detectChanges();\n }\n\n private performFullscreenToggle(): void {\n this.FullScreen = !this.FullScreen;\n\n if (this.FullScreen) {\n this.moveToBodyForFullscreen();\n } else {\n this.fullscreenEditMode = false;\n this.restoreFromFullscreen();\n }\n\n this.FullScreenToggled.emit(this.FullScreen);\n this.cdr.detectChanges();\n // Re-fit after layout change\n setTimeout(() => this.flowEditor?.ZoomToFit(), 200);\n }\n\n private moveToBodyForFullscreen(): void {\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentElement;\n this.originalNextSibling = hostEl.nextSibling;\n\n // Create backdrop as a separate body-level element so it covers everything\n this.backdropElement = this.renderer.createElement('div');\n this.renderer.addClass(this.backdropElement, 'mj-agent-editor-backdrop');\n this.renderer.listen(this.backdropElement, 'click', () => this.toggleFullScreen());\n this.renderer.appendChild(document.body, this.backdropElement);\n\n // Move the host element to body — @HostBinding applies the fixed-position class\n this.renderer.appendChild(document.body, hostEl);\n }\n\n private restoreFromFullscreen(): void {\n // Remove backdrop\n if (this.backdropElement) {\n this.renderer.removeChild(document.body, this.backdropElement);\n this.backdropElement = null;\n }\n\n // Restore host element to original position\n if (!this.originalParent) return;\n const hostEl = this.elRef.nativeElement;\n if (this.originalNextSibling) {\n this.renderer.insertBefore(this.originalParent, hostEl, this.originalNextSibling);\n } else {\n this.renderer.appendChild(this.originalParent, hostEl);\n }\n this.originalParent = null;\n this.originalNextSibling = null;\n }\n\n protected onStepClickedInList(step: MJAIAgentStepEntity): void {\n this.selectedStep = step;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(step);\n this.cdr.detectChanges();\n }\n\n // ── Keyboard Shortcuts ─────────────────────────────────────\n\n @HostListener('document:keydown.escape')\n protected onEscapeKey(): void {\n if (this.showUnsavedDialog) {\n this.onUnsavedDialogCancel();\n } else if (this.FullScreen) {\n this.toggleFullScreen();\n }\n }\n\n // ── Permission Check ────────────────────────────────────────\n\n private checkUpdatePermission(): void {\n const p = this.ProviderToUse;\n const entity = p.EntityByName('MJ: AI Agents');\n if (entity) {\n const perms = entity.GetUserPermisions(p.CurrentUser);\n this.userCanUpdate = perms?.CanUpdate === true;\n }\n }\n\n // ── View Preference Persistence ─────────────────────────────\n\n private loadViewPreferences(): void {\n const raw = UserInfoEngine.Instance.GetSetting(FlowAgentEditorComponent.PREF_KEY);\n if (raw) {\n try {\n const prefs = JSON.parse(raw) as { grid?: boolean; minimap?: boolean; legend?: boolean };\n if (prefs.grid != null) this.prefShowGrid = prefs.grid;\n if (prefs.minimap != null) this.prefShowMinimap = prefs.minimap;\n if (prefs.legend != null) this.prefShowLegend = prefs.legend;\n } catch {\n // Ignore malformed preference data\n }\n }\n }\n\n private saveViewPreferences(): void {\n const prefs = JSON.stringify({\n grid: this.prefShowGrid,\n minimap: this.prefShowMinimap,\n legend: this.prefShowLegend\n });\n // Fire-and-forget — preference save errors are non-critical\n UserInfoEngine.Instance.SetSetting(FlowAgentEditorComponent.PREF_KEY, prefs);\n }\n\n protected onGridPrefChanged(show: boolean): void {\n this.prefShowGrid = show;\n this.saveViewPreferences();\n }\n\n protected onMinimapPrefChanged(show: boolean): void {\n this.prefShowMinimap = show;\n this.saveViewPreferences();\n }\n\n protected onLegendPrefChanged(show: boolean): void {\n this.prefShowLegend = show;\n this.saveViewPreferences();\n }\n\n // ── Helpers ─────────────────────────────────────────────────\n\n private markDirty(): void {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n this.FlowChanged.emit(true);\n }\n }\n}\n","<div class=\"mj-agent-editor\">\n\n <!-- ── Toolbar ─────────────────────────────────────────────── -->\n <div class=\"mj-agent-editor-toolbar\" [class.mj-agent-editor-toolbar--editing]=\"isEditingActive\">\n <div class=\"mj-agent-editor-toolbar-left\">\n <!-- Undo / Redo (edit mode only) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanUndo\" (click)=\"flowEditor?.Undo()\" title=\"Undo (Ctrl+Z)\">\n <i class=\"fa-solid fa-rotate-left\"></i>\n </button>\n }\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanRedo\" (click)=\"flowEditor?.Redo()\" title=\"Redo (Ctrl+Y)\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n </button>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-center\">\n <!-- Fullscreen title -->\n <span class=\"mj-agent-editor-title\">\n <i class=\"fa-solid fa-diagram-project\"></i> Flow Configuration\n </span>\n\n <!-- View Mode Toggle -->\n <div class=\"mj-agent-editor-view-toggle\">\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'diagram'\"\n (click)=\"viewMode = 'diagram'\">\n <i class=\"fa-solid fa-diagram-project\"></i> Diagram\n </button>\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\">\n <i class=\"fa-solid fa-list\"></i> List\n </button>\n </div>\n\n <!-- Mode indicator badge -->\n @if (isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--editing\">\n <i class=\"fa-solid fa-pen\"></i> Editing\n </span>\n }\n @if (!isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--readonly\">\n <i class=\"fa-solid fa-lock\"></i> Read Only\n </span>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-right\">\n <!-- Status indicators -->\n @if (hasUnsavedChanges) {\n <span class=\"mj-agent-editor-status mj-agent-editor-status--unsaved\">\n <i class=\"fa-solid fa-circle\"></i> Unsaved\n </span>\n }\n @if (lastSaved) {\n <span class=\"mj-agent-editor-status\">\n Saved {{ lastSaved | date:'shortTime' }}\n </span>\n }\n\n <!-- Save + Cancel (when editing) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\"\n [disabled]=\"isSaving || !hasUnsavedChanges\" (click)=\"Save()\">\n <i class=\"fa-solid\" [ngClass]=\"isSaving ? 'fa-spinner fa-spin' : 'fa-floppy-disk'\"></i>\n {{ isSaving ? 'Saving...' : 'Save' }}\n </button>\n }\n @if (fullscreenEditMode && !EditMode) {\n <button\n class=\"mj-agent-editor-btn\"\n (click)=\"cancelFullscreenEdit()\" title=\"Cancel editing\">\n <i class=\"fa-solid fa-xmark\"></i> Cancel\n </button>\n }\n\n @if (isEditingActive) {\n <div class=\"mj-agent-editor-btn-divider\"></div>\n }\n\n <!-- Fullscreen edit toggle (only when parent is NOT in edit mode) -->\n @if (!EditMode && !fullscreenEditMode && userCanUpdate) {\n <button\n class=\"mj-agent-editor-btn mj-agent-editor-btn--edit\"\n (click)=\"toggleFullscreenEditMode()\" title=\"Edit flow\">\n <i class=\"fa-solid fa-pen-to-square\"></i> Edit\n </button>\n }\n\n <!-- Expand / Close fullscreen -->\n @if (!FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--expand\"\n (click)=\"toggleFullScreen()\" title=\"Expand to full screen\">\n <i class=\"fa-solid fa-up-right-and-down-left-from-center\"></i> Expand\n </button>\n }\n @if (FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--close\"\n (click)=\"toggleFullScreen()\" title=\"Close full screen (Esc)\">\n <i class=\"fa-solid fa-xmark\"></i> Close\n </button>\n }\n </div>\n </div>\n\n <!-- ── Loading State ─────────────────────────────────────── -->\n @if (isLoading) {\n <div class=\"mj-agent-editor-loading\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading flow...</span>\n </div>\n }\n\n <!-- ── Main Content ──────────────────────────────────────── -->\n @if (!isLoading) {\n <div class=\"mj-agent-editor-body\">\n <!-- Diagram View -->\n @if (viewMode === 'diagram') {\n <div class=\"mj-agent-editor-diagram\">\n <mj-flow-editor #flowEditor\n [Nodes]=\"nodes\"\n [Connections]=\"connections\"\n [NodeTypes]=\"nodeTypes\"\n [ReadOnly]=\"!isEditingActive\"\n [ShowMinimap]=\"prefShowMinimap\"\n [ShowPalette]=\"isEditingActive\"\n [ShowGrid]=\"prefShowGrid\"\n [ShowLegend]=\"prefShowLegend\"\n [ShowStatusBar]=\"true\"\n [ShowToolbar]=\"true\"\n [AutoLayoutDirection]=\"'vertical'\"\n (NodeSelected)=\"onNodeSelected($event)\"\n (NodeAdded)=\"onNodeAdded($event)\"\n (NodeRemoved)=\"onNodeRemoved($event)\"\n (ConnectionCreated)=\"onConnectionCreated($event)\"\n (ConnectionRemoved)=\"onConnectionRemoved($event)\"\n (ConnectionReassigned)=\"onConnectionReassigned($event)\"\n (ConnectionSelected)=\"onConnectionSelected($event)\"\n (NodesChanged)=\"onNodesChanged($event)\"\n (ConnectionsChanged)=\"onConnectionsChanged($event)\"\n (GridToggled)=\"onGridPrefChanged($event)\"\n (MinimapToggled)=\"onMinimapPrefChanged($event)\"\n (LegendToggled)=\"onLegendPrefChanged($event)\">\n </mj-flow-editor>\n <!-- Properties Panel -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n <!-- List View -->\n @if (viewMode === 'list') {\n <div class=\"mj-agent-editor-list\">\n <mj-agent-step-list\n [Steps]=\"steps\"\n [Paths]=\"paths\"\n [SelectedStepID]=\"selectedStep?.ID || null\"\n (StepClicked)=\"onStepClickedInList($event)\">\n </mj-agent-step-list>\n <!-- Properties Panel in list mode too -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ── Unsaved Changes Dialog ──────────────────────────── -->\n @if (showUnsavedDialog) {\n <div class=\"mj-agent-editor-dialog-overlay\">\n <div class=\"mj-agent-editor-dialog\">\n <div class=\"mj-agent-editor-dialog-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h3 class=\"mj-agent-editor-dialog-title\">Unsaved Changes</h3>\n <p class=\"mj-agent-editor-dialog-message\">\n You have unsaved changes to this flow. What would you like to do?\n </p>\n <div class=\"mj-agent-editor-dialog-actions\">\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\" (click)=\"onUnsavedDialogSave()\">\n <i class=\"fa-solid fa-floppy-disk\"></i> Save & Close\n </button>\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--danger-outline\" (click)=\"onUnsavedDialogDiscard()\">\n Discard Changes\n </button>\n <button class=\"mj-agent-editor-btn\" (click)=\"onUnsavedDialogCancel()\">\n Cancel\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-flow-editor",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.31.0",
|
|
4
4
|
"description": "MemberJunction: Generic visual flow editor component powered by Foblex Flow, with an agent-specific Flow Agent Editor",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"@foblex/mediator": "1.1.3",
|
|
43
43
|
"@foblex/platform": "1.0.4",
|
|
44
44
|
"@foblex/utils": "1.1.1",
|
|
45
|
-
"@memberjunction/core": "5.
|
|
46
|
-
"@memberjunction/core-entities": "5.
|
|
47
|
-
"@memberjunction/global": "5.
|
|
48
|
-
"@memberjunction/ng-
|
|
45
|
+
"@memberjunction/core": "5.31.0",
|
|
46
|
+
"@memberjunction/core-entities": "5.31.0",
|
|
47
|
+
"@memberjunction/global": "5.31.0",
|
|
48
|
+
"@memberjunction/ng-base-types": "5.31.0",
|
|
49
|
+
"@memberjunction/ng-code-editor": "5.31.0",
|
|
49
50
|
"rxjs": "^7.8.2",
|
|
50
51
|
"tslib": "^2.8.1"
|
|
51
52
|
},
|