@camunda/task-testing 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -26,12 +26,16 @@ const DEFAULT_CONFIG = {
26
26
  output: {}
27
27
  };
28
28
  const SUPPORTED_ELEMENT_TYPES = ['bpmn:Task'];
29
- const DEFAULT_OUTPUT = null;
29
+ const DEFAULT_OUTPUT = undefined;
30
30
  class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
31
31
  constructor(injector, elementVariables, config = DEFAULT_CONFIG) {
32
32
  super();
33
33
  this._injector = injector;
34
34
  this._elementVariables = elementVariables;
35
+
36
+ /**
37
+ * @type {import('./types').Config}
38
+ */
35
39
  this._config = {
36
40
  ...DEFAULT_CONFIG,
37
41
  ...config
@@ -103,6 +107,11 @@ class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
103
107
  }
104
108
  return this._config.input[element.id];
105
109
  }
110
+
111
+ /**
112
+ * @param {import('./types').Element} element
113
+ * @returns {import('./types').ElementOutput}
114
+ */
106
115
  getOutputConfigForElement(element) {
107
116
  if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.isAny)(element, SUPPORTED_ELEMENT_TYPES)) {
108
117
  throw new Error(`Unsupported element type: ${element.type}`);
@@ -338,6 +347,7 @@ class ElementVariables extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
338
347
 
339
348
  __webpack_require__.r(__webpack_exports__);
340
349
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
350
+ /* harmony export */ INTERVAL_MS: () => (/* binding */ INTERVAL_MS),
341
351
  /* harmony export */ "default": () => (/* binding */ TaskExecution)
342
352
  /* harmony export */ });
343
353
  /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ "./node_modules/events/events.js");
@@ -354,73 +364,32 @@ __webpack_require__.r(__webpack_exports__);
354
364
 
355
365
 
356
366
  const INTERVAL_MS = 1000;
367
+
368
+ /**
369
+ * @import { TaskExecutionApi, TaskExecutionResult, TaskExecutionError, TaskExecutionStatus } from './types';
370
+ */
371
+
372
+ /**
373
+ * Emits:
374
+ * - `taskExecution.status.changed` with one of {@link TaskExecutionStatus}
375
+ * - `taskExecution.finished` with {@link TaskExecutionResult}
376
+ * - `taskExecution.error` with {@link TaskExecutionError}
377
+ */
357
378
  class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
358
379
  /**
359
380
  * @param {Object} injector
360
- * @param {import('./types').TaskExecutionApi} api
381
+ * @param {TaskExecutionApi} api
361
382
  */
362
383
  constructor(injector, api) {
363
384
  super();
364
- this._injector = injector;
365
385
 
366
- /** @type {import('./types').TaskExecutionApi} */
386
+ /** @type {TaskExecutionApi} */
367
387
  this._api = api;
388
+ this._interval = null;
368
389
  const eventBus = injector.get('eventBus');
369
390
  eventBus.on(['selection.changed', 'commandStack.changed'], () => {
370
391
  this.cancelTaskExecution();
371
392
  });
372
- this._currentTaskExecution = null;
373
- }
374
- async _cancelTaskExecution() {
375
- if (!this._currentTaskExecution) {
376
- return;
377
- }
378
- const {
379
- interval,
380
- processInstanceKey,
381
- processDefinitionKey
382
- } = this._currentTaskExecution;
383
- if (interval) {
384
- clearInterval(interval);
385
- }
386
- if (processInstanceKey) {
387
-
388
- // TODO: delete process instance
389
- }
390
- if (processDefinitionKey) {
391
-
392
- // TODO: delete process definition
393
- }
394
-
395
- // TODO: cancel deploy and start instance if they are in progress
396
-
397
- this._currentTaskExecution = null;
398
- }
399
- async cancelTaskExecution() {
400
- if (!this._currentTaskExecution) {
401
- return;
402
- }
403
- await this._cancelTaskExecution();
404
-
405
- /** @type {import('./types').TaskExecutionEvents.Cancelled} */
406
- this.emit('taskExecution.cancelled');
407
- }
408
- async endTaskExecution() {
409
- if (!this._currentTaskExecution) {
410
- return;
411
- }
412
- const {
413
- incident,
414
- variables
415
- } = this._currentTaskExecution;
416
- await this._cancelTaskExecution();
417
-
418
- /** @type {import('./types').TaskExecutionEvents.End} */
419
- this.emit('taskExecution.end', {
420
- incident,
421
- success: !incident,
422
- variables
423
- });
424
393
  }
425
394
 
426
395
  /**
@@ -433,116 +402,119 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
433
402
  */
434
403
  async executeTask(elementId, variables) {
435
404
  await this.cancelTaskExecution();
436
- this._currentTaskExecution = {
437
- incident: null,
438
- /** @type {null | ReturnType<typeof setInterval>} */
439
- interval: null,
440
- /** @type {string|null} */
441
- processDefinitionKey: null,
442
- /** @type {string|null} */
443
- processInstanceKey: null,
444
- /** @type {Object<string, any>|null} */
445
- variables: null
446
- };
447
-
448
- /** @type {import('./types').TaskExecutionEvents.Start} */
449
- this.emit('taskExecution.start');
450
- const deploymentResponse = await this._api.deploy();
451
- if (!deploymentResponse.success) {
452
- /** @type {import('./types').TaskExecutionEvents.Error} */
453
- this.emit('taskExecution.error', {
454
- message: 'Failed to deploy process definition',
455
- response: deploymentResponse
456
- });
457
- await this.cancelTaskExecution();
405
+ this.emit('taskExecution.status.changed', 'deploying');
406
+ const deploymentResult = await this._api.deploy();
407
+ if (!deploymentResult.success) {
408
+ this._emitError('Failed to deploy process definition', deploymentResult.error);
409
+ this.cancelTaskExecution();
458
410
  return;
459
411
  }
460
- const processId = getProcessId(deploymentResponse.response);
412
+ const processId = getProcessId(deploymentResult.response);
461
413
  if (!processId) {
462
- /** @type {import('./types').TaskExecutionEvents.Error} */
463
- this.emit('taskExecution.error', {
464
- message: 'Failed to retrieve process ID from deployment response',
465
- response: deploymentResponse
466
- });
467
- await this.cancelTaskExecution();
414
+ this._emitError('Failed to retrieve process ID from deployment response');
415
+ this.cancelTaskExecution();
468
416
  return;
469
417
  }
470
- this._currentTaskExecution.processDefinitionKey = getProcessDefinitionKey(deploymentResponse.response);
471
- const startInstanceResponse = await this._api.startInstance(processId, elementId, variables);
472
- if (!startInstanceResponse.success) {
473
- /** @type {import('./types').TaskExecutionEvents.Error} */
474
- this.emit('taskExecution.error', {
475
- message: 'Failed to start process instance',
476
- response: startInstanceResponse
477
- });
478
- await this.cancelTaskExecution();
418
+ this.emit('taskExecution.status.changed', 'starting-instance');
419
+ const startInstanceResult = await this._api.startInstance(processId, elementId, variables);
420
+ if (!startInstanceResult.success) {
421
+ this._emitError('Failed to start process instance', startInstanceResult.error);
422
+ this.cancelTaskExecution();
479
423
  return;
480
424
  }
481
- const {
482
- processInstanceKey
483
- } = startInstanceResponse.response;
484
- this._currentTaskExecution.processInstanceKey = processInstanceKey;
425
+ const processInstanceKey = getProcessInstanceKey(startInstanceResult.response);
426
+ if (!processInstanceKey) {
427
+ this._emitError('Failed to retrieve process instance key from start instance response');
428
+ this.cancelTaskExecution();
429
+ return;
430
+ }
431
+ this.emit('taskExecution.status.changed', 'executing', processInstanceKey);
485
432
  const intervalCallback = async () => {
486
433
  const getProcessInstanceResult = await this._api.getProcessInstance(processInstanceKey);
487
434
  if (!getProcessInstanceResult.success) {
488
- /** @type {import('./types').TaskExecutionEvents.Error} */
489
- this.emit('taskExecution.error', {
490
- message: 'Failed to get process instance',
491
- response: getProcessInstanceResult
492
- });
435
+ this._emitError('Failed to get process instance', getProcessInstanceResult.error);
493
436
  return;
494
437
  }
495
- const processInstance = getProcessInstance(getProcessInstanceResult.response);
438
+ const processInstance = getProcessInstance(getProcessInstanceResult.response, processInstanceKey);
496
439
  if (!processInstance) {
497
440
  // No process instance found, try again
498
441
  return;
499
442
  }
500
- const state = getProcessInstanceState(getProcessInstanceResult.response),
501
- hasIncident = hasProcessInstanceIncident(getProcessInstanceResult.response);
443
+ const state = getProcessInstanceState(getProcessInstanceResult.response, processInstanceKey);
444
+ const hasIncident = hasProcessInstanceIncident(getProcessInstanceResult.response, processInstanceKey);
445
+ let incident = null;
502
446
  if (hasIncident) {
503
447
  const getProcessInstanceIncidentResult = await this._api.getProcessInstanceIncident(processInstanceKey);
504
448
  if (!getProcessInstanceIncidentResult.success) {
505
- /** @type {import('./types').TaskExecutionEvents.Error} */
506
- this.emit('taskExecution.error', {
507
- message: 'Failed to get process instance incident',
508
- response: getProcessInstanceIncidentResult
509
- });
449
+ this._emitError('Failed to get process instance incident', getProcessInstanceIncidentResult.error);
510
450
  return;
511
451
  }
512
- const incident = getIncident(getProcessInstanceIncidentResult.response);
513
- if (this._currentTaskExecution) {
514
- this._currentTaskExecution.incident = incident;
515
- }
516
- this.endTaskExecution();
517
- return;
452
+ incident = getIncident(getProcessInstanceIncidentResult.response);
518
453
  }
519
- if (['TERMINATED', 'COMPLETED', 'CANCELED'].includes(state)) {
454
+ const isCompleted = ['COMPLETED', 'TERMINATED', 'CANCELED'].includes(state);
455
+ if (isCompleted || hasIncident) {
520
456
  const getProcessInstanceVariablesResult = await this._api.getProcessInstanceVariables(processInstanceKey);
521
457
  if (!getProcessInstanceVariablesResult.success) {
522
- this.emit('taskExecution.error', {
523
- message: 'Failed to get process instance variables',
524
- response: getProcessInstanceVariablesResult
525
- });
526
- } else {
527
- if (this._currentTaskExecution) {
528
- this._currentTaskExecution.variables = getVariables(getProcessInstanceVariablesResult.response);
529
- }
458
+ this._emitError('Failed to get process instance variables', getProcessInstanceVariablesResult.error);
459
+ return;
530
460
  }
531
- this.endTaskExecution();
461
+ const variables = getVariables(getProcessInstanceVariablesResult.response);
462
+ this.emit('taskExecution.finished', {
463
+ success: !incident,
464
+ incident,
465
+ variables
466
+ });
467
+ this.cancelTaskExecution();
532
468
  }
533
469
  };
534
- this._currentTaskExecution.interval = setInterval(intervalCallback, INTERVAL_MS);
470
+ this._interval = setInterval(intervalCallback, INTERVAL_MS);
471
+ }
472
+
473
+ /**
474
+ * Cancel current task execution, clean up and emit events:
475
+ * - `taskExecution.status.changed` with status `idle`
476
+ * - `taskExecution.canceled`
477
+ */
478
+ async cancelTaskExecution() {
479
+ // TODO: Proper clean up:
480
+ // - delete process instance
481
+ // - delete process definition
482
+ // - cancel deploy and start instance if they are in progress
483
+
484
+ if (this._interval) {
485
+ clearInterval(this._interval);
486
+ }
487
+ this.emit('taskExecution.status.changed', 'idle');
488
+ this.emit('taskExecution.canceled');
489
+ }
490
+
491
+ /**
492
+ * Emit `taskExecution.error` event.
493
+ *
494
+ * @param {string} message
495
+ * @param {any} [response]
496
+ */
497
+ _emitError(message, response) {
498
+ /** @type {import('./types').TaskExecutionError} */
499
+ const error = {
500
+ message,
501
+ response
502
+ };
503
+ this.emit('taskExecution.error', error);
535
504
  }
536
505
  }
537
506
 
538
507
  /**
539
508
  * Get the process ID from the deployment response.
540
509
  *
541
- * @param {import('./types').DeploymentResponse} response
510
+ * @param {import('./types').DeploymentResponse} [response]
542
511
  *
543
512
  * @returns {string|null} The process ID or null if not found.
544
513
  */
545
514
  function getProcessId(response) {
515
+ if (!response) {
516
+ return null;
517
+ }
546
518
  const {
547
519
  processes = []
548
520
  } = response;
@@ -555,41 +527,39 @@ function getProcessId(response) {
555
527
  }
556
528
 
557
529
  /**
558
- * Get the process definition key from the deployment response.
530
+ * Get the process instance key from the response.
559
531
  *
560
- * @param {import('./types').DeploymentResponse} response
532
+ * @param {import('./types').StartInstanceResponse} [response]
561
533
  *
562
- * @returns {string|null} The process definition key or null if not found.
534
+ * @returns {string|null} The process instance key or null if not found.
563
535
  */
564
- function getProcessDefinitionKey(response) {
536
+ function getProcessInstanceKey(response) {
537
+ if (!response) {
538
+ return null;
539
+ }
565
540
  const {
566
- processes = []
541
+ processInstanceKey
567
542
  } = response;
568
- for (const process of processes) {
569
- if (process) {
570
- return process.processDefinitionKey;
571
- }
572
- }
573
- return null;
543
+ return processInstanceKey || null;
574
544
  }
575
- function getProcessInstance(response) {
545
+ function getProcessInstance(response, processInstanceKey) {
576
546
  const {
577
547
  items = []
578
548
  } = response;
579
549
  if (!items.length) {
580
550
  return null;
581
551
  }
582
- return items[0];
552
+ return items.find(item => item.processInstanceKey === processInstanceKey) || null;
583
553
  }
584
- function getProcessInstanceState(response) {
585
- const processInstance = getProcessInstance(response);
554
+ function getProcessInstanceState(response, processInstanceKey) {
555
+ const processInstance = getProcessInstance(response, processInstanceKey);
586
556
  if (!processInstance) {
587
557
  return null;
588
558
  }
589
559
  return processInstance.state;
590
560
  }
591
- function hasProcessInstanceIncident(response) {
592
- const processInstance = getProcessInstance(response);
561
+ function hasProcessInstanceIncident(response, processInstanceKey) {
562
+ const processInstance = getProcessInstance(response, processInstanceKey);
593
563
  if (!processInstance) {
594
564
  return false;
595
565
  }
@@ -605,7 +575,11 @@ function getVariables(response) {
605
575
  name,
606
576
  value
607
577
  } = item;
608
- variables[name] = JSON.parse(value);
578
+ try {
579
+ variables[name] = JSON.parse(value);
580
+ } catch {
581
+ variables[name] = value;
582
+ }
609
583
  }
610
584
  return variables;
611
585
  }
@@ -643,7 +617,6 @@ __webpack_require__.r(__webpack_exports__);
643
617
 
644
618
  function Input({
645
619
  allOutputs,
646
- element,
647
620
  input,
648
621
  onErrorChange,
649
622
  onResetInput,
@@ -673,9 +646,8 @@ function Input({
673
646
  children: "Reset"
674
647
  })
675
648
  })]
676
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_InputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
649
+ }), input && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_InputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
677
650
  allOutputs: allOutputs,
678
- element: element,
679
651
  value: input,
680
652
  onChange: onSetInput,
681
653
  onErrorChange: onErrorChange,
@@ -694,6 +666,7 @@ function Input({
694
666
 
695
667
  __webpack_require__.r(__webpack_exports__);
696
668
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
669
+ /* harmony export */ INVALID_JSON_ERROR: () => (/* binding */ INVALID_JSON_ERROR),
697
670
  /* harmony export */ PLACEHOLDER_TEXT: () => (/* binding */ PLACEHOLDER_TEXT),
698
671
  /* harmony export */ "default": () => (/* binding */ InputEditor)
699
672
  /* harmony export */ });
@@ -708,7 +681,7 @@ __webpack_require__.r(__webpack_exports__);
708
681
  /* harmony import */ var _codemirror_lang_json__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @codemirror/lang-json */ "./node_modules/@codemirror/lang-json/dist/index.js");
709
682
  /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
710
683
  /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
711
- /* harmony import */ var _InputEditorTheme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./InputEditorTheme */ "./lib/components/Input/InputEditorTheme.js");
684
+ /* harmony import */ var _shared_CodeMirrorTheme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/CodeMirrorTheme */ "./lib/components/shared/CodeMirrorTheme.js");
712
685
  /* harmony import */ var _utils_autocompletion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/autocompletion */ "./lib/utils/autocompletion.js");
713
686
  /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
714
687
 
@@ -727,11 +700,11 @@ __webpack_require__.r(__webpack_exports__);
727
700
  const fromPropAnnotation = _codemirror_state__WEBPACK_IMPORTED_MODULE_6__.Annotation.define();
728
701
  const autocompletionCompartment = new _codemirror_state__WEBPACK_IMPORTED_MODULE_6__.Compartment();
729
702
  const PLACEHOLDER_TEXT = 'Enter process variables in JSON format';
703
+ const INVALID_JSON_ERROR = 'JSON contains errors';
730
704
  const DEFAULT_ALL_OUTPUTS = {},
731
705
  DEFAULT_VARIABLES_FOR_ELEMENT = [];
732
706
  function InputEditor({
733
707
  allOutputs = DEFAULT_ALL_OUTPUTS,
734
- element,
735
708
  value,
736
709
  onChange,
737
710
  onErrorChange,
@@ -786,8 +759,8 @@ function InputEditor({
786
759
  const source = view => {
787
760
  const errors = (0,_codemirror_lang_json__WEBPACK_IMPORTED_MODULE_7__.jsonParseLinter)()(view);
788
761
  const hasError = errors && errors.length > 0;
789
- onErrorChange(hasError ? 'Invalid JSON' : null);
790
- setError(hasError ? 'Invalid JSON' : null);
762
+ onErrorChange(hasError ? INVALID_JSON_ERROR : null);
763
+ setError(hasError ? INVALID_JSON_ERROR : null);
791
764
  return errors;
792
765
  };
793
766
  const editorState = _codemirror_state__WEBPACK_IMPORTED_MODULE_6__.EditorState.create({
@@ -797,7 +770,7 @@ function InputEditor({
797
770
  'tabindex': '0'
798
771
  }), (0,_codemirror_lint__WEBPACK_IMPORTED_MODULE_12__.linter)(source, {
799
772
  delay: 300
800
- }), autocompletionCompartment.of((0,_utils_autocompletion__WEBPACK_IMPORTED_MODULE_4__.getAutocompletionExtensions)(autocompletions)), (0,_codemirror_view__WEBPACK_IMPORTED_MODULE_10__.placeholder)(PLACEHOLDER_TEXT), _InputEditorTheme__WEBPACK_IMPORTED_MODULE_3__["default"], _codemirror_view__WEBPACK_IMPORTED_MODULE_10__.EditorView.lineWrapping, _codemirror_view__WEBPACK_IMPORTED_MODULE_10__.EditorView.updateListener.of(update => {
773
+ }), autocompletionCompartment.of((0,_utils_autocompletion__WEBPACK_IMPORTED_MODULE_4__.getAutocompletionExtensions)(autocompletions)), (0,_codemirror_view__WEBPACK_IMPORTED_MODULE_10__.placeholder)(PLACEHOLDER_TEXT), _shared_CodeMirrorTheme__WEBPACK_IMPORTED_MODULE_3__["default"], _codemirror_view__WEBPACK_IMPORTED_MODULE_10__.EditorView.lineWrapping, _codemirror_view__WEBPACK_IMPORTED_MODULE_10__.EditorView.updateListener.of(update => {
801
774
  if (update.docChanged) {
802
775
  if (update.transactions.some(transaction => transaction.annotation(fromPropAnnotation))) {
803
776
  return;
@@ -815,7 +788,7 @@ function InputEditor({
815
788
  return () => {
816
789
  view.destroy();
817
790
  };
818
- }, []);
791
+ }, [onChange]);
819
792
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
820
793
  if (!editorView) return;
821
794
  editorView.dispatch({
@@ -837,17 +810,17 @@ function InputEditor({
837
810
  }
838
811
  }, [editorView, value]);
839
812
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
840
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('input__editor', {
841
- 'input__editor--error': error
813
+ className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('code__editor', {
814
+ 'code__editor--error': error
842
815
  }),
843
816
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
844
- className: "input__editor-codemirror",
817
+ className: "code__editor-codemirror",
845
818
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
846
819
  ref: ref,
847
- className: "input__editor-codemirror-inner"
820
+ className: "code__editor-codemirror-inner"
848
821
  })
849
822
  }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
850
- className: "input__editor-error",
823
+ className: "code__editor-error",
851
824
  children: error
852
825
  })]
853
826
  });
@@ -914,122 +887,6 @@ function getDetail(value) {
914
887
 
915
888
  /***/ }),
916
889
 
917
- /***/ "./lib/components/Input/InputEditorTheme.js":
918
- /*!**************************************************!*\
919
- !*** ./lib/components/Input/InputEditorTheme.js ***!
920
- \**************************************************/
921
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
922
-
923
- __webpack_require__.r(__webpack_exports__);
924
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
925
- /* harmony export */ baseTheme: () => (/* binding */ baseTheme),
926
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
927
- /* harmony export */ highlightTheme: () => (/* binding */ highlightTheme),
928
- /* harmony export */ syntaxClasses: () => (/* binding */ syntaxClasses)
929
- /* harmony export */ });
930
- /* harmony import */ var _codemirror_language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @codemirror/language */ "./node_modules/@codemirror/language/dist/index.js");
931
- /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @codemirror/view */ "./node_modules/@codemirror/view/dist/index.js");
932
- /* harmony import */ var _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lezer/highlight */ "./node_modules/@lezer/highlight/dist/index.js");
933
-
934
-
935
-
936
- const baseTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.theme({
937
- '&': {
938
- height: '100%',
939
- width: '100%'
940
- },
941
- '.cm-scroller': {
942
- overflow: 'auto'
943
- },
944
- '& .cm-content': {
945
- padding: '0px'
946
- },
947
- '& .cm-line': {
948
- padding: '0px'
949
- },
950
- '&.cm-editor.cm-focused': {
951
- outline: 'none'
952
- },
953
- '& .cm-completionInfo': {
954
- whiteSpace: 'pre-wrap',
955
- overflow: 'hidden',
956
- textOverflow: 'ellipsis'
957
- },
958
- '&.cm-editor': {
959
- height: '100%'
960
- },
961
- // Don't wrap whitespace for custom HTML
962
- '& .cm-completionInfo > *': {
963
- whiteSpace: 'normal'
964
- },
965
- '& .cm-completionInfo ul': {
966
- margin: 0,
967
- paddingLeft: '15px'
968
- },
969
- '& .cm-completionInfo pre': {
970
- marginBottom: 0,
971
- whiteSpace: 'pre-wrap'
972
- },
973
- '& .cm-completionInfo p': {
974
- marginTop: 0
975
- },
976
- '& .cm-completionInfo p:not(:last-of-type)': {
977
- marginBottom: 0
978
- }
979
- });
980
- const highlightTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.baseTheme({
981
- '& .variableName': {
982
- color: '#10f'
983
- },
984
- '& .number': {
985
- color: '#164'
986
- },
987
- '& .string': {
988
- color: '#a11'
989
- },
990
- '& .bool': {
991
- color: '#219'
992
- },
993
- '& .function': {
994
- color: '#aa3731',
995
- fontWeight: 'bold'
996
- },
997
- '& .control': {
998
- color: '#708'
999
- }
1000
- });
1001
- const syntaxClasses = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.syntaxHighlighting)(_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.HighlightStyle.define([{
1002
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName,
1003
- class: 'variableName'
1004
- }, {
1005
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.name,
1006
- class: 'variableName'
1007
- }, {
1008
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.number,
1009
- class: 'number'
1010
- }, {
1011
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.string,
1012
- class: 'string'
1013
- }, {
1014
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.bool,
1015
- class: 'bool'
1016
- }, {
1017
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.function(_lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName),
1018
- class: 'function'
1019
- }, {
1020
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.function(_lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.special(_lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName)),
1021
- class: 'function'
1022
- }, {
1023
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.controlKeyword,
1024
- class: 'control'
1025
- }, {
1026
- tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.operatorKeyword,
1027
- class: 'control'
1028
- }]));
1029
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([baseTheme, highlightTheme, syntaxClasses]);
1030
-
1031
- /***/ }),
1032
-
1033
890
  /***/ "./lib/components/Output/Output.jsx":
1034
891
  /*!******************************************!*\
1035
892
  !*** ./lib/components/Output/Output.jsx ***!
@@ -1038,215 +895,372 @@ const syntaxClasses = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.synta
1038
895
 
1039
896
  __webpack_require__.r(__webpack_exports__);
1040
897
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
898
+ /* harmony export */ TASK_EXECUTION_STATUS_LABEL: () => (/* binding */ TASK_EXECUTION_STATUS_LABEL),
1041
899
  /* harmony export */ "default": () => (/* binding */ Output)
1042
900
  /* harmony export */ });
1043
901
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1044
902
  /* harmony import */ var _carbon_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @carbon/react */ "@carbon/react");
1045
903
  /* harmony import */ var _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @carbon/icons-react */ "@carbon/icons-react");
1046
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
904
+ /* harmony import */ var _OutputEditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./OutputEditor */ "./lib/components/Output/OutputEditor.jsx");
905
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1047
906
 
1048
907
 
1049
908
 
1050
909
 
910
+
911
+ const TASK_EXECUTION_STATUS_LABEL = {
912
+ deploying: 'Deploying...',
913
+ 'starting-instance': 'Starting instance...',
914
+ executing: 'Waiting for task to be completed...'
915
+ };
916
+
917
+ /**
918
+ * @param {Object} props
919
+ * @param {boolean} props.isConnectionConfigured
920
+ * @param {string} [props.configureConnectionBannerTitle]
921
+ * @param {string} [props.configureConnectionBannerDescription]
922
+ * @param {string} [props.configureConnectionLabel]
923
+ * @param {Function} [props.onConfigureConnection]
924
+ * @param {boolean} props.isTaskExecuting
925
+ * @param {import('../../types').ElementOutput} props.output
926
+ * @param {Function} props.onResetOutput
927
+ * @param {import('../../types').TaskExecutionStatus} props.taskExecutionStatus
928
+ */
1051
929
  function Output({
1052
930
  isConnectionConfigured,
931
+ configureConnectionBannerTitle,
932
+ configureConnectionBannerDescription,
933
+ configureConnectionLabel,
1053
934
  onConfigureConnection,
1054
935
  isTaskExecuting,
1055
936
  output,
1056
- onResetOutput
937
+ onResetOutput,
938
+ taskExecutionStatus
1057
939
  }) {
1058
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
940
+ const statusIcon = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
941
+ if (output !== null && output !== void 0 && output.error || output !== null && output !== void 0 && output.incident || !isConnectionConfigured) {
942
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.ErrorFilled, {
943
+ className: "output__status-icon--error"
944
+ });
945
+ }
946
+ if (output !== null && output !== void 0 && output.success) {
947
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.CheckmarkFilled, {
948
+ className: "output__status-icon--success"
949
+ });
950
+ }
951
+ if (isTaskExecuting) {
952
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.InlineLoading, {});
953
+ }
954
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.InProgress, {
955
+ className: "output__status-icon--ready"
956
+ });
957
+ }, [output, isTaskExecuting, isConnectionConfigured]);
958
+ const showResetButton = isConnectionConfigured && ((output === null || output === void 0 ? void 0 : output.success) || (output === null || output === void 0 ? void 0 : output.error) || (output === null || output === void 0 ? void 0 : output.incident));
959
+ const headerText = isTaskExecuting ? TASK_EXECUTION_STATUS_LABEL[taskExecutionStatus] : 'Results';
960
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1059
961
  className: "output",
1060
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
962
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1061
963
  className: "output__header",
1062
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
964
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1063
965
  className: "output__header--title",
1064
- children: "Results"
1065
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1066
- className: "output__header--buttons",
1067
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
1068
- kind: "ghost",
1069
- onClick: onResetOutput,
1070
- size: "sm",
1071
- renderIcon: _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Reset,
1072
- hasIconOnly: true,
1073
- tooltipPosition: "right",
1074
- iconDescription: "Reset output",
1075
- children: "Reset"
1076
- })
966
+ children: [statusIcon, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
967
+ children: headerText
968
+ })]
969
+ }), showResetButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
970
+ kind: "ghost",
971
+ onClick: () => onResetOutput(),
972
+ size: "sm",
973
+ renderIcon: _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Reset,
974
+ hasIconOnly: true,
975
+ tooltipPosition: "right",
976
+ iconDescription: "Reset output",
977
+ children: "Reset"
978
+ }), (output === null || output === void 0 ? void 0 : output.operateUrl) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
979
+ href: output.operateUrl,
980
+ target: "_blank",
981
+ className: "output__header--button-operate",
982
+ children: "View in Operate"
1077
983
  })]
1078
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
984
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1079
985
  className: "output__body",
1080
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1081
- className: "output__body--inner",
1082
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ConfigureConnection, {
1083
- isConnectionConfigured: isConnectionConfigured,
1084
- onConfigureConnection: onConfigureConnection
1085
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(NoResults, {
1086
- isConnectionConfigured: isConnectionConfigured,
1087
- isTaskExecuting: isTaskExecuting,
1088
- output: output
1089
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Success, {
1090
- isConnectionConfigured: isConnectionConfigured,
1091
- isTaskExecuting: isTaskExecuting,
1092
- output: output
1093
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Error, {
1094
- isConnectionConfigured: isConnectionConfigured,
1095
- isTaskExecuting: isTaskExecuting,
1096
- output: output
1097
- })]
1098
- })
986
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(OutputBanner, {
987
+ isConnectionConfigured: isConnectionConfigured,
988
+ configureConnectionBannerTitle: configureConnectionBannerTitle,
989
+ configureConnectionBannerDescription: configureConnectionBannerDescription,
990
+ configureConnectionLabel: configureConnectionLabel,
991
+ onConfigureConnection: onConfigureConnection,
992
+ output: output
993
+ }), isConnectionConfigured && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(OutputVariables, {
994
+ isTaskExecuting: isTaskExecuting,
995
+ output: output
996
+ })]
1099
997
  })]
1100
998
  });
1101
999
  }
1102
- function ConfigureConnection(props) {
1103
- const {
1104
- isConnectionConfigured,
1105
- onConfigureConnection
1106
- } = props;
1107
- if (isConnectionConfigured) {
1108
- return null;
1000
+ function OutputBanner({
1001
+ isConnectionConfigured,
1002
+ configureConnectionBannerTitle,
1003
+ configureConnectionBannerDescription,
1004
+ configureConnectionLabel,
1005
+ onConfigureConnection,
1006
+ output
1007
+ }) {
1008
+ if (!isConnectionConfigured) {
1009
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
1010
+ title: configureConnectionBannerTitle,
1011
+ description: configureConnectionBannerDescription,
1012
+ actionLabel: configureConnectionLabel,
1013
+ onActionClick: onConfigureConnection
1014
+ });
1109
1015
  }
1110
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
1111
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1112
- className: "output__state output__state--error",
1113
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1114
- className: "output__state-icon",
1115
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.ErrorFilled, {
1116
- className: "output__status-icon"
1117
- })
1118
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1119
- className: "output__state-content",
1120
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1121
- className: "output__state-title",
1122
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
1123
- children: "Connection required"
1124
- }), onConfigureConnection && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
1125
- onClick: onConfigureConnection,
1126
- children: "Configure"
1127
- })]
1128
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1129
- className: "output__state-details",
1130
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
1131
- children: "Configure a connection to start testing."
1132
- })
1133
- })]
1134
- })]
1135
- })
1136
- });
1137
- }
1138
- function NoResults(props) {
1139
- const {
1140
- isConnectionConfigured,
1141
- isTaskExecuting,
1142
- output
1143
- } = props;
1144
- if (!isConnectionConfigured || isTaskExecuting || output) {
1145
- return null;
1016
+ if (output !== null && output !== void 0 && output.error) {
1017
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
1018
+ title: "Task execution failed",
1019
+ description: `Error: ${output.error.message}`
1020
+ });
1146
1021
  }
1147
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1148
- className: "output__variables output__variables--no-results",
1149
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.CodeSnippet, {
1150
- type: "multi",
1151
- hideCopyButton: true,
1152
- maxCollapsedNumberOfRows: 100,
1153
- children: 'Test task to see results'
1154
- })
1155
- });
1022
+ if (output !== null && output !== void 0 && output.incident) {
1023
+ const action = output.incident.operateUrl ? {
1024
+ actionLabel: 'View in Operate',
1025
+ actionUrl: output.incident.operateUrl
1026
+ } : {};
1027
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
1028
+ title: "Task execution failed",
1029
+ description: `Incident: ${output.incident.type}`,
1030
+ ...action
1031
+ });
1032
+ }
1033
+ return null;
1156
1034
  }
1157
- function Success({
1158
- isConnectionConfigured,
1035
+ function OutputVariables({
1159
1036
  isTaskExecuting,
1160
1037
  output
1161
1038
  }) {
1162
- if (!isConnectionConfigured || isTaskExecuting || !output || !output.success) {
1163
- return null;
1039
+ if (isTaskExecuting) {
1040
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.CodeSnippetSkeleton, {
1041
+ className: "output__variables--skeleton",
1042
+ type: "multi"
1043
+ });
1044
+ }
1045
+ if (output !== null && output !== void 0 && output.success) {
1046
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1047
+ value: JSON.stringify(output.variables, null, 2)
1048
+ });
1049
+
1050
+ // TODO: Introduce tabs when able to filter variables by `scopeKey`
1051
+ // return (
1052
+ // <Tabs>
1053
+ // <TabList>
1054
+ // <Tab>Process variables</Tab>
1055
+ // <Tab>Task variables</Tab>
1056
+ // </TabList>
1057
+ // <TabPanels>
1058
+ // <TabPanel>
1059
+ // <OutputEditor value={ JSON.stringify(output.variables, null, 2) } />
1060
+ // </TabPanel>
1061
+ // <TabPanel>
1062
+ // <OutputEditor value={ JSON.stringify(output.variables, null, 2) } />
1063
+ // </TabPanel>
1064
+ // </TabPanels>
1065
+ // </Tabs>
1066
+ // );
1067
+ }
1068
+ if (output !== null && output !== void 0 && output.error) {
1069
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1070
+ value: (output === null || output === void 0 ? void 0 : output.error.response) || 'No error details available'
1071
+ });
1072
+ }
1073
+ if (output !== null && output !== void 0 && output.incident) {
1074
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tabs, {
1075
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabList, {
1076
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tab, {
1077
+ children: "Incident"
1078
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tab, {
1079
+ children: "Process variables"
1080
+ })]
1081
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabPanels, {
1082
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabPanel, {
1083
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1084
+ value: printIncident(output.incident)
1085
+ })
1086
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabPanel, {
1087
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1088
+ value: JSON.stringify(output.variables, null, 2)
1089
+ })
1090
+ })]
1091
+ })]
1092
+ });
1164
1093
  }
1165
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1166
- className: "output__variables",
1167
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.CodeSnippet, {
1168
- type: "multi",
1169
- feedback: "Copied to clipboard",
1170
- hideCopyButton: false,
1171
- maxCollapsedNumberOfRows: 100,
1172
- align: "left",
1173
- children: JSON.stringify(output.variables, null, 2)
1094
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1095
+ className: "output__variables--empty",
1096
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1097
+ children: ["Enter input variables, then click ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
1098
+ className: "output__variables--empty-action",
1099
+ children: "Test task"
1100
+ }), " to see results."]
1174
1101
  })
1175
1102
  });
1176
1103
  }
1177
- function Error({
1178
- isConnectionConfigured,
1179
- isTaskExecuting,
1180
- output
1104
+
1105
+ /**
1106
+ *
1107
+ * @param {Object} props
1108
+ * @param {string} props.title
1109
+ * @param {string} props.description
1110
+ * @param {string} [props.actionLabel]
1111
+ * @param {string} [props.actionUrl]
1112
+ * @param {Function} [props.onActionClick]
1113
+ */
1114
+ function ErrorBanner({
1115
+ title,
1116
+ description,
1117
+ actionLabel,
1118
+ actionUrl = '#',
1119
+ onActionClick = () => {}
1181
1120
  }) {
1182
- if (!isConnectionConfigured || isTaskExecuting || !output || output.success) {
1183
- return null;
1184
- }
1185
- const {
1186
- error,
1187
- incident
1188
- } = output;
1189
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
1190
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1191
- className: "output__state output__state--error",
1192
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1193
- className: "output__state-icon",
1194
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.ErrorFilled, {
1195
- className: "output__status-icon"
1196
- })
1197
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1198
- className: "output__state-content",
1199
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1200
- className: "output__state-title",
1201
- children: "Task execution failed"
1202
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1203
- className: "output__state-details",
1204
- children: [incident && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
1205
- children: ["Incident: ", incident.type]
1206
- }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
1207
- children: ["Error: ", error.message]
1208
- })]
1121
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1122
+ className: "output__error",
1123
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1124
+ className: "output__error--icon",
1125
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.ErrorFilled, {})
1126
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1127
+ className: "output__error--content",
1128
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1129
+ className: "output__error--title",
1130
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
1131
+ children: title
1132
+ }), actionLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
1133
+ href: actionUrl,
1134
+ onClick: () => onActionClick(),
1135
+ children: actionLabel
1209
1136
  })]
1137
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1138
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
1139
+ children: description
1140
+ })
1210
1141
  })]
1211
- }), incident && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.CodeSnippet, {
1212
- type: "multi",
1213
- feedback: "Copied to clipboard",
1214
- hideCopyButton: false,
1215
- maxCollapsedNumberOfRows: 100,
1216
- align: "left",
1217
- children: printError(incident)
1218
- }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.CodeSnippet, {
1219
- type: "multi",
1220
- feedback: "Copied to clipboard",
1221
- hideCopyButton: false,
1222
- maxCollapsedNumberOfRows: 100,
1223
- align: "left",
1224
- children: printError(error)
1225
1142
  })]
1226
1143
  });
1227
1144
  }
1228
- function printError(error) {
1229
- let text = '';
1230
- Object.keys(error).forEach(key => {
1231
- text += `${capitalize(key)}: ${JSON.stringify(error[key], null, 2)}\n`;
1232
- });
1233
- return text;
1234
- }
1235
-
1236
- /**
1237
- * Capitalize a string, adding spaces before capital letters.
1238
- *
1239
- * @example
1240
- *
1241
- * capitalize('fooBar'); // Foo Bar
1242
- *
1243
- * @param {string} string
1244
- *
1245
- * @returns {string}
1246
- */
1247
- function capitalize(string) {
1248
- return string.replace(/([A-Z])/g, ' $1').replace(/^./, match => match.toUpperCase());
1249
- }
1145
+
1146
+ /**
1147
+ * Print the details of an incident.
1148
+ *
1149
+ * @param {Object} incident
1150
+ *
1151
+ * @returns {string}
1152
+ */
1153
+ function printIncident(incident) {
1154
+ let text = '';
1155
+ Object.keys(incident).forEach(key => {
1156
+ text += `${capitalize(key)}: ${JSON.stringify(incident[key], null, 2)}\n`;
1157
+ });
1158
+ return text;
1159
+ }
1160
+
1161
+ /**
1162
+ * Capitalize a string, adding spaces before capital letters.
1163
+ *
1164
+ * @example
1165
+ *
1166
+ * capitalize('fooBar'); // Foo Bar
1167
+ *
1168
+ * @param {string} string
1169
+ *
1170
+ * @returns {string}
1171
+ */
1172
+ function capitalize(string) {
1173
+ return string.replace(/([A-Z])/g, ' $1').replace(/^./, match => match.toUpperCase());
1174
+ }
1175
+
1176
+ /***/ }),
1177
+
1178
+ /***/ "./lib/components/Output/OutputEditor.jsx":
1179
+ /*!************************************************!*\
1180
+ !*** ./lib/components/Output/OutputEditor.jsx ***!
1181
+ \************************************************/
1182
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1183
+
1184
+ __webpack_require__.r(__webpack_exports__);
1185
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1186
+ /* harmony export */ "default": () => (/* binding */ OutputEditor)
1187
+ /* harmony export */ });
1188
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1189
+ /* harmony import */ var _carbon_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @carbon/react */ "@carbon/react");
1190
+ /* harmony import */ var _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @carbon/icons-react */ "@carbon/icons-react");
1191
+ /* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @codemirror/state */ "./node_modules/@codemirror/state/dist/index.js");
1192
+ /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @codemirror/view */ "./node_modules/@codemirror/view/dist/index.js");
1193
+ /* harmony import */ var _codemirror_lang_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @codemirror/lang-json */ "./node_modules/@codemirror/lang-json/dist/index.js");
1194
+ /* harmony import */ var _shared_CodeMirrorTheme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/CodeMirrorTheme */ "./lib/components/shared/CodeMirrorTheme.js");
1195
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+
1204
+ function OutputEditor({
1205
+ value
1206
+ }) {
1207
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1208
+
1209
+ /**
1210
+ * @type {ReturnType<typeof useState<EditorView>>}
1211
+ */
1212
+ const [editorView, setEditorView] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1213
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1214
+ if (!ref.current) {
1215
+ return;
1216
+ }
1217
+ const editorState = _codemirror_state__WEBPACK_IMPORTED_MODULE_5__.EditorState.create({
1218
+ doc: value,
1219
+ extensions: [(0,_codemirror_lang_json__WEBPACK_IMPORTED_MODULE_6__.json)(), _codemirror_state__WEBPACK_IMPORTED_MODULE_5__.EditorState.tabSize.of(2), _codemirror_state__WEBPACK_IMPORTED_MODULE_5__.EditorState.readOnly.of(true), _codemirror_view__WEBPACK_IMPORTED_MODULE_7__.EditorView.editable.of(false), _codemirror_view__WEBPACK_IMPORTED_MODULE_7__.EditorView.lineWrapping, _shared_CodeMirrorTheme__WEBPACK_IMPORTED_MODULE_3__["default"]]
1220
+ });
1221
+ const view = new _codemirror_view__WEBPACK_IMPORTED_MODULE_7__.EditorView({
1222
+ state: editorState,
1223
+ parent: ref.current
1224
+ });
1225
+ setEditorView(view);
1226
+ return () => {
1227
+ view.destroy();
1228
+ };
1229
+ }, []);
1230
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1231
+ if (!editorView) return;
1232
+ const editorValue = editorView.state.doc.toString();
1233
+ if (value !== editorValue) {
1234
+ editorView.dispatch({
1235
+ changes: {
1236
+ from: 0,
1237
+ to: editorValue.length,
1238
+ insert: value
1239
+ }
1240
+ });
1241
+ }
1242
+ }, [editorView, value]);
1243
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1244
+ className: "code__editor",
1245
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
1246
+ className: "code__editor-copy-button",
1247
+ renderIcon: _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Copy,
1248
+ iconDescription: "Copy to clipboard",
1249
+ size: "sm",
1250
+ kind: "ghost",
1251
+ hasIconOnly: true,
1252
+ onClick: () => {
1253
+ navigator.clipboard.writeText(value);
1254
+ }
1255
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1256
+ className: "code__editor-codemirror",
1257
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1258
+ ref: ref,
1259
+ className: "code__editor-codemirror-inner"
1260
+ })
1261
+ })]
1262
+ });
1263
+ }
1250
1264
 
1251
1265
  /***/ }),
1252
1266
 
@@ -1264,15 +1278,18 @@ __webpack_require__.r(__webpack_exports__);
1264
1278
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1265
1279
  /* harmony import */ var _carbon_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @carbon/react */ "@carbon/react");
1266
1280
  /* harmony import */ var _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @carbon/icons-react */ "@carbon/icons-react");
1267
- /* harmony import */ var _hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks/useSelectedElement */ "./lib/hooks/useSelectedElement.js");
1268
- /* harmony import */ var _ElementConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ElementConfig */ "./lib/ElementConfig.js");
1269
- /* harmony import */ var _ElementVariables__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ElementVariables */ "./lib/ElementVariables.js");
1270
- /* harmony import */ var _Input_Input__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Input/Input */ "./lib/components/Input/Input.jsx");
1271
- /* harmony import */ var _Output_Output__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Output/Output */ "./lib/components/Output/Output.jsx");
1272
- /* harmony import */ var _TaskExecution__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../TaskExecution */ "./lib/TaskExecution.js");
1273
- /* harmony import */ var _utils_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/element */ "./lib/utils/element.js");
1274
- /* harmony import */ var _style_style_scss__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../style/style.scss */ "./lib/style/style.scss");
1275
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1281
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
1282
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
1283
+ /* harmony import */ var _hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useSelectedElement */ "./lib/hooks/useSelectedElement.js");
1284
+ /* harmony import */ var _ElementConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ElementConfig */ "./lib/ElementConfig.js");
1285
+ /* harmony import */ var _ElementVariables__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ElementVariables */ "./lib/ElementVariables.js");
1286
+ /* harmony import */ var _Input_Input__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Input/Input */ "./lib/components/Input/Input.jsx");
1287
+ /* harmony import */ var _Output_Output__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Output/Output */ "./lib/components/Output/Output.jsx");
1288
+ /* harmony import */ var _TaskExecution__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../TaskExecution */ "./lib/TaskExecution.js");
1289
+ /* harmony import */ var _utils_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/element */ "./lib/utils/element.js");
1290
+ /* harmony import */ var _style_style_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../style/style.scss */ "./lib/style/style.scss");
1291
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1292
+
1276
1293
 
1277
1294
 
1278
1295
 
@@ -1291,18 +1308,30 @@ const NO_ELEMENT_TEXT = 'Select a task to start testing';
1291
1308
  * @param {Object} props
1292
1309
  * @param {Object} props.injector
1293
1310
  * @param {import('../../types').TaskExecutionApi} props.api
1294
- * @param {boolean} [props.isConnectionConfigured]
1295
- * @param {string} [props.onConfigureConnection]
1311
+ * @param {boolean} props.isConnectionConfigured
1312
+ * @param {string} [props.configureConnectionBannerTitle]
1313
+ * @param {string} [props.configureConnectionBannerDescription]
1314
+ * @param {string} [props.configureConnectionLabel]
1315
+ * @param {Function} [props.onConfigureConnection]
1296
1316
  * @param {import('../../types').Config|undefined} [props.config]
1297
1317
  * @param {Function} [props.onConfigChanged=() => {}]
1318
+ * @param {string} [props.operateBaseUrl]
1319
+ * @param {Function} [props.onTaskExecution=() => {}]
1320
+ * @param {Function} [props.onTaskExecutionCanceled=() => {}]
1298
1321
  */
1299
1322
  function TaskTesting({
1300
1323
  injector,
1301
1324
  api,
1302
1325
  isConnectionConfigured,
1326
+ configureConnectionBannerTitle = 'Connection required',
1327
+ configureConnectionBannerDescription = 'Configure a connection to start testing.',
1328
+ configureConnectionLabel = 'Configure',
1303
1329
  onConfigureConnection,
1304
1330
  config,
1305
- onConfigChanged = () => {}
1331
+ onConfigChanged = () => {},
1332
+ operateBaseUrl,
1333
+ onTaskExecution = () => {},
1334
+ onTaskExecutionCanceled = () => {}
1306
1335
  }) {
1307
1336
  /**
1308
1337
  * @type {React.RefObject<ElementVariables?>}
@@ -1314,31 +1343,49 @@ function TaskTesting({
1314
1343
  */
1315
1344
  const elementConfigRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1316
1345
  const [variablesForElement, setVariablesForElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
1317
- const [isTaskExecuting, setIsTaskExecuting] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
1318
- const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('{}');
1319
- const [output, setOutput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
1346
+
1347
+ /**
1348
+ * @type {ReturnType<typeof useState<import('../../types').TaskExecutionStatus>>}
1349
+ */
1350
+ const [taskExecutionStatus, setTaskExecutionStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1351
+
1352
+ /**
1353
+ * @type {ReturnType<typeof useState<string>>}
1354
+ */
1355
+ const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1356
+
1357
+ /**
1358
+ * @type {ReturnType<typeof useState<import('../../types').ElementOutput>>}
1359
+ */
1360
+ const [output, setOutput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1320
1361
  const [allOutputs, setAllOutputs] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
1321
1362
  const [inputError, setInputError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
1322
- const element = (0,_hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_3__.useSelectedElement)(injector);
1363
+ const element = (0,_hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_4__.useSelectedElement)(injector);
1323
1364
 
1324
1365
  /**
1325
1366
  * @type {React.RefObject<TaskExecution?>}
1326
1367
  */
1327
1368
  const taskExecutionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1369
+
1370
+ // Initialize services once the injector is available
1328
1371
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1329
- const elementVariables = new _ElementVariables__WEBPACK_IMPORTED_MODULE_5__.ElementVariables(injector);
1372
+ const elementVariables = new _ElementVariables__WEBPACK_IMPORTED_MODULE_6__.ElementVariables(injector);
1330
1373
  elementVariablesRef.current = elementVariables;
1331
- const elementConfig = new _ElementConfig__WEBPACK_IMPORTED_MODULE_4__.ElementConfig(injector, elementVariables, config);
1374
+ const elementConfig = new _ElementConfig__WEBPACK_IMPORTED_MODULE_5__.ElementConfig(injector, elementVariables, config);
1332
1375
  elementConfigRef.current = elementConfig;
1333
- const taskExecution = new _TaskExecution__WEBPACK_IMPORTED_MODULE_8__["default"](injector, api);
1376
+ const taskExecution = new _TaskExecution__WEBPACK_IMPORTED_MODULE_9__["default"](injector, api);
1334
1377
  taskExecutionRef.current = taskExecution;
1335
1378
  }, [injector]);
1379
+
1380
+ // Get input variables for the selected element
1336
1381
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1337
1382
  if (!element || !elementVariablesRef.current) {
1338
1383
  return;
1339
1384
  }
1340
1385
  elementVariablesRef.current.getVariablesForElement(element).then(variables => setVariablesForElement(variables));
1341
1386
  }, [element]);
1387
+
1388
+ // Subscribe to `variables.changed` event fired by the Variables Resolver
1342
1389
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1343
1390
  if (!elementVariablesRef.current) {
1344
1391
  return;
@@ -1357,6 +1404,8 @@ function TaskTesting({
1357
1404
  }
1358
1405
  };
1359
1406
  }, [element]);
1407
+
1408
+ // Listen for changes in the config from the modeler
1360
1409
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1361
1410
  if (!elementConfigRef.current) {
1362
1411
  return;
@@ -1380,61 +1429,55 @@ function TaskTesting({
1380
1429
  }
1381
1430
  };
1382
1431
  }, [element, onConfigChanged, setAllOutputs, setInput, setOutput]);
1432
+
1433
+ // Subscribe to task execution events
1383
1434
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1384
- if (!taskExecutionRef.current) {
1385
- return;
1386
- }
1387
- const handleTaskExecutionStart = () => {
1388
- setIsTaskExecuting(true);
1389
- if (!element || !elementConfigRef.current) {
1390
- return;
1391
- }
1392
- elementConfigRef.current.setOutputConfigForElement(element, null);
1393
- };
1394
- taskExecutionRef.current.on('taskExecution.start', handleTaskExecutionStart);
1395
- const handleTaskExecutionError = ({
1396
- message,
1397
- response
1398
- }) => {
1399
- setIsTaskExecuting(false);
1400
- if (!element || !elementConfigRef.current) {
1401
- return;
1402
- }
1403
- elementConfigRef.current.setOutputConfigForElement(element, {
1435
+ var _taskExecutionRef$cur, _taskExecutionRef$cur2, _taskExecutionRef$cur3, _taskExecutionRef$cur4;
1436
+ /** @param {import('../../types').TaskExecutionError} error */
1437
+ const handleError = error => {
1438
+ var _elementConfigRef$cur;
1439
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur = elementConfigRef.current) === null || _elementConfigRef$cur === void 0 || _elementConfigRef$cur.setOutputConfigForElement(element, {
1404
1440
  success: false,
1405
- error: {
1406
- message,
1407
- response
1408
- }
1441
+ error
1409
1442
  });
1410
1443
  };
1411
- taskExecutionRef.current.on('taskExecution.error', handleTaskExecutionError);
1412
- const handleTaskExecutionCancelled = () => {
1413
- setIsTaskExecuting(false);
1414
- };
1415
- taskExecutionRef.current.on('taskExecution.cancelled', handleTaskExecutionCancelled);
1416
- const handleTaskExecutionEnd = ({
1417
- incident,
1418
- success,
1419
- variables
1420
- }) => {
1421
- setIsTaskExecuting(false);
1422
- if (!element || !elementConfigRef.current) {
1423
- return;
1444
+
1445
+ /**
1446
+ * @param {import('../../types').TaskExecutionStatus} status
1447
+ * @param {string} [processInstanceKey]
1448
+ */
1449
+ const handleStatusChange = (status, processInstanceKey) => {
1450
+ setTaskExecutionStatus(status);
1451
+ if (processInstanceKey) {
1452
+ var _elementConfigRef$cur2;
1453
+ const operateUrl = operateBaseUrl ? `${operateBaseUrl}/processes/${processInstanceKey}` : null;
1454
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur2 = elementConfigRef.current) === null || _elementConfigRef$cur2 === void 0 || _elementConfigRef$cur2.setOutputConfigForElement(element, {
1455
+ operateUrl
1456
+ });
1424
1457
  }
1425
- elementConfigRef.current.setOutputConfigForElement(element, {
1426
- success,
1427
- incident,
1428
- variables
1458
+ };
1459
+
1460
+ /** @param {import('../../types').ElementOutput} output */
1461
+ const handleFinished = output => {
1462
+ var _elementConfigRef$cur3, _elementConfigRef$cur4;
1463
+ const {
1464
+ operateUrl
1465
+ } = (elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur3 = elementConfigRef.current) === null || _elementConfigRef$cur3 === void 0 ? void 0 : _elementConfigRef$cur3.getOutputConfigForElement(element)) || {};
1466
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur4 = elementConfigRef.current) === null || _elementConfigRef$cur4 === void 0 || _elementConfigRef$cur4.setOutputConfigForElement(element, {
1467
+ ...output,
1468
+ operateUrl
1429
1469
  });
1430
1470
  };
1431
- taskExecutionRef.current.on('taskExecution.end', handleTaskExecutionEnd);
1471
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur = taskExecutionRef.current) === null || _taskExecutionRef$cur === void 0 || _taskExecutionRef$cur.on('taskExecution.finished', handleFinished);
1472
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur2 = taskExecutionRef.current) === null || _taskExecutionRef$cur2 === void 0 || _taskExecutionRef$cur2.on('taskExecution.status.changed', handleStatusChange);
1473
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur3 = taskExecutionRef.current) === null || _taskExecutionRef$cur3 === void 0 || _taskExecutionRef$cur3.on('taskExecution.error', handleError);
1474
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.canceled', () => onTaskExecutionCanceled());
1432
1475
  return () => {
1433
1476
  if (taskExecutionRef.current) {
1434
- taskExecutionRef.current.off('taskExecution.start', handleTaskExecutionStart);
1435
- taskExecutionRef.current.off('taskExecution.error', handleTaskExecutionError);
1436
- taskExecutionRef.current.off('taskExecution.cancelled', handleTaskExecutionCancelled);
1437
- taskExecutionRef.current.off('taskExecution.end', handleTaskExecutionEnd);
1477
+ taskExecutionRef.current.off('taskExecution.finished', handleFinished);
1478
+ taskExecutionRef.current.off('taskExecution.status.changed', handleStatusChange);
1479
+ taskExecutionRef.current.off('taskExecution.error', handleError);
1480
+ taskExecutionRef.current.off('taskExecution.canceled', () => onTaskExecutionCanceled());
1438
1481
  }
1439
1482
  };
1440
1483
  }, [element]);
@@ -1446,10 +1489,13 @@ function TaskTesting({
1446
1489
  }
1447
1490
  }, [config]);
1448
1491
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1449
- if (element && elementConfigRef.current) {
1450
- elementConfigRef.current.getInputConfigForElement(element).then(setInput);
1451
- setOutput(elementConfigRef.current.getOutputConfigForElement(element));
1492
+ var _elementConfigRef$cur5, _elementConfigRef$cur6;
1493
+ if (!element) {
1494
+ setInput(undefined);
1495
+ return;
1452
1496
  }
1497
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur5 = elementConfigRef.current) === null || _elementConfigRef$cur5 === void 0 || _elementConfigRef$cur5.getInputConfigForElement(element).then(setInput);
1498
+ setOutput(elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur6 = elementConfigRef.current) === null || _elementConfigRef$cur6 === void 0 ? void 0 : _elementConfigRef$cur6.getOutputConfigForElement(element));
1453
1499
  }, [element]);
1454
1500
  const handleSetInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(newInput => {
1455
1501
  if (element && elementConfigRef.current) {
@@ -1466,7 +1512,9 @@ function TaskTesting({
1466
1512
  return;
1467
1513
  }
1468
1514
  const inputConfig = await elementConfigRef.current.getInputConfigForElement(element);
1515
+ elementConfigRef.current.setOutputConfigForElement(element, null);
1469
1516
  taskExecutionRef.current.executeTask(element.id, JSON.parse(inputConfig));
1517
+ onTaskExecution();
1470
1518
  };
1471
1519
  const handleCancelTaskExecution = () => {
1472
1520
  if (taskExecutionRef.current) {
@@ -1479,84 +1527,199 @@ function TaskTesting({
1479
1527
  }
1480
1528
  }, [element]);
1481
1529
  if (!config) {
1482
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
1530
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
1483
1531
  className: "task-testing__container task-testing__container--empty",
1484
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1532
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1485
1533
  className: "task-testing__container-no-config",
1486
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.InlineLoading, {}), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
1534
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.InlineLoading, {}), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
1487
1535
  children: "Configuring..."
1488
1536
  })]
1489
1537
  })
1490
1538
  });
1491
1539
  }
1492
1540
  if (!element) {
1493
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
1541
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
1494
1542
  className: "task-testing__container task-testing__container--empty",
1495
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1543
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1496
1544
  className: "task-testing__container-no-element",
1497
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Cursor_1, {}), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
1545
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Cursor_1, {}), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
1498
1546
  children: NO_ELEMENT_TEXT
1499
1547
  })]
1500
1548
  })
1501
1549
  });
1502
1550
  }
1503
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1551
+ const showTooltip = !isConnectionConfigured || !!inputError;
1552
+ const tooltipLabel = !isConnectionConfigured ? 'Connection not configured' : inputError;
1553
+ const isTaskExecuting = !!taskExecutionStatus && taskExecutionStatus !== 'idle';
1554
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1504
1555
  className: "task-testing__container",
1505
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1506
- className: "task-testing__container--header",
1507
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1508
- className: "task-testing__container--header--left",
1509
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Chemistry, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1510
- children: ["Test task ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
1511
- className: "task-testing__container--header-task-name",
1512
- children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_9__.getName)(element)
1556
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1557
+ className: "task-testing__container--left",
1558
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1559
+ className: "task-testing__container--header",
1560
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1561
+ className: "task-name",
1562
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Chemistry, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
1563
+ children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_10__.getName)(element)
1513
1564
  })]
1514
- })]
1515
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
1516
- className: "task-testing__container--header--right",
1517
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {
1518
- className: !isConnectionConfigured || inputError ? 'has-error' : '',
1519
- label: "Cannot test task",
1565
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {
1566
+ className: classnames__WEBPACK_IMPORTED_MODULE_3___default()({
1567
+ 'has-error': showTooltip
1568
+ }),
1569
+ label: tooltipLabel,
1520
1570
  align: "left-start",
1521
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
1522
- kind: isConnectionConfigured && !inputError && !isTaskExecuting ? 'primary' : 'tertiary',
1571
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
1572
+ className: "btn-execute",
1573
+ kind: "primary",
1523
1574
  size: "sm",
1575
+ renderIcon: isTaskExecuting ? _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.StopFilledAlt : _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.PlayFilledAlt,
1524
1576
  onClick: isTaskExecuting ? handleCancelTaskExecution : handleExecuteTask,
1525
- children: [isTaskExecuting && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.InlineLoading, {
1526
- status: "active"
1527
- }), isTaskExecuting ? 'Testing...' : 'Test task']
1577
+ children: isTaskExecuting ? 'Cancel' : 'Test task'
1528
1578
  })
1529
- })
1530
- })]
1531
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1532
- className: "task-testing__container--main",
1533
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
1534
- className: "task-testing__container--main--left",
1535
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_Input_Input__WEBPACK_IMPORTED_MODULE_6__["default"], {
1536
- allOutputs: allOutputs,
1537
- element: element,
1538
- input: input,
1539
- onErrorChange: setInputError,
1540
- onResetInput: handleResetInput,
1541
- onSetInput: handleSetInput,
1542
- variablesForElement: variablesForElement
1543
- })
1544
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
1545
- className: "task-testing__container--main--right",
1546
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_Output_Output__WEBPACK_IMPORTED_MODULE_7__["default"], {
1547
- isConnectionConfigured: isConnectionConfigured,
1548
- onConfigureConnection: onConfigureConnection,
1549
- isTaskExecuting: isTaskExecuting,
1550
- output: output,
1551
- onResetOutput: handleResetOutput
1552
- })
1579
+ })]
1580
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Input_Input__WEBPACK_IMPORTED_MODULE_7__["default"], {
1581
+ allOutputs: allOutputs,
1582
+ input: input,
1583
+ onErrorChange: setInputError,
1584
+ onResetInput: handleResetInput,
1585
+ onSetInput: handleSetInput,
1586
+ variablesForElement: variablesForElement
1553
1587
  })]
1588
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
1589
+ className: "task-testing__container--right",
1590
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Output_Output__WEBPACK_IMPORTED_MODULE_8__["default"], {
1591
+ isConnectionConfigured: isConnectionConfigured,
1592
+ configureConnectionBannerTitle: configureConnectionBannerTitle,
1593
+ configureConnectionBannerDescription: configureConnectionBannerDescription,
1594
+ configureConnectionLabel: configureConnectionLabel,
1595
+ onConfigureConnection: onConfigureConnection,
1596
+ isTaskExecuting: isTaskExecuting,
1597
+ output: output,
1598
+ onResetOutput: handleResetOutput,
1599
+ taskExecutionStatus: taskExecutionStatus || 'idle'
1600
+ })
1554
1601
  })]
1555
1602
  });
1556
1603
  }
1557
1604
 
1558
1605
  /***/ }),
1559
1606
 
1607
+ /***/ "./lib/components/shared/CodeMirrorTheme.js":
1608
+ /*!**************************************************!*\
1609
+ !*** ./lib/components/shared/CodeMirrorTheme.js ***!
1610
+ \**************************************************/
1611
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1612
+
1613
+ __webpack_require__.r(__webpack_exports__);
1614
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1615
+ /* harmony export */ baseTheme: () => (/* binding */ baseTheme),
1616
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1617
+ /* harmony export */ highlightTheme: () => (/* binding */ highlightTheme),
1618
+ /* harmony export */ syntaxClasses: () => (/* binding */ syntaxClasses)
1619
+ /* harmony export */ });
1620
+ /* harmony import */ var _codemirror_language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @codemirror/language */ "./node_modules/@codemirror/language/dist/index.js");
1621
+ /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @codemirror/view */ "./node_modules/@codemirror/view/dist/index.js");
1622
+ /* harmony import */ var _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lezer/highlight */ "./node_modules/@lezer/highlight/dist/index.js");
1623
+
1624
+
1625
+
1626
+ const baseTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.theme({
1627
+ '&': {
1628
+ height: '100%',
1629
+ width: '100%'
1630
+ },
1631
+ '.cm-scroller': {
1632
+ overflow: 'auto'
1633
+ },
1634
+ '& .cm-content': {
1635
+ padding: '0px'
1636
+ },
1637
+ '& .cm-line': {
1638
+ padding: '0px'
1639
+ },
1640
+ '&.cm-editor.cm-focused': {
1641
+ outline: 'none'
1642
+ },
1643
+ '& .cm-completionInfo': {
1644
+ whiteSpace: 'pre-wrap',
1645
+ overflow: 'hidden',
1646
+ textOverflow: 'ellipsis'
1647
+ },
1648
+ '&.cm-editor': {
1649
+ height: '100%'
1650
+ },
1651
+ // Don't wrap whitespace for custom HTML
1652
+ '& .cm-completionInfo > *': {
1653
+ whiteSpace: 'normal'
1654
+ },
1655
+ '& .cm-completionInfo ul': {
1656
+ margin: 0,
1657
+ paddingLeft: '15px'
1658
+ },
1659
+ '& .cm-completionInfo pre': {
1660
+ marginBottom: 0,
1661
+ whiteSpace: 'pre-wrap'
1662
+ },
1663
+ '& .cm-completionInfo p': {
1664
+ marginTop: 0
1665
+ },
1666
+ '& .cm-completionInfo p:not(:last-of-type)': {
1667
+ marginBottom: 0
1668
+ }
1669
+ });
1670
+ const highlightTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.baseTheme({
1671
+ '& .variableName': {
1672
+ color: '#10f'
1673
+ },
1674
+ '& .number': {
1675
+ color: '#164'
1676
+ },
1677
+ '& .string': {
1678
+ color: '#a11'
1679
+ },
1680
+ '& .bool': {
1681
+ color: '#219'
1682
+ },
1683
+ '& .function': {
1684
+ color: '#aa3731',
1685
+ fontWeight: 'bold'
1686
+ },
1687
+ '& .control': {
1688
+ color: '#708'
1689
+ }
1690
+ });
1691
+ const syntaxClasses = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.syntaxHighlighting)(_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.HighlightStyle.define([{
1692
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName,
1693
+ class: 'variableName'
1694
+ }, {
1695
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.name,
1696
+ class: 'variableName'
1697
+ }, {
1698
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.number,
1699
+ class: 'number'
1700
+ }, {
1701
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.string,
1702
+ class: 'string'
1703
+ }, {
1704
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.bool,
1705
+ class: 'bool'
1706
+ }, {
1707
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.function(_lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName),
1708
+ class: 'function'
1709
+ }, {
1710
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.function(_lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.special(_lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName)),
1711
+ class: 'function'
1712
+ }, {
1713
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.controlKeyword,
1714
+ class: 'control'
1715
+ }, {
1716
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.operatorKeyword,
1717
+ class: 'control'
1718
+ }]));
1719
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([baseTheme, highlightTheme, syntaxClasses]);
1720
+
1721
+ /***/ }),
1722
+
1560
1723
  /***/ "./lib/hooks/useSelectedElement.js":
1561
1724
  /*!*****************************************!*\
1562
1725
  !*** ./lib/hooks/useSelectedElement.js ***!
@@ -32324,7 +32487,7 @@ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBP
32324
32487
  // Module
32325
32488
  ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32326
32489
  display: flex;
32327
- flex-direction: column;
32490
+ flex-direction: row;
32328
32491
  height: 100%;
32329
32492
  width: 100%;
32330
32493
  padding: 10px;
@@ -32342,47 +32505,45 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32342
32505
  inline-size: initial;
32343
32506
  min-block-size: initial;
32344
32507
  }
32345
- .task-testing__container .task-testing__container--header {
32508
+ .task-testing__container .task-testing__container--left {
32509
+ width: 50%;
32346
32510
  display: flex;
32347
- flex-direction: row;
32348
- gap: 12px;
32511
+ flex-direction: column;
32512
+ border-right: 1px solid #E0E0E0;
32513
+ padding-right: 6px;
32349
32514
  }
32350
- .task-testing__container .task-testing__container--header .task-testing__container--header--left,
32351
- .task-testing__container .task-testing__container--header .task-testing__container--header--right {
32352
- display: flex;
32353
- align-items: center;
32515
+ .task-testing__container .task-testing__container--right {
32354
32516
  width: 50%;
32517
+ display: flex;
32518
+ flex-direction: column;
32519
+ padding-left: 6px;
32355
32520
  }
32356
- .task-testing__container .task-testing__container--header .task-testing__container--header--left {
32521
+ .task-testing__container .task-testing__container--header {
32357
32522
  display: flex;
32523
+ flex-direction: row;
32358
32524
  align-items: center;
32359
- gap: 5px;
32525
+ justify-content: space-between;
32526
+ gap: 12px;
32527
+ width: 100%;
32360
32528
  }
32361
- .task-testing__container .task-testing__container--header .task-testing__container--header--left .task-testing__container--header-task-name {
32529
+ .task-testing__container .task-testing__container--header .task-name {
32530
+ display: flex;
32362
32531
  font-weight: bold;
32532
+ gap: 6px;
32363
32533
  }
32364
- .task-testing__container .task-testing__container--header .task-testing__container--header--right {
32365
- justify-content: flex-end;
32534
+ .task-testing__container .task-testing__container--header .btn-execute {
32535
+ width: 138px;
32366
32536
  }
32367
- .task-testing__container .task-testing__container--header .task-testing__container--header--right .cds--popover-container:not(.has-error) .cds--popover {
32537
+ .task-testing__container .task-testing__container--header .cds--popover-container:not(.has-error) .cds--popover {
32368
32538
  display: none;
32369
32539
  }
32370
- .task-testing__container .task-testing__container--header .task-testing__container--header--right .cds--btn .cds--inline-loading {
32540
+ .task-testing__container .task-testing__container--header .cds--tooltip-content {
32541
+ padding: 12px;
32542
+ }
32543
+ .task-testing__container .task-testing__container--header .cds--btn .cds--inline-loading {
32371
32544
  inline-size: initial;
32372
32545
  min-block-size: initial;
32373
32546
  }
32374
- .task-testing__container .task-testing__container--main {
32375
- display: flex;
32376
- flex-direction: row;
32377
- gap: 12px;
32378
- flex-grow: 1;
32379
- }
32380
- .task-testing__container .task-testing__container--main .task-testing__container--main--left,
32381
- .task-testing__container .task-testing__container--main .task-testing__container--main--right {
32382
- display: flex;
32383
- flex-direction: column;
32384
- width: 50%;
32385
- }
32386
32547
  .task-testing__container .input {
32387
32548
  flex-grow: 1;
32388
32549
  display: flex;
@@ -32394,6 +32555,9 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32394
32555
  align-items: center;
32395
32556
  gap: 5px;
32396
32557
  }
32558
+ .task-testing__container .input .input__header--title {
32559
+ color: #525252;
32560
+ }
32397
32561
  .task-testing__container .output {
32398
32562
  flex-grow: 1;
32399
32563
  display: flex;
@@ -32403,126 +32567,162 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32403
32567
  .task-testing__container .output .output__header {
32404
32568
  display: flex;
32405
32569
  align-items: center;
32406
- gap: 5px;
32570
+ height: 32px;
32571
+ width: 100%;
32572
+ }
32573
+ .task-testing__container .output .output__header--title {
32574
+ color: #525252;
32575
+ display: flex;
32576
+ align-items: center;
32577
+ gap: 6px;
32578
+ }
32579
+ .task-testing__container .output .output__header--title svg.output__status-icon--ready {
32580
+ fill: #0043ce;
32581
+ }
32582
+ .task-testing__container .output .output__header--title svg.output__status-icon--success {
32583
+ fill: #24a148;
32584
+ }
32585
+ .task-testing__container .output .output__header--title svg.output__status-icon--error {
32586
+ fill: #da1e28;
32587
+ }
32588
+ .task-testing__container .output .output__header--title .cds--inline-loading {
32589
+ inline-size: 16px;
32590
+ min-block-size: initial;
32591
+ }
32592
+ .task-testing__container .output .output__header--button-operate {
32593
+ margin-left: auto;
32407
32594
  }
32408
32595
  .task-testing__container .output .output__body {
32596
+ display: flex;
32597
+ flex-direction: column;
32409
32598
  flex-grow: 1;
32410
32599
  position: relative;
32411
32600
  }
32412
- .task-testing__container .output .output__body .output__body--inner {
32413
- position: absolute;
32414
- top: 0;
32415
- left: 0;
32416
- right: 0;
32417
- bottom: 0;
32418
- overflow: auto;
32601
+ .task-testing__container .output .output__body .cds--tabs {
32602
+ --cds-layout-size-height-local: 32px;
32603
+ }
32604
+ .task-testing__container .output .output__body .cds--tab-content {
32605
+ padding: 0;
32606
+ height: calc(100% - 20px);
32607
+ }
32608
+ .task-testing__container .output .output__body .cds--tab-content:not([hidden]) {
32419
32609
  display: flex;
32420
- flex-direction: column;
32421
- gap: 12px;
32422
32610
  }
32423
- .task-testing__container .output .output__state {
32611
+ .task-testing__container .output .output__body .cds--popover {
32612
+ display: none;
32613
+ }
32614
+ .task-testing__container .output .output__error {
32424
32615
  display: flex;
32425
32616
  flex-direction: row;
32426
32617
  gap: 12px;
32427
32618
  padding: 12px;
32428
- border: 1px solid transparent;
32619
+ margin-bottom: 12px;
32620
+ border: 1px solid #da1e28;
32429
32621
  border-left-width: 3px;
32622
+ background-color: #fff1f1;
32430
32623
  }
32431
- .task-testing__container .output .output__state .output__state-content {
32624
+ .task-testing__container .output .output__error .output__error--content {
32432
32625
  display: flex;
32433
32626
  flex-direction: column;
32434
32627
  gap: 6px;
32435
32628
  flex-grow: 1;
32436
32629
  margin-top: 1px;
32437
32630
  }
32438
- .task-testing__container .output .output__state .output__state-content .output__state-title {
32631
+ .task-testing__container .output .output__error .output__error--content .output__error--title {
32439
32632
  display: flex;
32440
32633
  justify-content: space-between;
32441
32634
  font-weight: bold;
32442
32635
  }
32443
- .task-testing__container .output .output__state .output__state-content .output__state-title .cds--link {
32636
+ .task-testing__container .output .output__error .output__error--content .output__error--title .cds--link {
32444
32637
  cursor: pointer;
32445
32638
  }
32446
- .task-testing__container .output .output__state.output__state--error {
32447
- border-color: #da1e28;
32448
- background-color: #fff1f1;
32449
- }
32450
- .task-testing__container .output .output__state.output__state--error .output__state-icon svg {
32639
+ .task-testing__container .output .output__error .output__error--icon svg {
32451
32640
  fill: #da1e28;
32452
32641
  }
32453
- .task-testing__container .output .output__variables.output__variables--no-results .cds--snippet-container {
32454
- min-height: 0 !important;
32455
- outline: none;
32642
+ .task-testing__container .output .output__variables--empty {
32643
+ height: 32px;
32644
+ display: flex;
32645
+ align-items: center;
32646
+ color: #525252;
32456
32647
  }
32457
- .task-testing__container .output .output__variables .output__variables--title {
32458
- margin-bottom: 12px;
32648
+ .task-testing__container .output .output__variables--empty-action {
32649
+ font-weight: bold;
32459
32650
  }
32460
- .task-testing__container .output .output__variables .cds--snippet-container {
32651
+ .task-testing__container .output .cds--snippet-container {
32461
32652
  width: 100%;
32462
32653
  }
32463
- .task-testing__container .output .output__variables .cds--snippet {
32654
+ .task-testing__container .output .cds--snippet {
32464
32655
  max-inline-size: 100%;
32656
+ height: 100%;
32465
32657
  }
32466
32658
  .task-testing__container .output code {
32467
32659
  font-size: 14px;
32468
32660
  }
32469
32661
 
32470
- .input__editor {
32662
+ .code__editor {
32471
32663
  position: relative;
32472
32664
  flex-grow: 1;
32473
32665
  display: flex;
32474
32666
  flex-direction: column;
32475
32667
  }
32476
- .input__editor.input__editor--error .input__editor-codemirror .input__editor-codemirror-inner .cm-editor {
32668
+ .code__editor.code__editor--error .code__editor-codemirror .code__editor-codemirror-inner .cm-editor {
32477
32669
  outline: 1px solid #da1e28;
32478
32670
  outline-offset: -1px;
32479
- background-color: #fff1f1;
32480
32671
  }
32481
- .input__editor .input__editor-codemirror {
32672
+ .code__editor .code__editor-codemirror {
32482
32673
  position: relative;
32483
32674
  flex-grow: 1;
32484
32675
  }
32485
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner {
32676
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner {
32486
32677
  position: absolute;
32487
32678
  top: 0;
32488
32679
  left: 0;
32489
32680
  right: 0;
32490
32681
  bottom: 0;
32491
32682
  }
32492
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-editor {
32683
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-editor {
32493
32684
  height: 100%;
32494
32685
  background-color: var(--cds-layer, #f4f4f4);
32495
32686
  }
32496
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-scroller {
32687
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-scroller {
32497
32688
  overflow-y: auto !important;
32498
32689
  }
32499
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-content {
32690
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-content {
32500
32691
  padding: 15px;
32501
32692
  }
32502
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-focused {
32693
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-focused {
32503
32694
  outline: none;
32504
32695
  }
32505
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-tooltip {
32696
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-tooltip {
32506
32697
  font-size: 14px;
32507
32698
  }
32508
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .info {
32699
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .info {
32509
32700
  padding: 5px;
32510
32701
  font-family: monospace;
32511
32702
  font-size: 12px;
32512
32703
  max-width: 300px;
32513
32704
  word-wrap: break-word;
32514
32705
  }
32515
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .info span {
32706
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .info span {
32516
32707
  font-style: italic;
32517
32708
  }
32518
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .info pre {
32709
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .info pre {
32519
32710
  margin-top: 5px;
32520
32711
  }
32521
- .input__editor .input__editor-error {
32712
+ .code__editor .code__editor-error {
32522
32713
  color: #da1e28;
32523
32714
  font-size: 13px;
32524
32715
  margin-top: 5px;
32525
- }`, "",{"version":3,"sources":["webpack://./lib/style/style.scss"],"names":[],"mappings":"AAAA;EACE,aAAA;EACA,sBAAA;EACA,YAAA;EACA,WAAA;EACA,aAAA;EACA,eAAA;AACF;AAEI;;EAEE,aAAA;EACA,mBAAA;EACA,QAAA;EACA,YAAA;AAAN;AAEM;;EACE,oBAAA;EACA,uBAAA;AACR;AAIE;EACE,aAAA;EACA,mBAAA;EACA,SAAA;AAFJ;AAII;;EAEE,aAAA;EACA,mBAAA;EACA,UAAA;AAFN;AAKI;EACE,aAAA;EACA,mBAAA;EACA,QAAA;AAHN;AAKM;EACE,iBAAA;AAHR;AAOI;EACE,yBAAA;AALN;AAOM;EACE,aAAA;AALR;AAQM;EACE,oBAAA;EACA,uBAAA;AANR;AAWE;EACE,aAAA;EACA,mBAAA;EACA,SAAA;EACA,YAAA;AATJ;AAWI;;EAEE,aAAA;EACA,sBAAA;EACA,UAAA;AATN;AAaE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAXJ;AAaI;EACE,aAAA;EACA,mBAAA;EACA,QAAA;AAXN;AAeE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAbJ;AAeI;EACE,aAAA;EACA,mBAAA;EACA,QAAA;AAbN;AAgBI;EACE,YAAA;EACA,kBAAA;AAdN;AAgBM;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,SAAA;AAdR;AAkBI;EACE,aAAA;EACA,mBAAA;EACA,SAAA;EACA,aAAA;EACA,6BAAA;EACA,sBAAA;AAhBN;AAkBM;EACE,aAAA;EACA,sBAAA;EACA,QAAA;EACA,YAAA;EACA,eAAA;AAhBR;AAkBQ;EACE,aAAA;EACA,8BAAA;EACA,iBAAA;AAhBV;AAkBU;EACE,eAAA;AAhBZ;AAqBM;EACE,qBAAA;EACA,yBAAA;AAnBR;AAqBQ;EACE,aAAA;AAnBV;AAyBM;EACE,wBAAA;EACA,aAAA;AAvBR;AA0BM;EACE,mBAAA;AAxBR;AA2BM;EACE,WAAA;AAzBR;AA4BM;EACE,qBAAA;AA1BR;AA8BI;EACE,eAAA;AA5BN;;AAiCA;EACE,kBAAA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AA9BF;AAgCE;EACE,0BAAA;EACA,oBAAA;EACA,yBAAA;AA9BJ;AAiCE;EACE,kBAAA;EACA,YAAA;AA/BJ;AAiCI;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;AA/BN;AAiCM;EACE,YAAA;EACA,2CAAA;AA/BR;AAkCM;EACE,2BAAA;AAhCR;AAmCM;EACE,aAAA;AAjCR;AAoCM;EACE,aAAA;AAlCR;AAqCM;EACE,eAAA;AAnCR;AAsCM;EACE,YAAA;EACA,sBAAA;EACA,eAAA;EACA,gBAAA;EACA,qBAAA;AApCR;AAsCQ;EACE,kBAAA;AApCV;AAuCQ;EACE,eAAA;AArCV;AA2CE;EACE,cAAA;EACA,eAAA;EACA,eAAA;AAzCJ","sourcesContent":[".task-testing__container {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n padding: 10px;\n font-size: 14px;\n\n &.task-testing__container--empty {\n .task-testing__container-no-config,\n .task-testing__container-no-element {\n display: flex;\n align-items: center;\n gap: 5px;\n height: 32px;\n\n .cds--inline-loading {\n inline-size: initial;\n min-block-size: initial;\n }\n }\n }\n\n .task-testing__container--header {\n display: flex;\n flex-direction: row;\n gap: 12px;\n\n .task-testing__container--header--left,\n .task-testing__container--header--right {\n display: flex;\n align-items: center;\n width: 50%;\n }\n\n .task-testing__container--header--left {\n display: flex;\n align-items: center;\n gap: 5px;\n\n .task-testing__container--header-task-name {\n font-weight: bold;\n }\n }\n\n .task-testing__container--header--right {\n justify-content: flex-end;\n\n .cds--popover-container:not(.has-error) .cds--popover {\n display: none;\n }\n\n .cds--btn .cds--inline-loading {\n inline-size: initial;\n min-block-size: initial;\n }\n } \n }\n\n .task-testing__container--main {\n display: flex;\n flex-direction: row;\n gap: 12px;\n flex-grow: 1;\n\n .task-testing__container--main--left,\n .task-testing__container--main--right {\n display: flex;\n flex-direction: column;\n width: 50%;\n }\n }\n\n .input {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n\n .input__header {\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n\n .output {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n\n .output__header {\n display: flex;\n align-items: center;\n gap: 5px;\n }\n\n .output__body {\n flex-grow: 1;\n position: relative;\n\n .output__body--inner {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n }\n\n .output__state {\n display: flex;\n flex-direction: row;\n gap: 12px;\n padding: 12px;\n border: 1px solid transparent;\n border-left-width: 3px;\n\n .output__state-content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex-grow: 1;\n margin-top: 1px;\n\n .output__state-title {\n display: flex;\n justify-content: space-between;\n font-weight: bold;\n\n .cds--link {\n cursor: pointer;\n }\n }\n }\n\n &.output__state--error {\n border-color: #da1e28;\n background-color: #fff1f1;\n\n .output__state-icon svg {\n fill: #da1e28;\n }\n }\n }\n\n .output__variables {\n &.output__variables--no-results .cds--snippet-container {\n min-height: 0 !important;\n outline: none;\n }\n\n .output__variables--title {\n margin-bottom: 12px;\n }\n\n .cds--snippet-container {\n width: 100%;\n }\n\n .cds--snippet {\n max-inline-size: 100%\n }\n }\n\n code {\n font-size: 14px;\n }\n }\n}\n\n.input__editor {\n position: relative;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n\n &.input__editor--error .input__editor-codemirror .input__editor-codemirror-inner .cm-editor {\n outline: 1px solid #da1e28;\n outline-offset: -1px;\n background-color: #fff1f1;\n }\n\n .input__editor-codemirror {\n position: relative;\n flex-grow: 1;\n\n .input__editor-codemirror-inner {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n .cm-editor {\n height: 100%;\n background-color: var(--cds-layer, #f4f4f4);\n }\n\n .cm-scroller {\n overflow-y: auto !important;\n }\n\n .cm-content {\n padding: 15px;\n }\n\n .cm-focused {\n outline: none;\n }\n\n .cm-tooltip {\n font-size: 14px;\n }\n\n .info {\n padding: 5px;\n font-family: monospace;\n font-size: 12px;\n max-width: 300px;\n word-wrap: break-word;\n\n span {\n font-style: italic;\n }\n\n pre {\n margin-top: 5px;\n }\n }\n }\n }\n\n .input__editor-error {\n color: #da1e28;\n font-size: 13px;\n margin-top: 5px;\n }\n}"],"sourceRoot":""}]);
32716
+ }
32717
+ .code__editor .code__editor-copy-button {
32718
+ position: absolute;
32719
+ top: 10px;
32720
+ right: 10px;
32721
+ z-index: 10;
32722
+ }
32723
+ .code__editor .code__editor-copy-button svg {
32724
+ fill: #525252;
32725
+ }`, "",{"version":3,"sources":["webpack://./lib/style/style.scss"],"names":[],"mappings":"AAAA;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;EACA,aAAA;EACA,eAAA;AACF;AAEI;;EAEE,aAAA;EACA,mBAAA;EACA,QAAA;EACA,YAAA;AAAN;AAEM;;EACE,oBAAA;EACA,uBAAA;AACR;AAIE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,+BAAA;EACA,kBAAA;AAFJ;AAKE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;AAHJ;AAME;EACE,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,SAAA;EACA,WAAA;AAJJ;AAMI;EACE,aAAA;EACA,iBAAA;EACA,QAAA;AAJN;AAOI;EACE,YAAA;AALN;AAQI;EACE,aAAA;AANN;AASI;EACE,aAAA;AAPN;AAUI;EACE,oBAAA;EACA,uBAAA;AARN;AAYE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAVJ;AAYI;EACE,aAAA;EACA,mBAAA;EACA,QAAA;AAVN;AAaI;EACE,cAAA;AAXN;AAeE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAbJ;AAeI;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;AAbN;AAgBI;EACE,cAAA;EACA,aAAA;EACA,mBAAA;EACA,QAAA;AAdN;AAgBM;EACE,aAAA;AAdR;AAiBM;EACE,aAAA;AAfR;AAkBM;EACE,aAAA;AAhBR;AAmBM;EACE,iBAAA;EACA,uBAAA;AAjBR;AAqBI;EACE,iBAAA;AAnBN;AAsBI;EACE,aAAA;EACA,sBAAA;EACA,YAAA;EACA,kBAAA;AApBN;AAsBM;EACE,oCAAA;AApBR;AAuBM;EACE,UAAA;EACA,yBAAA;AArBR;AAwBM;EACE,aAAA;AAtBR;AA0BM;EACE,aAAA;AAxBR;AA4BI;EACE,aAAA;EACA,mBAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,yBAAA;EACA,sBAAA;EACA,yBAAA;AA1BN;AA4BM;EACE,aAAA;EACA,sBAAA;EACA,QAAA;EACA,YAAA;EACA,eAAA;AA1BR;AA4BQ;EACE,aAAA;EACA,8BAAA;EACA,iBAAA;AA1BV;AA4BU;EACE,eAAA;AA1BZ;AA+BM;EACE,aAAA;AA7BR;AAiCI;EACE,YAAA;EACA,aAAA;EACA,mBAAA;EACA,cAAA;AA/BN;AAkCI;EACE,iBAAA;AAhCN;AAmCI;EACE,WAAA;AAjCN;AAoCI;EACE,qBAAA;EACA,YAAA;AAlCN;AAqCI;EACE,eAAA;AAnCN;;AAwCA;EACE,kBAAA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AArCF;AAuCE;EACE,0BAAA;EACA,oBAAA;AArCJ;AAwCE;EACE,kBAAA;EACA,YAAA;AAtCJ;AAwCI;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;AAtCN;AAwCM;EACE,YAAA;EACA,2CAAA;AAtCR;AAyCM;EACE,2BAAA;AAvCR;AA0CM;EACE,aAAA;AAxCR;AA2CM;EACE,aAAA;AAzCR;AA4CM;EACE,eAAA;AA1CR;AA6CM;EACE,YAAA;EACA,sBAAA;EACA,eAAA;EACA,gBAAA;EACA,qBAAA;AA3CR;AA6CQ;EACE,kBAAA;AA3CV;AA8CQ;EACE,eAAA;AA5CV;AAkDE;EACE,cAAA;EACA,eAAA;EACA,eAAA;AAhDJ;AAmDE;EACE,kBAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;AAjDJ;AAmDI;EACE,aAAA;AAjDN","sourcesContent":[".task-testing__container {\n display: flex;\n flex-direction: row;\n height: 100%;\n width: 100%;\n padding: 10px;\n font-size: 14px;\n\n &.task-testing__container--empty {\n .task-testing__container-no-config,\n .task-testing__container-no-element {\n display: flex;\n align-items: center;\n gap: 5px;\n height: 32px;\n\n .cds--inline-loading {\n inline-size: initial;\n min-block-size: initial;\n }\n }\n }\n\n .task-testing__container--left {\n width: 50%;\n display: flex;\n flex-direction: column;\n border-right: 1px solid #E0E0E0;\n padding-right: 6px;\n }\n\n .task-testing__container--right {\n width: 50%;\n display: flex;\n flex-direction: column;\n padding-left: 6px;\n }\n\n .task-testing__container--header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n\n .task-name {\n display: flex;\n font-weight: bold;\n gap: 6px;\n }\n\n .btn-execute {\n width: 138px;\n }\n\n .cds--popover-container:not(.has-error) .cds--popover {\n display: none;\n }\n\n .cds--tooltip-content {\n padding: 12px;\n }\n\n .cds--btn .cds--inline-loading {\n inline-size: initial;\n min-block-size: initial;\n }\n }\n\n .input {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n\n .input__header {\n display: flex;\n align-items: center;\n gap: 5px;\n }\n\n .input__header--title {\n color: #525252;\n }\n }\n\n .output {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n\n .output__header {\n display: flex;\n align-items: center;\n height: 32px;\n width: 100%;\n }\n\n .output__header--title {\n color: #525252;\n display: flex;\n align-items: center;\n gap: 6px;\n\n svg.output__status-icon--ready {\n fill: #0043ce;\n }\n\n svg.output__status-icon--success {\n fill: #24a148;\n }\n\n svg.output__status-icon--error {\n fill: #da1e28;\n }\n\n .cds--inline-loading {\n inline-size: 16px;\n min-block-size: initial;\n }\n }\n\n .output__header--button-operate {\n margin-left: auto;\n }\n\n .output__body {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n position: relative;\n\n .cds--tabs {\n --cds-layout-size-height-local: 32px;\n }\n \n .cds--tab-content {\n padding: 0;\n height: calc(100% - 20px);\n }\n\n .cds--tab-content:not([hidden]) {\n display: flex;\n }\n\n // Tooltip on Carbon Button with absolute position is broken.\n .cds--popover {\n display: none;\n }\n }\n\n .output__error {\n display: flex;\n flex-direction: row;\n gap: 12px;\n padding: 12px;\n margin-bottom: 12px;\n border: 1px solid #da1e28;\n border-left-width: 3px;\n background-color: #fff1f1;\n\n .output__error--content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex-grow: 1;\n margin-top: 1px;\n\n .output__error--title {\n display: flex;\n justify-content: space-between;\n font-weight: bold;\n\n .cds--link {\n cursor: pointer;\n }\n }\n }\n\n .output__error--icon svg {\n fill: #da1e28;\n }\n }\n\n .output__variables--empty {\n height: 32px;\n display: flex;\n align-items: center;\n color: #525252;\n }\n\n .output__variables--empty-action {\n font-weight: bold;\n }\n\n .cds--snippet-container {\n width: 100%;\n }\n\n .cds--snippet {\n max-inline-size: 100%;\n height: 100%;\n }\n\n code {\n font-size: 14px;\n }\n }\n}\n\n.code__editor {\n position: relative;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n\n &.code__editor--error .code__editor-codemirror .code__editor-codemirror-inner .cm-editor {\n outline: 1px solid #da1e28;\n outline-offset: -1px;\n }\n\n .code__editor-codemirror {\n position: relative;\n flex-grow: 1;\n\n .code__editor-codemirror-inner {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n .cm-editor {\n height: 100%;\n background-color: var(--cds-layer, #f4f4f4);\n }\n\n .cm-scroller {\n overflow-y: auto !important;\n }\n\n .cm-content {\n padding: 15px;\n }\n\n .cm-focused {\n outline: none;\n }\n\n .cm-tooltip {\n font-size: 14px;\n }\n\n .info {\n padding: 5px;\n font-family: monospace;\n font-size: 12px;\n max-width: 300px;\n word-wrap: break-word;\n\n span {\n font-style: italic;\n }\n\n pre {\n margin-top: 5px;\n }\n }\n }\n }\n\n .code__editor-error {\n color: #da1e28;\n font-size: 13px;\n margin-top: 5px;\n }\n\n .code__editor-copy-button {\n position: absolute;\n top: 10px;\n right: 10px;\n z-index: 10;\n\n svg {\n fill: #525252;\n }\n }\n}"],"sourceRoot":""}]);
32526
32726
  // Exports
32527
32727
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
32528
32728