@fluxo-dev/shell-workflow 26.2.1 → 26.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import React, { forwardRef, createElement as createElement$2, useState, useEffect, memo, useMemo, useContext, createContext, useCallback, useRef, useLayoutEffect } from 'react';
3
- import { Box, Group, Text, Tooltip, ActionIcon, ScrollArea, Stack, UnstyledButton, Modal, Button, Menu, Select, TextInput, Checkbox, NumberInput, Textarea, JsonInput, Collapse, Badge, Paper, Divider, SimpleGrid, Center, Table, Accordion, Alert, Loader, Switch, PasswordInput, CloseButton } from '@mantine/core';
3
+ import { Box, Group, Text, Tooltip, ActionIcon, ScrollArea, Stack, UnstyledButton, Modal, Button, Menu, Select, TextInput, Checkbox, NumberInput, Textarea, JsonInput, Collapse, Badge, Paper, Accordion, Divider, SimpleGrid, Center, Table, Alert, Loader, Switch, PasswordInput, CloseButton } from '@mantine/core';
4
4
  import { WorkflowStatus, FluxoClientSys, PointerStatus, ActionInputTypeEnum, NodeTypeEnum, FluxoStateDispatcher, DynamicPortType, BlockConfigFieldType, EmbeddedModule } from '@fluxo-dev/api-client-base';
5
5
  import { notifications } from '@mantine/notifications';
6
6
  import { WaitData, SlidingPanel, ShellSessionContext, DataCard, NoData } from '@fluxo-dev/ui-components';
@@ -100012,35 +100012,387 @@ const useTriggerDefinitions = () => {
100012
100012
  };
100013
100013
  };
100014
100014
 
100015
+ var anObject$a = anObject$r;
100016
+
100017
+ // `RegExp.prototype.flags` getter implementation
100018
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
100019
+ var regexpFlags$1 = function () {
100020
+ var that = anObject$a(this);
100021
+ var result = '';
100022
+ if (that.hasIndices) result += 'd';
100023
+ if (that.global) result += 'g';
100024
+ if (that.ignoreCase) result += 'i';
100025
+ if (that.multiline) result += 'm';
100026
+ if (that.dotAll) result += 's';
100027
+ if (that.unicode) result += 'u';
100028
+ if (that.unicodeSets) result += 'v';
100029
+ if (that.sticky) result += 'y';
100030
+ return result;
100031
+ };
100032
+
100033
+ var call$c = functionCall;
100034
+ var hasOwn$2 = hasOwnProperty_1;
100035
+ var isPrototypeOf$1 = objectIsPrototypeOf;
100036
+ var regExpFlags = regexpFlags$1;
100037
+
100038
+ var RegExpPrototype$4 = RegExp.prototype;
100039
+
100040
+ var regexpGetFlags = function (R) {
100041
+ var flags = R.flags;
100042
+ return flags === undefined && !('flags' in RegExpPrototype$4) && !hasOwn$2(R, 'flags') && isPrototypeOf$1(RegExpPrototype$4, R)
100043
+ ? call$c(regExpFlags, R) : flags;
100044
+ };
100045
+
100046
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
100047
+ var defineBuiltIn$4 = defineBuiltIn$9;
100048
+ var anObject$9 = anObject$r;
100049
+ var $toString = toString$h;
100050
+ var fails$c = fails$x;
100051
+ var getRegExpFlags$2 = regexpGetFlags;
100052
+
100053
+ var TO_STRING = 'toString';
100054
+ var RegExpPrototype$3 = RegExp.prototype;
100055
+ var nativeToString = RegExpPrototype$3[TO_STRING];
100056
+
100057
+ var NOT_GENERIC = fails$c(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
100058
+ // FF44- RegExp#toString has a wrong name
100059
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
100060
+
100061
+ // `RegExp.prototype.toString` method
100062
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
100063
+ if (NOT_GENERIC || INCORRECT_NAME) {
100064
+ defineBuiltIn$4(RegExpPrototype$3, TO_STRING, function toString() {
100065
+ var R = anObject$9(this);
100066
+ var pattern = $toString(R.source);
100067
+ var flags = $toString(getRegExpFlags$2(R));
100068
+ return '/' + pattern + '/' + flags;
100069
+ }, { unsafe: true });
100070
+ }
100071
+
100015
100072
  /**
100016
- * Get handle color based on handle ID/outcome
100073
+ * Create a new action node with optional position
100017
100074
  */
100018
- const getHandleColor = handleId => {
100019
- if (!handleId) return COLORS.handle.default;
100020
- const lowerHandle = handleId.toLowerCase();
100021
- if (lowerHandle.includes('success') || lowerHandle === 'true') {
100022
- return COLORS.handle.success;
100075
+ const createActionNode = (action, position) => {
100076
+ // Determine source handles from outcomes
100077
+ const sourceHandles = action.outcomes && action.outcomes.length > 0 ? action.outcomes.filter(outcome => outcome && outcome.trim() !== '') : ['default'];
100078
+ return {
100079
+ id: `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
100080
+ type: 'action',
100081
+ position: position || {
100082
+ x: Math.random() * 400,
100083
+ y: Math.random() * 400
100084
+ },
100085
+ data: {
100086
+ label: action.name,
100087
+ nodeType: NodeTypeEnum.Action,
100088
+ stepType: action.id,
100089
+ inputs: {},
100090
+ outputs: {},
100091
+ handles: {
100092
+ source: sourceHandles,
100093
+ target: ['default']
100094
+ }
100095
+ }
100096
+ };
100097
+ };
100098
+ /**
100099
+ * Create a new primitive node
100100
+ */
100101
+ const createPrimitiveNode = (primitiveType, label, position) => {
100102
+ const handles = getPrimitiveHandles(primitiveType);
100103
+ return {
100104
+ id: `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
100105
+ type: 'default',
100106
+ position: position || {
100107
+ x: Math.random() * 400 + 100,
100108
+ y: Math.random() * 400 + 100
100109
+ },
100110
+ data: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
100111
+ label,
100112
+ nodeType: primitiveType,
100113
+ inputs: {},
100114
+ outputs: {},
100115
+ handles
100116
+ }, primitiveType === NodeTypeEnum.While && {
100117
+ condition: ''
100118
+ }), primitiveType === NodeTypeEnum.ForEach && {
100119
+ collection: ''
100120
+ }), primitiveType === NodeTypeEnum.Decision && {
100121
+ condition: ''
100122
+ }), primitiveType === NodeTypeEnum.Delay && {
100123
+ interval: '00:00:10'
100124
+ }), primitiveType === NodeTypeEnum.Schedule && {
100125
+ interval: '00:01:00'
100126
+ }), primitiveType === NodeTypeEnum.WaitForEvent && {
100127
+ eventName: ''
100128
+ })
100129
+ };
100130
+ };
100131
+ /**
100132
+ * Create trigger node (replaces Start node)
100133
+ * Triggers are always initial nodes and can have inputs/outputs like actions
100134
+ */
100135
+ const createTriggerNode = (trigger, position, workflowId) => {
100136
+ return {
100137
+ id: `trigger-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
100138
+ type: 'trigger',
100139
+ position: position || {
100140
+ x: 250,
100141
+ y: 50
100142
+ },
100143
+ data: {
100144
+ label: trigger.name,
100145
+ nodeType: NodeTypeEnum.Action,
100146
+ // Triggers are treated as actions with no incoming connections
100147
+ stepType: trigger.id,
100148
+ // Trigger ID (e.g., "manual-trigger", "http-trigger")
100149
+ inputs: {},
100150
+ // Can be populated like action inputs
100151
+ outputs: {},
100152
+ // Can have outputs like actions
100153
+ handles: {
100154
+ source: ['default'],
100155
+ // Triggers always have output
100156
+ target: [] // Triggers NEVER have input (always root nodes)
100157
+ },
100158
+ // Pass trigger metadata for runtime execution
100159
+ triggerInputs: trigger.inputs || [],
100160
+ // Input definitions for modal
100161
+ workflowId: workflowId // Workflow ID for execution
100162
+ } // Use 'as any' to extend NodeData with custom props
100163
+ };
100164
+ };
100165
+ /**
100166
+ * Create start node (DEPRECATED - use createTriggerNode instead)
100167
+ * Kept for backward compatibility
100168
+ */
100169
+ const createStartNode = () => {
100170
+ return {
100171
+ id: 'start',
100172
+ type: 'start',
100173
+ position: {
100174
+ x: 250,
100175
+ y: 50
100176
+ },
100177
+ data: {
100178
+ label: 'Start (Manual)',
100179
+ nodeType: NodeTypeEnum.Start,
100180
+ stepType: 'manual-trigger',
100181
+ // Map to manual trigger
100182
+ inputs: {},
100183
+ outputs: {},
100184
+ handles: {
100185
+ source: ['default'],
100186
+ target: []
100187
+ }
100188
+ }
100189
+ };
100190
+ };
100191
+
100192
+ /**
100193
+ * Hook for node operations (add, update, delete)
100194
+ */
100195
+ const useNodeOperations$1 = (nodes, setNodes, workflowId) => {
100196
+ const addActionNode = useCallback((action, position) => {
100197
+ console.log('➕ Adding action node:', action.name, 'at position:', position);
100198
+ const newNode = createActionNode(action, position);
100199
+ setNodes(nds => [...nds, newNode]);
100200
+ }, [setNodes]);
100201
+ const addPrimitiveNode = useCallback((primitiveType, label, position) => {
100202
+ console.log('➕ Adding primitive node:', label, 'at position:', position);
100203
+ const newNode = createPrimitiveNode(primitiveType, label, position);
100204
+ setNodes(nds => [...nds, newNode]);
100205
+ }, [setNodes]);
100206
+ const addTriggerNode = useCallback((trigger, position) => {
100207
+ console.log('➕ Adding trigger node:', trigger.name, 'at position:', position, 'workflowId:', workflowId);
100208
+ // If no position provided, find a position for the new trigger (stack them vertically)
100209
+ let finalPosition = position;
100210
+ if (!finalPosition) {
100211
+ const existingTriggers = nodes.filter(n => {
100212
+ var _a, _b;
100213
+ return ((_b = (_a = n.data.handles) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.length) === 0;
100214
+ });
100215
+ const yPosition = 50 + existingTriggers.length * 150;
100216
+ finalPosition = {
100217
+ x: 250,
100218
+ y: yPosition
100219
+ };
100220
+ }
100221
+ const newNode = createTriggerNode(trigger, finalPosition, workflowId);
100222
+ setNodes(nds => [...nds, newNode]);
100223
+ }, [setNodes, nodes, workflowId]);
100224
+ const addStartNode = useCallback(() => {
100225
+ console.log('➕ Adding start node');
100226
+ const startNode = createStartNode();
100227
+ setNodes([startNode]);
100228
+ }, [setNodes]);
100229
+ const updateNodeData = useCallback((nodeId, data) => {
100230
+ console.log('🔄 Updating node data:', nodeId, data);
100231
+ setNodes(nds => nds.map(node => node.id === nodeId ? Object.assign(Object.assign({}, node), {
100232
+ data: Object.assign(Object.assign({}, node.data), data)
100233
+ }) : node));
100234
+ }, [setNodes]);
100235
+ const deleteNode = useCallback(nodeId => {
100236
+ console.log('🗑️ Deleting node:', nodeId);
100237
+ setNodes(nds => nds.filter(node => node.id !== nodeId));
100238
+ }, [setNodes]);
100239
+ return {
100240
+ addActionNode,
100241
+ addPrimitiveNode,
100242
+ addTriggerNode,
100243
+ addStartNode,
100244
+ updateNodeData,
100245
+ deleteNode
100246
+ };
100247
+ };
100248
+
100249
+ var isArray$1 = isArray$4;
100250
+ var lengthOfArrayLike$1 = lengthOfArrayLike$7;
100251
+ var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
100252
+ var bind$3 = functionBindContext;
100253
+
100254
+ // `FlattenIntoArray` abstract operation
100255
+ // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
100256
+ var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
100257
+ var targetIndex = start;
100258
+ var sourceIndex = 0;
100259
+ var mapFn = mapper ? bind$3(mapper, thisArg) : false;
100260
+ var element, elementLen;
100261
+
100262
+ while (sourceIndex < sourceLen) {
100263
+ if (sourceIndex in source) {
100264
+ element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
100265
+
100266
+ if (depth > 0 && isArray$1(element)) {
100267
+ elementLen = lengthOfArrayLike$1(element);
100268
+ targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
100269
+ } else {
100270
+ doesNotExceedSafeInteger(targetIndex + 1);
100271
+ target[targetIndex] = element;
100272
+ }
100273
+
100274
+ targetIndex++;
100275
+ }
100276
+ sourceIndex++;
100023
100277
  }
100024
- if (lowerHandle.includes('fail') || lowerHandle.includes('error') || lowerHandle === 'false') {
100025
- return COLORS.handle.fail;
100278
+ return targetIndex;
100279
+ };
100280
+
100281
+ var flattenIntoArray_1 = flattenIntoArray$1;
100282
+
100283
+ var uncurryThis$c = functionUncurryThis;
100284
+ var fails$b = fails$x;
100285
+ var isCallable$8 = isCallable$s;
100286
+ var classof$2 = classof$9;
100287
+ var getBuiltIn$3 = getBuiltIn$a;
100288
+ var inspectSource$1 = inspectSource$3;
100289
+
100290
+ var noop = function () { /* empty */ };
100291
+ var construct = getBuiltIn$3('Reflect', 'construct');
100292
+ var constructorRegExp = /^\s*(?:class|function)\b/;
100293
+ var exec$3 = uncurryThis$c(constructorRegExp.exec);
100294
+ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
100295
+
100296
+ var isConstructorModern = function isConstructor(argument) {
100297
+ if (!isCallable$8(argument)) return false;
100298
+ try {
100299
+ construct(noop, [], argument);
100300
+ return true;
100301
+ } catch (error) {
100302
+ return false;
100026
100303
  }
100027
- if (lowerHandle.includes('timeout') || lowerHandle.includes('warning')) {
100028
- return COLORS.handle.timeout;
100304
+ };
100305
+
100306
+ var isConstructorLegacy = function isConstructor(argument) {
100307
+ if (!isCallable$8(argument)) return false;
100308
+ switch (classof$2(argument)) {
100309
+ case 'AsyncFunction':
100310
+ case 'GeneratorFunction':
100311
+ case 'AsyncGeneratorFunction': return false;
100029
100312
  }
100030
- if (lowerHandle.includes('default') || lowerHandle.includes('parallel')) {
100031
- return COLORS.handle.default;
100313
+ try {
100314
+ // we can't check .prototype since constructors produced by .bind haven't it
100315
+ // `Function#toString` throws on some built-it function in some legacy engines
100316
+ // (for example, `DOMQuad` and similar in FF41-)
100317
+ return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource$1(argument));
100318
+ } catch (error) {
100319
+ return true;
100032
100320
  }
100033
- return COLORS.handle.neutral;
100034
100321
  };
100035
- /**
100036
- * Check if handle is an outcome (not default)
100037
- */
100038
- const isOutcomeHandle = handleId => {
100039
- return handleId !== null && handleId !== undefined && handleId !== 'default';
100322
+
100323
+ isConstructorLegacy.sham = true;
100324
+
100325
+ // `IsConstructor` abstract operation
100326
+ // https://tc39.es/ecma262/#sec-isconstructor
100327
+ var isConstructor$2 = !construct || fails$b(function () {
100328
+ var called;
100329
+ return isConstructorModern(isConstructorModern.call)
100330
+ || !isConstructorModern(Object)
100331
+ || !isConstructorModern(function () { called = true; })
100332
+ || called;
100333
+ }) ? isConstructorLegacy : isConstructorModern;
100334
+
100335
+ var isArray = isArray$4;
100336
+ var isConstructor$1 = isConstructor$2;
100337
+ var isObject$4 = isObject$g;
100338
+ var wellKnownSymbol$8 = wellKnownSymbol$n;
100339
+
100340
+ var SPECIES$4 = wellKnownSymbol$8('species');
100341
+ var $Array = Array;
100342
+
100343
+ // a part of `ArraySpeciesCreate` abstract operation
100344
+ // https://tc39.es/ecma262/#sec-arrayspeciescreate
100345
+ var arraySpeciesConstructor$1 = function (originalArray) {
100346
+ var C;
100347
+ if (isArray(originalArray)) {
100348
+ C = originalArray.constructor;
100349
+ // cross-realm fallback
100350
+ if (isConstructor$1(C) && (C === $Array || isArray(C.prototype))) C = undefined;
100351
+ else if (isObject$4(C)) {
100352
+ C = C[SPECIES$4];
100353
+ if (C === null) C = undefined;
100354
+ }
100355
+ } return C === undefined ? $Array : C;
100356
+ };
100357
+
100358
+ var arraySpeciesConstructor = arraySpeciesConstructor$1;
100359
+
100360
+ // `ArraySpeciesCreate` abstract operation
100361
+ // https://tc39.es/ecma262/#sec-arrayspeciescreate
100362
+ var arraySpeciesCreate$1 = function (originalArray, length) {
100363
+ return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
100040
100364
  };
100041
100365
 
100042
100366
  var $$i = _export;
100043
- var uncurryThis$c = functionUncurryThisClause;
100367
+ var flattenIntoArray = flattenIntoArray_1;
100368
+ var aCallable$6 = aCallable$k;
100369
+ var toObject$1 = toObject$8;
100370
+ var lengthOfArrayLike = lengthOfArrayLike$7;
100371
+ var arraySpeciesCreate = arraySpeciesCreate$1;
100372
+
100373
+ // `Array.prototype.flatMap` method
100374
+ // https://tc39.es/ecma262/#sec-array.prototype.flatmap
100375
+ $$i({ target: 'Array', proto: true }, {
100376
+ flatMap: function flatMap(callbackfn /* , thisArg */) {
100377
+ var O = toObject$1(this);
100378
+ var sourceLen = lengthOfArrayLike(O);
100379
+ var A;
100380
+ aCallable$6(callbackfn);
100381
+ A = arraySpeciesCreate(O, 0);
100382
+ A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
100383
+ return A;
100384
+ }
100385
+ });
100386
+
100387
+ // this method was added to unscopables after implementation
100388
+ // in popular engines, so it's moved to a separate module
100389
+ var addToUnscopables = addToUnscopables$3;
100390
+
100391
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
100392
+ addToUnscopables('flatMap');
100393
+
100394
+ var $$h = _export;
100395
+ var uncurryThis$b = functionUncurryThisClause;
100044
100396
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
100045
100397
  var toLength$2 = toLength$4;
100046
100398
  var toString$a = toString$h;
@@ -100048,7 +100400,7 @@ var notARegExp = notARegexp;
100048
100400
  var requireObjectCoercible$5 = requireObjectCoercible$b;
100049
100401
  var correctIsRegExpLogic = correctIsRegexpLogic;
100050
100402
 
100051
- var stringSlice$8 = uncurryThis$c(''.slice);
100403
+ var stringSlice$8 = uncurryThis$b(''.slice);
100052
100404
  var min$2 = Math.min;
100053
100405
 
100054
100406
  var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
@@ -100060,7 +100412,7 @@ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
100060
100412
 
100061
100413
  // `String.prototype.startsWith` method
100062
100414
  // https://tc39.es/ecma262/#sec-string.prototype.startswith
100063
- $$i({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
100415
+ $$h({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
100064
100416
  startsWith: function startsWith(searchString /* , position = 0 */) {
100065
100417
  var that = toString$a(requireObjectCoercible$5(this));
100066
100418
  notARegExp(searchString);
@@ -100070,6 +100422,89 @@ $$i({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_RE
100070
100422
  }
100071
100423
  });
100072
100424
 
100425
+ var call$b = functionCall;
100426
+ var anObject$8 = anObject$r;
100427
+ var getIteratorDirect$2 = getIteratorDirect$a;
100428
+ var getIteratorMethod = getIteratorMethod$3;
100429
+
100430
+ var getIteratorFlattenable$1 = function (obj, stringHandling) {
100431
+ if (!stringHandling || typeof obj !== 'string') anObject$8(obj);
100432
+ var method = getIteratorMethod(obj);
100433
+ return getIteratorDirect$2(anObject$8(method !== undefined ? call$b(method, obj) : obj));
100434
+ };
100435
+
100436
+ var $$g = _export;
100437
+ var call$a = functionCall;
100438
+ var aCallable$5 = aCallable$k;
100439
+ var anObject$7 = anObject$r;
100440
+ var getIteratorDirect$1 = getIteratorDirect$a;
100441
+ var getIteratorFlattenable = getIteratorFlattenable$1;
100442
+ var createIteratorProxy = iteratorCreateProxy;
100443
+ var iteratorClose = iteratorClose$6;
100444
+ var IS_PURE = isPure;
100445
+
100446
+ var IteratorProxy = createIteratorProxy(function () {
100447
+ var iterator = this.iterator;
100448
+ var mapper = this.mapper;
100449
+ var result, inner;
100450
+
100451
+ while (true) {
100452
+ if (inner = this.inner) try {
100453
+ result = anObject$7(call$a(inner.next, inner.iterator));
100454
+ if (!result.done) return result.value;
100455
+ this.inner = null;
100456
+ } catch (error) { iteratorClose(iterator, 'throw', error); }
100457
+
100458
+ result = anObject$7(call$a(this.next, iterator));
100459
+
100460
+ if (this.done = !!result.done) return;
100461
+
100462
+ try {
100463
+ this.inner = getIteratorFlattenable(mapper(result.value, this.counter++), false);
100464
+ } catch (error) { iteratorClose(iterator, 'throw', error); }
100465
+ }
100466
+ });
100467
+
100468
+ // `Iterator.prototype.flatMap` method
100469
+ // https://github.com/tc39/proposal-iterator-helpers
100470
+ $$g({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
100471
+ flatMap: function flatMap(mapper) {
100472
+ anObject$7(this);
100473
+ aCallable$5(mapper);
100474
+ return new IteratorProxy(getIteratorDirect$1(this), {
100475
+ mapper: mapper,
100476
+ inner: null
100477
+ });
100478
+ }
100479
+ });
100480
+
100481
+ /**
100482
+ * Get handle color based on handle ID/outcome
100483
+ */
100484
+ const getHandleColor = handleId => {
100485
+ if (!handleId) return COLORS.handle.default;
100486
+ const lowerHandle = handleId.toLowerCase();
100487
+ if (lowerHandle.includes('success') || lowerHandle === 'true') {
100488
+ return COLORS.handle.success;
100489
+ }
100490
+ if (lowerHandle.includes('fail') || lowerHandle.includes('error') || lowerHandle === 'false') {
100491
+ return COLORS.handle.fail;
100492
+ }
100493
+ if (lowerHandle.includes('timeout') || lowerHandle.includes('warning')) {
100494
+ return COLORS.handle.timeout;
100495
+ }
100496
+ if (lowerHandle.includes('default') || lowerHandle.includes('parallel')) {
100497
+ return COLORS.handle.default;
100498
+ }
100499
+ return COLORS.handle.neutral;
100500
+ };
100501
+ /**
100502
+ * Check if handle is an outcome (not default)
100503
+ */
100504
+ const isOutcomeHandle = handleId => {
100505
+ return handleId !== null && handleId !== undefined && handleId !== 'default';
100506
+ };
100507
+
100073
100508
  /**
100074
100509
  * Validate that all outcomes are connected
100075
100510
  */
@@ -100123,31 +100558,13 @@ const cleanRecord = record => {
100123
100558
  return cleaned;
100124
100559
  };
100125
100560
 
100126
- var anObject$a = anObject$r;
100127
-
100128
- // `RegExp.prototype.flags` getter implementation
100129
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
100130
- var regexpFlags$1 = function () {
100131
- var that = anObject$a(this);
100132
- var result = '';
100133
- if (that.hasIndices) result += 'd';
100134
- if (that.global) result += 'g';
100135
- if (that.ignoreCase) result += 'i';
100136
- if (that.multiline) result += 'm';
100137
- if (that.dotAll) result += 's';
100138
- if (that.unicode) result += 'u';
100139
- if (that.unicodeSets) result += 'v';
100140
- if (that.sticky) result += 'y';
100141
- return result;
100142
- };
100143
-
100144
- var fails$c = fails$x;
100561
+ var fails$a = fails$x;
100145
100562
  var global$d = global$s;
100146
100563
 
100147
100564
  // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
100148
100565
  var $RegExp$2 = global$d.RegExp;
100149
100566
 
100150
- var UNSUPPORTED_Y$3 = fails$c(function () {
100567
+ var UNSUPPORTED_Y$3 = fails$a(function () {
100151
100568
  var re = $RegExp$2('a', 'y');
100152
100569
  re.lastIndex = 2;
100153
100570
  return re.exec('abcd') !== null;
@@ -100155,11 +100572,11 @@ var UNSUPPORTED_Y$3 = fails$c(function () {
100155
100572
 
100156
100573
  // UC Browser bug
100157
100574
  // https://github.com/zloirock/core-js/issues/1008
100158
- var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$c(function () {
100575
+ var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$a(function () {
100159
100576
  return !$RegExp$2('a', 'y').sticky;
100160
100577
  });
100161
100578
 
100162
- var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$c(function () {
100579
+ var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$a(function () {
100163
100580
  // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
100164
100581
  var re = $RegExp$2('^r', 'gy');
100165
100582
  re.lastIndex = 2;
@@ -100172,24 +100589,24 @@ var regexpStickyHelpers = {
100172
100589
  UNSUPPORTED_Y: UNSUPPORTED_Y$3
100173
100590
  };
100174
100591
 
100175
- var fails$b = fails$x;
100592
+ var fails$9 = fails$x;
100176
100593
  var global$c = global$s;
100177
100594
 
100178
100595
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
100179
100596
  var $RegExp$1 = global$c.RegExp;
100180
100597
 
100181
- var regexpUnsupportedDotAll = fails$b(function () {
100598
+ var regexpUnsupportedDotAll = fails$9(function () {
100182
100599
  var re = $RegExp$1('.', 's');
100183
100600
  return !(re.dotAll && re.test('\n') && re.flags === 's');
100184
100601
  });
100185
100602
 
100186
- var fails$a = fails$x;
100603
+ var fails$8 = fails$x;
100187
100604
  var global$b = global$s;
100188
100605
 
100189
100606
  // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
100190
100607
  var $RegExp = global$b.RegExp;
100191
100608
 
100192
- var regexpUnsupportedNcg = fails$a(function () {
100609
+ var regexpUnsupportedNcg = fails$8(function () {
100193
100610
  var re = $RegExp('(?<a>b)', 'g');
100194
100611
  return re.exec('b').groups.a !== 'b' ||
100195
100612
  'b'.replace(re, '$<a>c') !== 'bc';
@@ -100197,8 +100614,8 @@ var regexpUnsupportedNcg = fails$a(function () {
100197
100614
 
100198
100615
  /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
100199
100616
  /* eslint-disable regexp/no-useless-quantifier -- testing */
100200
- var call$c = functionCall;
100201
- var uncurryThis$b = functionUncurryThis;
100617
+ var call$9 = functionCall;
100618
+ var uncurryThis$a = functionUncurryThis;
100202
100619
  var toString$9 = toString$h;
100203
100620
  var regexpFlags = regexpFlags$1;
100204
100621
  var stickyHelpers$2 = regexpStickyHelpers;
@@ -100211,16 +100628,16 @@ var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
100211
100628
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
100212
100629
  var nativeExec = RegExp.prototype.exec;
100213
100630
  var patchedExec = nativeExec;
100214
- var charAt$5 = uncurryThis$b(''.charAt);
100215
- var indexOf$1 = uncurryThis$b(''.indexOf);
100216
- var replace$2 = uncurryThis$b(''.replace);
100217
- var stringSlice$7 = uncurryThis$b(''.slice);
100631
+ var charAt$5 = uncurryThis$a(''.charAt);
100632
+ var indexOf$1 = uncurryThis$a(''.indexOf);
100633
+ var replace$2 = uncurryThis$a(''.replace);
100634
+ var stringSlice$7 = uncurryThis$a(''.slice);
100218
100635
 
100219
100636
  var UPDATES_LAST_INDEX_WRONG = (function () {
100220
100637
  var re1 = /a/;
100221
100638
  var re2 = /b*/g;
100222
- call$c(nativeExec, re1, 'a');
100223
- call$c(nativeExec, re2, 'a');
100639
+ call$9(nativeExec, re1, 'a');
100640
+ call$9(nativeExec, re2, 'a');
100224
100641
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
100225
100642
  })();
100226
100643
 
@@ -100241,14 +100658,14 @@ if (PATCH) {
100241
100658
 
100242
100659
  if (raw) {
100243
100660
  raw.lastIndex = re.lastIndex;
100244
- result = call$c(patchedExec, raw, str);
100661
+ result = call$9(patchedExec, raw, str);
100245
100662
  re.lastIndex = raw.lastIndex;
100246
100663
  return result;
100247
100664
  }
100248
100665
 
100249
100666
  var groups = state.groups;
100250
100667
  var sticky = UNSUPPORTED_Y$2 && re.sticky;
100251
- var flags = call$c(regexpFlags, re);
100668
+ var flags = call$9(regexpFlags, re);
100252
100669
  var source = re.source;
100253
100670
  var charsAdded = 0;
100254
100671
  var strCopy = str;
@@ -100276,7 +100693,7 @@ if (PATCH) {
100276
100693
  }
100277
100694
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
100278
100695
 
100279
- match = call$c(nativeExec, sticky ? reCopy : re, strCopy);
100696
+ match = call$9(nativeExec, sticky ? reCopy : re, strCopy);
100280
100697
 
100281
100698
  if (sticky) {
100282
100699
  if (match) {
@@ -100291,7 +100708,7 @@ if (PATCH) {
100291
100708
  if (NPCG_INCLUDED && match && match.length > 1) {
100292
100709
  // Fix browsers whose `exec` methods don't consistently return `undefined`
100293
100710
  // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
100294
- call$c(nativeReplace, match[0], reCopy, function () {
100711
+ call$9(nativeReplace, match[0], reCopy, function () {
100295
100712
  for (i = 1; i < arguments.length - 2; i++) {
100296
100713
  if (arguments[i] === undefined) match[i] = undefined;
100297
100714
  }
@@ -100312,77 +100729,38 @@ if (PATCH) {
100312
100729
 
100313
100730
  var regexpExec$2 = patchedExec;
100314
100731
 
100315
- var $$h = _export;
100316
- var exec$3 = regexpExec$2;
100732
+ var $$f = _export;
100733
+ var exec$2 = regexpExec$2;
100317
100734
 
100318
100735
  // `RegExp.prototype.exec` method
100319
100736
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
100320
- $$h({ target: 'RegExp', proto: true, forced: /./.exec !== exec$3 }, {
100321
- exec: exec$3
100737
+ $$f({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
100738
+ exec: exec$2
100322
100739
  });
100323
100740
 
100324
- var call$b = functionCall;
100325
- var hasOwn$2 = hasOwnProperty_1;
100326
- var isPrototypeOf$1 = objectIsPrototypeOf;
100327
- var regExpFlags = regexpFlags$1;
100328
-
100329
- var RegExpPrototype$4 = RegExp.prototype;
100330
-
100331
- var regexpGetFlags = function (R) {
100332
- var flags = R.flags;
100333
- return flags === undefined && !('flags' in RegExpPrototype$4) && !hasOwn$2(R, 'flags') && isPrototypeOf$1(RegExpPrototype$4, R)
100334
- ? call$b(regExpFlags, R) : flags;
100335
- };
100336
-
100337
- var PROPER_FUNCTION_NAME = functionName.PROPER;
100338
- var defineBuiltIn$4 = defineBuiltIn$9;
100339
- var anObject$9 = anObject$r;
100340
- var $toString = toString$h;
100341
- var fails$9 = fails$x;
100342
- var getRegExpFlags$2 = regexpGetFlags;
100343
-
100344
- var TO_STRING = 'toString';
100345
- var RegExpPrototype$3 = RegExp.prototype;
100346
- var nativeToString = RegExpPrototype$3[TO_STRING];
100347
-
100348
- var NOT_GENERIC = fails$9(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
100349
- // FF44- RegExp#toString has a wrong name
100350
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
100351
-
100352
- // `RegExp.prototype.toString` method
100353
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
100354
- if (NOT_GENERIC || INCORRECT_NAME) {
100355
- defineBuiltIn$4(RegExpPrototype$3, TO_STRING, function toString() {
100356
- var R = anObject$9(this);
100357
- var pattern = $toString(R.source);
100358
- var flags = $toString(getRegExpFlags$2(R));
100359
- return '/' + pattern + '/' + flags;
100360
- }, { unsafe: true });
100361
- }
100362
-
100363
100741
  // TODO: Remove from `core-js@4` since it's moved to entry points
100364
100742
 
100365
- var call$a = functionCall;
100743
+ var call$8 = functionCall;
100366
100744
  var defineBuiltIn$3 = defineBuiltIn$9;
100367
100745
  var regexpExec$1 = regexpExec$2;
100368
- var fails$8 = fails$x;
100369
- var wellKnownSymbol$8 = wellKnownSymbol$n;
100746
+ var fails$7 = fails$x;
100747
+ var wellKnownSymbol$7 = wellKnownSymbol$n;
100370
100748
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$a;
100371
100749
 
100372
- var SPECIES$4 = wellKnownSymbol$8('species');
100750
+ var SPECIES$3 = wellKnownSymbol$7('species');
100373
100751
  var RegExpPrototype$2 = RegExp.prototype;
100374
100752
 
100375
100753
  var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
100376
- var SYMBOL = wellKnownSymbol$8(KEY);
100754
+ var SYMBOL = wellKnownSymbol$7(KEY);
100377
100755
 
100378
- var DELEGATES_TO_SYMBOL = !fails$8(function () {
100756
+ var DELEGATES_TO_SYMBOL = !fails$7(function () {
100379
100757
  // String methods call symbol-named RegExp methods
100380
100758
  var O = {};
100381
100759
  O[SYMBOL] = function () { return 7; };
100382
100760
  return ''[KEY](O) !== 7;
100383
100761
  });
100384
100762
 
100385
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$8(function () {
100763
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$7(function () {
100386
100764
  // Symbol-named RegExp methods call .exec
100387
100765
  var execCalled = false;
100388
100766
  var re = /a/;
@@ -100395,7 +100773,7 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
100395
100773
  // RegExp[@@split] doesn't call the regex's exec method, but first creates
100396
100774
  // a new one. We need to return the patched regex when creating the new one.
100397
100775
  re.constructor = {};
100398
- re.constructor[SPECIES$4] = function () { return re; };
100776
+ re.constructor[SPECIES$3] = function () { return re; };
100399
100777
  re.flags = '';
100400
100778
  re[SYMBOL] = /./[SYMBOL];
100401
100779
  }
@@ -100422,9 +100800,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
100422
100800
  // The native String method already delegates to @@method (this
100423
100801
  // polyfilled function), leasing to infinite recursion.
100424
100802
  // We avoid it by directly calling the native @@method method.
100425
- return { done: true, value: call$a(nativeRegExpMethod, regexp, str, arg2) };
100803
+ return { done: true, value: call$8(nativeRegExpMethod, regexp, str, arg2) };
100426
100804
  }
100427
- return { done: true, value: call$a(nativeMethod, str, regexp, arg2) };
100805
+ return { done: true, value: call$8(nativeMethod, str, regexp, arg2) };
100428
100806
  }
100429
100807
  return { done: false };
100430
100808
  });
@@ -100436,14 +100814,14 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
100436
100814
  if (SHAM) createNonEnumerableProperty$1(RegExpPrototype$2[SYMBOL], 'sham', true);
100437
100815
  };
100438
100816
 
100439
- var uncurryThis$a = functionUncurryThis;
100817
+ var uncurryThis$9 = functionUncurryThis;
100440
100818
  var toIntegerOrInfinity$3 = toIntegerOrInfinity$7;
100441
100819
  var toString$8 = toString$h;
100442
100820
  var requireObjectCoercible$4 = requireObjectCoercible$b;
100443
100821
 
100444
- var charAt$4 = uncurryThis$a(''.charAt);
100445
- var charCodeAt = uncurryThis$a(''.charCodeAt);
100446
- var stringSlice$6 = uncurryThis$a(''.slice);
100822
+ var charAt$4 = uncurryThis$9(''.charAt);
100823
+ var charCodeAt = uncurryThis$9(''.charCodeAt);
100824
+ var stringSlice$6 = uncurryThis$9(''.slice);
100447
100825
 
100448
100826
  var createMethod = function (CONVERT_TO_STRING) {
100449
100827
  return function ($this, pos) {
@@ -100478,13 +100856,13 @@ var advanceStringIndex$2 = function (S, index, unicode) {
100478
100856
  return index + (unicode ? charAt$3(S, index).length : 1);
100479
100857
  };
100480
100858
 
100481
- var uncurryThis$9 = functionUncurryThis;
100482
- var toObject$1 = toObject$8;
100859
+ var uncurryThis$8 = functionUncurryThis;
100860
+ var toObject = toObject$8;
100483
100861
 
100484
100862
  var floor$1 = Math.floor;
100485
- var charAt$2 = uncurryThis$9(''.charAt);
100486
- var replace$1 = uncurryThis$9(''.replace);
100487
- var stringSlice$5 = uncurryThis$9(''.slice);
100863
+ var charAt$2 = uncurryThis$8(''.charAt);
100864
+ var replace$1 = uncurryThis$8(''.replace);
100865
+ var stringSlice$5 = uncurryThis$8(''.slice);
100488
100866
  // eslint-disable-next-line redos/no-vulnerable -- safe
100489
100867
  var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
100490
100868
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
@@ -100496,7 +100874,7 @@ var getSubstitution$2 = function (matched, str, position, captures, namedCapture
100496
100874
  var m = captures.length;
100497
100875
  var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
100498
100876
  if (namedCaptures !== undefined) {
100499
- namedCaptures = toObject$1(namedCaptures);
100877
+ namedCaptures = toObject(namedCaptures);
100500
100878
  symbols = SUBSTITUTION_SYMBOLS;
100501
100879
  }
100502
100880
  return replace$1(replacement, symbols, function (match, ch) {
@@ -100524,10 +100902,10 @@ var getSubstitution$2 = function (matched, str, position, captures, namedCapture
100524
100902
  });
100525
100903
  };
100526
100904
 
100527
- var call$9 = functionCall;
100528
- var anObject$8 = anObject$r;
100529
- var isCallable$8 = isCallable$s;
100530
- var classof$2 = classofRaw$2;
100905
+ var call$7 = functionCall;
100906
+ var anObject$6 = anObject$r;
100907
+ var isCallable$7 = isCallable$s;
100908
+ var classof$1 = classofRaw$2;
100531
100909
  var regexpExec = regexpExec$2;
100532
100910
 
100533
100911
  var $TypeError$5 = TypeError;
@@ -100536,22 +100914,22 @@ var $TypeError$5 = TypeError;
100536
100914
  // https://tc39.es/ecma262/#sec-regexpexec
100537
100915
  var regexpExecAbstract = function (R, S) {
100538
100916
  var exec = R.exec;
100539
- if (isCallable$8(exec)) {
100540
- var result = call$9(exec, R, S);
100541
- if (result !== null) anObject$8(result);
100917
+ if (isCallable$7(exec)) {
100918
+ var result = call$7(exec, R, S);
100919
+ if (result !== null) anObject$6(result);
100542
100920
  return result;
100543
100921
  }
100544
- if (classof$2(R) === 'RegExp') return call$9(regexpExec, R, S);
100922
+ if (classof$1(R) === 'RegExp') return call$7(regexpExec, R, S);
100545
100923
  throw new $TypeError$5('RegExp#exec called on incompatible receiver');
100546
100924
  };
100547
100925
 
100548
100926
  var apply$1 = functionApply;
100549
- var call$8 = functionCall;
100550
- var uncurryThis$8 = functionUncurryThis;
100927
+ var call$6 = functionCall;
100928
+ var uncurryThis$7 = functionUncurryThis;
100551
100929
  var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
100552
- var fails$7 = fails$x;
100553
- var anObject$7 = anObject$r;
100554
- var isCallable$7 = isCallable$s;
100930
+ var fails$6 = fails$x;
100931
+ var anObject$5 = anObject$r;
100932
+ var isCallable$6 = isCallable$s;
100555
100933
  var isNullOrUndefined$3 = isNullOrUndefined$7;
100556
100934
  var toIntegerOrInfinity$2 = toIntegerOrInfinity$7;
100557
100935
  var toLength$1 = toLength$4;
@@ -100561,15 +100939,15 @@ var advanceStringIndex$1 = advanceStringIndex$2;
100561
100939
  var getMethod$2 = getMethod$7;
100562
100940
  var getSubstitution$1 = getSubstitution$2;
100563
100941
  var regExpExec$1 = regexpExecAbstract;
100564
- var wellKnownSymbol$7 = wellKnownSymbol$n;
100942
+ var wellKnownSymbol$6 = wellKnownSymbol$n;
100565
100943
 
100566
- var REPLACE$1 = wellKnownSymbol$7('replace');
100944
+ var REPLACE$1 = wellKnownSymbol$6('replace');
100567
100945
  var max$1 = Math.max;
100568
100946
  var min$1 = Math.min;
100569
- var concat = uncurryThis$8([].concat);
100570
- var push$1 = uncurryThis$8([].push);
100571
- var stringIndexOf$1 = uncurryThis$8(''.indexOf);
100572
- var stringSlice$4 = uncurryThis$8(''.slice);
100947
+ var concat = uncurryThis$7([].concat);
100948
+ var push$1 = uncurryThis$7([].push);
100949
+ var stringIndexOf$1 = uncurryThis$7(''.indexOf);
100950
+ var stringSlice$4 = uncurryThis$7(''.slice);
100573
100951
 
100574
100952
  var maybeToString = function (it) {
100575
100953
  return it === undefined ? it : String(it);
@@ -100590,7 +100968,7 @@ var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
100590
100968
  return false;
100591
100969
  })();
100592
100970
 
100593
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () {
100971
+ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$6(function () {
100594
100972
  var re = /./;
100595
100973
  re.exec = function () {
100596
100974
  var result = [];
@@ -100612,13 +100990,13 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
100612
100990
  var O = requireObjectCoercible$3(this);
100613
100991
  var replacer = isNullOrUndefined$3(searchValue) ? undefined : getMethod$2(searchValue, REPLACE$1);
100614
100992
  return replacer
100615
- ? call$8(replacer, searchValue, O, replaceValue)
100616
- : call$8(nativeReplace, toString$7(O), searchValue, replaceValue);
100993
+ ? call$6(replacer, searchValue, O, replaceValue)
100994
+ : call$6(nativeReplace, toString$7(O), searchValue, replaceValue);
100617
100995
  },
100618
100996
  // `RegExp.prototype[@@replace]` method
100619
100997
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
100620
100998
  function (string, replaceValue) {
100621
- var rx = anObject$7(this);
100999
+ var rx = anObject$5(this);
100622
101000
  var S = toString$7(string);
100623
101001
 
100624
101002
  if (
@@ -100630,7 +101008,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
100630
101008
  if (res.done) return res.value;
100631
101009
  }
100632
101010
 
100633
- var functionalReplace = isCallable$7(replaceValue);
101011
+ var functionalReplace = isCallable$6(replaceValue);
100634
101012
  if (!functionalReplace) replaceValue = toString$7(replaceValue);
100635
101013
 
100636
101014
  var global = rx.global;
@@ -100808,126 +101186,6 @@ const generateGuid = () => {
100808
101186
  });
100809
101187
  };
100810
101188
 
100811
- /**
100812
- * Create a new action node
100813
- */
100814
- const createActionNode = action => {
100815
- // Determine source handles from outcomes
100816
- const sourceHandles = action.outcomes && action.outcomes.length > 0 ? action.outcomes.filter(outcome => outcome && outcome.trim() !== '') : ['default'];
100817
- return {
100818
- id: `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
100819
- type: 'action',
100820
- position: {
100821
- x: Math.random() * 400,
100822
- y: Math.random() * 400
100823
- },
100824
- data: {
100825
- label: action.name,
100826
- nodeType: NodeTypeEnum.Action,
100827
- stepType: action.id,
100828
- inputs: {},
100829
- outputs: {},
100830
- handles: {
100831
- source: sourceHandles,
100832
- target: ['default']
100833
- }
100834
- }
100835
- };
100836
- };
100837
- /**
100838
- * Create a new primitive node
100839
- */
100840
- const createPrimitiveNode = (primitiveType, label) => {
100841
- const handles = getPrimitiveHandles(primitiveType);
100842
- return {
100843
- id: `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
100844
- type: 'default',
100845
- position: {
100846
- x: Math.random() * 400 + 100,
100847
- y: Math.random() * 400 + 100
100848
- },
100849
- data: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
100850
- label,
100851
- nodeType: primitiveType,
100852
- inputs: {},
100853
- outputs: {},
100854
- handles
100855
- }, primitiveType === NodeTypeEnum.While && {
100856
- condition: ''
100857
- }), primitiveType === NodeTypeEnum.ForEach && {
100858
- collection: ''
100859
- }), primitiveType === NodeTypeEnum.Decision && {
100860
- condition: ''
100861
- }), primitiveType === NodeTypeEnum.Delay && {
100862
- interval: '00:00:10'
100863
- }), primitiveType === NodeTypeEnum.Schedule && {
100864
- interval: '00:01:00'
100865
- }), primitiveType === NodeTypeEnum.WaitForEvent && {
100866
- eventName: ''
100867
- })
100868
- };
100869
- };
100870
- /**
100871
- * Create trigger node (replaces Start node)
100872
- * Triggers are always initial nodes and can have inputs/outputs like actions
100873
- */
100874
- const createTriggerNode = (trigger, position, workflowId) => {
100875
- return {
100876
- id: `trigger-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
100877
- type: 'trigger',
100878
- position: position || {
100879
- x: 250,
100880
- y: 50
100881
- },
100882
- data: {
100883
- label: trigger.name,
100884
- nodeType: NodeTypeEnum.Action,
100885
- // Triggers are treated as actions with no incoming connections
100886
- stepType: trigger.id,
100887
- // Trigger ID (e.g., "manual-trigger", "http-trigger")
100888
- inputs: {},
100889
- // Can be populated like action inputs
100890
- outputs: {},
100891
- // Can have outputs like actions
100892
- handles: {
100893
- source: ['default'],
100894
- // Triggers always have output
100895
- target: [] // Triggers NEVER have input (always root nodes)
100896
- },
100897
- // Pass trigger metadata for runtime execution
100898
- triggerInputs: trigger.inputs || [],
100899
- // Input definitions for modal
100900
- workflowId: workflowId // Workflow ID for execution
100901
- } // Use 'as any' to extend NodeData with custom props
100902
- };
100903
- };
100904
- /**
100905
- * Create start node (DEPRECATED - use createTriggerNode instead)
100906
- * Kept for backward compatibility
100907
- */
100908
- const createStartNode = () => {
100909
- return {
100910
- id: 'start',
100911
- type: 'start',
100912
- position: {
100913
- x: 250,
100914
- y: 50
100915
- },
100916
- data: {
100917
- label: 'Start (Manual)',
100918
- nodeType: NodeTypeEnum.Start,
100919
- stepType: 'manual-trigger',
100920
- // Map to manual trigger
100921
- inputs: {},
100922
- outputs: {},
100923
- handles: {
100924
- source: ['default'],
100925
- target: []
100926
- }
100927
- }
100928
- };
100929
- };
100930
-
100931
101189
  /**
100932
101190
  * Find all parallel executions in the workflow
100933
101191
  * @param edges - All edges in the workflow
@@ -101207,19 +101465,19 @@ const getIconComponent = (iconName, size = 16) => {
101207
101465
  });
101208
101466
  };
101209
101467
 
101210
- var $$g = _export;
101468
+ var $$e = _export;
101211
101469
  var iterate$3 = iterate$a;
101212
- var aCallable$6 = aCallable$k;
101213
- var anObject$6 = anObject$r;
101214
- var getIteratorDirect$2 = getIteratorDirect$a;
101470
+ var aCallable$4 = aCallable$k;
101471
+ var anObject$4 = anObject$r;
101472
+ var getIteratorDirect = getIteratorDirect$a;
101215
101473
 
101216
101474
  // `Iterator.prototype.every` method
101217
101475
  // https://github.com/tc39/proposal-iterator-helpers
101218
- $$g({ target: 'Iterator', proto: true, real: true }, {
101476
+ $$e({ target: 'Iterator', proto: true, real: true }, {
101219
101477
  every: function every(predicate) {
101220
- anObject$6(this);
101221
- aCallable$6(predicate);
101222
- var record = getIteratorDirect$2(this);
101478
+ anObject$4(this);
101479
+ aCallable$4(predicate);
101480
+ var record = getIteratorDirect(this);
101223
101481
  var counter = 0;
101224
101482
  return !iterate$3(record, function (value, stop) {
101225
101483
  if (!predicate(value, counter++)) return stop();
@@ -101307,260 +101565,6 @@ const computeWhileReturnVisualEdges = (nodes, edges) => {
101307
101565
  return visualEdges;
101308
101566
  };
101309
101567
 
101310
- /**
101311
- * Hook for node operations (add, update, delete)
101312
- */
101313
- const useNodeOperations$1 = (nodes, setNodes, workflowId) => {
101314
- const addActionNode = useCallback(action => {
101315
- console.log('➕ Adding action node:', action.name);
101316
- const newNode = createActionNode(action);
101317
- setNodes(nds => [...nds, newNode]);
101318
- }, [setNodes]);
101319
- const addPrimitiveNode = useCallback((primitiveType, label) => {
101320
- console.log('➕ Adding primitive node:', label);
101321
- const newNode = createPrimitiveNode(primitiveType, label);
101322
- setNodes(nds => [...nds, newNode]);
101323
- }, [setNodes]);
101324
- const addTriggerNode = useCallback(trigger => {
101325
- console.log('➕ Adding trigger node:', trigger.name, 'workflowId:', workflowId);
101326
- // Find a position for the new trigger (stack them vertically)
101327
- const existingTriggers = nodes.filter(n => {
101328
- var _a, _b;
101329
- return ((_b = (_a = n.data.handles) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.length) === 0;
101330
- });
101331
- const yPosition = 50 + existingTriggers.length * 150;
101332
- const newNode = createTriggerNode(trigger, {
101333
- x: 250,
101334
- y: yPosition
101335
- }, workflowId);
101336
- setNodes(nds => [...nds, newNode]);
101337
- }, [setNodes, nodes, workflowId]);
101338
- const addStartNode = useCallback(() => {
101339
- console.log('➕ Adding start node');
101340
- const startNode = createStartNode();
101341
- setNodes([startNode]);
101342
- }, [setNodes]);
101343
- const updateNodeData = useCallback((nodeId, data) => {
101344
- console.log('🔄 Updating node data:', nodeId, data);
101345
- setNodes(nds => nds.map(node => node.id === nodeId ? Object.assign(Object.assign({}, node), {
101346
- data: Object.assign(Object.assign({}, node.data), data)
101347
- }) : node));
101348
- }, [setNodes]);
101349
- const deleteNode = useCallback(nodeId => {
101350
- console.log('🗑️ Deleting node:', nodeId);
101351
- setNodes(nds => nds.filter(node => node.id !== nodeId));
101352
- }, [setNodes]);
101353
- return {
101354
- addActionNode,
101355
- addPrimitiveNode,
101356
- addTriggerNode,
101357
- addStartNode,
101358
- updateNodeData,
101359
- deleteNode
101360
- };
101361
- };
101362
-
101363
- var isArray$1 = isArray$4;
101364
- var lengthOfArrayLike$1 = lengthOfArrayLike$7;
101365
- var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
101366
- var bind$3 = functionBindContext;
101367
-
101368
- // `FlattenIntoArray` abstract operation
101369
- // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
101370
- var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
101371
- var targetIndex = start;
101372
- var sourceIndex = 0;
101373
- var mapFn = mapper ? bind$3(mapper, thisArg) : false;
101374
- var element, elementLen;
101375
-
101376
- while (sourceIndex < sourceLen) {
101377
- if (sourceIndex in source) {
101378
- element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
101379
-
101380
- if (depth > 0 && isArray$1(element)) {
101381
- elementLen = lengthOfArrayLike$1(element);
101382
- targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
101383
- } else {
101384
- doesNotExceedSafeInteger(targetIndex + 1);
101385
- target[targetIndex] = element;
101386
- }
101387
-
101388
- targetIndex++;
101389
- }
101390
- sourceIndex++;
101391
- }
101392
- return targetIndex;
101393
- };
101394
-
101395
- var flattenIntoArray_1 = flattenIntoArray$1;
101396
-
101397
- var uncurryThis$7 = functionUncurryThis;
101398
- var fails$6 = fails$x;
101399
- var isCallable$6 = isCallable$s;
101400
- var classof$1 = classof$9;
101401
- var getBuiltIn$3 = getBuiltIn$a;
101402
- var inspectSource$1 = inspectSource$3;
101403
-
101404
- var noop = function () { /* empty */ };
101405
- var construct = getBuiltIn$3('Reflect', 'construct');
101406
- var constructorRegExp = /^\s*(?:class|function)\b/;
101407
- var exec$2 = uncurryThis$7(constructorRegExp.exec);
101408
- var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
101409
-
101410
- var isConstructorModern = function isConstructor(argument) {
101411
- if (!isCallable$6(argument)) return false;
101412
- try {
101413
- construct(noop, [], argument);
101414
- return true;
101415
- } catch (error) {
101416
- return false;
101417
- }
101418
- };
101419
-
101420
- var isConstructorLegacy = function isConstructor(argument) {
101421
- if (!isCallable$6(argument)) return false;
101422
- switch (classof$1(argument)) {
101423
- case 'AsyncFunction':
101424
- case 'GeneratorFunction':
101425
- case 'AsyncGeneratorFunction': return false;
101426
- }
101427
- try {
101428
- // we can't check .prototype since constructors produced by .bind haven't it
101429
- // `Function#toString` throws on some built-it function in some legacy engines
101430
- // (for example, `DOMQuad` and similar in FF41-)
101431
- return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource$1(argument));
101432
- } catch (error) {
101433
- return true;
101434
- }
101435
- };
101436
-
101437
- isConstructorLegacy.sham = true;
101438
-
101439
- // `IsConstructor` abstract operation
101440
- // https://tc39.es/ecma262/#sec-isconstructor
101441
- var isConstructor$2 = !construct || fails$6(function () {
101442
- var called;
101443
- return isConstructorModern(isConstructorModern.call)
101444
- || !isConstructorModern(Object)
101445
- || !isConstructorModern(function () { called = true; })
101446
- || called;
101447
- }) ? isConstructorLegacy : isConstructorModern;
101448
-
101449
- var isArray = isArray$4;
101450
- var isConstructor$1 = isConstructor$2;
101451
- var isObject$4 = isObject$g;
101452
- var wellKnownSymbol$6 = wellKnownSymbol$n;
101453
-
101454
- var SPECIES$3 = wellKnownSymbol$6('species');
101455
- var $Array = Array;
101456
-
101457
- // a part of `ArraySpeciesCreate` abstract operation
101458
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
101459
- var arraySpeciesConstructor$1 = function (originalArray) {
101460
- var C;
101461
- if (isArray(originalArray)) {
101462
- C = originalArray.constructor;
101463
- // cross-realm fallback
101464
- if (isConstructor$1(C) && (C === $Array || isArray(C.prototype))) C = undefined;
101465
- else if (isObject$4(C)) {
101466
- C = C[SPECIES$3];
101467
- if (C === null) C = undefined;
101468
- }
101469
- } return C === undefined ? $Array : C;
101470
- };
101471
-
101472
- var arraySpeciesConstructor = arraySpeciesConstructor$1;
101473
-
101474
- // `ArraySpeciesCreate` abstract operation
101475
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
101476
- var arraySpeciesCreate$1 = function (originalArray, length) {
101477
- return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
101478
- };
101479
-
101480
- var $$f = _export;
101481
- var flattenIntoArray = flattenIntoArray_1;
101482
- var aCallable$5 = aCallable$k;
101483
- var toObject = toObject$8;
101484
- var lengthOfArrayLike = lengthOfArrayLike$7;
101485
- var arraySpeciesCreate = arraySpeciesCreate$1;
101486
-
101487
- // `Array.prototype.flatMap` method
101488
- // https://tc39.es/ecma262/#sec-array.prototype.flatmap
101489
- $$f({ target: 'Array', proto: true }, {
101490
- flatMap: function flatMap(callbackfn /* , thisArg */) {
101491
- var O = toObject(this);
101492
- var sourceLen = lengthOfArrayLike(O);
101493
- var A;
101494
- aCallable$5(callbackfn);
101495
- A = arraySpeciesCreate(O, 0);
101496
- A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
101497
- return A;
101498
- }
101499
- });
101500
-
101501
- // this method was added to unscopables after implementation
101502
- // in popular engines, so it's moved to a separate module
101503
- var addToUnscopables = addToUnscopables$3;
101504
-
101505
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
101506
- addToUnscopables('flatMap');
101507
-
101508
- var call$7 = functionCall;
101509
- var anObject$5 = anObject$r;
101510
- var getIteratorDirect$1 = getIteratorDirect$a;
101511
- var getIteratorMethod = getIteratorMethod$3;
101512
-
101513
- var getIteratorFlattenable$1 = function (obj, stringHandling) {
101514
- if (!stringHandling || typeof obj !== 'string') anObject$5(obj);
101515
- var method = getIteratorMethod(obj);
101516
- return getIteratorDirect$1(anObject$5(method !== undefined ? call$7(method, obj) : obj));
101517
- };
101518
-
101519
- var $$e = _export;
101520
- var call$6 = functionCall;
101521
- var aCallable$4 = aCallable$k;
101522
- var anObject$4 = anObject$r;
101523
- var getIteratorDirect = getIteratorDirect$a;
101524
- var getIteratorFlattenable = getIteratorFlattenable$1;
101525
- var createIteratorProxy = iteratorCreateProxy;
101526
- var iteratorClose = iteratorClose$6;
101527
- var IS_PURE = isPure;
101528
-
101529
- var IteratorProxy = createIteratorProxy(function () {
101530
- var iterator = this.iterator;
101531
- var mapper = this.mapper;
101532
- var result, inner;
101533
-
101534
- while (true) {
101535
- if (inner = this.inner) try {
101536
- result = anObject$4(call$6(inner.next, inner.iterator));
101537
- if (!result.done) return result.value;
101538
- this.inner = null;
101539
- } catch (error) { iteratorClose(iterator, 'throw', error); }
101540
-
101541
- result = anObject$4(call$6(this.next, iterator));
101542
-
101543
- if (this.done = !!result.done) return;
101544
-
101545
- try {
101546
- this.inner = getIteratorFlattenable(mapper(result.value, this.counter++), false);
101547
- } catch (error) { iteratorClose(iterator, 'throw', error); }
101548
- }
101549
- });
101550
-
101551
- // `Iterator.prototype.flatMap` method
101552
- // https://github.com/tc39/proposal-iterator-helpers
101553
- $$e({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
101554
- flatMap: function flatMap(mapper) {
101555
- anObject$4(this);
101556
- aCallable$4(mapper);
101557
- return new IteratorProxy(getIteratorDirect(this), {
101558
- mapper: mapper,
101559
- inner: null
101560
- });
101561
- }
101562
- });
101563
-
101564
101568
  /**
101565
101569
  * Hook to manage workflow state (nodes and edges)
101566
101570
  * Loads workflow from backend if workflowId is provided
@@ -104387,318 +104391,401 @@ const NodeConfigPanel = /*#__PURE__*/React.memo(({
104387
104391
  });
104388
104392
  NodeConfigPanel.displayName = 'NodeConfigPanel';
104389
104393
 
104394
+ const categoryIcons$1 = {
104395
+ 'Control Flow': jsx(IconTopologyStar3, {
104396
+ size: 16
104397
+ }),
104398
+ 'Triggers': jsx(IconBolt, {
104399
+ size: 16
104400
+ })
104401
+ };
104390
104402
  const ActionsPanel = /*#__PURE__*/React.memo(({
104391
104403
  actions,
104392
104404
  triggers,
104393
104405
  onAddAction,
104394
104406
  onAddTrigger,
104395
104407
  onAddPrimitive,
104408
+ onActionDragStart,
104409
+ onTriggerDragStart,
104410
+ onPrimitiveDragStart,
104396
104411
  triggersLoading
104397
104412
  }) => {
104398
104413
  const [searchTerm, setSearchTerm] = useState('');
104399
- const [expandedCategories, setExpandedCategories] = useState(new Set(['Primitives']));
104400
- const toggleCategory = categoryName => {
104401
- setExpandedCategories(prev => {
104402
- const newSet = new Set(prev);
104403
- if (newSet.has(categoryName)) {
104404
- newSet.delete(categoryName);
104405
- } else {
104406
- newSet.add(categoryName);
104407
- }
104408
- return newSet;
104409
- });
104414
+ // Filtra primitives basandosi sulla ricerca
104415
+ const filteredPrimitives = WORKFLOW_PRIMITIVES.filter(primitive => {
104416
+ const searchLower = searchTerm.toLowerCase();
104417
+ return primitive.label.toLowerCase().includes(searchLower) || primitive.description.toLowerCase().includes(searchLower);
104418
+ });
104419
+ // Filtra triggers basandosi sulla ricerca
104420
+ const filteredTriggers = triggers.map(category => Object.assign(Object.assign({}, category), {
104421
+ triggers: category.triggers.filter(trigger => {
104422
+ var _a;
104423
+ const searchLower = searchTerm.toLowerCase();
104424
+ return trigger.name.toLowerCase().includes(searchLower) || ((_a = trigger.description) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchLower));
104425
+ })
104426
+ })).filter(category => category.triggers.length > 0);
104427
+ // Filtra actions basandosi sulla ricerca
104428
+ const filteredActions = actions.map(category => Object.assign(Object.assign({}, category), {
104429
+ actions: category.actions.filter(action => {
104430
+ var _a, _b;
104431
+ const searchLower = searchTerm.toLowerCase();
104432
+ return action.name.toLowerCase().includes(searchLower) || ((_a = action.description) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchLower)) || ((_b = action.tags) === null || _b === void 0 ? void 0 : _b.some(tag => tag.toLowerCase().includes(searchLower)));
104433
+ })
104434
+ })).filter(category => category.actions.length > 0);
104435
+ // Accordion items da visualizzare di default
104436
+ const defaultAccordionValues = ['primitives'];
104437
+ const handlePrimitiveInteraction = (e, primitive) => {
104438
+ if (e.type === 'dragstart' && onPrimitiveDragStart) {
104439
+ onPrimitiveDragStart(e, primitive.type, primitive.label);
104440
+ } else if (e.type === 'click') {
104441
+ onAddPrimitive(primitive.type, primitive.label);
104442
+ }
104410
104443
  };
104411
- return jsx(Paper, {
104412
- shadow: "none",
104413
- p: 0,
104444
+ const handleTriggerInteraction = (e, trigger) => {
104445
+ if (e.type === 'dragstart' && onTriggerDragStart) {
104446
+ onTriggerDragStart(e, trigger);
104447
+ } else if (e.type === 'click') {
104448
+ onAddTrigger(trigger);
104449
+ }
104450
+ };
104451
+ const handleActionInteraction = (e, action) => {
104452
+ if (e.type === 'dragstart' && onActionDragStart) {
104453
+ onActionDragStart(e, action);
104454
+ } else if (e.type === 'click') {
104455
+ onAddAction(action);
104456
+ }
104457
+ };
104458
+ return jsxs(Box, {
104414
104459
  style: {
104415
104460
  width: 280,
104416
- overflowY: 'auto',
104461
+ height: '100%',
104417
104462
  borderRight: '1px solid #e5e7eb',
104418
- background: 'white'
104463
+ background: '#f9fafb',
104464
+ display: 'flex',
104465
+ flexDirection: 'column'
104419
104466
  },
104420
- children: jsxs(Stack, {
104421
- gap: 0,
104422
- children: [jsx(Box, {
104423
- p: "md",
104424
- style: {
104425
- borderBottom: '1px solid #f3f4f6'
104426
- },
104427
- children: jsx(TextInput, {
104428
- placeholder: "Ricerca...",
104429
- leftSection: jsx(IconSearch, {
104430
- size: 14
104431
- }),
104432
- value: searchTerm,
104433
- onChange: e => setSearchTerm(e.currentTarget.value),
104434
- size: "sm",
104467
+ children: [jsxs(Box, {
104468
+ p: 16,
104469
+ style: {
104470
+ borderBottom: '1px solid #e5e7eb'
104471
+ },
104472
+ children: [jsx(Text, {
104473
+ size: "xs",
104474
+ c: "dimmed",
104475
+ tt: "uppercase",
104476
+ fw: 600,
104477
+ mb: 8,
104478
+ children: "Azioni & Trigger"
104479
+ }), jsx(TextInput, {
104480
+ placeholder: "Cerca...",
104481
+ leftSection: jsx(IconSearch, {
104482
+ size: 14
104483
+ }),
104484
+ size: "xs",
104485
+ value: searchTerm,
104486
+ onChange: e => setSearchTerm(e.currentTarget.value)
104487
+ })]
104488
+ }), jsx(ScrollArea, {
104489
+ style: {
104490
+ flex: 1
104491
+ },
104492
+ children: jsxs(Box, {
104493
+ p: 12,
104494
+ children: [jsxs(Accordion, {
104495
+ multiple: true,
104496
+ defaultValue: defaultAccordionValues,
104435
104497
  styles: {
104436
- input: {
104437
- border: '1px solid #e5e7eb',
104498
+ item: {
104499
+ border: 'none',
104500
+ marginBottom: 8
104501
+ },
104502
+ control: {
104503
+ padding: '8px 12px',
104438
104504
  borderRadius: 6,
104439
- fontSize: 13
104505
+ '&:hover': {
104506
+ background: 'white'
104507
+ }
104440
104508
  }
104441
- }
104442
- })
104443
- }), jsxs(Box, {
104444
- children: [jsx(Box, {
104445
- px: "md",
104446
- py: "sm",
104447
- style: {
104448
- cursor: 'pointer',
104449
- borderBottom: '1px solid #f3f4f6'
104450
104509
  },
104451
- onClick: () => toggleCategory('Primitives'),
104452
- children: jsxs(Group, {
104453
- justify: "space-between",
104454
- children: [jsx(Text, {
104455
- size: "xs",
104456
- fw: 600,
104457
- c: "#374151",
104458
- tt: "uppercase",
104459
- children: "Control Flow"
104460
- }), jsx(Text, {
104461
- size: "xs",
104462
- c: "#9ca3af",
104463
- fw: 500,
104464
- children: expandedCategories.has('Primitives') ? '−' : '+'
104465
- })]
104466
- })
104467
- }), expandedCategories.has('Primitives') && jsx(Box, {
104468
- p: "md",
104469
- pt: "sm",
104470
- children: jsx(Stack, {
104471
- gap: 6,
104472
- children: WORKFLOW_PRIMITIVES.map(primitive => jsxs(Box, {
104473
- p: "sm",
104474
- style: {
104475
- cursor: 'pointer',
104476
- border: '1px solid #f3f4f6',
104477
- borderRadius: 6,
104478
- transition: 'all 0.15s ease',
104479
- background: 'white'
104480
- },
104481
- onClick: () => onAddPrimitive(primitive.type, primitive.label),
104482
- children: [jsxs(Group, {
104510
+ children: [filteredPrimitives.length > 0 && jsxs(Accordion.Item, {
104511
+ value: "primitives",
104512
+ children: [jsx(Accordion.Control, {
104513
+ children: jsxs(Group, {
104483
104514
  gap: 8,
104484
- mb: 4,
104485
- children: [jsx(Box, {
104486
- style: {
104487
- display: 'flex',
104488
- alignItems: 'center',
104489
- color: '#6b7280'
104490
- },
104491
- children: getIconComponent(primitive.icon, 16)
104492
- }), jsx(Text, {
104515
+ children: [categoryIcons$1['Control Flow'], jsx(Text, {
104493
104516
  size: "sm",
104494
- fw: 500,
104495
- c: "#111827",
104496
- children: primitive.label
104517
+ fw: 600,
104518
+ children: "Control Flow"
104519
+ }), jsx(Badge, {
104520
+ size: "xs",
104521
+ color: "gray",
104522
+ variant: "light",
104523
+ children: filteredPrimitives.length
104497
104524
  })]
104498
- }), jsx(Text, {
104499
- size: "xs",
104500
- c: "#6b7280",
104501
- style: {
104502
- fontSize: 11
104503
- },
104504
- children: primitive.description
104505
- })]
104506
- }, primitive.type))
104507
- })
104508
- })]
104509
- }), jsxs(Box, {
104510
- children: [jsx(Box, {
104511
- px: "md",
104512
- py: "sm",
104513
- style: {
104514
- cursor: 'pointer',
104515
- borderBottom: '1px solid #f3f4f6'
104516
- },
104517
- onClick: () => toggleCategory('Triggers'),
104518
- children: jsxs(Group, {
104519
- justify: "space-between",
104520
- children: [jsx(Text, {
104521
- size: "xs",
104522
- fw: 600,
104523
- c: "#374151",
104524
- tt: "uppercase",
104525
- children: "Triggers"
104526
- }), jsx(Text, {
104527
- size: "xs",
104528
- c: "#9ca3af",
104529
- fw: 500,
104530
- children: expandedCategories.has('Triggers') ? '−' : '+'
104531
- })]
104532
- })
104533
- }), expandedCategories.has('Triggers') && jsx(Box, {
104534
- p: "md",
104535
- pt: "sm",
104536
- children: triggersLoading ? jsx(Text, {
104537
- size: "xs",
104538
- c: "dimmed",
104539
- ta: "center",
104540
- children: "Loading triggers..."
104541
- }) : jsx(Stack, {
104542
- gap: 8,
104543
- children: triggers.map(category => jsxs(Box, {
104544
- children: [jsx(Text, {
104545
- size: "xs",
104546
- fw: 600,
104547
- c: "#6b7280",
104548
- mb: 6,
104549
- children: category.name
104550
- }), jsx(Stack, {
104525
+ })
104526
+ }), jsx(Accordion.Panel, {
104527
+ children: jsx(Stack, {
104551
104528
  gap: 6,
104552
- children: category.triggers.map(trigger => jsxs(Box, {
104553
- p: "sm",
104529
+ children: filteredPrimitives.map(primitive => jsx(UnstyledButton, {
104530
+ draggable: !!onPrimitiveDragStart,
104531
+ onDragStart: e => handlePrimitiveInteraction(e, primitive),
104532
+ onClick: e => handlePrimitiveInteraction(e, primitive),
104554
104533
  style: {
104555
- cursor: 'pointer',
104556
- border: '1px solid #f3f4f6',
104534
+ padding: '8px 12px',
104557
104535
  borderRadius: 6,
104558
- transition: 'all 0.15s ease',
104559
- background: 'white'
104536
+ border: '1px solid #e5e7eb',
104537
+ background: 'white',
104538
+ cursor: onPrimitiveDragStart ? 'grab' : 'pointer',
104539
+ transition: 'all 0.15s ease'
104560
104540
  },
104561
- onClick: () => onAddTrigger(trigger),
104562
- children: [jsxs(Group, {
104541
+ styles: {
104542
+ root: {
104543
+ '&:hover': {
104544
+ borderColor: '#6b7280',
104545
+ boxShadow: '0 2px 8px rgba(107, 114, 128, 0.15)',
104546
+ transform: 'translateY(-1px)'
104547
+ },
104548
+ '&:active': {
104549
+ cursor: onPrimitiveDragStart ? 'grabbing' : 'pointer'
104550
+ }
104551
+ }
104552
+ },
104553
+ children: jsxs(Group, {
104563
104554
  gap: 8,
104564
- mb: 4,
104555
+ wrap: "nowrap",
104565
104556
  children: [jsx(Box, {
104566
104557
  style: {
104567
104558
  display: 'flex',
104568
104559
  alignItems: 'center',
104569
- color: '#10b981'
104560
+ color: '#6b7280',
104561
+ flexShrink: 0
104570
104562
  },
104571
- children: getIconComponent(getTriggerIcon(trigger), 16)
104572
- }), jsx(Text, {
104573
- size: "sm",
104574
- fw: 500,
104575
- c: "#111827",
104576
- children: trigger.name
104563
+ children: getIconComponent(primitive.icon, 16)
104564
+ }), jsxs(Box, {
104565
+ style: {
104566
+ flex: 1,
104567
+ minWidth: 0
104568
+ },
104569
+ children: [jsx(Text, {
104570
+ size: "xs",
104571
+ fw: 500,
104572
+ truncate: true,
104573
+ children: primitive.label
104574
+ }), jsx(Text, {
104575
+ size: "xs",
104576
+ c: "dimmed",
104577
+ lineClamp: 1,
104578
+ children: primitive.description
104579
+ })]
104577
104580
  })]
104578
- }), jsx(Text, {
104581
+ })
104582
+ }, primitive.type))
104583
+ })
104584
+ })]
104585
+ }), !triggersLoading && filteredTriggers.length > 0 && jsxs(Accordion.Item, {
104586
+ value: "triggers",
104587
+ children: [jsx(Accordion.Control, {
104588
+ children: jsxs(Group, {
104589
+ gap: 8,
104590
+ children: [categoryIcons$1['Triggers'], jsx(Text, {
104591
+ size: "sm",
104592
+ fw: 600,
104593
+ children: "Triggers"
104594
+ }), jsx(Badge, {
104595
+ size: "xs",
104596
+ color: "gray",
104597
+ variant: "light",
104598
+ children: filteredTriggers.reduce((acc, cat) => acc + cat.triggers.length, 0)
104599
+ })]
104600
+ })
104601
+ }), jsx(Accordion.Panel, {
104602
+ children: jsx(Stack, {
104603
+ gap: 12,
104604
+ children: filteredTriggers.map(category => jsxs(Box, {
104605
+ children: [jsx(Text, {
104579
104606
  size: "xs",
104607
+ fw: 600,
104580
104608
  c: "#6b7280",
104581
- style: {
104582
- fontSize: 11
104583
- },
104584
- children: trigger.description
104609
+ mb: 6,
104610
+ tt: "uppercase",
104611
+ children: category.name
104612
+ }), jsx(Stack, {
104613
+ gap: 6,
104614
+ children: category.triggers.map(trigger => jsx(UnstyledButton, {
104615
+ draggable: !!onTriggerDragStart,
104616
+ onDragStart: e => handleTriggerInteraction(e, trigger),
104617
+ onClick: e => handleTriggerInteraction(e, trigger),
104618
+ style: {
104619
+ padding: '8px 12px',
104620
+ borderRadius: 6,
104621
+ border: '1px solid #e5e7eb',
104622
+ background: 'white',
104623
+ cursor: onTriggerDragStart ? 'grab' : 'pointer',
104624
+ transition: 'all 0.15s ease'
104625
+ },
104626
+ styles: {
104627
+ root: {
104628
+ '&:hover': {
104629
+ borderColor: '#10b981',
104630
+ boxShadow: '0 2px 8px rgba(16, 185, 129, 0.15)',
104631
+ transform: 'translateY(-1px)'
104632
+ },
104633
+ '&:active': {
104634
+ cursor: onTriggerDragStart ? 'grabbing' : 'pointer'
104635
+ }
104636
+ }
104637
+ },
104638
+ children: jsxs(Group, {
104639
+ gap: 8,
104640
+ wrap: "nowrap",
104641
+ children: [jsx(Box, {
104642
+ style: {
104643
+ display: 'flex',
104644
+ alignItems: 'center',
104645
+ color: '#10b981',
104646
+ flexShrink: 0
104647
+ },
104648
+ children: getIconComponent(getTriggerIcon(trigger), 16)
104649
+ }), jsxs(Box, {
104650
+ style: {
104651
+ flex: 1,
104652
+ minWidth: 0
104653
+ },
104654
+ children: [jsx(Text, {
104655
+ size: "xs",
104656
+ fw: 500,
104657
+ truncate: true,
104658
+ children: trigger.name
104659
+ }), jsx(Text, {
104660
+ size: "xs",
104661
+ c: "dimmed",
104662
+ lineClamp: 1,
104663
+ children: trigger.description
104664
+ })]
104665
+ })]
104666
+ })
104667
+ }, trigger.id))
104585
104668
  })]
104586
- }, trigger.id))
104587
- })]
104588
- }, category.name))
104589
- })
104590
- })]
104591
- }), actions.map(category => {
104592
- const filteredActions = category.actions.filter(action => {
104593
- var _a, _b;
104594
- const searchLower = searchTerm.toLowerCase();
104595
- return action.name.toLowerCase().includes(searchLower) || ((_a = action.description) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchLower)) || ((_b = action.tags) === null || _b === void 0 ? void 0 : _b.some(tag => tag.toLowerCase().includes(searchLower)));
104596
- });
104597
- if (filteredActions.length === 0 && searchTerm) return null;
104598
- const categoryKey = `Actions-${category.name}`;
104599
- const isExpanded = expandedCategories.has(categoryKey);
104600
- return jsxs(Box, {
104601
- children: [jsx(Box, {
104602
- px: "md",
104603
- py: "sm",
104604
- style: {
104605
- cursor: 'pointer',
104606
- borderBottom: '1px solid #f3f4f6'
104607
- },
104608
- onClick: () => toggleCategory(categoryKey),
104609
- children: jsxs(Group, {
104610
- justify: "space-between",
104611
- children: [jsxs(Group, {
104669
+ }, category.name))
104670
+ })
104671
+ })]
104672
+ }), filteredActions.map(category => jsxs(Accordion.Item, {
104673
+ value: `action-${category.name}`,
104674
+ children: [jsx(Accordion.Control, {
104675
+ children: jsxs(Group, {
104612
104676
  gap: 8,
104613
- children: [jsx(Text, {
104614
- size: "xs",
104677
+ children: [jsx(IconPlaystationCircle, {
104678
+ size: 16
104679
+ }), jsx(Text, {
104680
+ size: "sm",
104615
104681
  fw: 600,
104616
- c: "#374151",
104617
- tt: "uppercase",
104618
104682
  children: category.name
104619
- }), jsx(Text, {
104683
+ }), jsx(Badge, {
104620
104684
  size: "xs",
104621
- c: "#9ca3af",
104622
- fw: 500,
104623
- children: filteredActions.length
104685
+ color: "gray",
104686
+ variant: "light",
104687
+ children: category.actions.length
104624
104688
  })]
104625
- }), jsx(Text, {
104626
- size: "xs",
104627
- c: "#9ca3af",
104628
- fw: 500,
104629
- children: isExpanded ? '−' : '+'
104630
- })]
104631
- })
104632
- }), isExpanded && jsx(Box, {
104633
- p: "md",
104634
- pt: "sm",
104635
- children: jsx(Stack, {
104636
- gap: 6,
104637
- children: filteredActions.map(action => jsxs(Box, {
104638
- p: "sm",
104639
- style: {
104640
- cursor: 'pointer',
104641
- border: `1px solid ${action.color || '#f3f4f6'}`,
104642
- borderRadius: 6,
104643
- transition: 'all 0.15s ease',
104644
- background: 'white',
104645
- borderLeftWidth: action.color ? 3 : 1
104646
- },
104647
- onClick: () => onAddAction(action),
104648
- children: [jsxs(Group, {
104649
- gap: 8,
104650
- mb: 4,
104651
- children: [action.icon && jsx(Box, {
104652
- style: {
104653
- display: 'flex',
104654
- alignItems: 'center',
104655
- color: action.color || '#6b7280'
104656
- },
104657
- children: getIconComponent(action.icon, 16)
104658
- }), jsx(Text, {
104659
- size: "sm",
104660
- fw: 500,
104661
- c: "#111827",
104662
- children: action.name
104663
- })]
104664
- }), action.description && jsx(Text, {
104665
- size: "xs",
104666
- c: "#6b7280",
104667
- mb: 4,
104689
+ })
104690
+ }), jsx(Accordion.Panel, {
104691
+ children: jsx(Stack, {
104692
+ gap: 6,
104693
+ children: category.actions.map(action => jsx(UnstyledButton, {
104694
+ draggable: !!onActionDragStart,
104695
+ onDragStart: e => handleActionInteraction(e, action),
104696
+ onClick: e => handleActionInteraction(e, action),
104668
104697
  style: {
104669
- fontSize: 11
104698
+ padding: '8px 12px',
104699
+ borderRadius: 6,
104700
+ border: `1px solid ${action.color || '#e5e7eb'}`,
104701
+ background: 'white',
104702
+ cursor: onActionDragStart ? 'grab' : 'pointer',
104703
+ transition: 'all 0.15s ease',
104704
+ borderLeftWidth: action.color ? 3 : 1
104670
104705
  },
104671
- children: action.description
104672
- }), action.tags && action.tags.length > 0 && jsx(Group, {
104673
- gap: 4,
104674
- mb: 4,
104675
- children: action.tags.map(tag => jsx(Badge, {
104676
- size: "xs",
104677
- variant: "light",
104678
- color: "gray",
104679
- children: tag
104680
- }, tag))
104681
- }), action.outcomes && action.outcomes.length > 0 && jsx(Group, {
104682
- gap: 4,
104683
- children: action.outcomes.map(outcome => jsx(Text, {
104684
- size: "xs",
104685
- style: {
104686
- fontSize: 10,
104687
- color: '#6b7280',
104688
- padding: '2px 6px',
104689
- borderRadius: 3,
104690
- background: '#f3f4f6',
104691
- fontWeight: 500
104692
- },
104693
- children: outcome
104694
- }, outcome))
104695
- })]
104696
- }, action.id))
104697
- })
104698
- })]
104699
- }, category.name);
104700
- })]
104701
- })
104706
+ styles: {
104707
+ root: {
104708
+ '&:hover': {
104709
+ borderColor: action.color || '#6b7280',
104710
+ boxShadow: `0 2px 8px ${action.color ? `${action.color}30` : 'rgba(107, 114, 128, 0.15)'}`,
104711
+ transform: 'translateY(-1px)'
104712
+ },
104713
+ '&:active': {
104714
+ cursor: onActionDragStart ? 'grabbing' : 'pointer'
104715
+ }
104716
+ }
104717
+ },
104718
+ children: jsxs(Box, {
104719
+ children: [jsxs(Group, {
104720
+ gap: 8,
104721
+ wrap: "nowrap",
104722
+ mb: action.description ? 4 : 0,
104723
+ children: [action.icon && jsx(Box, {
104724
+ style: {
104725
+ display: 'flex',
104726
+ alignItems: 'center',
104727
+ color: action.color || '#6b7280',
104728
+ flexShrink: 0
104729
+ },
104730
+ children: getIconComponent(action.icon, 16)
104731
+ }), jsx(Text, {
104732
+ size: "xs",
104733
+ fw: 500,
104734
+ style: {
104735
+ flex: 1,
104736
+ minWidth: 0
104737
+ },
104738
+ truncate: true,
104739
+ children: action.name
104740
+ })]
104741
+ }), action.description && jsx(Text, {
104742
+ size: "xs",
104743
+ c: "dimmed",
104744
+ lineClamp: 2,
104745
+ mb: 4,
104746
+ children: action.description
104747
+ }), action.tags && action.tags.length > 0 && jsx(Group, {
104748
+ gap: 4,
104749
+ mb: 4,
104750
+ children: action.tags.slice(0, 3).map(tag => jsx(Badge, {
104751
+ size: "xs",
104752
+ variant: "light",
104753
+ color: "gray",
104754
+ children: tag
104755
+ }, tag))
104756
+ }), action.outcomes && action.outcomes.length > 0 && jsx(Group, {
104757
+ gap: 4,
104758
+ children: action.outcomes.map(outcome => jsx(Text, {
104759
+ size: "xs",
104760
+ style: {
104761
+ fontSize: 10,
104762
+ color: '#6b7280',
104763
+ padding: '2px 6px',
104764
+ borderRadius: 3,
104765
+ background: '#f3f4f6',
104766
+ fontWeight: 500
104767
+ },
104768
+ children: outcome
104769
+ }, outcome))
104770
+ })]
104771
+ })
104772
+ }, action.id))
104773
+ })
104774
+ })]
104775
+ }, category.name))]
104776
+ }), filteredPrimitives.length === 0 && filteredTriggers.length === 0 && filteredActions.length === 0 && jsx(Box, {
104777
+ p: 16,
104778
+ style: {
104779
+ textAlign: 'center'
104780
+ },
104781
+ children: jsx(Text, {
104782
+ size: "sm",
104783
+ c: "dimmed",
104784
+ children: "Nessun elemento trovato"
104785
+ })
104786
+ })]
104787
+ })
104788
+ })]
104702
104789
  });
104703
104790
  });
104704
104791
  ActionsPanel.displayName = 'ActionsPanel';
@@ -105310,6 +105397,8 @@ function WorkflowDesignerV2({
105310
105397
  const [settingsDraft, setSettingsDraft] = useState(metadata);
105311
105398
  const [persistedSnapshot, setPersistedSnapshot] = useState(null);
105312
105399
  const nameInputRef = useRef(null);
105400
+ const reactFlowWrapper = useRef(null);
105401
+ const [reactFlowInstance, setReactFlowInstance] = useState(null);
105313
105402
  const currentSnapshot = useMemo(() => createWorkflowDesignerSnapshot(nodes, edges, metadata), [nodes, edges, metadata]);
105314
105403
  const hasPendingNameEdit = isEditingName && tempName.trim() !== metadata.name;
105315
105404
  const hasPendingSettingsChanges = showSettingsModal && JSON.stringify(normalizeForComparison$1(settingsDraft)) !== JSON.stringify(normalizeForComparison$1(metadata));
@@ -105361,8 +105450,68 @@ function WorkflowDesignerV2({
105361
105450
  const getAvailableOutputs = useAvailableOutputs(nodes, edges, actions, triggers);
105362
105451
  const visualWhileEdges = useMemo(() => computeWhileReturnVisualEdges(nodes, edges), [nodes, edges]);
105363
105452
  const displayEdges = useMemo(() => [...edges, ...visualWhileEdges], [edges, visualWhileEdges]);
105453
+ // Wrapper functions to call addNode with position from drag and drop
105454
+ const onAddAction = useCallback((action, position) => {
105455
+ addActionNode(action, position);
105456
+ }, [addActionNode]);
105457
+ const onAddTrigger = useCallback((trigger, position) => {
105458
+ addTriggerNode(trigger, position);
105459
+ }, [addTriggerNode]);
105460
+ const onAddPrimitive = useCallback((primitiveType, label, position) => {
105461
+ addPrimitiveNode(primitiveType, label, position);
105462
+ }, [addPrimitiveNode]);
105364
105463
  const selectedNode = nodes.find(n => n.id === selectedNodeId);
105365
105464
  // Handlers
105465
+ const handleFlowInit = useCallback(instance => {
105466
+ setReactFlowInstance(instance);
105467
+ }, []);
105468
+ const handleDragOver = useCallback(event => {
105469
+ event.preventDefault();
105470
+ event.dataTransfer.dropEffect = 'move';
105471
+ }, []);
105472
+ const handleDrop = useCallback(event => {
105473
+ event.preventDefault();
105474
+ const itemType = event.dataTransfer.getData('application/reactflow-itemtype');
105475
+ const itemDataJson = event.dataTransfer.getData('application/reactflow-itemdata');
105476
+ if (!itemType || !itemDataJson) return;
105477
+ if (!reactFlowInstance) return;
105478
+ const position = reactFlowInstance.screenToFlowPosition({
105479
+ x: event.clientX,
105480
+ y: event.clientY
105481
+ });
105482
+ try {
105483
+ const itemData = JSON.parse(itemDataJson);
105484
+ if (itemType === 'action') {
105485
+ const action = itemData;
105486
+ onAddAction(action, position);
105487
+ } else if (itemType === 'trigger') {
105488
+ const trigger = itemData;
105489
+ onAddTrigger(trigger, position);
105490
+ } else if (itemType === 'primitive') {
105491
+ onAddPrimitive(itemData.type, itemData.label, position);
105492
+ }
105493
+ } catch (error) {
105494
+ console.error('Error parsing dropped item:', error);
105495
+ }
105496
+ }, [reactFlowInstance, onAddAction, onAddTrigger, onAddPrimitive]);
105497
+ const handleActionDragStart = (event, action) => {
105498
+ event.dataTransfer.setData('application/reactflow-itemtype', 'action');
105499
+ event.dataTransfer.setData('application/reactflow-itemdata', JSON.stringify(action));
105500
+ event.dataTransfer.effectAllowed = 'move';
105501
+ };
105502
+ const handleTriggerDragStart = (event, trigger) => {
105503
+ event.dataTransfer.setData('application/reactflow-itemtype', 'trigger');
105504
+ event.dataTransfer.setData('application/reactflow-itemdata', JSON.stringify(trigger));
105505
+ event.dataTransfer.effectAllowed = 'move';
105506
+ };
105507
+ const handlePrimitiveDragStart = (event, primitiveType, label) => {
105508
+ event.dataTransfer.setData('application/reactflow-itemtype', 'primitive');
105509
+ event.dataTransfer.setData('application/reactflow-itemdata', JSON.stringify({
105510
+ type: primitiveType,
105511
+ label
105512
+ }));
105513
+ event.dataTransfer.effectAllowed = 'move';
105514
+ };
105366
105515
  const handleNodeClick = useCallback((_, node) => {
105367
105516
  setSelectedNodeId(node.id);
105368
105517
  setShowConfigPanel(true);
@@ -105626,12 +105775,16 @@ function WorkflowDesignerV2({
105626
105775
  children: [jsx(ActionsPanel, {
105627
105776
  actions: actions,
105628
105777
  triggers: triggers,
105629
- onAddAction: addActionNode,
105630
- onAddTrigger: addTriggerNode,
105631
- onAddPrimitive: addPrimitiveNode,
105778
+ onAddAction: onAddAction,
105779
+ onAddTrigger: onAddTrigger,
105780
+ onAddPrimitive: onAddPrimitive,
105781
+ onActionDragStart: handleActionDragStart,
105782
+ onTriggerDragStart: handleTriggerDragStart,
105783
+ onPrimitiveDragStart: handlePrimitiveDragStart,
105632
105784
  loading: actionsLoading,
105633
105785
  triggersLoading: triggersLoading
105634
105786
  }), jsx(Box, {
105787
+ ref: reactFlowWrapper,
105635
105788
  style: {
105636
105789
  flex: 1,
105637
105790
  background: COLORS.background.canvas
@@ -105639,11 +105792,14 @@ function WorkflowDesignerV2({
105639
105792
  children: jsxs(index$2, {
105640
105793
  nodes: nodes,
105641
105794
  edges: displayEdges,
105795
+ onInit: handleFlowInit,
105642
105796
  onNodesChange: onNodesChange,
105643
105797
  onEdgesChange: onEdgesChange,
105644
105798
  onConnect: onConnect,
105645
105799
  onNodeClick: handleNodeClick,
105646
105800
  onNodesDelete: onNodesDelete,
105801
+ onDrop: handleDrop,
105802
+ onDragOver: handleDragOver,
105647
105803
  nodeTypes: nodeTypes$1,
105648
105804
  edgeTypes: edgeTypes,
105649
105805
  fitView: true,
@@ -106551,7 +106707,7 @@ function generateCountBasedPorts(descriptor, config) {
106551
106707
  const i = index + 1;
106552
106708
  return {
106553
106709
  id: applyTemplate(portNamePattern, {
106554
- i: i === 1 ? '' : String(i),
106710
+ i: i === 1 ? '1' : String(i),
106555
106711
  index: String(i)
106556
106712
  }),
106557
106713
  label: applyTemplate(labelPattern, {
@@ -106567,7 +106723,7 @@ function generateCountBasedPorts(descriptor, config) {
106567
106723
  const ports = [];
106568
106724
  for (let i = 1; i <= count; i++) {
106569
106725
  const portName = applyTemplate(portNamePattern, {
106570
- i: i === 1 ? '' : String(i),
106726
+ i: i === 1 ? '1' : String(i),
106571
106727
  index: String(i)
106572
106728
  });
106573
106729
  const label = applyTemplate(labelPattern, {
@@ -112707,6 +112863,7 @@ function BlockConfigPanel({
112707
112863
  });
112708
112864
  case BlockConfigFieldType.TextArea:
112709
112865
  case BlockConfigFieldType.Expression:
112866
+ case BlockConfigFieldType.Sql:
112710
112867
  return jsx(Textarea, {
112711
112868
  label: field.label,
112712
112869
  description: field.description,
@@ -113923,6 +114080,7 @@ function EtlDesigner({
113923
114080
  const nameInputRef = useRef(null);
113924
114081
  const reactFlowWrapper = useRef(null);
113925
114082
  const [reactFlowInstance, setReactFlowInstance] = useState(null);
114083
+ const [editorLoaded, setEditorLoaded] = useState(false);
113926
114084
  const closeConfigPanel = useCallback(() => {
113927
114085
  setShowConfigPanel(false);
113928
114086
  setSelectedNodeId(null);
@@ -113977,7 +114135,15 @@ function EtlDesigner({
113977
114135
  setShowSettingsModal(false);
113978
114136
  };
113979
114137
  useEffect(() => {
113980
- if (!pipelineId || blockDescriptors.size === 0) return;
114138
+ if (!pipelineId && blockDescriptors.size === 0) {
114139
+ return;
114140
+ }
114141
+ if (!pipelineId && blockDescriptors.size > 0) {
114142
+ setEditorLoaded(true);
114143
+ }
114144
+ if (!pipelineId || blockDescriptors.size === 0) {
114145
+ return;
114146
+ }
113981
114147
  const loadPipeline = () => __awaiter(this, void 0, void 0, function* () {
113982
114148
  try {
113983
114149
  const pipeline = yield FluxoClientSys.Instance.workflow.getEtlPipeline(pipelineId);
@@ -114004,6 +114170,7 @@ function EtlDesigner({
114004
114170
  customMetadata: pipeline.metadata
114005
114171
  })));
114006
114172
  setTempName(pipeline.name);
114173
+ setEditorLoaded(true);
114007
114174
  } catch (error) {
114008
114175
  console.error('Failed to load ETL pipeline:', error);
114009
114176
  notifications.show({
@@ -114250,7 +114417,7 @@ function EtlDesigner({
114250
114417
  size: "xs",
114251
114418
  variant: "light",
114252
114419
  color: pipelineDebug.isStopping ? 'yellow' : pipelineDebug.status === 'running' || pipelineDebug.status === 'subscribed' ? 'green' : pipelineDebug.status === 'failed' ? 'red' : pipelineDebug.status === 'completed' ? 'teal' : pipelineDebug.status === 'cancelled' ? 'gray' : pipelineDebug.status === 'connecting' ? 'yellow' : 'gray',
114253
- children: ["Debug: ", pipelineDebug.isStopping ? 'stopping' : pipelineDebug.status]
114420
+ children: ["Debug:", ' ', pipelineDebug.isStopping ? 'stopping' : pipelineDebug.status]
114254
114421
  }), jsx(Tooltip, {
114255
114422
  label: "Impostazioni",
114256
114423
  children: jsx(ActionIcon, {
@@ -114354,7 +114521,7 @@ function EtlDesigner({
114354
114521
  flex: 1,
114355
114522
  background: '#fafafa'
114356
114523
  },
114357
- children: jsxs(index$2, {
114524
+ children: editorLoaded && jsxs(index$2, {
114358
114525
  nodes: nodes,
114359
114526
  edges: displayEdges,
114360
114527
  onInit: handleFlowInit,
@@ -115320,7 +115487,7 @@ function EtlBrowse({
115320
115487
  fw: 600,
115321
115488
  children: "Metriche blocchi"
115322
115489
  }), jsx(ScrollArea, {
115323
- h: 260,
115490
+ h: 'calc(100vh - 260px)',
115324
115491
  children: jsxs(Table, {
115325
115492
  highlightOnHover: true,
115326
115493
  bg: "white",