@datatechsolutions/ui 2.11.32 → 2.11.34

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.
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { ToggleSwitch, GlassModal, ContextMenu, FormInput, FormSelect, FormTextarea, Button, IconButton } from './chunk-QNR3NADH.mjs';
3
- import { useTranslations, I18nProvider, createI18nFromMessages } from './chunk-7VJ7CMMT.mjs';
2
+ import { ToggleSwitch, GlassModal, ContextMenu, FormInput, FormSelect, FormTextarea, Button, IconButton } from './chunk-CH5BZ5ML.mjs';
4
3
  import { GraphNodeHeader, GraphNodeMeta, GraphNodeBadge, GraphNodeIconBubble } from './chunk-OZNTQROP.mjs';
5
4
  import { getAgentTier, createDefaultLogicNodeConfig, applyDagreLayout } from './chunk-TLPPVL3W.mjs';
5
+ import { useTranslations, I18nProvider, createI18nFromMessages } from './chunk-7VJ7CMMT.mjs';
6
6
  import { memo, useState, useRef, useCallback, useEffect, lazy, createContext, useMemo, useContext } from 'react';
7
7
  import { Position, NodeResizer, MarkerType, useReactFlow, getBezierPath, BaseEdge, EdgeLabelRenderer, Handle, ReactFlowProvider, useNodesState, useEdgesState, addEdge, BackgroundVariant } from '@xyflow/react';
8
8
  import '@xyflow/react/dist/style.css';
9
9
  import { create } from 'zustand';
10
10
  import { PlusIcon, XMarkIcon } from '@heroicons/react/24/solid';
11
- import { Bars2Icon, CursorArrowRaysIcon, HandRaisedIcon, MagnifyingGlassPlusIcon, MagnifyingGlassMinusIcon, ArrowsPointingInIcon, ArrowUturnLeftIcon, ArrowUturnRightIcon, MapIcon, Squares2X2Icon, ArrowsRightLeftIcon, CommandLineIcon, ExclamationTriangleIcon, CpuChipIcon, TrashIcon, WrenchScrewdriverIcon, NewspaperIcon, ChartBarIcon, CloudIcon, ScaleIcon, AdjustmentsHorizontalIcon, CircleStackIcon, PlayIcon, StopIcon, ArrowsPointingOutIcon, CodeBracketIcon, GlobeAltIcon, DocumentTextIcon, ArrowPathIcon, BookOpenIcon, ChatBubbleLeftRightIcon, QuestionMarkCircleIcon, AdjustmentsVerticalIcon, Square3Stack3DIcon, DocumentMagnifyingGlassIcon, ListBulletIcon, PlayCircleIcon, PencilSquareIcon, ServerStackIcon, KeyIcon, RectangleGroupIcon, ChevronDownIcon, ChevronUpIcon, PresentationChartBarIcon, ChartPieIcon, ChartBarSquareIcon, CurrencyDollarIcon, ShieldCheckIcon, ClipboardDocumentCheckIcon, FireIcon, ShoppingBagIcon, UsersIcon, BuildingStorefrontIcon, PencilIcon, DocumentDuplicateIcon, ClipboardDocumentIcon, ClipboardIcon, PlusIcon as PlusIcon$1, XMarkIcon as XMarkIcon$1 } from '@heroicons/react/24/outline';
11
+ import { Bars2Icon, CursorArrowRaysIcon, HandRaisedIcon, MagnifyingGlassPlusIcon, MagnifyingGlassMinusIcon, ArrowsPointingInIcon, ArrowUturnLeftIcon, ArrowUturnRightIcon, MapIcon, EllipsisHorizontalIcon, Squares2X2Icon, ArrowsRightLeftIcon, CommandLineIcon, ExclamationTriangleIcon, CpuChipIcon, TrashIcon, WrenchScrewdriverIcon, NewspaperIcon, ChartBarIcon, CloudIcon, ScaleIcon, AdjustmentsHorizontalIcon, CircleStackIcon, PlayIcon, StopIcon, ArrowsPointingOutIcon, CodeBracketIcon, GlobeAltIcon, DocumentTextIcon, ArrowPathIcon, BookOpenIcon, ChatBubbleLeftRightIcon, QuestionMarkCircleIcon, AdjustmentsVerticalIcon, Square3Stack3DIcon, DocumentMagnifyingGlassIcon, ListBulletIcon, PlayCircleIcon, PencilSquareIcon, ServerStackIcon, KeyIcon, RectangleGroupIcon, ChevronDownIcon, ChevronUpIcon, PresentationChartBarIcon, ChartPieIcon, ChartBarSquareIcon, CurrencyDollarIcon, ShieldCheckIcon, ClipboardDocumentCheckIcon, FireIcon, ShoppingBagIcon, UsersIcon, BuildingStorefrontIcon, PencilIcon, DocumentDuplicateIcon, ClipboardDocumentIcon, ClipboardIcon, PlusIcon as PlusIcon$1, XMarkIcon as XMarkIcon$1 } from '@heroicons/react/24/outline';
12
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
13
 
14
14
  var DEFAULT_PASTE_OFFSET = 40;
@@ -28,6 +28,10 @@ var useWorkflowStore = create((set, get) => ({
28
28
  showVariableInspector: false,
29
29
  showVersionHistory: false,
30
30
  showRunPanel: false,
31
+ showMinimap: true,
32
+ showDots: true,
33
+ showShortcuts: false,
34
+ cardDisplayMode: "detailed",
31
35
  isRunning: false,
32
36
  nodeResults: {},
33
37
  selectedRunId: null,
@@ -171,6 +175,21 @@ var useWorkflowStore = create((set, get) => ({
171
175
  toggleRunPanel: () => {
172
176
  set((state) => ({ showRunPanel: !state.showRunPanel }));
173
177
  },
178
+ toggleMinimap: () => {
179
+ set((state) => ({ showMinimap: !state.showMinimap }));
180
+ },
181
+ toggleDots: () => {
182
+ set((state) => ({ showDots: !state.showDots }));
183
+ },
184
+ toggleShortcuts: () => {
185
+ set((state) => ({ showShortcuts: !state.showShortcuts }));
186
+ },
187
+ closeShortcuts: () => {
188
+ set({ showShortcuts: false });
189
+ },
190
+ toggleCardDisplayMode: () => {
191
+ set((state) => ({ cardDisplayMode: state.cardDisplayMode === "detailed" ? "compact" : "detailed" }));
192
+ },
174
193
  setIsRunning: (running) => {
175
194
  set({ isRunning: running });
176
195
  },
@@ -201,6 +220,10 @@ var useWorkflowStore = create((set, get) => ({
201
220
  showVariableInspector: false,
202
221
  showVersionHistory: false,
203
222
  showRunPanel: false,
223
+ showMinimap: true,
224
+ showDots: true,
225
+ showShortcuts: false,
226
+ cardDisplayMode: "detailed",
204
227
  isRunning: false,
205
228
  nodeResults: {},
206
229
  selectedRunId: null,
@@ -675,68 +698,77 @@ function ConditionalEdgeComponent({
675
698
  const hasLabel = Boolean(label && labelStyle);
676
699
  const insertButtonOffset = hasLabel ? -20 : 0;
677
700
  const deleteButtonOffset = hasLabel ? showInsertPopup ? -40 : -40 : showInsertPopup ? -20 : -20;
678
- return /* @__PURE__ */ jsxs(Fragment, { children: [
679
- /* @__PURE__ */ jsx(
680
- "path",
681
- {
682
- d: edgePath,
683
- fill: "none",
684
- stroke: "transparent",
685
- strokeWidth: 20,
686
- onMouseEnter: () => setIsHovered(true),
687
- onMouseLeave: () => setIsHovered(false),
688
- className: "react-flow__edge-interaction"
689
- }
690
- ),
691
- /* @__PURE__ */ jsx(BaseEdge, { id, path: edgePath, markerEnd, style }),
692
- /* @__PURE__ */ jsxs(EdgeLabelRenderer, { children: [
693
- hasLabel && labelStyle && /* @__PURE__ */ jsx(
694
- "div",
695
- {
696
- className: `nodrag nopan pointer-events-auto absolute rounded-full px-2 py-0.5 text-[10px] font-semibold ${labelStyle.background} ${labelStyle.text} ${labelStyle.darkBackground} ${labelStyle.darkText}`,
697
- style: {
698
- transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`
699
- },
700
- "data-testid": `edge-label-${id}`,
701
- children: label
702
- }
703
- ),
704
- showControls && !showInsertPopup && /* @__PURE__ */ jsx(
705
- "button",
706
- {
707
- type: "button",
708
- className: "nodrag nopan pointer-events-auto absolute flex h-5 w-5 items-center justify-center rounded-full border border-teal-300 bg-white shadow-md transition-all hover:scale-110 hover:bg-teal-50 dark:border-teal-600 dark:bg-gray-800 dark:hover:bg-teal-900/30",
709
- style: {
710
- transform: `translate(-50%, -50%) translate(${labelX}px,${labelY + insertButtonOffset}px)`
711
- },
712
- onClick: handleInsertClick,
713
- "aria-label": "Insert node",
714
- children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-3 w-3 text-teal-500 dark:text-teal-400" })
715
- }
716
- ),
717
- showInsertPopup && /* @__PURE__ */ jsx(
718
- EdgeInsertPopup,
719
- {
720
- position: { x: labelX, y: labelY + insertButtonOffset },
721
- onSelect: handleInsertNodeSelect,
722
- onClose: () => setShowInsertPopup(false)
723
- }
724
- ),
725
- showControls && /* @__PURE__ */ jsx(
726
- "button",
727
- {
728
- type: "button",
729
- className: "nodrag nopan pointer-events-auto absolute flex h-5 w-5 items-center justify-center rounded-full border border-red-300 bg-white shadow-md transition-all hover:scale-110 hover:bg-red-50 dark:border-red-600 dark:bg-gray-800 dark:hover:bg-red-900/30",
730
- style: {
731
- transform: `translate(-50%, -50%) translate(${labelX}px,${labelY + deleteButtonOffset}px)`
732
- },
733
- onClick: handleDeleteEdge,
734
- "aria-label": "Delete connection",
735
- children: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-3 w-3 text-red-500 dark:text-red-400" })
736
- }
737
- )
738
- ] })
739
- ] });
701
+ return /* @__PURE__ */ jsxs(
702
+ "g",
703
+ {
704
+ onMouseEnter: () => setIsHovered(true),
705
+ onMouseLeave: () => setIsHovered(false),
706
+ children: [
707
+ /* @__PURE__ */ jsx(
708
+ "path",
709
+ {
710
+ d: edgePath,
711
+ fill: "none",
712
+ stroke: "transparent",
713
+ strokeWidth: 20,
714
+ className: "react-flow__edge-interaction"
715
+ }
716
+ ),
717
+ /* @__PURE__ */ jsx(BaseEdge, { id, path: edgePath, markerEnd, style }),
718
+ /* @__PURE__ */ jsxs(EdgeLabelRenderer, { children: [
719
+ hasLabel && labelStyle && /* @__PURE__ */ jsx(
720
+ "div",
721
+ {
722
+ className: `nodrag nopan pointer-events-auto absolute rounded-full px-2 py-0.5 text-[10px] font-semibold ${labelStyle.background} ${labelStyle.text} ${labelStyle.darkBackground} ${labelStyle.darkText}`,
723
+ style: {
724
+ transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`
725
+ },
726
+ "data-testid": `edge-label-${id}`,
727
+ children: label
728
+ }
729
+ ),
730
+ showControls && !showInsertPopup && /* @__PURE__ */ jsx(
731
+ "button",
732
+ {
733
+ type: "button",
734
+ className: "nodrag nopan pointer-events-auto absolute flex h-5 w-5 items-center justify-center rounded-full border border-teal-300 bg-white shadow-md transition-all hover:scale-110 hover:bg-teal-50 dark:border-teal-600 dark:bg-gray-800 dark:hover:bg-teal-900/30",
735
+ style: {
736
+ transform: `translate(-50%, -50%) translate(${labelX}px,${labelY + insertButtonOffset}px)`
737
+ },
738
+ onClick: handleInsertClick,
739
+ onMouseEnter: () => setIsHovered(true),
740
+ onMouseLeave: () => setIsHovered(false),
741
+ "aria-label": "Insert node",
742
+ children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-3 w-3 text-teal-500 dark:text-teal-400" })
743
+ }
744
+ ),
745
+ showInsertPopup && /* @__PURE__ */ jsx(
746
+ EdgeInsertPopup,
747
+ {
748
+ position: { x: labelX, y: labelY + insertButtonOffset },
749
+ onSelect: handleInsertNodeSelect,
750
+ onClose: () => setShowInsertPopup(false)
751
+ }
752
+ ),
753
+ showControls && /* @__PURE__ */ jsx(
754
+ "button",
755
+ {
756
+ type: "button",
757
+ className: "nodrag nopan pointer-events-auto absolute flex h-5 w-5 items-center justify-center rounded-full border border-red-300 bg-white shadow-md transition-all hover:scale-110 hover:bg-red-50 dark:border-red-600 dark:bg-gray-800 dark:hover:bg-red-900/30",
758
+ style: {
759
+ transform: `translate(-50%, -50%) translate(${labelX}px,${labelY + deleteButtonOffset}px)`
760
+ },
761
+ onClick: handleDeleteEdge,
762
+ onMouseEnter: () => setIsHovered(true),
763
+ onMouseLeave: () => setIsHovered(false),
764
+ "aria-label": "Delete connection",
765
+ children: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-3 w-3 text-red-500 dark:text-red-400" })
766
+ }
767
+ )
768
+ ] })
769
+ ]
770
+ }
771
+ );
740
772
  }
741
773
  var ConditionalEdge = memo(ConditionalEdgeComponent);
742
774
  function CustomConnectionLine({
@@ -793,6 +825,8 @@ var DraggableCommandBar = memo(function DraggableCommandBar2({
793
825
  onControlModeChange,
794
826
  showMinimap,
795
827
  onToggleMinimap,
828
+ showDots,
829
+ onToggleDots,
796
830
  cardDisplayMode,
797
831
  onToggleCardDisplayMode,
798
832
  layoutDirection,
@@ -916,6 +950,16 @@ var DraggableCommandBar = memo(function DraggableCommandBar2({
916
950
  children: /* @__PURE__ */ jsx(MapIcon, { className: "h-4 w-4" })
917
951
  }
918
952
  ),
953
+ /* @__PURE__ */ jsx(
954
+ "button",
955
+ {
956
+ type: "button",
957
+ onClick: onToggleDots,
958
+ title: tWorkflow("toggleDots"),
959
+ className: showDots ? activeButtonClassName : inactiveButtonClassName,
960
+ children: /* @__PURE__ */ jsx(EllipsisHorizontalIcon, { className: "h-4 w-4" })
961
+ }
962
+ ),
919
963
  /* @__PURE__ */ jsx(
920
964
  "button",
921
965
  {
@@ -992,7 +1036,9 @@ var DraggableCommandBar = memo(function DraggableCommandBar2({
992
1036
  { keys: "\u21E7 5", label: tWorkflow("shortcutZoom50") },
993
1037
  { keys: "Esc", label: tWorkflow("shortcutDeselect") },
994
1038
  { keys: "\u232B", label: tWorkflow("shortcutDelete") },
995
- { keys: "L", label: tWorkflow("layoutMode") }
1039
+ { keys: "L", label: tWorkflow("layoutMode") },
1040
+ { keys: "G", label: tWorkflow("toggleDots") },
1041
+ { keys: "M", label: tWorkflow("toggleMinimap") }
996
1042
  ].map((shortcut) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
997
1043
  /* @__PURE__ */ jsx("span", { className: "text-[11px] text-gray-600 dark:text-gray-300", children: shortcut.label }),
998
1044
  /* @__PURE__ */ jsx("span", { className: "flex items-center gap-0.5", children: shortcut.keys.split(" ").map((key) => /* @__PURE__ */ jsx(
@@ -5954,10 +6000,16 @@ function WorkflowCanvasInner({
5954
6000
  const canRedo = useWorkflowStore((state) => state.future.length > 0);
5955
6001
  const controlMode = useWorkflowStore((state) => state.controlMode);
5956
6002
  const setControlMode = useWorkflowStore((state) => state.setControlMode);
5957
- const [showMinimap, setShowMinimap] = useState(true);
5958
- const [showShortcuts, setShowShortcuts] = useState(false);
5959
- const [cardDisplayMode, setCardDisplayMode] = useState("detailed");
6003
+ const showMinimap = useWorkflowStore((s) => s.showMinimap);
6004
+ const showDots = useWorkflowStore((s) => s.showDots);
6005
+ const showShortcuts = useWorkflowStore((s) => s.showShortcuts);
6006
+ const cardDisplayMode = useWorkflowStore((s) => s.cardDisplayMode);
5960
6007
  const layoutDirection = useWorkflowStore((s) => s.layoutDirection);
6008
+ const toggleMinimap = useWorkflowStore((s) => s.toggleMinimap);
6009
+ const toggleDots = useWorkflowStore((s) => s.toggleDots);
6010
+ const toggleShortcuts = useWorkflowStore((s) => s.toggleShortcuts);
6011
+ const closeShortcuts = useWorkflowStore((s) => s.closeShortcuts);
6012
+ const toggleCardDisplayMode = useWorkflowStore((s) => s.toggleCardDisplayMode);
5961
6013
  const setLayoutDirection = useWorkflowStore((s) => s.setLayoutDirection);
5962
6014
  const [editingLogicNodeId, setEditingLogicNodeId] = useState(null);
5963
6015
  const handleEditLogicNode = useCallback((nodeId) => {
@@ -6732,6 +6784,14 @@ function WorkflowCanvasInner({
6732
6784
  setControlMode("hand");
6733
6785
  return;
6734
6786
  }
6787
+ if (event.key.toLowerCase() === "g") {
6788
+ toggleDots();
6789
+ return;
6790
+ }
6791
+ if (event.key.toLowerCase() === "m") {
6792
+ toggleMinimap();
6793
+ return;
6794
+ }
6735
6795
  if (event.shiftKey && event.key === "!") {
6736
6796
  event.preventDefault();
6737
6797
  zoomTo(1);
@@ -7297,7 +7357,7 @@ function WorkflowCanvasInner({
7297
7357
  deleteKeyCode: ["Backspace", "Delete"],
7298
7358
  connectionLineStyle: { stroke: GRAPH_ACTIVE_EDGE_COLOR, strokeWidth: 2 },
7299
7359
  children: [
7300
- /* @__PURE__ */ jsx(
7360
+ showDots && /* @__PURE__ */ jsx(
7301
7361
  Background,
7302
7362
  {
7303
7363
  variant: BackgroundVariant.Dots,
@@ -7333,14 +7393,16 @@ function WorkflowCanvasInner({
7333
7393
  controlMode,
7334
7394
  onControlModeChange: setControlMode,
7335
7395
  showMinimap,
7336
- onToggleMinimap: () => setShowMinimap((previous) => !previous),
7396
+ onToggleMinimap: toggleMinimap,
7397
+ showDots,
7398
+ onToggleDots: toggleDots,
7337
7399
  cardDisplayMode,
7338
- onToggleCardDisplayMode: () => setCardDisplayMode((previous) => previous === "detailed" ? "compact" : "detailed"),
7400
+ onToggleCardDisplayMode: toggleCardDisplayMode,
7339
7401
  layoutDirection,
7340
7402
  onLayoutDirectionChange: handleLayoutDirectionChange,
7341
7403
  showShortcuts,
7342
- onToggleShortcuts: () => setShowShortcuts((previous) => !previous),
7343
- onCloseShortcuts: () => setShowShortcuts(false),
7404
+ onToggleShortcuts: toggleShortcuts,
7405
+ onCloseShortcuts: closeShortcuts,
7344
7406
  tWorkflow
7345
7407
  }
7346
7408
  ),
@@ -7548,5 +7610,5 @@ function Workspace({
7548
7610
  }
7549
7611
 
7550
7612
  export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CATEGORY_COLORS, CATEGORY_PILL_COLORS, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, ICON_MAP, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeModal, MINIMAP_NODE_COLORS, ModelProviderFlowNode, NODE_EXECUTION_ACCENT_COLORS, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, WorkflowCanvas, Workspace, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, getNodeExecutionAccent, getNodeExecutionAccentRgb, isFrameworkCompatibleWithProviders, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
7551
- //# sourceMappingURL=chunk-YNZAYMGD.mjs.map
7552
- //# sourceMappingURL=chunk-YNZAYMGD.mjs.map
7613
+ //# sourceMappingURL=chunk-WG4S74B5.mjs.map
7614
+ //# sourceMappingURL=chunk-WG4S74B5.mjs.map