@uipath/apollo-react 6.65.1 → 6.67.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/canvas/components/AgentCanvas/AgentFlow.cjs +95 -53
- package/dist/canvas/components/AgentCanvas/AgentFlow.d.ts.map +1 -1
- package/dist/canvas/components/AgentCanvas/AgentFlow.js +96 -44
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.cjs +1 -1
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.d.ts +1 -1
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.d.ts.map +1 -1
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.js +1 -1
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.cjs +5 -5
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.d.ts +7 -0
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.d.ts.map +1 -1
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.js +5 -5
- package/dist/canvas/components/CanvasZoomControls/index.d.ts +1 -1
- package/dist/canvas/components/CanvasZoomControls/index.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/builder-types.d.ts +8 -0
- package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-file-support-indicator.cjs +79 -0
- package/dist/canvas/components/Guardrails/components/guardrail-file-support-indicator.d.ts +9 -0
- package/dist/canvas/components/Guardrails/components/guardrail-file-support-indicator.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-file-support-indicator.js +45 -0
- package/dist/canvas/components/Guardrails/guardrail-builder.cjs +4 -0
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.js +4 -0
- package/dist/canvas/components/Guardrails/i18n.cjs +95 -5
- package/dist/canvas/components/Guardrails/i18n.d.ts +21 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/i18n.js +80 -2
- package/dist/canvas/components/Guardrails/index.cjs +68 -55
- package/dist/canvas/components/Guardrails/index.d.ts +5 -3
- package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/index.js +3 -2
- package/dist/canvas/components/ToolbarButton.cjs +6 -3
- package/dist/canvas/components/ToolbarButton.d.ts.map +1 -1
- package/dist/canvas/components/ToolbarButton.js +6 -3
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/canvas/types.cjs +5 -1
- package/dist/canvas/types.d.ts +15 -0
- package/dist/canvas/types.d.ts.map +1 -1
- package/dist/canvas/types.js +5 -1
- package/package.json +2 -2
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
3
|
(()=>{
|
|
13
4
|
__webpack_require__.d = (exports1, definition)=>{
|
|
14
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -36,18 +27,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
36
27
|
AgentFlow: ()=>AgentFlow
|
|
37
28
|
});
|
|
38
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
-
const styled_namespaceObject = require("@emotion/styled");
|
|
40
|
-
var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
|
|
41
30
|
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
42
31
|
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
32
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
43
33
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
44
34
|
const external_react_namespaceObject = require("react");
|
|
45
35
|
const external_BaseCanvas_index_cjs_namespaceObject = require("../BaseCanvas/index.cjs");
|
|
46
36
|
const NodeRegistryProvider_cjs_namespaceObject = require("../../core/NodeRegistryProvider.cjs");
|
|
47
37
|
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
48
38
|
const props_helpers_cjs_namespaceObject = require("../../utils/props-helpers.cjs");
|
|
49
|
-
const
|
|
39
|
+
const external_CanvasModeToolbar_index_cjs_namespaceObject = require("../CanvasModeToolbar/index.cjs");
|
|
40
|
+
const external_CanvasZoomControls_index_cjs_namespaceObject = require("../CanvasZoomControls/index.cjs");
|
|
50
41
|
const external_StickyNoteNode_index_cjs_namespaceObject = require("../StickyNoteNode/index.cjs");
|
|
42
|
+
const external_ToolbarButton_cjs_namespaceObject = require("../ToolbarButton.cjs");
|
|
51
43
|
const external_agent_flow_manifest_cjs_namespaceObject = require("./agent-flow.manifest.cjs");
|
|
52
44
|
const PaneContextMenu_cjs_namespaceObject = require("./components/PaneContextMenu.cjs");
|
|
53
45
|
const SuggestionGroupPanel_cjs_namespaceObject = require("./components/SuggestionGroupPanel.cjs");
|
|
@@ -57,33 +49,6 @@ const Edge_cjs_namespaceObject = require("./edges/Edge.cjs");
|
|
|
57
49
|
const AgentNode_cjs_namespaceObject = require("./nodes/AgentNode.cjs");
|
|
58
50
|
const ResourceNode_cjs_namespaceObject = require("./nodes/ResourceNode.cjs");
|
|
59
51
|
const agent_flow_store_cjs_namespaceObject = require("./store/agent-flow-store.cjs");
|
|
60
|
-
const ToolbarContainer = styled_default().div`
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
background: var(--canvas-background);
|
|
64
|
-
border: 1px solid var(--canvas-border-de-emp);
|
|
65
|
-
border-radius: 16px;
|
|
66
|
-
padding: 4px;
|
|
67
|
-
gap: 4px;
|
|
68
|
-
height: 50px;
|
|
69
|
-
`;
|
|
70
|
-
const ToolbarButton = styled_default().button`
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
width: 40px;
|
|
75
|
-
height: 40px;
|
|
76
|
-
border: none;
|
|
77
|
-
background: transparent;
|
|
78
|
-
cursor: pointer;
|
|
79
|
-
border-radius: 16px;
|
|
80
|
-
transition: background-color 0.15s ease;
|
|
81
|
-
color: var(--canvas-foreground);
|
|
82
|
-
|
|
83
|
-
&:hover {
|
|
84
|
-
background: var(--canvas-background-hover);
|
|
85
|
-
}
|
|
86
|
-
`;
|
|
87
52
|
const edgeTypes = {
|
|
88
53
|
default: Edge_cjs_namespaceObject.Edge
|
|
89
54
|
};
|
|
@@ -166,7 +131,7 @@ const createResourceNodeWrapper = (opts)=>(props)=>{
|
|
|
166
131
|
suggestionGroupVersion: opts.suggestionGroupVersion
|
|
167
132
|
});
|
|
168
133
|
};
|
|
169
|
-
const AgentFlowInner = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ children, mode, readOnlyNodeIds, spans, onEnable, onDisable, onAddBreakpoint, onRemoveBreakpoint, onAddGuardrail, onGoToSource, onErrorAction, onAddResource: _onAddResource, onSelectResource, setSpanForSelectedNode, getNodeFromSelectedSpan, onExpandResource, onCollapseResource, agentNodeTranslations, resourceNodeTranslations, stickyNoteNodeTranslations, canvasTranslations, enableTimelinePlayer, canvasRef, enableMcpTools, enableMemory, enableA2a, enableStickyNotes, enableInstructions, healthScore, onHealthScoreClick, suggestionTranslations, suggestionGroup, onAgentNodePositionChange, onResourceNodePositionChange, onOrganize, onUpdateStickyNote, zoomLevel, onZoomLevelChange })=>{
|
|
134
|
+
const AgentFlowInner = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ children, mode, readOnlyNodeIds, spans, onEnable, onDisable, onAddBreakpoint, onRemoveBreakpoint, onAddGuardrail, onGoToSource, onErrorAction, onAddResource: _onAddResource, onSelectResource, setSpanForSelectedNode, getNodeFromSelectedSpan, onExpandResource, onCollapseResource, agentNodeTranslations, resourceNodeTranslations, stickyNoteNodeTranslations, canvasTranslations, enableTimelinePlayer, canvasRef, enableMcpTools, enableMemory, enableA2a, enableStickyNotes, enableInstructions, healthScore, onHealthScoreClick, suggestionTranslations, suggestionGroup, onAgentNodePositionChange, onResourceNodePositionChange, onOrganize, onUpdateStickyNote, zoomLevel, onZoomLevelChange, onUndo, onRedo, canUndo, canRedo, undoCount, redoCount, onRun, canRun, runDisabledReason, onStop, isRunning })=>{
|
|
170
135
|
const { nodes, edges, onNodesChange, onEdgesChange, onConnect, autoArrange, setSelectedNodeId, selectedNodeId, setDragging, expandAgent, collapseAgent, createResourcePlaceholder, actOnSuggestionGroup, currentSuggestionIndex, navigateToNextSuggestion, navigateToPreviousSuggestion, addStickyNote, paneContextMenu, openPaneContextMenu, closePaneContextMenu } = (0, agent_flow_store_cjs_namespaceObject.useAgentFlowStore)();
|
|
171
136
|
const nodeTypesBase = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
172
137
|
stickyNote: (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_index_cjs_namespaceObject.StickyNoteNode, {
|
|
@@ -181,7 +146,7 @@ const AgentFlowInner = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({
|
|
|
181
146
|
const timelinePlayerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
182
147
|
const suggestionGroupPanelRef = (0, external_react_namespaceObject.useRef)(null);
|
|
183
148
|
const toolbarContainerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
184
|
-
const timelineHeight = (0, external_react_namespaceObject.useMemo)(()=>(0, TimelinePlayer_utils_cjs_namespaceObject.calculateTimelineHeight)(enableTimelinePlayer, spans), [
|
|
149
|
+
const timelineHeight = (0, external_react_namespaceObject.useMemo)(()=>(0, TimelinePlayer_utils_cjs_namespaceObject.calculateTimelineHeight)(enableTimelinePlayer ?? true, spans), [
|
|
185
150
|
enableTimelinePlayer,
|
|
186
151
|
spans
|
|
187
152
|
]);
|
|
@@ -429,6 +394,23 @@ const AgentFlowInner = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({
|
|
|
429
394
|
onZoomLevelChange,
|
|
430
395
|
zoomLevel
|
|
431
396
|
]);
|
|
397
|
+
const editingLocked = !!isRunning || 'design' !== mode;
|
|
398
|
+
const showUndo = !!onUndo;
|
|
399
|
+
const showRedo = !!onRedo;
|
|
400
|
+
const showAddNote = !!enableStickyNotes;
|
|
401
|
+
const showStop = !!isRunning && !!onStop;
|
|
402
|
+
const showPlay = !!onRun && !isRunning;
|
|
403
|
+
const showRunControl = showPlay || showStop;
|
|
404
|
+
const hasToolbarItems = showUndo || showRedo || showRunControl || showAddNote;
|
|
405
|
+
const timelineVisible = timelineHeight > 0;
|
|
406
|
+
const suggestionPanelVisible = (suggestionGroup?.suggestions.filter((suggestion)=>!suggestion.isStandalone).length ?? 0) > 0;
|
|
407
|
+
const showModeToolbar = hasToolbarItems && (showStop || !timelineVisible && !suggestionPanelVisible);
|
|
408
|
+
const translations = canvasTranslations ?? external_types_cjs_namespaceObject.DefaultCanvasTranslations;
|
|
409
|
+
const defaults = external_types_cjs_namespaceObject.DefaultCanvasTranslations;
|
|
410
|
+
const undoLabel = translations.undo ?? defaults.undo;
|
|
411
|
+
const redoLabel = translations.redo ?? defaults.redo;
|
|
412
|
+
const runLabel = translations.run ?? defaults.run;
|
|
413
|
+
const stopLabel = translations.stop ?? defaults.stop;
|
|
432
414
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Column, {
|
|
433
415
|
w: "100%",
|
|
434
416
|
h: "100%",
|
|
@@ -472,10 +454,16 @@ const AgentFlowInner = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({
|
|
|
472
454
|
children: [
|
|
473
455
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
|
|
474
456
|
position: "bottom-right",
|
|
475
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
onOrganize: 'design' === mode ? onOrganize : void 0
|
|
457
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasZoomControls_index_cjs_namespaceObject.CanvasZoomControls, {
|
|
458
|
+
orientation: "vertical",
|
|
459
|
+
onFitView: ()=>reactFlowFitView(adjustedFitViewOptions),
|
|
460
|
+
onOrganize: 'design' === mode ? onOrganize : void 0,
|
|
461
|
+
labels: {
|
|
462
|
+
zoomIn: translations.zoomIn,
|
|
463
|
+
zoomOut: translations.zoomOut,
|
|
464
|
+
fitView: translations.zoomToFit,
|
|
465
|
+
organize: translations.organize
|
|
466
|
+
}
|
|
479
467
|
})
|
|
480
468
|
}),
|
|
481
469
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_cjs_namespaceObject.Panel, {
|
|
@@ -490,16 +478,70 @@ const AgentFlowInner = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({
|
|
|
490
478
|
}),
|
|
491
479
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
492
480
|
ref: toolbarContainerRef,
|
|
493
|
-
children:
|
|
481
|
+
children: showModeToolbar && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_CanvasModeToolbar_index_cjs_namespaceObject.CanvasModeToolbar, {
|
|
494
482
|
className: "nodrag nopan nowheel",
|
|
495
|
-
children:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
483
|
+
children: [
|
|
484
|
+
showUndo && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
485
|
+
testId: "agent-flow-undo-button",
|
|
486
|
+
label: undoLabel,
|
|
487
|
+
className: `relative ${external_CanvasModeToolbar_index_cjs_namespaceObject.TOOLBAR_ICON_BUTTON_CLASS}`,
|
|
488
|
+
onClick: onUndo,
|
|
489
|
+
disabled: false === canUndo || editingLocked,
|
|
490
|
+
children: [
|
|
491
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Undo2, {}),
|
|
492
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasModeToolbar_index_cjs_namespaceObject.CountBadge, {
|
|
493
|
+
count: undoCount ?? 0
|
|
494
|
+
})
|
|
495
|
+
]
|
|
496
|
+
}),
|
|
497
|
+
showRedo && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
498
|
+
testId: "agent-flow-redo-button",
|
|
499
|
+
label: redoLabel,
|
|
500
|
+
className: `relative ${external_CanvasModeToolbar_index_cjs_namespaceObject.TOOLBAR_ICON_BUTTON_CLASS}`,
|
|
501
|
+
onClick: onRedo,
|
|
502
|
+
disabled: false === canRedo || editingLocked,
|
|
503
|
+
children: [
|
|
504
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Redo2, {}),
|
|
505
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasModeToolbar_index_cjs_namespaceObject.CountBadge, {
|
|
506
|
+
count: redoCount ?? 0
|
|
507
|
+
})
|
|
508
|
+
]
|
|
509
|
+
}),
|
|
510
|
+
(showUndo || showRedo) && (showRunControl || showAddNote) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Separator, {
|
|
511
|
+
orientation: "vertical",
|
|
512
|
+
className: "h-5"
|
|
513
|
+
}),
|
|
514
|
+
showStop ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
515
|
+
testId: "agent-flow-stop-button",
|
|
516
|
+
label: stopLabel,
|
|
517
|
+
className: external_CanvasModeToolbar_index_cjs_namespaceObject.TOOLBAR_ICON_BUTTON_CLASS,
|
|
518
|
+
onClick: onStop,
|
|
519
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Square, {
|
|
520
|
+
strokeWidth: 0,
|
|
521
|
+
className: "fill-current text-destructive"
|
|
522
|
+
})
|
|
523
|
+
}) : showPlay && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
524
|
+
testId: "agent-flow-run-button",
|
|
525
|
+
label: runLabel,
|
|
526
|
+
tooltip: false === canRun ? runDisabledReason : void 0,
|
|
527
|
+
className: external_CanvasModeToolbar_index_cjs_namespaceObject.TOOLBAR_ICON_BUTTON_CLASS,
|
|
528
|
+
onClick: onRun,
|
|
529
|
+
disabled: false === canRun || editingLocked,
|
|
530
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Play, {})
|
|
531
|
+
}),
|
|
532
|
+
showRunControl && showAddNote && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Separator, {
|
|
533
|
+
orientation: "vertical",
|
|
534
|
+
className: "h-5"
|
|
535
|
+
}),
|
|
536
|
+
showAddNote && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
537
|
+
testId: "agent-flow-add-note-button",
|
|
538
|
+
label: translations.addNote,
|
|
539
|
+
className: external_CanvasModeToolbar_index_cjs_namespaceObject.TOOLBAR_ICON_BUTTON_CLASS,
|
|
540
|
+
onClick: ()=>addStickyNote(),
|
|
541
|
+
disabled: editingLocked,
|
|
542
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.StickyNote, {})
|
|
501
543
|
})
|
|
502
|
-
|
|
544
|
+
]
|
|
503
545
|
})
|
|
504
546
|
}),
|
|
505
547
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentFlow.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AgentCanvas/AgentFlow.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,EAIL,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"AgentFlow.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AgentCanvas/AgentFlow.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,EAIL,KAAK,cAAc,EAepB,MAAM,aAAa,CAAC;AA6xBrB,eAAO,MAAM,SAAS,GAAI,OAAO,iBAAiB,CAAC,cAAc,CAAC,4CAQjE,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from "@emotion/styled";
|
|
3
2
|
import { Column } from "../../layouts/index.js";
|
|
4
3
|
import { Panel, useReactFlow } from "../../xyflow/react.js";
|
|
5
|
-
import {
|
|
4
|
+
import { Separator } from "@uipath/apollo-wind";
|
|
5
|
+
import { Play, Redo2, Square, StickyNote, Undo2 } from "lucide-react";
|
|
6
6
|
import { memo, useCallback, useEffect, useMemo, useRef } from "react";
|
|
7
7
|
import { BaseCanvas } from "../BaseCanvas/index.js";
|
|
8
8
|
import { NodeRegistryProvider } from "../../core/NodeRegistryProvider.js";
|
|
9
9
|
import { DefaultAgentNodeTranslations, DefaultCanvasTranslations, DefaultResourceNodeTranslations, DefaultStickyNoteNodeTranslations, DefaultSuggestionTranslations, isAgentFlowAgentNode, isAgentFlowResourceNode, isStickyNoteNode } from "../../types.js";
|
|
10
10
|
import { hasAgentRunning } from "../../utils/props-helpers.js";
|
|
11
|
-
import {
|
|
11
|
+
import { CanvasModeToolbar, CountBadge, TOOLBAR_ICON_BUTTON_CLASS } from "../CanvasModeToolbar/index.js";
|
|
12
|
+
import { CanvasZoomControls } from "../CanvasZoomControls/index.js";
|
|
12
13
|
import { StickyNoteNode } from "../StickyNoteNode/index.js";
|
|
14
|
+
import { ToolbarButton } from "../ToolbarButton.js";
|
|
13
15
|
import { agentFlowManifest } from "./agent-flow.manifest.js";
|
|
14
16
|
import { PaneContextMenu } from "./components/PaneContextMenu.js";
|
|
15
17
|
import { SuggestionGroupPanel } from "./components/SuggestionGroupPanel.js";
|
|
@@ -19,33 +21,6 @@ import { Edge } from "./edges/Edge.js";
|
|
|
19
21
|
import { AgentNodeElement } from "./nodes/AgentNode.js";
|
|
20
22
|
import { ResourceNode } from "./nodes/ResourceNode.js";
|
|
21
23
|
import { AgentFlowProvider, useAgentFlowStore } from "./store/agent-flow-store.js";
|
|
22
|
-
const ToolbarContainer = styled.div`
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
background: var(--canvas-background);
|
|
26
|
-
border: 1px solid var(--canvas-border-de-emp);
|
|
27
|
-
border-radius: 16px;
|
|
28
|
-
padding: 4px;
|
|
29
|
-
gap: 4px;
|
|
30
|
-
height: 50px;
|
|
31
|
-
`;
|
|
32
|
-
const ToolbarButton = styled.button`
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
width: 40px;
|
|
37
|
-
height: 40px;
|
|
38
|
-
border: none;
|
|
39
|
-
background: transparent;
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
border-radius: 16px;
|
|
42
|
-
transition: background-color 0.15s ease;
|
|
43
|
-
color: var(--canvas-foreground);
|
|
44
|
-
|
|
45
|
-
&:hover {
|
|
46
|
-
background: var(--canvas-background-hover);
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
24
|
const edgeTypes = {
|
|
50
25
|
default: Edge
|
|
51
26
|
};
|
|
@@ -128,7 +103,7 @@ const createResourceNodeWrapper = (opts)=>(props)=>{
|
|
|
128
103
|
suggestionGroupVersion: opts.suggestionGroupVersion
|
|
129
104
|
});
|
|
130
105
|
};
|
|
131
|
-
const AgentFlowInner = /*#__PURE__*/ memo(({ children, mode, readOnlyNodeIds, spans, onEnable, onDisable, onAddBreakpoint, onRemoveBreakpoint, onAddGuardrail, onGoToSource, onErrorAction, onAddResource: _onAddResource, onSelectResource, setSpanForSelectedNode, getNodeFromSelectedSpan, onExpandResource, onCollapseResource, agentNodeTranslations, resourceNodeTranslations, stickyNoteNodeTranslations, canvasTranslations, enableTimelinePlayer, canvasRef, enableMcpTools, enableMemory, enableA2a, enableStickyNotes, enableInstructions, healthScore, onHealthScoreClick, suggestionTranslations, suggestionGroup, onAgentNodePositionChange, onResourceNodePositionChange, onOrganize, onUpdateStickyNote, zoomLevel, onZoomLevelChange })=>{
|
|
106
|
+
const AgentFlowInner = /*#__PURE__*/ memo(({ children, mode, readOnlyNodeIds, spans, onEnable, onDisable, onAddBreakpoint, onRemoveBreakpoint, onAddGuardrail, onGoToSource, onErrorAction, onAddResource: _onAddResource, onSelectResource, setSpanForSelectedNode, getNodeFromSelectedSpan, onExpandResource, onCollapseResource, agentNodeTranslations, resourceNodeTranslations, stickyNoteNodeTranslations, canvasTranslations, enableTimelinePlayer, canvasRef, enableMcpTools, enableMemory, enableA2a, enableStickyNotes, enableInstructions, healthScore, onHealthScoreClick, suggestionTranslations, suggestionGroup, onAgentNodePositionChange, onResourceNodePositionChange, onOrganize, onUpdateStickyNote, zoomLevel, onZoomLevelChange, onUndo, onRedo, canUndo, canRedo, undoCount, redoCount, onRun, canRun, runDisabledReason, onStop, isRunning })=>{
|
|
132
107
|
const { nodes, edges, onNodesChange, onEdgesChange, onConnect, autoArrange, setSelectedNodeId, selectedNodeId, setDragging, expandAgent, collapseAgent, createResourcePlaceholder, actOnSuggestionGroup, currentSuggestionIndex, navigateToNextSuggestion, navigateToPreviousSuggestion, addStickyNote, paneContextMenu, openPaneContextMenu, closePaneContextMenu } = useAgentFlowStore();
|
|
133
108
|
const nodeTypesBase = useMemo(()=>({
|
|
134
109
|
stickyNote: (props)=>/*#__PURE__*/ jsx(StickyNoteNode, {
|
|
@@ -143,7 +118,7 @@ const AgentFlowInner = /*#__PURE__*/ memo(({ children, mode, readOnlyNodeIds, sp
|
|
|
143
118
|
const timelinePlayerRef = useRef(null);
|
|
144
119
|
const suggestionGroupPanelRef = useRef(null);
|
|
145
120
|
const toolbarContainerRef = useRef(null);
|
|
146
|
-
const timelineHeight = useMemo(()=>calculateTimelineHeight(enableTimelinePlayer, spans), [
|
|
121
|
+
const timelineHeight = useMemo(()=>calculateTimelineHeight(enableTimelinePlayer ?? true, spans), [
|
|
147
122
|
enableTimelinePlayer,
|
|
148
123
|
spans
|
|
149
124
|
]);
|
|
@@ -391,6 +366,23 @@ const AgentFlowInner = /*#__PURE__*/ memo(({ children, mode, readOnlyNodeIds, sp
|
|
|
391
366
|
onZoomLevelChange,
|
|
392
367
|
zoomLevel
|
|
393
368
|
]);
|
|
369
|
+
const editingLocked = !!isRunning || 'design' !== mode;
|
|
370
|
+
const showUndo = !!onUndo;
|
|
371
|
+
const showRedo = !!onRedo;
|
|
372
|
+
const showAddNote = !!enableStickyNotes;
|
|
373
|
+
const showStop = !!isRunning && !!onStop;
|
|
374
|
+
const showPlay = !!onRun && !isRunning;
|
|
375
|
+
const showRunControl = showPlay || showStop;
|
|
376
|
+
const hasToolbarItems = showUndo || showRedo || showRunControl || showAddNote;
|
|
377
|
+
const timelineVisible = timelineHeight > 0;
|
|
378
|
+
const suggestionPanelVisible = (suggestionGroup?.suggestions.filter((suggestion)=>!suggestion.isStandalone).length ?? 0) > 0;
|
|
379
|
+
const showModeToolbar = hasToolbarItems && (showStop || !timelineVisible && !suggestionPanelVisible);
|
|
380
|
+
const translations = canvasTranslations ?? DefaultCanvasTranslations;
|
|
381
|
+
const defaults = DefaultCanvasTranslations;
|
|
382
|
+
const undoLabel = translations.undo ?? defaults.undo;
|
|
383
|
+
const redoLabel = translations.redo ?? defaults.redo;
|
|
384
|
+
const runLabel = translations.run ?? defaults.run;
|
|
385
|
+
const stopLabel = translations.stop ?? defaults.stop;
|
|
394
386
|
return /*#__PURE__*/ jsx(Column, {
|
|
395
387
|
w: "100%",
|
|
396
388
|
h: "100%",
|
|
@@ -434,10 +426,16 @@ const AgentFlowInner = /*#__PURE__*/ memo(({ children, mode, readOnlyNodeIds, sp
|
|
|
434
426
|
children: [
|
|
435
427
|
/*#__PURE__*/ jsx(Panel, {
|
|
436
428
|
position: "bottom-right",
|
|
437
|
-
children: /*#__PURE__*/ jsx(
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
onOrganize: 'design' === mode ? onOrganize : void 0
|
|
429
|
+
children: /*#__PURE__*/ jsx(CanvasZoomControls, {
|
|
430
|
+
orientation: "vertical",
|
|
431
|
+
onFitView: ()=>reactFlowFitView(adjustedFitViewOptions),
|
|
432
|
+
onOrganize: 'design' === mode ? onOrganize : void 0,
|
|
433
|
+
labels: {
|
|
434
|
+
zoomIn: translations.zoomIn,
|
|
435
|
+
zoomOut: translations.zoomOut,
|
|
436
|
+
fitView: translations.zoomToFit,
|
|
437
|
+
organize: translations.organize
|
|
438
|
+
}
|
|
441
439
|
})
|
|
442
440
|
}),
|
|
443
441
|
/*#__PURE__*/ jsxs(Panel, {
|
|
@@ -452,16 +450,70 @@ const AgentFlowInner = /*#__PURE__*/ memo(({ children, mode, readOnlyNodeIds, sp
|
|
|
452
450
|
}),
|
|
453
451
|
/*#__PURE__*/ jsx("div", {
|
|
454
452
|
ref: toolbarContainerRef,
|
|
455
|
-
children:
|
|
453
|
+
children: showModeToolbar && /*#__PURE__*/ jsxs(CanvasModeToolbar, {
|
|
456
454
|
className: "nodrag nopan nowheel",
|
|
457
|
-
children:
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
455
|
+
children: [
|
|
456
|
+
showUndo && /*#__PURE__*/ jsxs(ToolbarButton, {
|
|
457
|
+
testId: "agent-flow-undo-button",
|
|
458
|
+
label: undoLabel,
|
|
459
|
+
className: `relative ${TOOLBAR_ICON_BUTTON_CLASS}`,
|
|
460
|
+
onClick: onUndo,
|
|
461
|
+
disabled: false === canUndo || editingLocked,
|
|
462
|
+
children: [
|
|
463
|
+
/*#__PURE__*/ jsx(Undo2, {}),
|
|
464
|
+
/*#__PURE__*/ jsx(CountBadge, {
|
|
465
|
+
count: undoCount ?? 0
|
|
466
|
+
})
|
|
467
|
+
]
|
|
468
|
+
}),
|
|
469
|
+
showRedo && /*#__PURE__*/ jsxs(ToolbarButton, {
|
|
470
|
+
testId: "agent-flow-redo-button",
|
|
471
|
+
label: redoLabel,
|
|
472
|
+
className: `relative ${TOOLBAR_ICON_BUTTON_CLASS}`,
|
|
473
|
+
onClick: onRedo,
|
|
474
|
+
disabled: false === canRedo || editingLocked,
|
|
475
|
+
children: [
|
|
476
|
+
/*#__PURE__*/ jsx(Redo2, {}),
|
|
477
|
+
/*#__PURE__*/ jsx(CountBadge, {
|
|
478
|
+
count: redoCount ?? 0
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
}),
|
|
482
|
+
(showUndo || showRedo) && (showRunControl || showAddNote) && /*#__PURE__*/ jsx(Separator, {
|
|
483
|
+
orientation: "vertical",
|
|
484
|
+
className: "h-5"
|
|
485
|
+
}),
|
|
486
|
+
showStop ? /*#__PURE__*/ jsx(ToolbarButton, {
|
|
487
|
+
testId: "agent-flow-stop-button",
|
|
488
|
+
label: stopLabel,
|
|
489
|
+
className: TOOLBAR_ICON_BUTTON_CLASS,
|
|
490
|
+
onClick: onStop,
|
|
491
|
+
children: /*#__PURE__*/ jsx(Square, {
|
|
492
|
+
strokeWidth: 0,
|
|
493
|
+
className: "fill-current text-destructive"
|
|
494
|
+
})
|
|
495
|
+
}) : showPlay && /*#__PURE__*/ jsx(ToolbarButton, {
|
|
496
|
+
testId: "agent-flow-run-button",
|
|
497
|
+
label: runLabel,
|
|
498
|
+
tooltip: false === canRun ? runDisabledReason : void 0,
|
|
499
|
+
className: TOOLBAR_ICON_BUTTON_CLASS,
|
|
500
|
+
onClick: onRun,
|
|
501
|
+
disabled: false === canRun || editingLocked,
|
|
502
|
+
children: /*#__PURE__*/ jsx(Play, {})
|
|
503
|
+
}),
|
|
504
|
+
showRunControl && showAddNote && /*#__PURE__*/ jsx(Separator, {
|
|
505
|
+
orientation: "vertical",
|
|
506
|
+
className: "h-5"
|
|
507
|
+
}),
|
|
508
|
+
showAddNote && /*#__PURE__*/ jsx(ToolbarButton, {
|
|
509
|
+
testId: "agent-flow-add-note-button",
|
|
510
|
+
label: translations.addNote,
|
|
511
|
+
className: TOOLBAR_ICON_BUTTON_CLASS,
|
|
512
|
+
onClick: ()=>addStickyNote(),
|
|
513
|
+
disabled: editingLocked,
|
|
514
|
+
children: /*#__PURE__*/ jsx(StickyNote, {})
|
|
463
515
|
})
|
|
464
|
-
|
|
516
|
+
]
|
|
465
517
|
})
|
|
466
518
|
}),
|
|
467
519
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -33,7 +33,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
33
33
|
const external_react_namespaceObject = require("react");
|
|
34
34
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
35
35
|
const CANVAS_MODE_TOOLBAR_HEIGHT = 48;
|
|
36
|
-
const TOOLBAR_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5';
|
|
36
|
+
const TOOLBAR_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5 aria-disabled:hover:bg-transparent aria-disabled:hover:text-foreground-muted aria-disabled:hover:[&_svg]:size-5';
|
|
37
37
|
const CanvasModeToolbar_CountBadge = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ count, variant = 'default' }) {
|
|
38
38
|
if (count <= 0) return null;
|
|
39
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export declare const CANVAS_MODE_TOOLBAR_HEIGHT = 48;
|
|
3
|
-
export declare const TOOLBAR_ICON_BUTTON_CLASS = "text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5";
|
|
3
|
+
export declare const TOOLBAR_ICON_BUTTON_CLASS = "text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5 aria-disabled:hover:bg-transparent aria-disabled:hover:text-foreground-muted aria-disabled:hover:[&_svg]:size-5";
|
|
4
4
|
export declare const CountBadge: import("react").NamedExoticComponent<{
|
|
5
5
|
count: number;
|
|
6
6
|
variant?: "default" | "destructive";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasModeToolbar.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasModeToolbar/CanvasModeToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"CanvasModeToolbar.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasModeToolbar/CanvasModeToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,eAAO,MAAM,yBAAyB,gRACyO,CAAC;AAMhR,eAAO,MAAM,UAAU;WAId,MAAM;cACH,SAAS,GAAG,aAAa;EAcnC,CAAC;AAMH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,eAAO,MAAM,iBAAiB,8DAgB5B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { Row, cn } from "@uipath/apollo-wind";
|
|
4
4
|
const CANVAS_MODE_TOOLBAR_HEIGHT = 48;
|
|
5
|
-
const TOOLBAR_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5';
|
|
5
|
+
const TOOLBAR_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5 aria-disabled:hover:bg-transparent aria-disabled:hover:text-foreground-muted aria-disabled:hover:[&_svg]:size-5';
|
|
6
6
|
const CanvasModeToolbar_CountBadge = /*#__PURE__*/ memo(function({ count, variant = 'default' }) {
|
|
7
7
|
if (count <= 0) return null;
|
|
8
8
|
return /*#__PURE__*/ jsx("span", {
|
|
@@ -33,7 +33,7 @@ const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
|
33
33
|
const external_ToolbarButton_cjs_namespaceObject = require("../ToolbarButton.cjs");
|
|
34
34
|
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
35
35
|
const ZOOM_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-[18px] [&_svg]:transition-all hover:[&_svg]:size-[22px] disabled:hover:[&_svg]:size-[18px]';
|
|
36
|
-
const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(/*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(function({ orientation = 'vertical', fitViewOptions, zoomInOptions, zoomOutOptions, onOrganize, onFitView }, ref) {
|
|
36
|
+
const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(/*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(function({ orientation = 'vertical', fitViewOptions, zoomInOptions, zoomOutOptions, onOrganize, onFitView, labels }, ref) {
|
|
37
37
|
const { zoomIn, zoomOut, fitView } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
38
38
|
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
39
39
|
const isVertical = 'vertical' === orientation;
|
|
@@ -65,7 +65,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_n
|
|
|
65
65
|
children: [
|
|
66
66
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
67
67
|
testId: "zoom-in-button",
|
|
68
|
-
label: _({
|
|
68
|
+
label: labels?.zoomIn ?? _({
|
|
69
69
|
id: 'canvas.zoom.zoom_in',
|
|
70
70
|
message: 'Zoom in'
|
|
71
71
|
}),
|
|
@@ -76,7 +76,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_n
|
|
|
76
76
|
}),
|
|
77
77
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
78
78
|
testId: "zoom-out-button",
|
|
79
|
-
label: _({
|
|
79
|
+
label: labels?.zoomOut ?? _({
|
|
80
80
|
id: 'canvas.zoom.zoom_out',
|
|
81
81
|
message: 'Zoom out'
|
|
82
82
|
}),
|
|
@@ -87,7 +87,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_n
|
|
|
87
87
|
}),
|
|
88
88
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
89
89
|
testId: "fit-to-view-button",
|
|
90
|
-
label: _({
|
|
90
|
+
label: labels?.fitView ?? _({
|
|
91
91
|
id: 'canvas.zoom.fit_to_screen',
|
|
92
92
|
message: 'Fit to screen'
|
|
93
93
|
}),
|
|
@@ -98,7 +98,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_n
|
|
|
98
98
|
}),
|
|
99
99
|
onOrganize && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
100
100
|
testId: "organize-button",
|
|
101
|
-
label: _({
|
|
101
|
+
label: labels?.organize ?? _({
|
|
102
102
|
id: 'canvas.zoom.tidy_up',
|
|
103
103
|
message: 'Tidy up'
|
|
104
104
|
}),
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export interface CanvasZoomControlsLabels {
|
|
2
|
+
zoomIn?: string;
|
|
3
|
+
zoomOut?: string;
|
|
4
|
+
fitView?: string;
|
|
5
|
+
organize?: string;
|
|
6
|
+
}
|
|
1
7
|
export interface CanvasZoomControlsProps {
|
|
2
8
|
orientation?: 'vertical' | 'horizontal';
|
|
3
9
|
fitViewOptions?: {
|
|
@@ -13,6 +19,7 @@ export interface CanvasZoomControlsProps {
|
|
|
13
19
|
};
|
|
14
20
|
onOrganize?: () => void;
|
|
15
21
|
onFitView?: () => void;
|
|
22
|
+
labels?: CanvasZoomControlsLabels;
|
|
16
23
|
}
|
|
17
24
|
export declare const CanvasZoomControls: import("react").NamedExoticComponent<CanvasZoomControlsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
25
|
//# sourceMappingURL=CanvasZoomControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasZoomControls.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasZoomControls/CanvasZoomControls.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,aAAa,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasZoomControls.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasZoomControls/CanvasZoomControls.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,aAAa,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAKvB,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC;AAKD,eAAO,MAAM,kBAAkB,+GAwF9B,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { useReactFlow } from "../../xyflow/react.js";
|
|
|
5
5
|
import { ToolbarButton } from "../ToolbarButton.js";
|
|
6
6
|
import { useSafeLingui } from "../../../i18n/index.js";
|
|
7
7
|
const ZOOM_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-[18px] [&_svg]:transition-all hover:[&_svg]:size-[22px] disabled:hover:[&_svg]:size-[18px]';
|
|
8
|
-
const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(function({ orientation = 'vertical', fitViewOptions, zoomInOptions, zoomOutOptions, onOrganize, onFitView }, ref) {
|
|
8
|
+
const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(function({ orientation = 'vertical', fitViewOptions, zoomInOptions, zoomOutOptions, onOrganize, onFitView, labels }, ref) {
|
|
9
9
|
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
10
10
|
const { _ } = useSafeLingui();
|
|
11
11
|
const isVertical = 'vertical' === orientation;
|
|
@@ -37,7 +37,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ memo(/*#__PURE__*/ f
|
|
|
37
37
|
children: [
|
|
38
38
|
/*#__PURE__*/ jsx(ToolbarButton, {
|
|
39
39
|
testId: "zoom-in-button",
|
|
40
|
-
label: _({
|
|
40
|
+
label: labels?.zoomIn ?? _({
|
|
41
41
|
id: 'canvas.zoom.zoom_in',
|
|
42
42
|
message: 'Zoom in'
|
|
43
43
|
}),
|
|
@@ -48,7 +48,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ memo(/*#__PURE__*/ f
|
|
|
48
48
|
}),
|
|
49
49
|
/*#__PURE__*/ jsx(ToolbarButton, {
|
|
50
50
|
testId: "zoom-out-button",
|
|
51
|
-
label: _({
|
|
51
|
+
label: labels?.zoomOut ?? _({
|
|
52
52
|
id: 'canvas.zoom.zoom_out',
|
|
53
53
|
message: 'Zoom out'
|
|
54
54
|
}),
|
|
@@ -59,7 +59,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ memo(/*#__PURE__*/ f
|
|
|
59
59
|
}),
|
|
60
60
|
/*#__PURE__*/ jsx(ToolbarButton, {
|
|
61
61
|
testId: "fit-to-view-button",
|
|
62
|
-
label: _({
|
|
62
|
+
label: labels?.fitView ?? _({
|
|
63
63
|
id: 'canvas.zoom.fit_to_screen',
|
|
64
64
|
message: 'Fit to screen'
|
|
65
65
|
}),
|
|
@@ -70,7 +70,7 @@ const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ memo(/*#__PURE__*/ f
|
|
|
70
70
|
}),
|
|
71
71
|
onOrganize && /*#__PURE__*/ jsx(ToolbarButton, {
|
|
72
72
|
testId: "organize-button",
|
|
73
|
-
label: _({
|
|
73
|
+
label: labels?.organize ?? _({
|
|
74
74
|
id: 'canvas.zoom.tidy_up',
|
|
75
75
|
message: 'Tidy up'
|
|
76
76
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasZoomControls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasZoomControls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -66,6 +66,13 @@ export type GuardrailEscalateAction = Extract<GuardrailAction, {
|
|
|
66
66
|
$actionType: 'escalate';
|
|
67
67
|
}>;
|
|
68
68
|
export type GuardrailDefinitionStatus = 'Available' | 'FeatureDisabled' | 'Unauthorised' | 'Disabled';
|
|
69
|
+
export type GuardrailFileFormat = 'Text' | 'Pdf' | 'Image' | 'Office' | 'Html';
|
|
70
|
+
export type GuardrailFileSupportUnavailableReason = 'NotEnabled' | 'AutomationSuite';
|
|
71
|
+
export interface GuardrailFileSupport {
|
|
72
|
+
supported: boolean;
|
|
73
|
+
formats: GuardrailFileFormat[];
|
|
74
|
+
unavailableReason?: GuardrailFileSupportUnavailableReason;
|
|
75
|
+
}
|
|
69
76
|
export interface GuardrailDefinition {
|
|
70
77
|
validator: string;
|
|
71
78
|
displayName: string;
|
|
@@ -73,6 +80,7 @@ export interface GuardrailDefinition {
|
|
|
73
80
|
parameters: GuardrailParameterDefinition[];
|
|
74
81
|
status: GuardrailDefinitionStatus;
|
|
75
82
|
usageNote?: React.ReactNode;
|
|
83
|
+
fileSupport?: GuardrailFileSupport;
|
|
76
84
|
byoValidatorName?: string;
|
|
77
85
|
byoConnectorName?: string;
|
|
78
86
|
}
|