@memberjunction/ng-flow-editor 6.3.0-edge.1 → 6.3.0-edge.3
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.map +1 -1
- package/dist/lib/agent-editor/agent-flow-transformer.service.js +38 -0
- package/dist/lib/agent-editor/agent-flow-transformer.service.js.map +1 -1
- package/dist/lib/agent-editor/agent-properties-panel.component.d.ts +49 -0
- package/dist/lib/agent-editor/agent-properties-panel.component.d.ts.map +1 -1
- package/dist/lib/agent-editor/agent-properties-panel.component.js +1065 -347
- package/dist/lib/agent-editor/agent-properties-panel.component.js.map +1 -1
- package/dist/lib/agent-editor/agent-step-list.component.d.ts +10 -2
- package/dist/lib/agent-editor/agent-step-list.component.d.ts.map +1 -1
- package/dist/lib/agent-editor/agent-step-list.component.js +257 -199
- package/dist/lib/agent-editor/agent-step-list.component.js.map +1 -1
- package/dist/lib/agent-editor/flow-agent-editor.component.d.ts +16 -8
- package/dist/lib/agent-editor/flow-agent-editor.component.d.ts.map +1 -1
- package/dist/lib/agent-editor/flow-agent-editor.component.js +209 -117
- package/dist/lib/agent-editor/flow-agent-editor.component.js.map +1 -1
- package/dist/lib/agent-editor/flow-run-check.d.ts +0 -9
- package/dist/lib/agent-editor/flow-run-check.d.ts.map +1 -1
- package/dist/lib/agent-editor/flow-run-check.js +61 -1
- package/dist/lib/agent-editor/flow-run-check.js.map +1 -1
- package/dist/lib/agent-editor/waiting-step-config.d.ts +45 -0
- package/dist/lib/agent-editor/waiting-step-config.d.ts.map +1 -0
- package/dist/lib/agent-editor/waiting-step-config.js +117 -0
- package/dist/lib/agent-editor/waiting-step-config.js.map +1 -0
- package/dist/lib/components/flow-editor.component.d.ts +42 -5
- package/dist/lib/components/flow-editor.component.d.ts.map +1 -1
- package/dist/lib/components/flow-editor.component.js +299 -113
- package/dist/lib/components/flow-editor.component.js.map +1 -1
- package/dist/lib/components/flow-node.component.d.ts +25 -3
- package/dist/lib/components/flow-node.component.d.ts.map +1 -1
- package/dist/lib/components/flow-node.component.js +412 -125
- package/dist/lib/components/flow-node.component.js.map +1 -1
- package/dist/lib/components/flow-status-bar.component.d.ts +2 -1
- package/dist/lib/components/flow-status-bar.component.d.ts.map +1 -1
- package/dist/lib/components/flow-status-bar.component.js +12 -11
- package/dist/lib/components/flow-status-bar.component.js.map +1 -1
- package/dist/lib/components/flow-toolbar.component.d.ts +5 -2
- package/dist/lib/components/flow-toolbar.component.d.ts.map +1 -1
- package/dist/lib/components/flow-toolbar.component.js +42 -23
- package/dist/lib/components/flow-toolbar.component.js.map +1 -1
- package/dist/lib/interfaces/flow-types.d.ts +40 -0
- package/dist/lib/interfaces/flow-types.d.ts.map +1 -1
- package/dist/lib/interfaces/flow-types.js.map +1 -1
- package/dist/lib/services/flow-layout.service.d.ts +0 -1
- package/dist/lib/services/flow-layout.service.d.ts.map +1 -1
- package/dist/lib/services/flow-layout.service.js +5 -23
- package/dist/lib/services/flow-layout.service.js.map +1 -1
- package/dist/lib/services/flow-viewport.util.d.ts +58 -0
- package/dist/lib/services/flow-viewport.util.d.ts.map +1 -0
- package/dist/lib/services/flow-viewport.util.js +134 -0
- package/dist/lib/services/flow-viewport.util.js.map +1 -0
- package/dist/public-api.d.ts +1 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +1 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-types.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/flow-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,MAAM,GAAG,aAAa,GAAG,eAAe,CAAC,CAAC;AAMnG,6BAA6B;AAC7B,MAA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/B,KAA4B;QAJnB,WAAM,GAAN,MAAM,CAAuB;QAC7B,SAAI,GAAJ,IAAI,CAAiB;QACrB,eAAU,GAAV,UAAU,CAAuB;QACjC,eAAU,GAAV,UAAU,CAAY;QAC/B,UAAK,GAAL,KAAK,CAAuB;IACpC,CAAC;CACP;AAED,6FAA6F;AAC7F,MAAM,OAAO,mCAAmC;IAExB;IACA;IACA;IACA;IAJpB,YACoB,QAAgB,EAChB,MAA6B,EAC7B,IAAqB,EACrB,UAAiC;QAHjC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAuB;QAC7B,SAAI,GAAJ,IAAI,CAAiB;QACrB,eAAU,GAAV,UAAU,CAAuB;IAClD,CAAC;CACP","sourcesContent":["/**\n * Core interfaces for the generic flow editor.\n * These types are entity-agnostic — consumers map their domain data to/from these.\n */\nimport type { MJAIPromptEntity } from '@memberjunction/core-entities';\n\n/**\n * Prompt option shape for flow editor prompt pickers.\n */\nexport type PromptOption = Pick<MJAIPromptEntity, 'ID' | 'Name' | 'AIModelType' | 'AIModelTypeID'>;\n\n// ---------------------------------------------------------------------------\n// Node Types\n// ---------------------------------------------------------------------------\n\n/** Position on the canvas */\nexport interface FlowPosition {\n X: number;\n Y: number;\n}\n\n/** Size dimensions */\nexport interface FlowSize {\n Width: number;\n Height: number;\n}\n\n/** A port (connector) on a node */\nexport interface FlowNodePort {\n ID: string;\n Direction: 'input' | 'output';\n Side?: 'left' | 'right' | 'top' | 'bottom' | 'auto';\n Multiple?: boolean;\n Disabled?: boolean;\n Label?: string;\n /** Category string for connection validation (matched against FlowNodePort on targets) */\n Category?: string;\n}\n\n/** A small info badge displayed on a node */\nexport interface FlowNodeBadge {\n Label: string;\n Value: string;\n Icon?: string;\n Color?: string;\n}\n\n/** Visual status of a node */\n/**\n * How a node presents its state.\n *\n * `skipped` is deliberately its own value rather than a shade of `disabled`. Disabled means \"this\n * cannot run\"; skipped means \"the graph chose another route\" — nothing is wrong, and a reader who\n * cannot tell them apart goes looking for a failure that never happened.\n */\nexport type FlowNodeStatus = 'default' | 'success' | 'error' | 'warning' | 'running' | 'disabled' | 'pending' | 'skipped';\n\n/** A node in the flow graph */\nexport interface FlowNode {\n ID: string;\n Type: string;\n Label: string;\n Subtitle?: string;\n Icon?: string;\n IconColor?: string;\n Status: FlowNodeStatus;\n StatusMessage?: string;\n Badges?: FlowNodeBadge[];\n Position: FlowPosition;\n Size?: FlowSize;\n Ports: FlowNodePort[];\n Collapsed?: boolean;\n Selected?: boolean;\n Locked?: boolean;\n IsStartNode?: boolean;\n /** Opaque data payload — consumers store domain-specific data here */\n Data?: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Connection Types\n// ---------------------------------------------------------------------------\n\n/** Visual style for a connection line */\nexport type FlowConnectionStyle = 'solid' | 'dashed' | 'dotted';\n\n/** A connection (edge) between two nodes */\nexport interface FlowConnection {\n ID: string;\n SourceNodeID: string;\n SourcePortID: string;\n TargetNodeID: string;\n TargetPortID: string;\n Label?: string;\n LabelDetail?: string;\n /** Font Awesome icon class shown before the label text (e.g., 'fa-check') */\n LabelIcon?: string;\n /** Color for the label icon */\n LabelIconColor?: string;\n Condition?: string;\n Priority?: number;\n Style?: FlowConnectionStyle;\n Color?: string;\n /** Stroke width in px. Active/flowing edges use a thicker value so they read at a glance. */\n StrokeWidth?: number;\n Animated?: boolean;\n Selected?: boolean;\n /** Opaque data payload — consumers store domain-specific data here */\n Data?: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Node Type Registration (for palette and rendering)\n// ---------------------------------------------------------------------------\n\n/** Configuration for a node type displayed in the palette */\nexport interface FlowNodeTypeConfig {\n /** Unique type identifier (e.g., 'Action', 'Prompt') */\n Type: string;\n /** Display label */\n Label: string;\n /** Font Awesome icon class (e.g., 'fa-bolt') */\n Icon: string;\n /** Hex color for the node header */\n Color: string;\n /** Default ports created when this node type is added */\n DefaultPorts?: FlowNodePort[];\n /** Palette category for grouping (e.g., 'Steps', 'Loops') */\n Category?: string;\n /** Whether this type can be dragged from the palette (default true) */\n Draggable?: boolean;\n /** Maximum number of instances allowed (0 = unlimited, default 0) */\n MaxInstances?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Event Payloads\n// ---------------------------------------------------------------------------\n\n/** Emitted when a new node is added from the palette */\nexport interface FlowNodeAddedEvent {\n Node: FlowNode;\n DropPosition: FlowPosition;\n}\n\n/** Emitted when a node is moved on the canvas */\nexport interface FlowNodeMovedEvent {\n NodeID: string;\n OldPosition: FlowPosition;\n NewPosition: FlowPosition;\n}\n\n/** Emitted when a new connection is drawn */\nexport interface FlowConnectionCreatedEvent {\n SourceNodeID: string;\n SourcePortID: string;\n TargetNodeID: string;\n TargetPortID: string;\n}\n\n/** Emitted when an existing connection is reassigned (endpoint dragged to a different node) */\nexport interface FlowConnectionReassignedEvent {\n ConnectionID: string;\n OldSourceNodeID: string;\n OldSourcePortID: string;\n OldTargetNodeID: string;\n OldTargetPortID: string;\n NewSourceNodeID: string;\n NewSourcePortID: string;\n NewTargetNodeID: string;\n NewTargetPortID: string;\n}\n\n/** Emitted when the selection state changes */\nexport interface FlowSelectionChangedEvent {\n SelectedNodeIDs: string[];\n SelectedConnectionIDs: string[];\n}\n\n/** Emitted when empty canvas is clicked */\nexport interface FlowCanvasClickEvent {\n Position: FlowPosition;\n}\n\n/** Context menu target type */\nexport type FlowContextMenuTarget = 'node' | 'connection';\n\n/** Built-in design-time actions. Hosts may emit any other `ID` string. */\nexport type FlowContextMenuAction = 'edit' | 'remove' | string;\n\n/** One row in the canvas context menu. The host may replace the default Edit/Remove set. */\nexport type FlowContextMenuItem = {\n ID: string;\n Label: string;\n Icon?: string;\n Danger?: boolean;\n Disabled?: boolean;\n Shortcut?: string;\n};\n\n/**\n * Fired BEFORE the canvas menu opens. Mutate `Items` to replace the default set; `Cancel = true`\n * suppresses the menu. A `Before*` handler must not be async — the emitter reads `Cancel`/`Items`\n * when `emit()` returns.\n */\nexport class FlowBeforeContextMenuEventArgs {\n public Cancel = false;\n constructor(\n public readonly Target: FlowContextMenuTarget,\n public readonly Node: FlowNode | null,\n public readonly Connection: FlowConnection | null,\n public readonly MouseEvent: MouseEvent,\n public Items: FlowContextMenuItem[],\n ) {}\n}\n\n/** Fired AFTER a menu item is chosen. Built-in `edit`/`remove` still run unless ReadOnly. */\nexport class FlowAfterContextMenuActionEventArgs {\n constructor(\n public readonly ActionID: string,\n public readonly Target: FlowContextMenuTarget,\n public readonly Node: FlowNode | null,\n public readonly Connection: FlowConnection | null,\n ) {}\n}\n\n// ---------------------------------------------------------------------------\n// State Types (for undo/redo)\n// ---------------------------------------------------------------------------\n\n/** A complete snapshot of the flow state */\nexport interface FlowSnapshot {\n Nodes: FlowNode[];\n Connections: FlowConnection[];\n}\n\n// ---------------------------------------------------------------------------\n// Layout Types\n// ---------------------------------------------------------------------------\n\n/** Direction for auto-layout */\nexport type FlowLayoutDirection = 'horizontal' | 'vertical';\n\n/**\n * How the canvas toolbar presents itself.\n *\n * `shown` is the full bar. `minimized` is a chip that restores it. `hidden` leaves only a\n * recover tab — otherwise a host that hid the bar would have no way back from the canvas.\n */\nexport type FlowToolbarVisibility = 'shown' | 'hidden' | 'minimized';\n\n/** Horizontal placement of the canvas toolbar (and of its minimized / hidden recover control). */\nexport type FlowToolbarAlign = 'left' | 'center' | 'right';\n\n/** Result of an auto-layout operation */\nexport interface FlowLayoutResult {\n Positions: Map<string, FlowPosition>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flow-types.js","sourceRoot":"","sources":["../../../src/lib/interfaces/flow-types.ts"],"names":[],"mappings":"AAoPA;;;;GAIG;AACH,MAAM,OAAO,8BAA8B;IAGnB;IACA;IACA;IACA;IACT;IANJ,MAAM,GAAG,KAAK,CAAC;IACtB,YACoB,MAA6B,EAC7B,IAAqB,EACrB,UAAiC,EACjC,UAAsB,EAC/B,KAA4B;QAJnB,WAAM,GAAN,MAAM,CAAuB;QAC7B,SAAI,GAAJ,IAAI,CAAiB;QACrB,eAAU,GAAV,UAAU,CAAuB;QACjC,eAAU,GAAV,UAAU,CAAY;QAC/B,UAAK,GAAL,KAAK,CAAuB;IACpC,CAAC;CACP;AAED,6FAA6F;AAC7F,MAAM,OAAO,mCAAmC;IAExB;IACA;IACA;IACA;IAJpB,YACoB,QAAgB,EAChB,MAA6B,EAC7B,IAAqB,EACrB,UAAiC;QAHjC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAuB;QAC7B,SAAI,GAAJ,IAAI,CAAiB;QACrB,eAAU,GAAV,UAAU,CAAuB;IAClD,CAAC;CACP","sourcesContent":["/**\n * Core interfaces for the generic flow editor.\n * These types are entity-agnostic — consumers map their domain data to/from these.\n */\nimport type { MJAIPromptEntity } from '@memberjunction/core-entities';\n\n/**\n * Prompt option shape for flow editor prompt pickers.\n */\nexport type PromptOption = Pick<MJAIPromptEntity, 'ID' | 'Name' | 'AIModelType' | 'AIModelTypeID'>;\n\n// ---------------------------------------------------------------------------\n// Node Types\n// ---------------------------------------------------------------------------\n\n/** Position on the canvas */\nexport interface FlowPosition {\n X: number;\n Y: number;\n}\n\n/** Size dimensions */\nexport interface FlowSize {\n Width: number;\n Height: number;\n}\n\n/** A port (connector) on a node */\nexport interface FlowNodePort {\n ID: string;\n Direction: 'input' | 'output';\n Side?: 'left' | 'right' | 'top' | 'bottom' | 'auto';\n Multiple?: boolean;\n Disabled?: boolean;\n Label?: string;\n /** Category string for connection validation (matched against FlowNodePort on targets) */\n Category?: string;\n}\n\n/** A small info badge displayed on a node */\nexport interface FlowNodeBadge {\n Label: string;\n Value: string;\n Icon?: string;\n Color?: string;\n}\n\n/** One key/value preview row rendered when X-Ray mode is active on a node. */\nexport interface FlowNodeXRayItem {\n Key: string;\n Value: string;\n Changed?: boolean;\n}\n\n/** AI Decision confidence telemetry shown inside X-Ray mode. */\nexport interface FlowNodeConfidence {\n /** 0–100 percentage score */\n Score: number;\n /** Optional 0–100 minimum confidence threshold */\n Threshold?: number;\n Label?: string;\n}\n\n/** Breakpoint state rendered on the node's left gutter. */\nexport type FlowNodeBreakpointKind = 'single' | 'remembered';\n\n/** Security taint / person-verification indicator for a node. */\nexport type FlowNodeTaintState = 'tainted' | 'verified';\n\n/** Visual status of a node */\n/**\n * How a node presents its state.\n *\n * `skipped` is deliberately its own value rather than a shade of `disabled`. Disabled means \"this\n * cannot run\"; skipped means \"the graph chose another route\" — nothing is wrong, and a reader who\n * cannot tell them apart goes looking for a failure that never happened.\n */\nexport type FlowNodeStatus = 'default' | 'success' | 'error' | 'warning' | 'running' | 'disabled' | 'pending' | 'skipped';\n\n/** A node in the flow graph */\nexport interface FlowNode {\n ID: string;\n Type: string;\n Label: string;\n Subtitle?: string;\n Icon?: string;\n IconColor?: string;\n Status: FlowNodeStatus;\n StatusMessage?: string;\n Badges?: FlowNodeBadge[];\n Position: FlowPosition;\n Size?: FlowSize;\n Ports: FlowNodePort[];\n Collapsed?: boolean;\n Selected?: boolean;\n Locked?: boolean;\n IsStartNode?: boolean;\n /** Breakpoint armed on this step (solid red for single-run, hollow ring for remembered). */\n Breakpoint?: FlowNodeBreakpointKind | null;\n /** Live runner progress message (from `NodeProgress` frames). */\n ProgressMessage?: string;\n /** Live runner progress percentage 0–100 (undefined = indeterminate when ProgressMessage is set). */\n ProgressPercent?: number;\n /** Inline X-Ray key/value telemetry rows. */\n XRayItems?: FlowNodeXRayItem[];\n /** AI Decision confidence telemetry. */\n Confidence?: FlowNodeConfidence;\n /** External-data taint or human-verified shield state. */\n TaintState?: FlowNodeTaintState | null;\n /** Saga rollback / compensation label (e.g. \"Undo: Void Draft\"). */\n SagaCompensationLabel?: string;\n /** True when highlighted as part of a failure blast-radius preview (`ComputeTasksToBlock`). */\n BlastRadius?: boolean;\n /** True when the operator can invoke targeted `Step(taskID)` directly on this step. */\n CanStepSingle?: boolean;\n /** Opaque data payload — consumers store domain-specific data here */\n Data?: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Connection Types\n// ---------------------------------------------------------------------------\n\n/** Visual style for a connection line */\nexport type FlowConnectionStyle = 'solid' | 'dashed' | 'dotted';\n\n/** A connection (edge) between two nodes */\nexport interface FlowConnection {\n ID: string;\n SourceNodeID: string;\n SourcePortID: string;\n TargetNodeID: string;\n TargetPortID: string;\n Label?: string;\n LabelDetail?: string;\n /** Font Awesome icon class shown before the label text (e.g., 'fa-check') */\n LabelIcon?: string;\n /** Color for the label icon */\n LabelIconColor?: string;\n Condition?: string;\n Priority?: number;\n Style?: FlowConnectionStyle;\n Color?: string;\n /** Stroke width in px. Active/flowing edges use a thicker value so they read at a glance. */\n StrokeWidth?: number;\n Animated?: boolean;\n Selected?: boolean;\n /** True for untaken/skipped paths rendered ghosted rather than deleted. */\n Untaken?: boolean;\n /** Operator-forced path verdict (kept visually unmistakable with amber dotted stroke). */\n ForcedVerdict?: 'true' | 'false' | null;\n /** Opaque data payload — consumers store domain-specific data here */\n Data?: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Node Type Registration (for palette and rendering)\n// ---------------------------------------------------------------------------\n\n/** Configuration for a node type displayed in the palette */\nexport interface FlowNodeTypeConfig {\n /** Unique type identifier (e.g., 'Action', 'Prompt') */\n Type: string;\n /** Display label */\n Label: string;\n /** Font Awesome icon class (e.g., 'fa-bolt') */\n Icon: string;\n /** Hex color for the node header */\n Color: string;\n /** Default ports created when this node type is added */\n DefaultPorts?: FlowNodePort[];\n /** Palette category for grouping (e.g., 'Steps', 'Loops') */\n Category?: string;\n /** Whether this type can be dragged from the palette (default true) */\n Draggable?: boolean;\n /** Maximum number of instances allowed (0 = unlimited, default 0) */\n MaxInstances?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Event Payloads\n// ---------------------------------------------------------------------------\n\n/** Emitted when a new node is added from the palette */\nexport interface FlowNodeAddedEvent {\n Node: FlowNode;\n DropPosition: FlowPosition;\n}\n\n/** Emitted when a node is moved on the canvas */\nexport interface FlowNodeMovedEvent {\n NodeID: string;\n OldPosition: FlowPosition;\n NewPosition: FlowPosition;\n}\n\n/** Emitted when a new connection is drawn */\nexport interface FlowConnectionCreatedEvent {\n SourceNodeID: string;\n SourcePortID: string;\n TargetNodeID: string;\n TargetPortID: string;\n}\n\n/** Emitted when an existing connection is reassigned (endpoint dragged to a different node) */\nexport interface FlowConnectionReassignedEvent {\n ConnectionID: string;\n OldSourceNodeID: string;\n OldSourcePortID: string;\n OldTargetNodeID: string;\n OldTargetPortID: string;\n NewSourceNodeID: string;\n NewSourcePortID: string;\n NewTargetNodeID: string;\n NewTargetPortID: string;\n}\n\n/** Emitted when the selection state changes */\nexport interface FlowSelectionChangedEvent {\n SelectedNodeIDs: string[];\n SelectedConnectionIDs: string[];\n}\n\n/** Emitted when empty canvas is clicked */\nexport interface FlowCanvasClickEvent {\n Position: FlowPosition;\n}\n\n/** Context menu target type */\nexport type FlowContextMenuTarget = 'node' | 'connection';\n\n/** Built-in design-time actions. Hosts may emit any other `ID` string. */\nexport type FlowContextMenuAction = 'edit' | 'remove' | string;\n\n/** One row in the canvas context menu. The host may replace the default Edit/Remove set. */\nexport type FlowContextMenuItem = {\n ID: string;\n Label: string;\n Icon?: string;\n Danger?: boolean;\n Disabled?: boolean;\n Shortcut?: string;\n};\n\n/**\n * Fired BEFORE the canvas menu opens. Mutate `Items` to replace the default set; `Cancel = true`\n * suppresses the menu. A `Before*` handler must not be async — the emitter reads `Cancel`/`Items`\n * when `emit()` returns.\n */\nexport class FlowBeforeContextMenuEventArgs {\n public Cancel = false;\n constructor(\n public readonly Target: FlowContextMenuTarget,\n public readonly Node: FlowNode | null,\n public readonly Connection: FlowConnection | null,\n public readonly MouseEvent: MouseEvent,\n public Items: FlowContextMenuItem[],\n ) {}\n}\n\n/** Fired AFTER a menu item is chosen. Built-in `edit`/`remove` still run unless ReadOnly. */\nexport class FlowAfterContextMenuActionEventArgs {\n constructor(\n public readonly ActionID: string,\n public readonly Target: FlowContextMenuTarget,\n public readonly Node: FlowNode | null,\n public readonly Connection: FlowConnection | null,\n ) {}\n}\n\n// ---------------------------------------------------------------------------\n// State Types (for undo/redo)\n// ---------------------------------------------------------------------------\n\n/** A complete snapshot of the flow state */\nexport interface FlowSnapshot {\n Nodes: FlowNode[];\n Connections: FlowConnection[];\n}\n\n// ---------------------------------------------------------------------------\n// Layout Types\n// ---------------------------------------------------------------------------\n\n/** Direction for auto-layout */\nexport type FlowLayoutDirection = 'horizontal' | 'vertical';\n\n/**\n * How the canvas toolbar presents itself.\n *\n * `shown` is the full bar. `minimized` is a chip that restores it. `hidden` leaves only a\n * recover tab — otherwise a host that hid the bar would have no way back from the canvas.\n */\nexport type FlowToolbarVisibility = 'shown' | 'hidden' | 'minimized';\n\n/** Horizontal placement of the canvas toolbar (and of its minimized / hidden recover control). */\nexport type FlowToolbarAlign = 'left' | 'center' | 'right';\n\n/** Result of an auto-layout operation */\nexport interface FlowLayoutResult {\n Positions: Map<string, FlowPosition>;\n}\n"]}
|
|
@@ -14,7 +14,6 @@ export declare class FlowLayoutService {
|
|
|
14
14
|
* Returns a map of node ID → new position.
|
|
15
15
|
*/
|
|
16
16
|
CalculateLayout(nodes: FlowNode[], connections: FlowConnection[], direction?: FlowLayoutDirection): FlowLayoutResult;
|
|
17
|
-
private currentPositions;
|
|
18
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<FlowLayoutService, never>;
|
|
19
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<FlowLayoutService>;
|
|
20
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-layout.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/flow-layout.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-layout.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/flow-layout.service.ts"],"names":[],"mappings":"AAEA,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;yCAdR,iBAAiB;6CAAjB,iBAAiB;CAsD7B"}
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
+
import dagre from '@dagrejs/dagre';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
/**
|
|
4
5
|
* Auto-layout service using dagre for directed graph layout.
|
|
5
6
|
* Calculates optimal node positions for clean flow visualization.
|
|
6
7
|
*/
|
|
7
8
|
export class FlowLayoutService {
|
|
8
|
-
static DEFAULT_NODE_WIDTH =
|
|
9
|
-
static DEFAULT_NODE_HEIGHT =
|
|
10
|
-
static NODE_SEPARATION =
|
|
11
|
-
static RANK_SEPARATION =
|
|
9
|
+
static DEFAULT_NODE_WIDTH = 240;
|
|
10
|
+
static DEFAULT_NODE_HEIGHT = 110;
|
|
11
|
+
static NODE_SEPARATION = 64;
|
|
12
|
+
static RANK_SEPARATION = 104;
|
|
12
13
|
/**
|
|
13
14
|
* Calculate optimal positions for all nodes using dagre layout.
|
|
14
15
|
* Returns a map of node ID → new position.
|
|
15
16
|
*/
|
|
16
17
|
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
18
|
const graph = new dagre.graphlib.Graph();
|
|
27
19
|
graph.setGraph({
|
|
28
20
|
rankdir: direction === 'horizontal' ? 'LR' : 'TB',
|
|
@@ -32,13 +24,11 @@ export class FlowLayoutService {
|
|
|
32
24
|
marginy: 40
|
|
33
25
|
});
|
|
34
26
|
graph.setDefaultEdgeLabel(() => ({}));
|
|
35
|
-
// Add nodes
|
|
36
27
|
for (const node of nodes) {
|
|
37
28
|
const width = node.Size?.Width ?? FlowLayoutService.DEFAULT_NODE_WIDTH;
|
|
38
29
|
const height = node.Size?.Height ?? FlowLayoutService.DEFAULT_NODE_HEIGHT;
|
|
39
30
|
graph.setNode(node.ID, { width, height });
|
|
40
31
|
}
|
|
41
|
-
// Add edges
|
|
42
32
|
for (const conn of connections) {
|
|
43
33
|
if (graph.hasNode(conn.SourceNodeID) && graph.hasNode(conn.TargetNodeID)) {
|
|
44
34
|
graph.setEdge(conn.SourceNodeID, conn.TargetNodeID);
|
|
@@ -49,7 +39,6 @@ export class FlowLayoutService {
|
|
|
49
39
|
for (const node of nodes) {
|
|
50
40
|
const layoutNode = graph.node(node.ID);
|
|
51
41
|
if (layoutNode) {
|
|
52
|
-
// dagre returns center positions; convert to top-left
|
|
53
42
|
const width = node.Size?.Width ?? FlowLayoutService.DEFAULT_NODE_WIDTH;
|
|
54
43
|
const height = node.Size?.Height ?? FlowLayoutService.DEFAULT_NODE_HEIGHT;
|
|
55
44
|
positions.set(node.ID, {
|
|
@@ -60,13 +49,6 @@ export class FlowLayoutService {
|
|
|
60
49
|
}
|
|
61
50
|
return { Positions: positions };
|
|
62
51
|
}
|
|
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
52
|
static ɵfac = function FlowLayoutService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FlowLayoutService)(); };
|
|
71
53
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FlowLayoutService, factory: FlowLayoutService.ɵfac });
|
|
72
54
|
}
|
|
@@ -1 +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;;
|
|
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;AAC3C,OAAO,KAAK,MAAM,gBAAgB,CAAC;;AAGnC;;;GAGG;AAEH,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAU,kBAAkB,GAAG,GAAG,CAAC;IACzC,MAAM,CAAU,mBAAmB,GAAG,GAAG,CAAC;IAC1C,MAAM,CAAU,eAAe,GAAG,EAAE,CAAC;IACrC,MAAM,CAAU,eAAe,GAAG,GAAG,CAAC;IAE9C;;;OAGG;IACH,eAAe,CACb,KAAiB,EACjB,WAA6B,EAC7B,YAAiC,UAAU;QAE3C,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACzC,KAAK,CAAC,QAAQ,CAAC;YACb,OAAO,EAAE,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;YACjD,OAAO,EAAE,iBAAiB,CAAC,eAAe;YAC1C,OAAO,EAAE,iBAAiB,CAAC,eAAe;YAC1C,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QACH,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,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G,CAAC;iBAC7B,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAClC,CAAC;2GArDU,iBAAiB;gEAAjB,iBAAiB,WAAjB,iBAAiB;;iFAAjB,iBAAiB;cAD7B,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\nimport dagre from '@dagrejs/dagre';\nimport { FlowNode, FlowConnection, FlowPosition, FlowLayoutDirection, FlowLayoutResult } from '../interfaces/flow-types';\n\n/**\n * Auto-layout service using dagre for directed graph layout.\n * Calculates optimal node positions for clean flow visualization.\n */\n@Injectable()\nexport class FlowLayoutService {\n private static readonly DEFAULT_NODE_WIDTH = 240;\n private static readonly DEFAULT_NODE_HEIGHT = 110;\n private static readonly NODE_SEPARATION = 64;\n private static readonly RANK_SEPARATION = 104;\n\n /**\n * Calculate optimal positions for all nodes using dagre layout.\n * Returns a map of node ID → new position.\n */\n CalculateLayout(\n nodes: FlowNode[],\n connections: FlowConnection[],\n direction: FlowLayoutDirection = 'vertical'\n ): FlowLayoutResult {\n const graph = new dagre.graphlib.Graph();\n graph.setGraph({\n rankdir: direction === 'horizontal' ? 'LR' : 'TB',\n nodesep: FlowLayoutService.NODE_SEPARATION,\n ranksep: FlowLayoutService.RANK_SEPARATION,\n marginx: 40,\n marginy: 40\n });\n graph.setDefaultEdgeLabel(() => ({}));\n\n for (const node of nodes) {\n const width = node.Size?.Width ?? FlowLayoutService.DEFAULT_NODE_WIDTH;\n const height = node.Size?.Height ?? FlowLayoutService.DEFAULT_NODE_HEIGHT;\n graph.setNode(node.ID, { width, height });\n }\n\n for (const conn of connections) {\n if (graph.hasNode(conn.SourceNodeID) && graph.hasNode(conn.TargetNodeID)) {\n graph.setEdge(conn.SourceNodeID, conn.TargetNodeID);\n }\n }\n\n dagre.layout(graph);\n\n const positions = new Map<string, FlowPosition>();\n for (const node of nodes) {\n const layoutNode = graph.node(node.ID);\n if (layoutNode) {\n const width = node.Size?.Width ?? FlowLayoutService.DEFAULT_NODE_WIDTH;\n const height = node.Size?.Height ?? FlowLayoutService.DEFAULT_NODE_HEIGHT;\n positions.set(node.ID, {\n X: layoutNode.x - width / 2,\n Y: layoutNode.y - height / 2\n });\n }\n }\n\n return { Positions: positions };\n }\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pure viewport math and bounded per-workflow viewport persistence helpers
|
|
3
|
+
* for `<mj-flow-editor>`. Kept pure so fit-zoom clamping and UserInfoEngine serialization
|
|
4
|
+
* can be unit-tested without Angular TestBed or DOM layout.
|
|
5
|
+
*
|
|
6
|
+
* @module @memberjunction/ng-flow-editor
|
|
7
|
+
*/
|
|
8
|
+
import type { FlowNode } from '../interfaces/flow-types';
|
|
9
|
+
/** User setting key holding the bounded per-workflow pan & zoom dictionary. */
|
|
10
|
+
export declare const FLOW_VIEWPORTS_SETTING_KEY = "mj.flowEditor.viewports.v1";
|
|
11
|
+
/** Maximum automatic fit-to-screen scale so small 1–5 step workflows never blow up past 95%. */
|
|
12
|
+
export declare const MAX_FIT_SCALE = 0.95;
|
|
13
|
+
/** Minimum fit scale matching Foblex's `[fZoomMinimum]`. */
|
|
14
|
+
export declare const MIN_FIT_SCALE = 0.15;
|
|
15
|
+
/** Cap stored viewport entries so the single User Setting JSON payload remains small. */
|
|
16
|
+
export declare const MAX_STORED_VIEWPORTS = 100;
|
|
17
|
+
export interface FlowViewportState {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
scale: number;
|
|
21
|
+
updatedAt: number;
|
|
22
|
+
}
|
|
23
|
+
export interface FlowViewportStoreAdapter {
|
|
24
|
+
Get(key: string): string | undefined;
|
|
25
|
+
Set(key: string, value: string): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Computes a centered pan `{ x, y }` and zoom `scale` that fits all `nodes` inside
|
|
29
|
+
* `(viewportWidth, viewportHeight)` with breathing room while capping zoom at `maxScale`
|
|
30
|
+
* (default `0.95`). Small workflows sit naturally centered instead of zooming to 200%+.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ComputeCappedFitViewport(nodes: readonly FlowNode[], viewportWidth: number, viewportHeight: number, options?: {
|
|
33
|
+
padding?: number;
|
|
34
|
+
maxScale?: number;
|
|
35
|
+
minScale?: number;
|
|
36
|
+
}): {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
scale: number;
|
|
40
|
+
} | null;
|
|
41
|
+
/**
|
|
42
|
+
* Bounded per-key pan/zoom dictionary backed by `UserInfoEngine` (`MJ: User Settings`).
|
|
43
|
+
* Caps stored keys to the most recent `MAX_STORED_VIEWPORTS` entries.
|
|
44
|
+
*/
|
|
45
|
+
export declare class FlowViewportStore {
|
|
46
|
+
private readonly adapter;
|
|
47
|
+
private readonly maxEntries;
|
|
48
|
+
private cache;
|
|
49
|
+
constructor(adapter: FlowViewportStoreAdapter, maxEntries?: number);
|
|
50
|
+
Load(viewportKey: string | null | undefined): FlowViewportState | null;
|
|
51
|
+
Save(viewportKey: string | null | undefined, viewport: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
scale: number;
|
|
55
|
+
}): void;
|
|
56
|
+
private readAll;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=flow-viewport.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-viewport.util.d.ts","sourceRoot":"","sources":["../../../src/lib/services/flow-viewport.util.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,gGAAgG;AAChG,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,4DAA4D;AAC5D,eAAO,MAAM,aAAa,OAAO,CAAC;AAMlC,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,M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|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/** User setting key holding the bounded per-workflow pan & zoom dictionary. */
|
|
2
|
+
export const FLOW_VIEWPORTS_SETTING_KEY = 'mj.flowEditor.viewports.v1';
|
|
3
|
+
/** Maximum automatic fit-to-screen scale so small 1–5 step workflows never blow up past 95%. */
|
|
4
|
+
export const MAX_FIT_SCALE = 0.95;
|
|
5
|
+
/** Minimum fit scale matching Foblex's `[fZoomMinimum]`. */
|
|
6
|
+
export const MIN_FIT_SCALE = 0.15;
|
|
7
|
+
/** Default node footprint used when a FlowNode omits explicit Width/Height. */
|
|
8
|
+
const DEFAULT_NODE_WIDTH = 220;
|
|
9
|
+
const DEFAULT_NODE_HEIGHT = 96;
|
|
10
|
+
/** Cap stored viewport entries so the single User Setting JSON payload remains small. */
|
|
11
|
+
export const MAX_STORED_VIEWPORTS = 100;
|
|
12
|
+
/**
|
|
13
|
+
* Computes a centered pan `{ x, y }` and zoom `scale` that fits all `nodes` inside
|
|
14
|
+
* `(viewportWidth, viewportHeight)` with breathing room while capping zoom at `maxScale`
|
|
15
|
+
* (default `0.95`). Small workflows sit naturally centered instead of zooming to 200%+.
|
|
16
|
+
*/
|
|
17
|
+
export function ComputeCappedFitViewport(nodes, viewportWidth, viewportHeight, options) {
|
|
18
|
+
if (nodes.length === 0 || viewportWidth <= 0 || viewportHeight <= 0) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const padding = options?.padding ?? 72;
|
|
22
|
+
const maxScale = options?.maxScale ?? MAX_FIT_SCALE;
|
|
23
|
+
const minScale = options?.minScale ?? MIN_FIT_SCALE;
|
|
24
|
+
let minX = Number.POSITIVE_INFINITY;
|
|
25
|
+
let minY = Number.POSITIVE_INFINITY;
|
|
26
|
+
let maxX = Number.NEGATIVE_INFINITY;
|
|
27
|
+
let maxY = Number.NEGATIVE_INFINITY;
|
|
28
|
+
for (const node of nodes) {
|
|
29
|
+
const nx = Number.isFinite(node.Position?.X) ? node.Position.X : 0;
|
|
30
|
+
const ny = Number.isFinite(node.Position?.Y) ? node.Position.Y : 0;
|
|
31
|
+
const nw = node.Size?.Width && node.Size.Width > 0 ? node.Size.Width : DEFAULT_NODE_WIDTH;
|
|
32
|
+
const nh = node.Size?.Height && node.Size.Height > 0 ? node.Size.Height : DEFAULT_NODE_HEIGHT;
|
|
33
|
+
minX = Math.min(minX, nx);
|
|
34
|
+
minY = Math.min(minY, ny);
|
|
35
|
+
maxX = Math.max(maxX, nx + nw);
|
|
36
|
+
maxY = Math.max(maxY, ny + nh);
|
|
37
|
+
}
|
|
38
|
+
const contentW = Math.max(1, maxX - minX);
|
|
39
|
+
const contentH = Math.max(1, maxY - minY);
|
|
40
|
+
const availW = Math.max(80, viewportWidth - padding * 2);
|
|
41
|
+
const availH = Math.max(80, viewportHeight - padding * 2);
|
|
42
|
+
const rawScale = Math.min(availW / contentW, availH / contentH);
|
|
43
|
+
const scale = Math.round(Math.max(minScale, Math.min(maxScale, rawScale)) * 1000) / 1000;
|
|
44
|
+
const x = Math.round((viewportWidth - contentW * scale) / 2 - minX * scale);
|
|
45
|
+
const y = Math.round((viewportHeight - contentH * scale) / 2 - minY * scale);
|
|
46
|
+
return { x, y, scale };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Bounded per-key pan/zoom dictionary backed by `UserInfoEngine` (`MJ: User Settings`).
|
|
50
|
+
* Caps stored keys to the most recent `MAX_STORED_VIEWPORTS` entries.
|
|
51
|
+
*/
|
|
52
|
+
export class FlowViewportStore {
|
|
53
|
+
adapter;
|
|
54
|
+
maxEntries;
|
|
55
|
+
cache = null;
|
|
56
|
+
constructor(adapter, maxEntries = MAX_STORED_VIEWPORTS) {
|
|
57
|
+
this.adapter = adapter;
|
|
58
|
+
this.maxEntries = maxEntries;
|
|
59
|
+
}
|
|
60
|
+
Load(viewportKey) {
|
|
61
|
+
const key = viewportKey?.trim();
|
|
62
|
+
if (!key)
|
|
63
|
+
return null;
|
|
64
|
+
const dict = this.readAll();
|
|
65
|
+
const entry = dict[key];
|
|
66
|
+
return isValidViewport(entry) ? entry : null;
|
|
67
|
+
}
|
|
68
|
+
Save(viewportKey, viewport) {
|
|
69
|
+
const key = viewportKey?.trim();
|
|
70
|
+
if (!key)
|
|
71
|
+
return;
|
|
72
|
+
if (!Number.isFinite(viewport.x) || !Number.isFinite(viewport.y) || !Number.isFinite(viewport.scale) || viewport.scale <= 0) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const dict = { ...this.readAll() };
|
|
76
|
+
dict[key] = {
|
|
77
|
+
x: Math.round(viewport.x),
|
|
78
|
+
y: Math.round(viewport.y),
|
|
79
|
+
scale: Math.round(viewport.scale * 1000) / 1000,
|
|
80
|
+
updatedAt: Date.now(),
|
|
81
|
+
};
|
|
82
|
+
const keys = Object.keys(dict);
|
|
83
|
+
if (keys.length > this.maxEntries) {
|
|
84
|
+
keys.sort((a, b) => (dict[b]?.updatedAt ?? 0) - (dict[a]?.updatedAt ?? 0));
|
|
85
|
+
const trimmed = {};
|
|
86
|
+
for (const k of keys.slice(0, this.maxEntries)) {
|
|
87
|
+
trimmed[k] = dict[k];
|
|
88
|
+
}
|
|
89
|
+
this.cache = trimmed;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.cache = dict;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
this.adapter.Set(FLOW_VIEWPORTS_SETTING_KEY, JSON.stringify(this.cache));
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// Engine not bootstrapped in unit tests
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
readAll() {
|
|
102
|
+
if (this.cache)
|
|
103
|
+
return this.cache;
|
|
104
|
+
try {
|
|
105
|
+
const raw = this.adapter.Get(FLOW_VIEWPORTS_SETTING_KEY);
|
|
106
|
+
if (raw) {
|
|
107
|
+
const parsed = JSON.parse(raw);
|
|
108
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
109
|
+
const clean = {};
|
|
110
|
+
for (const [k, v] of Object.entries(parsed)) {
|
|
111
|
+
if (isValidViewport(v))
|
|
112
|
+
clean[k] = v;
|
|
113
|
+
}
|
|
114
|
+
this.cache = clean;
|
|
115
|
+
return clean;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// Malformed JSON or uninitialized engine
|
|
121
|
+
}
|
|
122
|
+
this.cache = {};
|
|
123
|
+
return this.cache;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function isValidViewport(value) {
|
|
127
|
+
if (!value || typeof value !== 'object')
|
|
128
|
+
return false;
|
|
129
|
+
const v = value;
|
|
130
|
+
return (typeof v.x === 'number' && Number.isFinite(v.x) &&
|
|
131
|
+
typeof v.y === 'number' && Number.isFinite(v.y) &&
|
|
132
|
+
typeof v.scale === 'number' && Number.isFinite(v.scale) && v.scale > 0);
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=flow-viewport.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-viewport.util.js","sourceRoot":"","sources":["../../../src/lib/services/flow-viewport.util.ts"],"names":[],"mappings":"AASA,+EAA+E;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,gGAAgG;AAChG,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAElC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAElC,+EAA+E;AAC/E,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,yFAAyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAcxC;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACpC,KAA0B,EAC1B,aAAqB,EACrB,cAAsB,EACtB,OAAoE;IAEpE,IAAI,KAAK,CAAC,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AK,GAAG,CAAC,CACzE,CAAC;AACN,CAAC","sourcesContent":["/**\n * @fileoverview Pure viewport math and bounded per-workflow viewport persistence helpers\n * for `<mj-flow-editor>`. Kept pure so fit-zoom clamping and UserInfoEngine serialization\n * can be unit-tested without Angular TestBed or DOM layout.\n *\n * @module @memberjunction/ng-flow-editor\n */\nimport type { FlowNode } from '../interfaces/flow-types';\n\n/** User setting key holding the bounded per-workflow pan & zoom dictionary. */\nexport const FLOW_VIEWPORTS_SETTING_KEY = 'mj.flowEditor.viewports.v1';\n\n/** Maximum automatic fit-to-screen scale so small 1–5 step workflows never blow up past 95%. */\nexport const MAX_FIT_SCALE = 0.95;\n\n/** Minimum fit scale matching Foblex's `[fZoomMinimum]`. */\nexport const MIN_FIT_SCALE = 0.15;\n\n/** Default node footprint used when a FlowNode omits explicit Width/Height. */\nconst DEFAULT_NODE_WIDTH = 220;\nconst DEFAULT_NODE_HEIGHT = 96;\n\n/** Cap stored viewport entries so the single User Setting JSON payload remains small. */\nexport const MAX_STORED_VIEWPORTS = 100;\n\nexport interface FlowViewportState {\n x: number;\n y: number;\n scale: number;\n updatedAt: number;\n}\n\nexport interface FlowViewportStoreAdapter {\n Get(key: string): string | undefined;\n Set(key: string, value: string): void;\n}\n\n/**\n * Computes a centered pan `{ x, y }` and zoom `scale` that fits all `nodes` inside\n * `(viewportWidth, viewportHeight)` with breathing room while capping zoom at `maxScale`\n * (default `0.95`). Small workflows sit naturally centered instead of zooming to 200%+.\n */\nexport function ComputeCappedFitViewport(\n nodes: readonly FlowNode[],\n viewportWidth: number,\n viewportHeight: number,\n options?: { padding?: number; maxScale?: number; minScale?: number },\n): { x: number; y: number; scale: number } | null {\n if (nodes.length === 0 || viewportWidth <= 0 || viewportHeight <= 0) {\n return null;\n }\n\n const padding = options?.padding ?? 72;\n const maxScale = options?.maxScale ?? MAX_FIT_SCALE;\n const minScale = options?.minScale ?? MIN_FIT_SCALE;\n\n let minX = Number.POSITIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (const node of nodes) {\n const nx = Number.isFinite(node.Position?.X) ? node.Position.X : 0;\n const ny = Number.isFinite(node.Position?.Y) ? node.Position.Y : 0;\n const nw = node.Size?.Width && node.Size.Width > 0 ? node.Size.Width : DEFAULT_NODE_WIDTH;\n const nh = node.Size?.Height && node.Size.Height > 0 ? node.Size.Height : DEFAULT_NODE_HEIGHT;\n minX = Math.min(minX, nx);\n minY = Math.min(minY, ny);\n maxX = Math.max(maxX, nx + nw);\n maxY = Math.max(maxY, ny + nh);\n }\n\n const contentW = Math.max(1, maxX - minX);\n const contentH = Math.max(1, maxY - minY);\n const availW = Math.max(80, viewportWidth - padding * 2);\n const availH = Math.max(80, viewportHeight - padding * 2);\n\n const rawScale = Math.min(availW / contentW, availH / contentH);\n const scale = Math.round(Math.max(minScale, Math.min(maxScale, rawScale)) * 1000) / 1000;\n\n const x = Math.round((viewportWidth - contentW * scale) / 2 - minX * scale);\n const y = Math.round((viewportHeight - contentH * scale) / 2 - minY * scale);\n return { x, y, scale };\n}\n\n/**\n * Bounded per-key pan/zoom dictionary backed by `UserInfoEngine` (`MJ: User Settings`).\n * Caps stored keys to the most recent `MAX_STORED_VIEWPORTS` entries.\n */\nexport class FlowViewportStore {\n private cache: Record<string, FlowViewportState> | null = null;\n\n constructor(\n private readonly adapter: FlowViewportStoreAdapter,\n private readonly maxEntries: number = MAX_STORED_VIEWPORTS,\n ) {}\n\n public Load(viewportKey: string | null | undefined): FlowViewportState | null {\n const key = viewportKey?.trim();\n if (!key) return null;\n const dict = this.readAll();\n const entry = dict[key];\n return isValidViewport(entry) ? entry : null;\n }\n\n public Save(viewportKey: string | null | undefined, viewport: { x: number; y: number; scale: number }): void {\n const key = viewportKey?.trim();\n if (!key) return;\n if (!Number.isFinite(viewport.x) || !Number.isFinite(viewport.y) || !Number.isFinite(viewport.scale) || viewport.scale <= 0) {\n return;\n }\n const dict = { ...this.readAll() };\n dict[key] = {\n x: Math.round(viewport.x),\n y: Math.round(viewport.y),\n scale: Math.round(viewport.scale * 1000) / 1000,\n updatedAt: Date.now(),\n };\n\n const keys = Object.keys(dict);\n if (keys.length > this.maxEntries) {\n keys.sort((a, b) => (dict[b]?.updatedAt ?? 0) - (dict[a]?.updatedAt ?? 0));\n const trimmed: Record<string, FlowViewportState> = {};\n for (const k of keys.slice(0, this.maxEntries)) {\n trimmed[k] = dict[k];\n }\n this.cache = trimmed;\n } else {\n this.cache = dict;\n }\n\n try {\n this.adapter.Set(FLOW_VIEWPORTS_SETTING_KEY, JSON.stringify(this.cache));\n } catch {\n // Engine not bootstrapped in unit tests\n }\n }\n\n private readAll(): Record<string, FlowViewportState> {\n if (this.cache) return this.cache;\n try {\n const raw = this.adapter.Get(FLOW_VIEWPORTS_SETTING_KEY);\n if (raw) {\n const parsed: unknown = JSON.parse(raw);\n if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {\n const clean: Record<string, FlowViewportState> = {};\n for (const [k, v] of Object.entries(parsed as Record<string, unknown>)) {\n if (isValidViewport(v)) clean[k] = v;\n }\n this.cache = clean;\n return clean;\n }\n }\n } catch {\n // Malformed JSON or uninitialized engine\n }\n this.cache = {};\n return this.cache;\n }\n}\n\nfunction isValidViewport(value: unknown): value is FlowViewportState {\n if (!value || typeof value !== 'object') return false;\n const v = value as Partial<FlowViewportState>;\n return (\n typeof v.x === 'number' && Number.isFinite(v.x) &&\n typeof v.y === 'number' && Number.isFinite(v.y) &&\n typeof v.scale === 'number' && Number.isFinite(v.scale) && v.scale > 0\n );\n}\n"]}
|
package/dist/public-api.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './lib/flow-editor.module';
|
|
|
2
2
|
export * from './lib/interfaces/flow-types';
|
|
3
3
|
export * from './lib/services/flow-state.service';
|
|
4
4
|
export * from './lib/services/flow-layout.service';
|
|
5
|
+
export * from './lib/services/flow-viewport.util';
|
|
5
6
|
export * from './lib/components/flow-editor.component';
|
|
6
7
|
export * from './lib/components/flow-node.component';
|
|
7
8
|
export * from './lib/components/flow-palette.component';
|
package/dist/public-api.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
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;AACnD,cAAc,mCAAmC,CAAC;AAGlD,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;AAClE,cAAc,mCAAmC,CAAC"}
|
package/dist/public-api.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from './lib/interfaces/flow-types';
|
|
|
8
8
|
// Services
|
|
9
9
|
export * from './lib/services/flow-state.service';
|
|
10
10
|
export * from './lib/services/flow-layout.service';
|
|
11
|
+
export * from './lib/services/flow-viewport.util';
|
|
11
12
|
// Generic Components
|
|
12
13
|
export * from './lib/components/flow-editor.component';
|
|
13
14
|
export * from './lib/components/flow-node.component';
|
package/dist/public-api.js.map
CHANGED
|
@@ -1 +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;
|
|
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;AACnD,cAAc,mCAAmC,CAAC;AAElD,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;AAClE,cAAc,mCAAmC,CAAC","sourcesContent":["/*\n * Public API Surface of @memberjunction/ng-flow-editor\n */\n\n// Module\nexport * from './lib/flow-editor.module';\n\n// Interfaces\nexport * from './lib/interfaces/flow-types';\n\n// Services\nexport * from './lib/services/flow-state.service';\nexport * from './lib/services/flow-layout.service';\nexport * from './lib/services/flow-viewport.util';\n\n// Generic Components\nexport * from './lib/components/flow-editor.component';\nexport * from './lib/components/flow-node.component';\nexport * from './lib/components/flow-palette.component';\nexport * from './lib/components/flow-toolbar.component';\nexport * from './lib/components/flow-status-bar.component';\n\n// Agent Editor Components\nexport * from './lib/agent-editor/flow-agent-editor.component';\nexport * from './lib/agent-editor/agent-properties-panel.component';\nexport * from './lib/agent-editor/agent-step-list.component';\nexport * from './lib/agent-editor/agent-flow-transformer.service';\nexport * from './lib/agent-editor/flow-run-check';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-flow-editor",
|
|
3
|
-
"version": "6.3.0-edge.
|
|
3
|
+
"version": "6.3.0-edge.3",
|
|
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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@angular/compiler": "21.2.22",
|
|
23
23
|
"@angular/compiler-cli": "21.2.22",
|
|
24
|
-
"@memberjunction/ng-test-utils": "6.3.0-edge.
|
|
24
|
+
"@memberjunction/ng-test-utils": "6.3.0-edge.3",
|
|
25
25
|
"sass": "^1.97.3",
|
|
26
26
|
"vitest": "^4.0.18"
|
|
27
27
|
},
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"@foblex/mediator": "1.1.3",
|
|
39
39
|
"@foblex/platform": "1.0.4",
|
|
40
40
|
"@foblex/utils": "1.1.1",
|
|
41
|
-
"@memberjunction/ai-core-plus": "6.3.0-edge.
|
|
42
|
-
"@memberjunction/core": "6.3.0-edge.
|
|
43
|
-
"@memberjunction/core-entities": "6.3.0-edge.
|
|
44
|
-
"@memberjunction/global": "6.3.0-edge.
|
|
45
|
-
"@memberjunction/ng-base-types": "6.3.0-edge.
|
|
46
|
-
"@memberjunction/ng-code-editor": "6.3.0-edge.
|
|
47
|
-
"@memberjunction/ng-shared-generic": "6.3.0-edge.
|
|
48
|
-
"@memberjunction/ng-ui-components": "6.3.0-edge.
|
|
41
|
+
"@memberjunction/ai-core-plus": "6.3.0-edge.3",
|
|
42
|
+
"@memberjunction/core": "6.3.0-edge.3",
|
|
43
|
+
"@memberjunction/core-entities": "6.3.0-edge.3",
|
|
44
|
+
"@memberjunction/global": "6.3.0-edge.3",
|
|
45
|
+
"@memberjunction/ng-base-types": "6.3.0-edge.3",
|
|
46
|
+
"@memberjunction/ng-code-editor": "6.3.0-edge.3",
|
|
47
|
+
"@memberjunction/ng-shared-generic": "6.3.0-edge.3",
|
|
48
|
+
"@memberjunction/ng-ui-components": "6.3.0-edge.3",
|
|
49
49
|
"rxjs": "^7.8.2",
|
|
50
50
|
"tslib": "^2.8.1"
|
|
51
51
|
},
|