@uipath/apollo-react 3.34.1 → 3.34.2

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.
@@ -93,7 +93,7 @@ const BaseNodeComponent = (props)=>{
93
93
  nodeId: id
94
94
  }), [
95
95
  manifest,
96
- data.display,
96
+ data,
97
97
  id
98
98
  ]);
99
99
  const Icon = (0, external_react_namespaceObject.useMemo)(()=>{
@@ -106,6 +106,8 @@ const BaseNodeComponent = (props)=>{
106
106
  ]);
107
107
  const handleConfigurations = (0, external_react_namespaceObject.useMemo)(()=>{
108
108
  if (handleConfigurationsProp && Array.isArray(handleConfigurationsProp)) return handleConfigurationsProp;
109
+ const dataHandleConfigs = data?.handleConfigurations;
110
+ if (dataHandleConfigs && Array.isArray(dataHandleConfigs)) return dataHandleConfigs;
109
111
  if (!manifest) return [];
110
112
  const resolved = (0, manifest_resolver_cjs_namespaceObject.resolveHandles)(manifest.handleConfiguration, {
111
113
  ...data,
@@ -127,7 +129,8 @@ const BaseNodeComponent = (props)=>{
127
129
  }, [
128
130
  handleConfigurationsProp,
129
131
  manifest,
130
- data
132
+ data,
133
+ id
131
134
  ]);
132
135
  const toolbarConfig = (0, external_react_namespaceObject.useMemo)(()=>{
133
136
  if (void 0 !== toolbarConfigProp) return null === toolbarConfigProp ? void 0 : toolbarConfigProp;
@@ -306,7 +309,7 @@ const BaseNodeComponent = (props)=>{
306
309
  showNotches,
307
310
  handleAction,
308
311
  multipleNodesSelected,
309
- connectedHandleIds.has
312
+ connectedHandleIds
310
313
  ]);
311
314
  const handleElements = useSmartHandles ? smartHandleElements : buttonHandleElements;
312
315
  if (!manifest) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAkB,MAAM,0CAA0C,CAAC;AAkChG,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AA2f1B,eAAO,MAAM,QAAQ,8CAtfa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CAsfhB,CAAC"}
1
+ {"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAkB,MAAM,0CAA0C,CAAC;AAiChG,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AAmgB1B,eAAO,MAAM,QAAQ,8CA7fa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CA6fhB,CAAC"}
@@ -65,7 +65,7 @@ const BaseNodeComponent = (props)=>{
65
65
  nodeId: id
66
66
  }), [
67
67
  manifest,
68
- data.display,
68
+ data,
69
69
  id
70
70
  ]);
71
71
  const Icon = useMemo(()=>{
@@ -78,6 +78,8 @@ const BaseNodeComponent = (props)=>{
78
78
  ]);
79
79
  const handleConfigurations = useMemo(()=>{
80
80
  if (handleConfigurationsProp && Array.isArray(handleConfigurationsProp)) return handleConfigurationsProp;
81
+ const dataHandleConfigs = data?.handleConfigurations;
82
+ if (dataHandleConfigs && Array.isArray(dataHandleConfigs)) return dataHandleConfigs;
81
83
  if (!manifest) return [];
82
84
  const resolved = resolveHandles(manifest.handleConfiguration, {
83
85
  ...data,
@@ -99,7 +101,8 @@ const BaseNodeComponent = (props)=>{
99
101
  }, [
100
102
  handleConfigurationsProp,
101
103
  manifest,
102
- data
104
+ data,
105
+ id
103
106
  ]);
104
107
  const toolbarConfig = useMemo(()=>{
105
108
  if (void 0 !== toolbarConfigProp) return null === toolbarConfigProp ? void 0 : toolbarConfigProp;
@@ -278,7 +281,7 @@ const BaseNodeComponent = (props)=>{
278
281
  showNotches,
279
282
  handleAction,
280
283
  multipleNodesSelected,
281
- connectedHandleIds.has
284
+ connectedHandleIds
282
285
  ]);
283
286
  const handleElements = useSmartHandles ? smartHandleElements : buttonHandleElements;
284
287
  if (!manifest) return /*#__PURE__*/ jsx("div", {
@@ -30,11 +30,9 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  DynamicHandles: ()=>DynamicHandles
31
31
  });
32
32
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
33
- const material_namespaceObject = require("@mui/material");
34
- const apollo_core_namespaceObject = require("@uipath/apollo-core");
35
33
  const index_cjs_namespaceObject = require("../../layouts/index.cjs");
36
34
  const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
37
- const external_material_index_cjs_namespaceObject = require("../../../material/index.cjs");
35
+ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
38
36
  const external_react_namespaceObject = require("react");
39
37
  const external_core_index_cjs_namespaceObject = require("../../core/index.cjs");
40
38
  const external_storybook_utils_index_cjs_namespaceObject = require("../../storybook-utils/index.cjs");
@@ -61,6 +59,15 @@ const sampleManifest = {
61
59
  colorDark: '#495057',
62
60
  icon: 'layers',
63
61
  tags: []
62
+ },
63
+ {
64
+ id: 'control',
65
+ name: 'Control Flow',
66
+ sortOrder: 3,
67
+ color: '#6c757d',
68
+ colorDark: '#495057',
69
+ icon: 'git-branch',
70
+ tags: []
64
71
  }
65
72
  ],
66
73
  nodes: [
@@ -215,6 +222,50 @@ const sampleManifest = {
215
222
  ]
216
223
  }
217
224
  ]
225
+ },
226
+ {
227
+ nodeType: 'uipath.decision',
228
+ version: '1.0.0',
229
+ category: 'control',
230
+ tags: [
231
+ 'control',
232
+ 'decision'
233
+ ],
234
+ sortOrder: 6,
235
+ display: {
236
+ label: 'Decision',
237
+ icon: 'git-branch',
238
+ shape: 'square'
239
+ },
240
+ handleConfiguration: [
241
+ {
242
+ position: 'left',
243
+ handles: [
244
+ {
245
+ id: 'input',
246
+ type: 'target',
247
+ handleType: 'input'
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ position: 'right',
253
+ handles: [
254
+ {
255
+ id: 'true',
256
+ type: 'source',
257
+ handleType: 'output',
258
+ label: '{inputs.trueLabel}'
259
+ },
260
+ {
261
+ id: 'false',
262
+ type: 'source',
263
+ handleType: 'output',
264
+ label: '{inputs.falseLabel}'
265
+ }
266
+ ]
267
+ }
268
+ ]
218
269
  }
219
270
  ]
220
271
  };
@@ -447,7 +498,7 @@ function CustomizedSizesStory() {
447
498
  });
448
499
  }
449
500
  function DynamicHandlesStory() {
450
- const [nodeData, setNodeData] = (0, external_react_namespaceObject.useState)({
501
+ const [switchData, setSwitchData] = (0, external_react_namespaceObject.useState)({
451
502
  dynamicInputs: [
452
503
  {
453
504
  label: 'Primary Input'
@@ -469,26 +520,55 @@ function DynamicHandlesStory() {
469
520
  ],
470
521
  hasDefault: false
471
522
  });
523
+ const [decisionData, setDecisionData] = (0, external_react_namespaceObject.useState)({
524
+ trueLabel: 'Approved',
525
+ falseLabel: 'Rejected'
526
+ });
472
527
  const initialNodes = (0, external_react_namespaceObject.useMemo)(()=>[
473
528
  {
474
529
  ...(0, external_storybook_utils_index_cjs_namespaceObject.createNode)({
475
530
  id: 'dynamic-handles-node',
476
531
  type: 'uipath.control-switch',
477
532
  position: {
478
- x: 400,
479
- y: 300
533
+ x: 700,
534
+ y: 200
480
535
  },
481
536
  data: {
482
537
  nodeType: 'uipath.control-switch',
483
538
  version: '1.0.0',
484
539
  inputs: {
485
- dynamicInputs: nodeData.dynamicInputs,
486
- dynamicOutputs: nodeData.dynamicOutputs,
487
- hasDefault: nodeData.hasDefault
540
+ dynamicInputs: switchData.dynamicInputs,
541
+ dynamicOutputs: switchData.dynamicOutputs,
542
+ hasDefault: switchData.hasDefault
488
543
  },
489
544
  display: {
490
545
  label: 'Dynamic Handles',
491
- subLabel: `${nodeData.dynamicInputs.length} inputs, ${nodeData.dynamicOutputs.length} outputs`,
546
+ subLabel: `${switchData.dynamicInputs.length} inputs, ${switchData.dynamicOutputs.length} outputs`,
547
+ shape: 'square'
548
+ }
549
+ }
550
+ }),
551
+ height: 96,
552
+ width: 96
553
+ },
554
+ {
555
+ ...(0, external_storybook_utils_index_cjs_namespaceObject.createNode)({
556
+ id: 'decision-node',
557
+ type: 'uipath.decision',
558
+ position: {
559
+ x: 700,
560
+ y: 600
561
+ },
562
+ data: {
563
+ nodeType: 'uipath.decision',
564
+ version: '1.0.0',
565
+ inputs: {
566
+ trueLabel: decisionData.trueLabel,
567
+ falseLabel: decisionData.falseLabel
568
+ },
569
+ display: {
570
+ label: 'Decision',
571
+ subLabel: 'Templated labels',
492
572
  shape: 'square'
493
573
  }
494
574
  }
@@ -497,77 +577,98 @@ function DynamicHandlesStory() {
497
577
  width: 96
498
578
  }
499
579
  ], [
500
- nodeData
580
+ switchData,
581
+ decisionData
501
582
  ]);
502
583
  const { canvasProps, setNodes } = (0, external_storybook_utils_index_cjs_namespaceObject.useCanvasStory)({
503
584
  initialNodes
504
585
  });
505
586
  (0, external_react_namespaceObject.useEffect)(()=>{
506
- setNodes((nodes)=>nodes.map((node)=>'dynamic-handles-node' === node.id ? {
587
+ setNodes((nodes)=>nodes.map((node)=>{
588
+ if ('dynamic-handles-node' === node.id) return {
507
589
  ...node,
508
590
  data: {
509
591
  ...node.data,
510
592
  inputs: {
511
- dynamicInputs: nodeData.dynamicInputs,
512
- dynamicOutputs: nodeData.dynamicOutputs,
513
- hasDefault: nodeData.hasDefault
593
+ dynamicInputs: switchData.dynamicInputs,
594
+ dynamicOutputs: switchData.dynamicOutputs,
595
+ hasDefault: switchData.hasDefault
514
596
  },
515
597
  display: {
516
598
  ...node.data.display || {},
517
- subLabel: `${nodeData.dynamicInputs.length} inputs, ${nodeData.dynamicOutputs.length} outputs`
599
+ subLabel: `${switchData.dynamicInputs.length} inputs, ${switchData.dynamicOutputs.length} outputs`
600
+ }
601
+ }
602
+ };
603
+ if ('decision-node' === node.id) return {
604
+ ...node,
605
+ data: {
606
+ ...node.data,
607
+ inputs: {
608
+ trueLabel: decisionData.trueLabel,
609
+ falseLabel: decisionData.falseLabel
518
610
  }
519
611
  }
520
- } : node));
612
+ };
613
+ return node;
614
+ }));
521
615
  }, [
522
- nodeData,
616
+ switchData,
617
+ decisionData,
523
618
  setNodes
524
619
  ]);
525
- const addHandle = (0, external_react_namespaceObject.useCallback)((type)=>{
526
- setNodeData((prev)=>{
527
- const newArray = [
528
- ...prev[type]
529
- ];
530
- if ('dynamicInputs' === type) newArray.push({
531
- label: `Input ${newArray.length + 1}`
532
- });
533
- else if ('dynamicOutputs' === type) newArray.push({
534
- name: `Output ${newArray.length + 1}`
535
- });
620
+ const handleInputCount = (0, external_react_namespaceObject.useCallback)((value)=>{
621
+ const count = value[0] ?? 0;
622
+ setSwitchData((prev)=>{
623
+ const current = prev.dynamicInputs;
624
+ if (count > current.length) {
625
+ const added = Array.from({
626
+ length: count - current.length
627
+ }, (_, i)=>({
628
+ label: `Input ${current.length + i + 1}`
629
+ }));
630
+ return {
631
+ ...prev,
632
+ dynamicInputs: [
633
+ ...current,
634
+ ...added
635
+ ]
636
+ };
637
+ }
536
638
  return {
537
639
  ...prev,
538
- [type]: newArray
640
+ dynamicInputs: current.slice(0, count)
539
641
  };
540
642
  });
541
643
  }, []);
542
- const removeHandle = (0, external_react_namespaceObject.useCallback)((type)=>{
543
- setNodeData((prev)=>{
544
- const newArray = [
545
- ...prev[type]
546
- ];
547
- if (newArray.length > 0) newArray.pop();
644
+ const handleOutputCount = (0, external_react_namespaceObject.useCallback)((value)=>{
645
+ const count = value[0] ?? 0;
646
+ setSwitchData((prev)=>{
647
+ const current = prev.dynamicOutputs;
648
+ if (count > current.length) {
649
+ const added = Array.from({
650
+ length: count - current.length
651
+ }, (_, i)=>({
652
+ name: `Output ${current.length + i + 1}`
653
+ }));
654
+ return {
655
+ ...prev,
656
+ dynamicOutputs: [
657
+ ...current,
658
+ ...added
659
+ ]
660
+ };
661
+ }
548
662
  return {
549
663
  ...prev,
550
- [type]: newArray
664
+ dynamicOutputs: current.slice(0, count)
551
665
  };
552
666
  });
553
667
  }, []);
554
- const handleTypes = [
555
- {
556
- key: 'dynamicInputs',
557
- label: 'Inputs',
558
- icon: 'arrow_back'
559
- },
560
- {
561
- key: 'dynamicOutputs',
562
- label: 'Outputs',
563
- icon: 'arrow_forward'
564
- }
565
- ];
566
668
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_BaseCanvas_index_cjs_namespaceObject.BaseCanvas, {
567
669
  ...canvasProps,
568
670
  mode: "design",
569
671
  children: [
570
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_NodeInspector_cjs_namespaceObject.NodeInspector, {}),
571
672
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
572
673
  position: "bottom-right",
573
674
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasPositionControls_cjs_namespaceObject.CanvasPositionControls, {
@@ -576,78 +677,124 @@ function DynamicHandlesStory() {
576
677
  }),
577
678
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_storybook_utils_index_cjs_namespaceObject.StoryInfoPanel, {
578
679
  title: "Dynamic Handles",
579
- description: "Interactive demonstration of dynamic handle generation. Use buttons to add/remove handles from arrays.",
680
+ description: "Demonstrates repeat expressions (dynamic handle count) and templated handle labels.",
580
681
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
581
- gap: 16,
682
+ gap: 20,
582
683
  children: [
583
- handleTypes.map(({ key, label, icon })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
584
- gap: 6,
585
- align: "flex-start",
586
- children: [
587
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
588
- gap: 8,
589
- align: "center",
590
- children: [
591
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIcon, {
592
- name: icon,
593
- size: "20px"
594
- }),
595
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
596
- variant: apollo_core_namespaceObject.FontVariantToken.fontSizeMBold,
597
- children: label
598
- })
599
- ]
600
- }),
601
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
602
- gap: 8,
603
- align: "center",
604
- children: [
605
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIconButton, {
606
- onClick: ()=>removeHandle(key),
607
- disabled: 0 === nodeData[key].length,
608
- "aria-label": `Remove ${label.toLowerCase()}`,
609
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIcon, {
610
- name: "remove"
611
- })
612
- }),
613
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
614
- variant: apollo_core_namespaceObject.FontVariantToken.fontSizeMBold,
615
- style: {
616
- minWidth: 24,
617
- textAlign: 'center'
618
- },
619
- children: nodeData[key].length
620
- }),
621
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIconButton, {
622
- onClick: ()=>addHandle(key),
623
- "aria-label": `Add ${label.toLowerCase()}`,
624
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIcon, {
625
- name: "add"
626
- })
627
- })
628
- ]
629
- })
630
- ]
631
- }, key)),
632
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Column, {
633
- gap: 6,
634
- align: "flex-start",
635
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(material_namespaceObject.FormControlLabel, {
636
- control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(material_namespaceObject.Checkbox, {
637
- checked: nodeData.hasDefault,
638
- onChange: (e)=>setNodeData((prev)=>({
639
- ...prev,
640
- hasDefault: e.target.checked
641
- }))
684
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
685
+ gap: 12,
686
+ children: [
687
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
688
+ className: "font-semibold",
689
+ children: "Switch Node — Repeat Handles"
690
+ }),
691
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
692
+ gap: 6,
693
+ align: "flex-start",
694
+ children: [
695
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Label, {
696
+ children: [
697
+ "Inputs (",
698
+ switchData.dynamicInputs.length,
699
+ ")"
700
+ ]
701
+ }),
702
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Slider, {
703
+ value: [
704
+ switchData.dynamicInputs.length
705
+ ],
706
+ onValueChange: handleInputCount,
707
+ min: 0,
708
+ max: 10,
709
+ step: 1
710
+ })
711
+ ]
712
+ }),
713
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
714
+ gap: 6,
715
+ align: "flex-start",
716
+ children: [
717
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Label, {
718
+ children: [
719
+ "Outputs (",
720
+ switchData.dynamicOutputs.length,
721
+ ")"
722
+ ]
723
+ }),
724
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Slider, {
725
+ value: [
726
+ switchData.dynamicOutputs.length
727
+ ],
728
+ onValueChange: handleOutputCount,
729
+ min: 0,
730
+ max: 10,
731
+ step: 1
732
+ })
733
+ ]
734
+ }),
735
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
736
+ className: "flex items-center gap-2",
737
+ children: [
738
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Switch, {
739
+ checked: switchData.hasDefault,
740
+ onCheckedChange: (checked)=>setSwitchData((prev)=>({
741
+ ...prev,
742
+ hasDefault: checked
743
+ }))
744
+ }),
745
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
746
+ children: "Has Default Output"
747
+ })
748
+ ]
749
+ })
750
+ ]
751
+ }),
752
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
753
+ gap: 12,
754
+ children: [
755
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
756
+ className: "font-semibold",
757
+ children: "Decision Node — Templated Labels"
758
+ }),
759
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
760
+ gap: 6,
761
+ align: "flex-start",
762
+ children: [
763
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
764
+ children: "True Label"
765
+ }),
766
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
767
+ value: decisionData.trueLabel,
768
+ onChange: (e)=>setDecisionData((prev)=>({
769
+ ...prev,
770
+ trueLabel: e.target.value
771
+ }))
772
+ })
773
+ ]
642
774
  }),
643
- label: "Has Default Output"
644
- })
775
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
776
+ gap: 6,
777
+ align: "flex-start",
778
+ children: [
779
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
780
+ children: "False Label"
781
+ }),
782
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
783
+ value: decisionData.falseLabel,
784
+ onChange: (e)=>setDecisionData((prev)=>({
785
+ ...prev,
786
+ falseLabel: e.target.value
787
+ }))
788
+ })
789
+ ]
790
+ })
791
+ ]
645
792
  }),
646
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApButton, {
647
- size: "small",
793
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
794
+ size: "sm",
648
795
  variant: "secondary",
649
- label: "Reset",
650
- onClick: ()=>setNodeData({
796
+ onClick: ()=>{
797
+ setSwitchData({
651
798
  dynamicInputs: [
652
799
  {
653
800
  label: 'Primary Input'
@@ -659,7 +806,13 @@ function DynamicHandlesStory() {
659
806
  }
660
807
  ],
661
808
  hasDefault: false
662
- })
809
+ });
810
+ setDecisionData({
811
+ trueLabel: 'Approved',
812
+ falseLabel: 'Rejected'
813
+ });
814
+ },
815
+ children: "Reset All"
663
816
  })
664
817
  ]
665
818
  })
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.stories.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAmBvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAqJrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAqB5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAgWnC,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAG7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAG5B,CAAC"}
1
+ {"version":3,"file":"BaseNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAkBvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAuLrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAqB5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAmZnC,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAG7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAG5B,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Checkbox, FormControlLabel } from "@mui/material";
3
- import { FontVariantToken } from "@uipath/apollo-core";
4
- import { Column, Row } from "../../layouts/index.js";
2
+ import { Column } from "../../layouts/index.js";
5
3
  import { Panel } from "../../xyflow/react.js";
6
- import { ApButton, ApIcon, ApIconButton, ApTypography } from "../../../material/index.js";
4
+ import { Button, Input, Label, Slider, Switch } from "@uipath/apollo-wind";
7
5
  import { useCallback, useEffect, useMemo, useState } from "react";
8
6
  import { NodeRegistryContext, NodeTypeRegistry } from "../../core/index.js";
9
7
  import { StoryInfoPanel, createNode, useCanvasStory, withCanvasProviders } from "../../storybook-utils/index.js";
@@ -30,6 +28,15 @@ const sampleManifest = {
30
28
  colorDark: '#495057',
31
29
  icon: 'layers',
32
30
  tags: []
31
+ },
32
+ {
33
+ id: 'control',
34
+ name: 'Control Flow',
35
+ sortOrder: 3,
36
+ color: '#6c757d',
37
+ colorDark: '#495057',
38
+ icon: 'git-branch',
39
+ tags: []
33
40
  }
34
41
  ],
35
42
  nodes: [
@@ -184,6 +191,50 @@ const sampleManifest = {
184
191
  ]
185
192
  }
186
193
  ]
194
+ },
195
+ {
196
+ nodeType: 'uipath.decision',
197
+ version: '1.0.0',
198
+ category: 'control',
199
+ tags: [
200
+ 'control',
201
+ 'decision'
202
+ ],
203
+ sortOrder: 6,
204
+ display: {
205
+ label: 'Decision',
206
+ icon: 'git-branch',
207
+ shape: 'square'
208
+ },
209
+ handleConfiguration: [
210
+ {
211
+ position: 'left',
212
+ handles: [
213
+ {
214
+ id: 'input',
215
+ type: 'target',
216
+ handleType: 'input'
217
+ }
218
+ ]
219
+ },
220
+ {
221
+ position: 'right',
222
+ handles: [
223
+ {
224
+ id: 'true',
225
+ type: 'source',
226
+ handleType: 'output',
227
+ label: '{inputs.trueLabel}'
228
+ },
229
+ {
230
+ id: 'false',
231
+ type: 'source',
232
+ handleType: 'output',
233
+ label: '{inputs.falseLabel}'
234
+ }
235
+ ]
236
+ }
237
+ ]
187
238
  }
188
239
  ]
189
240
  };
@@ -416,7 +467,7 @@ function CustomizedSizesStory() {
416
467
  });
417
468
  }
418
469
  function DynamicHandlesStory() {
419
- const [nodeData, setNodeData] = useState({
470
+ const [switchData, setSwitchData] = useState({
420
471
  dynamicInputs: [
421
472
  {
422
473
  label: 'Primary Input'
@@ -438,26 +489,55 @@ function DynamicHandlesStory() {
438
489
  ],
439
490
  hasDefault: false
440
491
  });
492
+ const [decisionData, setDecisionData] = useState({
493
+ trueLabel: 'Approved',
494
+ falseLabel: 'Rejected'
495
+ });
441
496
  const initialNodes = useMemo(()=>[
442
497
  {
443
498
  ...createNode({
444
499
  id: 'dynamic-handles-node',
445
500
  type: 'uipath.control-switch',
446
501
  position: {
447
- x: 400,
448
- y: 300
502
+ x: 700,
503
+ y: 200
449
504
  },
450
505
  data: {
451
506
  nodeType: 'uipath.control-switch',
452
507
  version: '1.0.0',
453
508
  inputs: {
454
- dynamicInputs: nodeData.dynamicInputs,
455
- dynamicOutputs: nodeData.dynamicOutputs,
456
- hasDefault: nodeData.hasDefault
509
+ dynamicInputs: switchData.dynamicInputs,
510
+ dynamicOutputs: switchData.dynamicOutputs,
511
+ hasDefault: switchData.hasDefault
457
512
  },
458
513
  display: {
459
514
  label: 'Dynamic Handles',
460
- subLabel: `${nodeData.dynamicInputs.length} inputs, ${nodeData.dynamicOutputs.length} outputs`,
515
+ subLabel: `${switchData.dynamicInputs.length} inputs, ${switchData.dynamicOutputs.length} outputs`,
516
+ shape: 'square'
517
+ }
518
+ }
519
+ }),
520
+ height: 96,
521
+ width: 96
522
+ },
523
+ {
524
+ ...createNode({
525
+ id: 'decision-node',
526
+ type: 'uipath.decision',
527
+ position: {
528
+ x: 700,
529
+ y: 600
530
+ },
531
+ data: {
532
+ nodeType: 'uipath.decision',
533
+ version: '1.0.0',
534
+ inputs: {
535
+ trueLabel: decisionData.trueLabel,
536
+ falseLabel: decisionData.falseLabel
537
+ },
538
+ display: {
539
+ label: 'Decision',
540
+ subLabel: 'Templated labels',
461
541
  shape: 'square'
462
542
  }
463
543
  }
@@ -466,77 +546,98 @@ function DynamicHandlesStory() {
466
546
  width: 96
467
547
  }
468
548
  ], [
469
- nodeData
549
+ switchData,
550
+ decisionData
470
551
  ]);
471
552
  const { canvasProps, setNodes } = useCanvasStory({
472
553
  initialNodes
473
554
  });
474
555
  useEffect(()=>{
475
- setNodes((nodes)=>nodes.map((node)=>'dynamic-handles-node' === node.id ? {
556
+ setNodes((nodes)=>nodes.map((node)=>{
557
+ if ('dynamic-handles-node' === node.id) return {
476
558
  ...node,
477
559
  data: {
478
560
  ...node.data,
479
561
  inputs: {
480
- dynamicInputs: nodeData.dynamicInputs,
481
- dynamicOutputs: nodeData.dynamicOutputs,
482
- hasDefault: nodeData.hasDefault
562
+ dynamicInputs: switchData.dynamicInputs,
563
+ dynamicOutputs: switchData.dynamicOutputs,
564
+ hasDefault: switchData.hasDefault
483
565
  },
484
566
  display: {
485
567
  ...node.data.display || {},
486
- subLabel: `${nodeData.dynamicInputs.length} inputs, ${nodeData.dynamicOutputs.length} outputs`
568
+ subLabel: `${switchData.dynamicInputs.length} inputs, ${switchData.dynamicOutputs.length} outputs`
569
+ }
570
+ }
571
+ };
572
+ if ('decision-node' === node.id) return {
573
+ ...node,
574
+ data: {
575
+ ...node.data,
576
+ inputs: {
577
+ trueLabel: decisionData.trueLabel,
578
+ falseLabel: decisionData.falseLabel
487
579
  }
488
580
  }
489
- } : node));
581
+ };
582
+ return node;
583
+ }));
490
584
  }, [
491
- nodeData,
585
+ switchData,
586
+ decisionData,
492
587
  setNodes
493
588
  ]);
494
- const addHandle = useCallback((type)=>{
495
- setNodeData((prev)=>{
496
- const newArray = [
497
- ...prev[type]
498
- ];
499
- if ('dynamicInputs' === type) newArray.push({
500
- label: `Input ${newArray.length + 1}`
501
- });
502
- else if ('dynamicOutputs' === type) newArray.push({
503
- name: `Output ${newArray.length + 1}`
504
- });
589
+ const handleInputCount = useCallback((value)=>{
590
+ const count = value[0] ?? 0;
591
+ setSwitchData((prev)=>{
592
+ const current = prev.dynamicInputs;
593
+ if (count > current.length) {
594
+ const added = Array.from({
595
+ length: count - current.length
596
+ }, (_, i)=>({
597
+ label: `Input ${current.length + i + 1}`
598
+ }));
599
+ return {
600
+ ...prev,
601
+ dynamicInputs: [
602
+ ...current,
603
+ ...added
604
+ ]
605
+ };
606
+ }
505
607
  return {
506
608
  ...prev,
507
- [type]: newArray
609
+ dynamicInputs: current.slice(0, count)
508
610
  };
509
611
  });
510
612
  }, []);
511
- const removeHandle = useCallback((type)=>{
512
- setNodeData((prev)=>{
513
- const newArray = [
514
- ...prev[type]
515
- ];
516
- if (newArray.length > 0) newArray.pop();
613
+ const handleOutputCount = useCallback((value)=>{
614
+ const count = value[0] ?? 0;
615
+ setSwitchData((prev)=>{
616
+ const current = prev.dynamicOutputs;
617
+ if (count > current.length) {
618
+ const added = Array.from({
619
+ length: count - current.length
620
+ }, (_, i)=>({
621
+ name: `Output ${current.length + i + 1}`
622
+ }));
623
+ return {
624
+ ...prev,
625
+ dynamicOutputs: [
626
+ ...current,
627
+ ...added
628
+ ]
629
+ };
630
+ }
517
631
  return {
518
632
  ...prev,
519
- [type]: newArray
633
+ dynamicOutputs: current.slice(0, count)
520
634
  };
521
635
  });
522
636
  }, []);
523
- const handleTypes = [
524
- {
525
- key: 'dynamicInputs',
526
- label: 'Inputs',
527
- icon: 'arrow_back'
528
- },
529
- {
530
- key: 'dynamicOutputs',
531
- label: 'Outputs',
532
- icon: 'arrow_forward'
533
- }
534
- ];
535
637
  return /*#__PURE__*/ jsxs(BaseCanvas, {
536
638
  ...canvasProps,
537
639
  mode: "design",
538
640
  children: [
539
- /*#__PURE__*/ jsx(NodeInspector, {}),
540
641
  /*#__PURE__*/ jsx(Panel, {
541
642
  position: "bottom-right",
542
643
  children: /*#__PURE__*/ jsx(CanvasPositionControls, {
@@ -545,78 +646,124 @@ function DynamicHandlesStory() {
545
646
  }),
546
647
  /*#__PURE__*/ jsx(StoryInfoPanel, {
547
648
  title: "Dynamic Handles",
548
- description: "Interactive demonstration of dynamic handle generation. Use buttons to add/remove handles from arrays.",
649
+ description: "Demonstrates repeat expressions (dynamic handle count) and templated handle labels.",
549
650
  children: /*#__PURE__*/ jsxs(Column, {
550
- gap: 16,
651
+ gap: 20,
551
652
  children: [
552
- handleTypes.map(({ key, label, icon })=>/*#__PURE__*/ jsxs(Column, {
553
- gap: 6,
554
- align: "flex-start",
555
- children: [
556
- /*#__PURE__*/ jsxs(Row, {
557
- gap: 8,
558
- align: "center",
559
- children: [
560
- /*#__PURE__*/ jsx(ApIcon, {
561
- name: icon,
562
- size: "20px"
563
- }),
564
- /*#__PURE__*/ jsx(ApTypography, {
565
- variant: FontVariantToken.fontSizeMBold,
566
- children: label
567
- })
568
- ]
569
- }),
570
- /*#__PURE__*/ jsxs(Row, {
571
- gap: 8,
572
- align: "center",
573
- children: [
574
- /*#__PURE__*/ jsx(ApIconButton, {
575
- onClick: ()=>removeHandle(key),
576
- disabled: 0 === nodeData[key].length,
577
- "aria-label": `Remove ${label.toLowerCase()}`,
578
- children: /*#__PURE__*/ jsx(ApIcon, {
579
- name: "remove"
580
- })
581
- }),
582
- /*#__PURE__*/ jsx(ApTypography, {
583
- variant: FontVariantToken.fontSizeMBold,
584
- style: {
585
- minWidth: 24,
586
- textAlign: 'center'
587
- },
588
- children: nodeData[key].length
589
- }),
590
- /*#__PURE__*/ jsx(ApIconButton, {
591
- onClick: ()=>addHandle(key),
592
- "aria-label": `Add ${label.toLowerCase()}`,
593
- children: /*#__PURE__*/ jsx(ApIcon, {
594
- name: "add"
595
- })
596
- })
597
- ]
598
- })
599
- ]
600
- }, key)),
601
- /*#__PURE__*/ jsx(Column, {
602
- gap: 6,
603
- align: "flex-start",
604
- children: /*#__PURE__*/ jsx(FormControlLabel, {
605
- control: /*#__PURE__*/ jsx(Checkbox, {
606
- checked: nodeData.hasDefault,
607
- onChange: (e)=>setNodeData((prev)=>({
608
- ...prev,
609
- hasDefault: e.target.checked
610
- }))
653
+ /*#__PURE__*/ jsxs(Column, {
654
+ gap: 12,
655
+ children: [
656
+ /*#__PURE__*/ jsx(Label, {
657
+ className: "font-semibold",
658
+ children: "Switch Node — Repeat Handles"
659
+ }),
660
+ /*#__PURE__*/ jsxs(Column, {
661
+ gap: 6,
662
+ align: "flex-start",
663
+ children: [
664
+ /*#__PURE__*/ jsxs(Label, {
665
+ children: [
666
+ "Inputs (",
667
+ switchData.dynamicInputs.length,
668
+ ")"
669
+ ]
670
+ }),
671
+ /*#__PURE__*/ jsx(Slider, {
672
+ value: [
673
+ switchData.dynamicInputs.length
674
+ ],
675
+ onValueChange: handleInputCount,
676
+ min: 0,
677
+ max: 10,
678
+ step: 1
679
+ })
680
+ ]
681
+ }),
682
+ /*#__PURE__*/ jsxs(Column, {
683
+ gap: 6,
684
+ align: "flex-start",
685
+ children: [
686
+ /*#__PURE__*/ jsxs(Label, {
687
+ children: [
688
+ "Outputs (",
689
+ switchData.dynamicOutputs.length,
690
+ ")"
691
+ ]
692
+ }),
693
+ /*#__PURE__*/ jsx(Slider, {
694
+ value: [
695
+ switchData.dynamicOutputs.length
696
+ ],
697
+ onValueChange: handleOutputCount,
698
+ min: 0,
699
+ max: 10,
700
+ step: 1
701
+ })
702
+ ]
703
+ }),
704
+ /*#__PURE__*/ jsxs("div", {
705
+ className: "flex items-center gap-2",
706
+ children: [
707
+ /*#__PURE__*/ jsx(Switch, {
708
+ checked: switchData.hasDefault,
709
+ onCheckedChange: (checked)=>setSwitchData((prev)=>({
710
+ ...prev,
711
+ hasDefault: checked
712
+ }))
713
+ }),
714
+ /*#__PURE__*/ jsx(Label, {
715
+ children: "Has Default Output"
716
+ })
717
+ ]
718
+ })
719
+ ]
720
+ }),
721
+ /*#__PURE__*/ jsxs(Column, {
722
+ gap: 12,
723
+ children: [
724
+ /*#__PURE__*/ jsx(Label, {
725
+ className: "font-semibold",
726
+ children: "Decision Node — Templated Labels"
727
+ }),
728
+ /*#__PURE__*/ jsxs(Column, {
729
+ gap: 6,
730
+ align: "flex-start",
731
+ children: [
732
+ /*#__PURE__*/ jsx(Label, {
733
+ children: "True Label"
734
+ }),
735
+ /*#__PURE__*/ jsx(Input, {
736
+ value: decisionData.trueLabel,
737
+ onChange: (e)=>setDecisionData((prev)=>({
738
+ ...prev,
739
+ trueLabel: e.target.value
740
+ }))
741
+ })
742
+ ]
611
743
  }),
612
- label: "Has Default Output"
613
- })
744
+ /*#__PURE__*/ jsxs(Column, {
745
+ gap: 6,
746
+ align: "flex-start",
747
+ children: [
748
+ /*#__PURE__*/ jsx(Label, {
749
+ children: "False Label"
750
+ }),
751
+ /*#__PURE__*/ jsx(Input, {
752
+ value: decisionData.falseLabel,
753
+ onChange: (e)=>setDecisionData((prev)=>({
754
+ ...prev,
755
+ falseLabel: e.target.value
756
+ }))
757
+ })
758
+ ]
759
+ })
760
+ ]
614
761
  }),
615
- /*#__PURE__*/ jsx(ApButton, {
616
- size: "small",
762
+ /*#__PURE__*/ jsx(Button, {
763
+ size: "sm",
617
764
  variant: "secondary",
618
- label: "Reset",
619
- onClick: ()=>setNodeData({
765
+ onClick: ()=>{
766
+ setSwitchData({
620
767
  dynamicInputs: [
621
768
  {
622
769
  label: 'Primary Input'
@@ -628,7 +775,13 @@ function DynamicHandlesStory() {
628
775
  }
629
776
  ],
630
777
  hasDefault: false
631
- })
778
+ });
779
+ setDecisionData({
780
+ trueLabel: 'Approved',
781
+ falseLabel: 'Rejected'
782
+ });
783
+ },
784
+ children: "Reset All"
632
785
  })
633
786
  ]
634
787
  })
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAynBxD,eAAO,MAAM,SAAS,8CA/mBa,cAAc,6CA+mBA,CAAC"}
1
+ {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAwnBxD,eAAO,MAAM,SAAS,8CA9mBa,cAAc,6CA8mBA,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAuBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KA2DrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAyLF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AAyHF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC"}
1
+ {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAuBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KA2DrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAyLF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AAuHF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-instance/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,eAAe,GAChB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5F,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-instance/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,eAAe,GAChB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5F,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
@@ -74,14 +74,23 @@ function createNode(options) {
74
74
  x: 0,
75
75
  y: 0
76
76
  }, data = {}, display, handleConfigurations, selected = false, useSmartHandles, executionStatus } = options;
77
+ const resolvedHandleConfigs = handleConfigurations ?? data.handleConfigurations;
78
+ const resolvedSmartHandles = useSmartHandles ?? data.useSmartHandles;
79
+ const resolvedExecutionStatus = executionStatus ?? data.executionStatus;
77
80
  const baseData = {
78
81
  nodeType: type,
79
82
  version: data.version || '1.0.0',
80
83
  parameters: data.parameters || {},
81
84
  display: display || data.display,
82
- handleConfigurations: handleConfigurations || data.handleConfigurations,
83
- useSmartHandles: useSmartHandles ?? data.useSmartHandles,
84
- executionStatus: executionStatus || data.executionStatus
85
+ ...void 0 !== resolvedHandleConfigs && {
86
+ handleConfigurations: resolvedHandleConfigs
87
+ },
88
+ ...void 0 !== resolvedSmartHandles && {
89
+ useSmartHandles: resolvedSmartHandles
90
+ },
91
+ ...void 0 !== resolvedExecutionStatus && {
92
+ executionStatus: resolvedExecutionStatus
93
+ }
85
94
  };
86
95
  return {
87
96
  id,
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../src/canvas/storybook-utils/mocks/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAKnF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBhB,CAAC;AAKX,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE5D,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEpC,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IAEjC,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IAEF,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,eAAe,CAA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BAAiB,CAAC,CAAC,CAAC,GAC5B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAsCxB;AAiBD,wBAAgB,cAAc,CAAC,OAAO,EAAE;IAEtC,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,KAAK,CACT,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CACzF,CAAC;IAEF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,CAuCvB;AAKD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAsCE,MAAM,EAAE;;;;;;;;;CAW1B,CAAC;AAkBX,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,iBAAiB,CAAC,GAC5D,IAAI,CAAC,YAAY,CAAC,EAAE,CA6BtB"}
@@ -42,14 +42,23 @@ function createNode(options) {
42
42
  x: 0,
43
43
  y: 0
44
44
  }, data = {}, display, handleConfigurations, selected = false, useSmartHandles, executionStatus } = options;
45
+ const resolvedHandleConfigs = handleConfigurations ?? data.handleConfigurations;
46
+ const resolvedSmartHandles = useSmartHandles ?? data.useSmartHandles;
47
+ const resolvedExecutionStatus = executionStatus ?? data.executionStatus;
45
48
  const baseData = {
46
49
  nodeType: type,
47
50
  version: data.version || '1.0.0',
48
51
  parameters: data.parameters || {},
49
52
  display: display || data.display,
50
- handleConfigurations: handleConfigurations || data.handleConfigurations,
51
- useSmartHandles: useSmartHandles ?? data.useSmartHandles,
52
- executionStatus: executionStatus || data.executionStatus
53
+ ...void 0 !== resolvedHandleConfigs && {
54
+ handleConfigurations: resolvedHandleConfigs
55
+ },
56
+ ...void 0 !== resolvedSmartHandles && {
57
+ useSmartHandles: resolvedSmartHandles
58
+ },
59
+ ...void 0 !== resolvedExecutionStatus && {
60
+ executionStatus: resolvedExecutionStatus
61
+ }
53
62
  };
54
63
  return {
55
64
  id,
@@ -75,6 +75,7 @@ function resolveHandles(handleGroups, context) {
75
75
  const indexVar = handle.indexVar || 'index';
76
76
  return array.map((item, index)=>{
77
77
  const vars = {
78
+ ...context,
78
79
  [itemVar]: item,
79
80
  [indexVar]: index
80
81
  };
@@ -97,6 +98,8 @@ function resolveHandles(handleGroups, context) {
97
98
  const visible = isCollapsed && isArtifactHandle ? false : baseVisible;
98
99
  return {
99
100
  ...handle,
101
+ id: replaceTemplateVars(handle.id, context),
102
+ label: handle.label ? replaceTemplateVars(handle.label, context) : void 0,
100
103
  visible
101
104
  };
102
105
  });
@@ -2,7 +2,7 @@ import type { HandleActionEvent } from '../components/ButtonHandle/ButtonHandle'
2
2
  import type { HandleGroupManifest, HandleManifest } from '../schema/node-definition/handle';
3
3
  import type { NodeDisplayManifest } from '../schema/node-definition/node-manifest';
4
4
  import type { InstanceDisplayConfig } from '../schema/node-instance';
5
- export interface ResolutionContext {
5
+ export interface ResolutionContext extends Record<string, unknown> {
6
6
  display?: InstanceDisplayConfig;
7
7
  inputs?: Record<string, unknown>;
8
8
  nodeId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-resolver.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/manifest-resolver.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC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MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;IAE7F,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE,OAAO,CAAC;IAEjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC/C;AAKD,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC;IAE/E,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAKD,UAAU,YAAY;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD,wBAAgB,cAAc,CAC5B,eAAe,CAAC,EAAE,mBAAmB,EACrC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,eAAe,CAoBjB;AA6BD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,EACrC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAmBT;AAiCD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAKhF;AAuCD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,mBAAmB,EAAE,EACnC,OAAO,EAAE,iBAAiB,GACzB,mBAAmB,EAAE,CAkEvB"}
@@ -44,6 +44,7 @@ function resolveHandles(handleGroups, context) {
44
44
  const indexVar = handle.indexVar || 'index';
45
45
  return array.map((item, index)=>{
46
46
  const vars = {
47
+ ...context,
47
48
  [itemVar]: item,
48
49
  [indexVar]: index
49
50
  };
@@ -66,6 +67,8 @@ function resolveHandles(handleGroups, context) {
66
67
  const visible = isCollapsed && isArtifactHandle ? false : baseVisible;
67
68
  return {
68
69
  ...handle,
70
+ id: replaceTemplateVars(handle.id, context),
71
+ label: handle.label ? replaceTemplateVars(handle.label, context) : void 0,
69
72
  visible
70
73
  };
71
74
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "3.34.1",
3
+ "version": "3.34.2",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",