@camunda/task-testing 0.1.1 → 0.2.1

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");
@@ -352,74 +362,49 @@ __webpack_require__.r(__webpack_exports__);
352
362
  * except in compliance with the MIT License.
353
363
  */
354
364
 
365
+ /**
366
+ * @import {
367
+ * TaskExecutionApi,
368
+ * TaskExecutionResult,
369
+ * TaskExecutionError,
370
+ * TaskExecutionStatus } from './types';
371
+ */
372
+
373
+ /**
374
+ * @import {
375
+ * CreateProcessInstanceResponse,
376
+ * DeployResourceResponse
377
+ * } from '@camunda8/sdk/dist/c8/lib/C8Dto';
378
+ */
379
+
355
380
 
356
381
  const INTERVAL_MS = 1000;
382
+
383
+ /**
384
+ * Emits:
385
+ * - `taskExecution.status.changed` with one of {@link TaskExecutionStatus}
386
+ * - `taskExecution.finished` with {@link TaskExecutionResult}
387
+ * - `taskExecution.error` with {@link TaskExecutionError}
388
+ * - `taskExecution.interrupted` when execution is interrupted by switching focus
389
+ */
357
390
  class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
358
391
  /**
359
392
  * @param {Object} injector
360
- * @param {import('./types').TaskExecutionApi} api
393
+ * @param {TaskExecutionApi} api
361
394
  */
362
395
  constructor(injector, api) {
363
396
  super();
364
- this._injector = injector;
365
397
 
366
- /** @type {import('./types').TaskExecutionApi} */
398
+ /** @type {TaskExecutionApi} */
367
399
  this._api = api;
400
+ this._interval = null;
401
+
402
+ /** @type {TaskExecutionStatus} */
403
+ this._status = 'idle';
368
404
  const eventBus = injector.get('eventBus');
369
405
  eventBus.on(['selection.changed', 'commandStack.changed'], () => {
370
406
  this.cancelTaskExecution();
371
- });
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
407
+ this.emit('taskExecution.interrupted');
423
408
  });
424
409
  }
425
410
 
@@ -432,113 +417,141 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
432
417
  * @returns {Promise<void>}
433
418
  */
434
419
  async executeTask(elementId, variables) {
435
- 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();
420
+ this._changeStatus('deploying');
421
+ const deploymentResult = await this._api.deploy();
422
+ if (this._status === 'idle') {
423
+ // Execution was canceled in the meantime
458
424
  return;
459
425
  }
460
- const processId = getProcessId(deploymentResponse.response);
426
+ if (!deploymentResult.success) {
427
+ this._emitError('Failed to deploy process definition', deploymentResult.error);
428
+ this.cancelTaskExecution();
429
+ return;
430
+ }
431
+ const processId = getProcessId(deploymentResult.response);
461
432
  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();
433
+ this._emitError('Failed to retrieve process ID from deployment response');
434
+ this.cancelTaskExecution();
468
435
  return;
469
436
  }
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();
437
+ this._changeStatus('starting-instance');
438
+ const startInstanceResult = await this._api.startInstance(processId, elementId, variables);
439
+ if (/** @type {TaskExecutionStatus} */this._status === 'idle') {
440
+ // Execution was canceled in the meantime
479
441
  return;
480
442
  }
481
- const {
482
- processInstanceKey
483
- } = startInstanceResponse.response;
484
- this._currentTaskExecution.processInstanceKey = processInstanceKey;
443
+ if (!startInstanceResult.success) {
444
+ this._emitError('Failed to start process instance', startInstanceResult.error);
445
+ this.cancelTaskExecution();
446
+ return;
447
+ }
448
+ const processInstanceKey = getProcessInstanceKey(startInstanceResult.response);
449
+ if (!processInstanceKey) {
450
+ this._emitError('Failed to retrieve process instance key from start instance response');
451
+ this.cancelTaskExecution();
452
+ return;
453
+ }
454
+ this._changeStatus('executing', processInstanceKey);
485
455
  const intervalCallback = async () => {
486
456
  const getProcessInstanceResult = await this._api.getProcessInstance(processInstanceKey);
457
+ if (this._status === 'idle') {
458
+ // Execution was canceled in the meantime
459
+ this.cancelTaskExecution();
460
+ return;
461
+ }
487
462
  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
- });
463
+ this._emitError('Failed to get process instance', getProcessInstanceResult.error);
493
464
  return;
494
465
  }
495
- const processInstance = getProcessInstance(getProcessInstanceResult.response);
466
+ const processInstance = getProcessInstance(getProcessInstanceResult.response, processInstanceKey);
496
467
  if (!processInstance) {
497
468
  // No process instance found, try again
498
469
  return;
499
470
  }
500
- const state = getProcessInstanceState(getProcessInstanceResult.response),
501
- hasIncident = hasProcessInstanceIncident(getProcessInstanceResult.response);
471
+ const state = getProcessInstanceState(getProcessInstanceResult.response, processInstanceKey);
472
+ const hasIncident = hasProcessInstanceIncident(getProcessInstanceResult.response, processInstanceKey);
473
+ let incident = null;
502
474
  if (hasIncident) {
503
475
  const getProcessInstanceIncidentResult = await this._api.getProcessInstanceIncident(processInstanceKey);
504
- 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
- });
476
+ if (/** @type {TaskExecutionStatus} */this._status === 'idle') {
477
+ // Execution was canceled in the meantime
478
+ this.cancelTaskExecution();
510
479
  return;
511
480
  }
512
- const incident = getIncident(getProcessInstanceIncidentResult.response);
513
- if (this._currentTaskExecution) {
514
- this._currentTaskExecution.incident = incident;
481
+ if (!getProcessInstanceIncidentResult.success) {
482
+ this._emitError('Failed to get process instance incident', getProcessInstanceIncidentResult.error);
483
+ return;
515
484
  }
516
- this.endTaskExecution();
517
- return;
485
+ incident = getIncident(getProcessInstanceIncidentResult.response);
518
486
  }
519
- if (['TERMINATED', 'COMPLETED', 'CANCELED'].includes(state)) {
487
+ const isCompleted = ['COMPLETED', 'TERMINATED', 'CANCELED'].includes(state);
488
+ if (isCompleted || hasIncident) {
520
489
  const getProcessInstanceVariablesResult = await this._api.getProcessInstanceVariables(processInstanceKey);
490
+ if (/** @type {TaskExecutionStatus} */this._status === 'idle') {
491
+ // Execution was canceled in the meantime
492
+ this.cancelTaskExecution();
493
+ return;
494
+ }
521
495
  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
- }
496
+ this._emitError('Failed to get process instance variables', getProcessInstanceVariablesResult.error);
497
+ return;
530
498
  }
531
- this.endTaskExecution();
499
+ const variables = getVariables(getProcessInstanceVariablesResult.response);
500
+ this.emit('taskExecution.finished', {
501
+ success: !incident,
502
+ incident,
503
+ variables
504
+ });
505
+ this.cancelTaskExecution();
532
506
  }
533
507
  };
534
- this._currentTaskExecution.interval = setInterval(intervalCallback, INTERVAL_MS);
508
+ this._interval = setInterval(intervalCallback, INTERVAL_MS);
509
+ }
510
+
511
+ /**
512
+ * Cancel current task execution, clean up and change status to `idle`.
513
+ */
514
+ async cancelTaskExecution() {
515
+ // TODO: Proper clean up:
516
+ // - delete process instance
517
+ // - delete process definition
518
+ // - cancel deploy and start instance if they are in progress
519
+
520
+ if (this._interval) {
521
+ clearInterval(this._interval);
522
+ }
523
+ this._changeStatus('idle');
524
+ }
525
+
526
+ /**
527
+ * Emit `taskExecution.error` event.
528
+ *
529
+ * @param {string} message
530
+ * @param {any} [response]
531
+ */
532
+ _emitError(message, response) {
533
+ /** @type {import('./types').TaskExecutionError} */
534
+ const error = {
535
+ message,
536
+ response
537
+ };
538
+ this.emit('taskExecution.error', error);
539
+ }
540
+
541
+ /** @param {TaskExecutionStatus} status */
542
+ _changeStatus(status, ...args) {
543
+ if (this._status === status) {
544
+ return;
545
+ }
546
+ this._status = status;
547
+ this.emit('taskExecution.status.changed', status, ...args);
535
548
  }
536
549
  }
537
550
 
538
551
  /**
539
552
  * Get the process ID from the deployment response.
540
553
  *
541
- * @param {import('./types').DeploymentResponse} response
554
+ * @param {DeployResourceResponse} response
542
555
  *
543
556
  * @returns {string|null} The process ID or null if not found.
544
557
  */
@@ -555,41 +568,36 @@ function getProcessId(response) {
555
568
  }
556
569
 
557
570
  /**
558
- * Get the process definition key from the deployment response.
571
+ * Get the process instance key from the response.
559
572
  *
560
- * @param {import('./types').DeploymentResponse} response
573
+ * @param {CreateProcessInstanceResponse} response
561
574
  *
562
- * @returns {string|null} The process definition key or null if not found.
575
+ * @returns {string|null} The process instance key or null if not found.
563
576
  */
564
- function getProcessDefinitionKey(response) {
577
+ function getProcessInstanceKey(response) {
565
578
  const {
566
- processes = []
579
+ processInstanceKey
567
580
  } = response;
568
- for (const process of processes) {
569
- if (process) {
570
- return process.processDefinitionKey;
571
- }
572
- }
573
- return null;
581
+ return processInstanceKey || null;
574
582
  }
575
- function getProcessInstance(response) {
583
+ function getProcessInstance(response, processInstanceKey) {
576
584
  const {
577
585
  items = []
578
586
  } = response;
579
587
  if (!items.length) {
580
588
  return null;
581
589
  }
582
- return items[0];
590
+ return items.find(item => item.processInstanceKey === processInstanceKey) || null;
583
591
  }
584
- function getProcessInstanceState(response) {
585
- const processInstance = getProcessInstance(response);
592
+ function getProcessInstanceState(response, processInstanceKey) {
593
+ const processInstance = getProcessInstance(response, processInstanceKey);
586
594
  if (!processInstance) {
587
595
  return null;
588
596
  }
589
597
  return processInstance.state;
590
598
  }
591
- function hasProcessInstanceIncident(response) {
592
- const processInstance = getProcessInstance(response);
599
+ function hasProcessInstanceIncident(response, processInstanceKey) {
600
+ const processInstance = getProcessInstance(response, processInstanceKey);
593
601
  if (!processInstance) {
594
602
  return false;
595
603
  }
@@ -605,7 +613,11 @@ function getVariables(response) {
605
613
  name,
606
614
  value
607
615
  } = item;
608
- variables[name] = JSON.parse(value);
616
+ try {
617
+ variables[name] = JSON.parse(value);
618
+ } catch {
619
+ variables[name] = value;
620
+ }
609
621
  }
610
622
  return variables;
611
623
  }
@@ -643,7 +655,6 @@ __webpack_require__.r(__webpack_exports__);
643
655
 
644
656
  function Input({
645
657
  allOutputs,
646
- element,
647
658
  input,
648
659
  onErrorChange,
649
660
  onResetInput,
@@ -673,9 +684,8 @@ function Input({
673
684
  children: "Reset"
674
685
  })
675
686
  })]
676
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_InputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
687
+ }), input && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_InputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
677
688
  allOutputs: allOutputs,
678
- element: element,
679
689
  value: input,
680
690
  onChange: onSetInput,
681
691
  onErrorChange: onErrorChange,
@@ -694,6 +704,7 @@ function Input({
694
704
 
695
705
  __webpack_require__.r(__webpack_exports__);
696
706
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
707
+ /* harmony export */ INVALID_JSON_ERROR: () => (/* binding */ INVALID_JSON_ERROR),
697
708
  /* harmony export */ PLACEHOLDER_TEXT: () => (/* binding */ PLACEHOLDER_TEXT),
698
709
  /* harmony export */ "default": () => (/* binding */ InputEditor)
699
710
  /* harmony export */ });
@@ -708,7 +719,7 @@ __webpack_require__.r(__webpack_exports__);
708
719
  /* harmony import */ var _codemirror_lang_json__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @codemirror/lang-json */ "./node_modules/@codemirror/lang-json/dist/index.js");
709
720
  /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
710
721
  /* 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");
722
+ /* harmony import */ var _shared_CodeMirrorTheme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/CodeMirrorTheme */ "./lib/components/shared/CodeMirrorTheme.js");
712
723
  /* harmony import */ var _utils_autocompletion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/autocompletion */ "./lib/utils/autocompletion.js");
713
724
  /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
714
725
 
@@ -727,11 +738,11 @@ __webpack_require__.r(__webpack_exports__);
727
738
  const fromPropAnnotation = _codemirror_state__WEBPACK_IMPORTED_MODULE_6__.Annotation.define();
728
739
  const autocompletionCompartment = new _codemirror_state__WEBPACK_IMPORTED_MODULE_6__.Compartment();
729
740
  const PLACEHOLDER_TEXT = 'Enter process variables in JSON format';
741
+ const INVALID_JSON_ERROR = 'JSON contains errors';
730
742
  const DEFAULT_ALL_OUTPUTS = {},
731
743
  DEFAULT_VARIABLES_FOR_ELEMENT = [];
732
744
  function InputEditor({
733
745
  allOutputs = DEFAULT_ALL_OUTPUTS,
734
- element,
735
746
  value,
736
747
  onChange,
737
748
  onErrorChange,
@@ -786,8 +797,8 @@ function InputEditor({
786
797
  const source = view => {
787
798
  const errors = (0,_codemirror_lang_json__WEBPACK_IMPORTED_MODULE_7__.jsonParseLinter)()(view);
788
799
  const hasError = errors && errors.length > 0;
789
- onErrorChange(hasError ? 'Invalid JSON' : null);
790
- setError(hasError ? 'Invalid JSON' : null);
800
+ onErrorChange(hasError ? INVALID_JSON_ERROR : null);
801
+ setError(hasError ? INVALID_JSON_ERROR : null);
791
802
  return errors;
792
803
  };
793
804
  const editorState = _codemirror_state__WEBPACK_IMPORTED_MODULE_6__.EditorState.create({
@@ -797,7 +808,7 @@ function InputEditor({
797
808
  'tabindex': '0'
798
809
  }), (0,_codemirror_lint__WEBPACK_IMPORTED_MODULE_12__.linter)(source, {
799
810
  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 => {
811
+ }), 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
812
  if (update.docChanged) {
802
813
  if (update.transactions.some(transaction => transaction.annotation(fromPropAnnotation))) {
803
814
  return;
@@ -815,7 +826,7 @@ function InputEditor({
815
826
  return () => {
816
827
  view.destroy();
817
828
  };
818
- }, []);
829
+ }, [onChange]);
819
830
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
820
831
  if (!editorView) return;
821
832
  editorView.dispatch({
@@ -837,17 +848,17 @@ function InputEditor({
837
848
  }
838
849
  }, [editorView, value]);
839
850
  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
851
+ className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('code__editor', {
852
+ 'code__editor--error': error
842
853
  }),
843
854
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
844
- className: "input__editor-codemirror",
855
+ className: "code__editor-codemirror",
845
856
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
846
857
  ref: ref,
847
- className: "input__editor-codemirror-inner"
858
+ className: "code__editor-codemirror-inner"
848
859
  })
849
860
  }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
850
- className: "input__editor-error",
861
+ className: "code__editor-error",
851
862
  children: error
852
863
  })]
853
864
  });
@@ -914,122 +925,6 @@ function getDetail(value) {
914
925
 
915
926
  /***/ }),
916
927
 
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
928
  /***/ "./lib/components/Output/Output.jsx":
1034
929
  /*!******************************************!*\
1035
930
  !*** ./lib/components/Output/Output.jsx ***!
@@ -1038,197 +933,263 @@ const syntaxClasses = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.synta
1038
933
 
1039
934
  __webpack_require__.r(__webpack_exports__);
1040
935
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
936
+ /* harmony export */ TASK_EXECUTION_STATUS_LABEL: () => (/* binding */ TASK_EXECUTION_STATUS_LABEL),
1041
937
  /* harmony export */ "default": () => (/* binding */ Output)
1042
938
  /* harmony export */ });
1043
939
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1044
940
  /* harmony import */ var _carbon_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @carbon/react */ "@carbon/react");
1045
941
  /* 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");
942
+ /* harmony import */ var _OutputEditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./OutputEditor */ "./lib/components/Output/OutputEditor.jsx");
943
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
944
+
945
+
1047
946
 
1048
947
 
1049
948
 
949
+ const TASK_EXECUTION_STATUS_LABEL = {
950
+ deploying: 'Deploying...',
951
+ 'starting-instance': 'Starting instance...',
952
+ executing: 'Waiting for task to be completed...'
953
+ };
1050
954
 
955
+ /**
956
+ * @param {Object} props
957
+ * @param {boolean} props.isConnectionConfigured
958
+ * @param {string} [props.configureConnectionBannerTitle]
959
+ * @param {string} [props.configureConnectionBannerDescription]
960
+ * @param {string} [props.configureConnectionLabel]
961
+ * @param {Function} [props.onConfigureConnection]
962
+ * @param {boolean} props.isTaskExecuting
963
+ * @param {import('../../types').ElementOutput} props.output
964
+ * @param {Function} props.onResetOutput
965
+ * @param {import('../../types').TaskExecutionStatus} props.taskExecutionStatus
966
+ */
1051
967
  function Output({
1052
968
  isConnectionConfigured,
969
+ configureConnectionBannerTitle,
970
+ configureConnectionBannerDescription,
971
+ configureConnectionLabel,
1053
972
  onConfigureConnection,
1054
973
  isTaskExecuting,
1055
974
  output,
1056
- onResetOutput
975
+ onResetOutput,
976
+ taskExecutionStatus
1057
977
  }) {
1058
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
978
+ const statusIcon = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
979
+ if (output !== null && output !== void 0 && output.error || output !== null && output !== void 0 && output.incident || !isConnectionConfigured) {
980
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.ErrorFilled, {
981
+ className: "output__status-icon--error"
982
+ });
983
+ }
984
+ if (output !== null && output !== void 0 && output.success) {
985
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.CheckmarkFilled, {
986
+ className: "output__status-icon--success"
987
+ });
988
+ }
989
+ if (isTaskExecuting) {
990
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.InlineLoading, {});
991
+ }
992
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.InProgress, {
993
+ className: "output__status-icon--ready"
994
+ });
995
+ }, [output, isTaskExecuting, isConnectionConfigured]);
996
+ 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));
997
+ const headerText = isTaskExecuting ? TASK_EXECUTION_STATUS_LABEL[taskExecutionStatus] : 'Results';
998
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1059
999
  className: "output",
1060
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
1000
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1061
1001
  className: "output__header",
1062
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1002
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1063
1003
  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
- })
1004
+ children: [statusIcon, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
1005
+ children: headerText
1006
+ })]
1007
+ }), showResetButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
1008
+ kind: "ghost",
1009
+ onClick: () => onResetOutput(),
1010
+ size: "sm",
1011
+ renderIcon: _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Reset,
1012
+ hasIconOnly: true,
1013
+ tooltipPosition: "right",
1014
+ iconDescription: "Reset output",
1015
+ children: "Reset"
1016
+ }), (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, {
1017
+ href: output.operateUrl,
1018
+ target: "_blank",
1019
+ className: "output__header--button-operate",
1020
+ children: "View in Operate"
1077
1021
  })]
1078
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
1022
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1079
1023
  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
- })
1024
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(OutputBanner, {
1025
+ isConnectionConfigured: isConnectionConfigured,
1026
+ configureConnectionBannerTitle: configureConnectionBannerTitle,
1027
+ configureConnectionBannerDescription: configureConnectionBannerDescription,
1028
+ configureConnectionLabel: configureConnectionLabel,
1029
+ onConfigureConnection: onConfigureConnection,
1030
+ output: output
1031
+ }), isConnectionConfigured && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(OutputVariables, {
1032
+ isTaskExecuting: isTaskExecuting,
1033
+ output: output
1034
+ })]
1099
1035
  })]
1100
1036
  });
1101
1037
  }
1102
- function ConfigureConnection(props) {
1103
- const {
1104
- isConnectionConfigured,
1105
- onConfigureConnection
1106
- } = props;
1107
- if (isConnectionConfigured) {
1108
- return null;
1038
+ function OutputBanner({
1039
+ isConnectionConfigured,
1040
+ configureConnectionBannerTitle,
1041
+ configureConnectionBannerDescription,
1042
+ configureConnectionLabel,
1043
+ onConfigureConnection,
1044
+ output
1045
+ }) {
1046
+ if (!isConnectionConfigured) {
1047
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
1048
+ title: configureConnectionBannerTitle,
1049
+ description: configureConnectionBannerDescription,
1050
+ actionLabel: configureConnectionLabel,
1051
+ onActionClick: onConfigureConnection
1052
+ });
1109
1053
  }
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;
1054
+ if (output !== null && output !== void 0 && output.error) {
1055
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
1056
+ title: "Task execution failed",
1057
+ description: `Error: ${output.error.message}`
1058
+ });
1146
1059
  }
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
- });
1060
+ if (output !== null && output !== void 0 && output.incident) {
1061
+ const action = output.incident.operateUrl ? {
1062
+ actionLabel: 'View in Operate',
1063
+ actionUrl: output.incident.operateUrl
1064
+ } : {};
1065
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
1066
+ title: "Task execution failed",
1067
+ description: `Incident: ${output.incident.type}`,
1068
+ ...action
1069
+ });
1070
+ }
1071
+ return null;
1156
1072
  }
1157
- function Success({
1158
- isConnectionConfigured,
1073
+ function OutputVariables({
1159
1074
  isTaskExecuting,
1160
1075
  output
1161
1076
  }) {
1162
- if (!isConnectionConfigured || isTaskExecuting || !output || !output.success) {
1163
- return null;
1077
+ if (isTaskExecuting) {
1078
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.CodeSnippetSkeleton, {
1079
+ className: "output__variables--skeleton",
1080
+ type: "multi"
1081
+ });
1164
1082
  }
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)
1083
+ if (output !== null && output !== void 0 && output.success) {
1084
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1085
+ value: JSON.stringify(output.variables, null, 2)
1086
+ });
1087
+
1088
+ // TODO: Introduce tabs when able to filter variables by `scopeKey`
1089
+ // return (
1090
+ // <Tabs>
1091
+ // <TabList>
1092
+ // <Tab>Process variables</Tab>
1093
+ // <Tab>Task variables</Tab>
1094
+ // </TabList>
1095
+ // <TabPanels>
1096
+ // <TabPanel>
1097
+ // <OutputEditor value={ JSON.stringify(output.variables, null, 2) } />
1098
+ // </TabPanel>
1099
+ // <TabPanel>
1100
+ // <OutputEditor value={ JSON.stringify(output.variables, null, 2) } />
1101
+ // </TabPanel>
1102
+ // </TabPanels>
1103
+ // </Tabs>
1104
+ // );
1105
+ }
1106
+ if (output !== null && output !== void 0 && output.error) {
1107
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1108
+ value: (output === null || output === void 0 ? void 0 : output.error.response) || 'No error details available'
1109
+ });
1110
+ }
1111
+ if (output !== null && output !== void 0 && output.incident) {
1112
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tabs, {
1113
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabList, {
1114
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tab, {
1115
+ children: "Incident"
1116
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tab, {
1117
+ children: "Process variables"
1118
+ })]
1119
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabPanels, {
1120
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabPanel, {
1121
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1122
+ value: printIncident(output.incident)
1123
+ })
1124
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.TabPanel, {
1125
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_OutputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
1126
+ value: JSON.stringify(output.variables, null, 2)
1127
+ })
1128
+ })]
1129
+ })]
1130
+ });
1131
+ }
1132
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1133
+ className: "output__variables--empty",
1134
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1135
+ children: ["Enter input variables, then click ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
1136
+ className: "output__variables--empty-action",
1137
+ children: "Test task"
1138
+ }), " to see results."]
1174
1139
  })
1175
1140
  });
1176
1141
  }
1177
- function Error({
1178
- isConnectionConfigured,
1179
- isTaskExecuting,
1180
- output
1142
+
1143
+ /**
1144
+ *
1145
+ * @param {Object} props
1146
+ * @param {string} props.title
1147
+ * @param {string} props.description
1148
+ * @param {string} [props.actionLabel]
1149
+ * @param {string} [props.actionUrl]
1150
+ * @param {Function} [props.onActionClick]
1151
+ */
1152
+ function ErrorBanner({
1153
+ title,
1154
+ description,
1155
+ actionLabel,
1156
+ actionUrl = '#',
1157
+ onActionClick = () => {}
1181
1158
  }) {
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"
1159
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1160
+ className: "output__error",
1161
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1162
+ className: "output__error--title",
1163
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
1164
+ children: title
1165
+ }), actionLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1166
+ className: "output__error--action",
1167
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
1168
+ href: actionUrl,
1169
+ onClick: () => onActionClick(),
1170
+ children: actionLabel
1196
1171
  })
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
- })]
1209
- })]
1210
1172
  })]
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)
1173
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1174
+ className: "output__error--content",
1175
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
1176
+ children: description
1177
+ })
1225
1178
  })]
1226
1179
  });
1227
1180
  }
1228
- function printError(error) {
1181
+
1182
+ /**
1183
+ * Print the details of an incident.
1184
+ *
1185
+ * @param {Object} incident
1186
+ *
1187
+ * @returns {string}
1188
+ */
1189
+ function printIncident(incident) {
1229
1190
  let text = '';
1230
- Object.keys(error).forEach(key => {
1231
- text += `${capitalize(key)}: ${JSON.stringify(error[key], null, 2)}\n`;
1191
+ Object.keys(incident).forEach(key => {
1192
+ text += `${capitalize(key)}: ${JSON.stringify(incident[key], null, 2)}\n`;
1232
1193
  });
1233
1194
  return text;
1234
1195
  }
@@ -1250,6 +1211,95 @@ function capitalize(string) {
1250
1211
 
1251
1212
  /***/ }),
1252
1213
 
1214
+ /***/ "./lib/components/Output/OutputEditor.jsx":
1215
+ /*!************************************************!*\
1216
+ !*** ./lib/components/Output/OutputEditor.jsx ***!
1217
+ \************************************************/
1218
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1219
+
1220
+ __webpack_require__.r(__webpack_exports__);
1221
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1222
+ /* harmony export */ "default": () => (/* binding */ OutputEditor)
1223
+ /* harmony export */ });
1224
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1225
+ /* harmony import */ var _carbon_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @carbon/react */ "@carbon/react");
1226
+ /* harmony import */ var _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @carbon/icons-react */ "@carbon/icons-react");
1227
+ /* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @codemirror/state */ "./node_modules/@codemirror/state/dist/index.js");
1228
+ /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @codemirror/view */ "./node_modules/@codemirror/view/dist/index.js");
1229
+ /* harmony import */ var _codemirror_lang_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @codemirror/lang-json */ "./node_modules/@codemirror/lang-json/dist/index.js");
1230
+ /* harmony import */ var _shared_CodeMirrorTheme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/CodeMirrorTheme */ "./lib/components/shared/CodeMirrorTheme.js");
1231
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1232
+
1233
+
1234
+
1235
+
1236
+
1237
+
1238
+
1239
+
1240
+ function OutputEditor({
1241
+ value
1242
+ }) {
1243
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1244
+
1245
+ /**
1246
+ * @type {ReturnType<typeof useState<EditorView>>}
1247
+ */
1248
+ const [editorView, setEditorView] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1249
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1250
+ if (!ref.current) {
1251
+ return;
1252
+ }
1253
+ const editorState = _codemirror_state__WEBPACK_IMPORTED_MODULE_5__.EditorState.create({
1254
+ doc: value,
1255
+ 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"]]
1256
+ });
1257
+ const view = new _codemirror_view__WEBPACK_IMPORTED_MODULE_7__.EditorView({
1258
+ state: editorState,
1259
+ parent: ref.current
1260
+ });
1261
+ setEditorView(view);
1262
+ return () => {
1263
+ view.destroy();
1264
+ };
1265
+ }, []);
1266
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1267
+ if (!editorView) return;
1268
+ const editorValue = editorView.state.doc.toString();
1269
+ if (value !== editorValue) {
1270
+ editorView.dispatch({
1271
+ changes: {
1272
+ from: 0,
1273
+ to: editorValue.length,
1274
+ insert: value
1275
+ }
1276
+ });
1277
+ }
1278
+ }, [editorView, value]);
1279
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
1280
+ className: "code__editor",
1281
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
1282
+ className: "code__editor-copy-button",
1283
+ renderIcon: _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Copy,
1284
+ iconDescription: "Copy to clipboard",
1285
+ size: "sm",
1286
+ kind: "ghost",
1287
+ hasIconOnly: true,
1288
+ onClick: () => {
1289
+ navigator.clipboard.writeText(value);
1290
+ }
1291
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1292
+ className: "code__editor-codemirror",
1293
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
1294
+ ref: ref,
1295
+ className: "code__editor-codemirror-inner"
1296
+ })
1297
+ })]
1298
+ });
1299
+ }
1300
+
1301
+ /***/ }),
1302
+
1253
1303
  /***/ "./lib/components/TaskTesting/TaskTesting.js":
1254
1304
  /*!***************************************************!*\
1255
1305
  !*** ./lib/components/TaskTesting/TaskTesting.js ***!
@@ -1264,15 +1314,18 @@ __webpack_require__.r(__webpack_exports__);
1264
1314
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1265
1315
  /* harmony import */ var _carbon_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @carbon/react */ "@carbon/react");
1266
1316
  /* 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");
1317
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
1318
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
1319
+ /* harmony import */ var _hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useSelectedElement */ "./lib/hooks/useSelectedElement.js");
1320
+ /* harmony import */ var _ElementConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ElementConfig */ "./lib/ElementConfig.js");
1321
+ /* harmony import */ var _ElementVariables__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ElementVariables */ "./lib/ElementVariables.js");
1322
+ /* harmony import */ var _Input_Input__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Input/Input */ "./lib/components/Input/Input.jsx");
1323
+ /* harmony import */ var _Output_Output__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Output/Output */ "./lib/components/Output/Output.jsx");
1324
+ /* harmony import */ var _TaskExecution__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../TaskExecution */ "./lib/TaskExecution.js");
1325
+ /* harmony import */ var _utils_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/element */ "./lib/utils/element.js");
1326
+ /* harmony import */ var _style_style_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../style/style.scss */ "./lib/style/style.scss");
1327
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1328
+
1276
1329
 
1277
1330
 
1278
1331
 
@@ -1291,54 +1344,84 @@ const NO_ELEMENT_TEXT = 'Select a task to start testing';
1291
1344
  * @param {Object} props
1292
1345
  * @param {Object} props.injector
1293
1346
  * @param {import('../../types').TaskExecutionApi} props.api
1294
- * @param {boolean} [props.isConnectionConfigured]
1295
- * @param {string} [props.onConfigureConnection]
1347
+ * @param {boolean} props.isConnectionConfigured
1348
+ * @param {string} [props.configureConnectionBannerTitle]
1349
+ * @param {string} [props.configureConnectionBannerDescription]
1350
+ * @param {string} [props.configureConnectionLabel]
1351
+ * @param {Function} [props.onConfigureConnection]
1296
1352
  * @param {import('../../types').Config|undefined} [props.config]
1297
1353
  * @param {Function} [props.onConfigChanged=() => {}]
1354
+ * @param {string} [props.operateBaseUrl]
1355
+ * @param {Function} [props.onTaskExecution=() => {}]
1356
+ * @param {Function} [props.onTaskExecutionInterrupted=() => {}]
1298
1357
  */
1299
1358
  function TaskTesting({
1300
1359
  injector,
1301
1360
  api,
1302
1361
  isConnectionConfigured,
1362
+ configureConnectionBannerTitle = 'Connection required',
1363
+ configureConnectionBannerDescription = 'Configure a connection to start testing.',
1364
+ configureConnectionLabel = 'Configure',
1303
1365
  onConfigureConnection,
1304
1366
  config,
1305
- onConfigChanged = () => {}
1367
+ onConfigChanged = () => {},
1368
+ operateBaseUrl,
1369
+ onTaskExecution = () => {},
1370
+ onTaskExecutionInterrupted = () => {}
1306
1371
  }) {
1307
1372
  /**
1308
- * @type {React.RefObject<ElementVariables?>}
1373
+ * @type {React.RefObject<ElementVariables?>}
1374
+ */
1375
+ const elementVariablesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1376
+
1377
+ /**
1378
+ * @type {React.RefObject<ElementConfig?>}
1379
+ */
1380
+ const elementConfigRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1381
+ const [variablesForElement, setVariablesForElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
1382
+
1383
+ /**
1384
+ * @type {ReturnType<typeof useState<import('../../types').TaskExecutionStatus>>}
1385
+ */
1386
+ const [taskExecutionStatus, setTaskExecutionStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1387
+
1388
+ /**
1389
+ * @type {ReturnType<typeof useState<string>>}
1309
1390
  */
1310
- const elementVariablesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1391
+ const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1311
1392
 
1312
1393
  /**
1313
- * @type {React.RefObject<ElementConfig?>}
1394
+ * @type {ReturnType<typeof useState<import('../../types').ElementOutput>>}
1314
1395
  */
1315
- const elementConfigRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1316
- 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);
1396
+ const [output, setOutput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
1320
1397
  const [allOutputs, setAllOutputs] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
1321
1398
  const [inputError, setInputError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
1322
- const element = (0,_hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_3__.useSelectedElement)(injector);
1399
+ const element = (0,_hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_4__.useSelectedElement)(injector);
1323
1400
 
1324
1401
  /**
1325
1402
  * @type {React.RefObject<TaskExecution?>}
1326
1403
  */
1327
1404
  const taskExecutionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
1405
+
1406
+ // Initialize services once the injector is available
1328
1407
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1329
- const elementVariables = new _ElementVariables__WEBPACK_IMPORTED_MODULE_5__.ElementVariables(injector);
1408
+ const elementVariables = new _ElementVariables__WEBPACK_IMPORTED_MODULE_6__.ElementVariables(injector);
1330
1409
  elementVariablesRef.current = elementVariables;
1331
- const elementConfig = new _ElementConfig__WEBPACK_IMPORTED_MODULE_4__.ElementConfig(injector, elementVariables, config);
1410
+ const elementConfig = new _ElementConfig__WEBPACK_IMPORTED_MODULE_5__.ElementConfig(injector, elementVariables, config);
1332
1411
  elementConfigRef.current = elementConfig;
1333
- const taskExecution = new _TaskExecution__WEBPACK_IMPORTED_MODULE_8__["default"](injector, api);
1412
+ const taskExecution = new _TaskExecution__WEBPACK_IMPORTED_MODULE_9__["default"](injector, api);
1334
1413
  taskExecutionRef.current = taskExecution;
1335
1414
  }, [injector]);
1415
+
1416
+ // Get input variables for the selected element
1336
1417
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1337
1418
  if (!element || !elementVariablesRef.current) {
1338
1419
  return;
1339
1420
  }
1340
1421
  elementVariablesRef.current.getVariablesForElement(element).then(variables => setVariablesForElement(variables));
1341
1422
  }, [element]);
1423
+
1424
+ // Subscribe to `variables.changed` event fired by the Variables Resolver
1342
1425
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1343
1426
  if (!elementVariablesRef.current) {
1344
1427
  return;
@@ -1357,6 +1440,8 @@ function TaskTesting({
1357
1440
  }
1358
1441
  };
1359
1442
  }, [element]);
1443
+
1444
+ // Listen for changes in the config from the modeler
1360
1445
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1361
1446
  if (!elementConfigRef.current) {
1362
1447
  return;
@@ -1380,61 +1465,55 @@ function TaskTesting({
1380
1465
  }
1381
1466
  };
1382
1467
  }, [element, onConfigChanged, setAllOutputs, setInput, setOutput]);
1468
+
1469
+ // Subscribe to task execution events
1383
1470
  (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, {
1471
+ var _taskExecutionRef$cur, _taskExecutionRef$cur2, _taskExecutionRef$cur3, _taskExecutionRef$cur4;
1472
+ /** @param {import('../../types').TaskExecutionError} error */
1473
+ const handleError = error => {
1474
+ var _elementConfigRef$cur;
1475
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur = elementConfigRef.current) === null || _elementConfigRef$cur === void 0 || _elementConfigRef$cur.setOutputConfigForElement(element, {
1404
1476
  success: false,
1405
- error: {
1406
- message,
1407
- response
1408
- }
1477
+ error
1409
1478
  });
1410
1479
  };
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;
1480
+
1481
+ /**
1482
+ * @param {import('../../types').TaskExecutionStatus} status
1483
+ * @param {string} [processInstanceKey]
1484
+ */
1485
+ const handleStatusChange = (status, processInstanceKey) => {
1486
+ setTaskExecutionStatus(status);
1487
+ if (processInstanceKey) {
1488
+ var _elementConfigRef$cur2;
1489
+ const operateUrl = operateBaseUrl ? `${operateBaseUrl}/processes/${processInstanceKey}` : null;
1490
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur2 = elementConfigRef.current) === null || _elementConfigRef$cur2 === void 0 || _elementConfigRef$cur2.setOutputConfigForElement(element, {
1491
+ operateUrl
1492
+ });
1424
1493
  }
1425
- elementConfigRef.current.setOutputConfigForElement(element, {
1426
- success,
1427
- incident,
1428
- variables
1494
+ };
1495
+
1496
+ /** @param {import('../../types').ElementOutput} output */
1497
+ const handleFinished = output => {
1498
+ var _elementConfigRef$cur3, _elementConfigRef$cur4;
1499
+ const {
1500
+ operateUrl
1501
+ } = (elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur3 = elementConfigRef.current) === null || _elementConfigRef$cur3 === void 0 ? void 0 : _elementConfigRef$cur3.getOutputConfigForElement(element)) || {};
1502
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur4 = elementConfigRef.current) === null || _elementConfigRef$cur4 === void 0 || _elementConfigRef$cur4.setOutputConfigForElement(element, {
1503
+ ...output,
1504
+ operateUrl
1429
1505
  });
1430
1506
  };
1431
- taskExecutionRef.current.on('taskExecution.end', handleTaskExecutionEnd);
1507
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur = taskExecutionRef.current) === null || _taskExecutionRef$cur === void 0 || _taskExecutionRef$cur.on('taskExecution.finished', handleFinished);
1508
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur2 = taskExecutionRef.current) === null || _taskExecutionRef$cur2 === void 0 || _taskExecutionRef$cur2.on('taskExecution.status.changed', handleStatusChange);
1509
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur3 = taskExecutionRef.current) === null || _taskExecutionRef$cur3 === void 0 || _taskExecutionRef$cur3.on('taskExecution.error', handleError);
1510
+ taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.interrupted', () => onTaskExecutionInterrupted());
1432
1511
  return () => {
1433
1512
  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);
1513
+ taskExecutionRef.current.off('taskExecution.finished', handleFinished);
1514
+ taskExecutionRef.current.off('taskExecution.status.changed', handleStatusChange);
1515
+ taskExecutionRef.current.off('taskExecution.error', handleError);
1516
+ taskExecutionRef.current.off('taskExecution.interrupted', () => onTaskExecutionInterrupted());
1438
1517
  }
1439
1518
  };
1440
1519
  }, [element]);
@@ -1446,10 +1525,13 @@ function TaskTesting({
1446
1525
  }
1447
1526
  }, [config]);
1448
1527
  (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));
1528
+ var _elementConfigRef$cur5, _elementConfigRef$cur6;
1529
+ if (!element) {
1530
+ setInput(undefined);
1531
+ return;
1452
1532
  }
1533
+ elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur5 = elementConfigRef.current) === null || _elementConfigRef$cur5 === void 0 || _elementConfigRef$cur5.getInputConfigForElement(element).then(setInput);
1534
+ setOutput(elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur6 = elementConfigRef.current) === null || _elementConfigRef$cur6 === void 0 ? void 0 : _elementConfigRef$cur6.getOutputConfigForElement(element));
1453
1535
  }, [element]);
1454
1536
  const handleSetInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(newInput => {
1455
1537
  if (element && elementConfigRef.current) {
@@ -1466,7 +1548,9 @@ function TaskTesting({
1466
1548
  return;
1467
1549
  }
1468
1550
  const inputConfig = await elementConfigRef.current.getInputConfigForElement(element);
1551
+ elementConfigRef.current.setOutputConfigForElement(element, null);
1469
1552
  taskExecutionRef.current.executeTask(element.id, JSON.parse(inputConfig));
1553
+ onTaskExecution();
1470
1554
  };
1471
1555
  const handleCancelTaskExecution = () => {
1472
1556
  if (taskExecutionRef.current) {
@@ -1479,84 +1563,202 @@ function TaskTesting({
1479
1563
  }
1480
1564
  }, [element]);
1481
1565
  if (!config) {
1482
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
1566
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
1483
1567
  className: "task-testing__container task-testing__container--empty",
1484
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1568
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1485
1569
  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", {
1570
+ 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
1571
  children: "Configuring..."
1488
1572
  })]
1489
1573
  })
1490
1574
  });
1491
1575
  }
1492
1576
  if (!element) {
1493
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
1577
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
1494
1578
  className: "task-testing__container task-testing__container--empty",
1495
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1579
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1496
1580
  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", {
1581
+ 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
1582
  children: NO_ELEMENT_TEXT
1499
1583
  })]
1500
1584
  })
1501
1585
  });
1502
1586
  }
1503
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
1587
+ const showTooltip = !isConnectionConfigured || !!inputError;
1588
+ const tooltipLabel = !isConnectionConfigured ? 'Connection not configured' : inputError;
1589
+ const isTaskExecuting = !!taskExecutionStatus && taskExecutionStatus !== 'idle';
1590
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1504
1591
  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)
1592
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1593
+ className: "task-testing__container--left",
1594
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1595
+ className: "task-testing__container--header",
1596
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
1597
+ className: "task-header",
1598
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
1599
+ className: "task-type",
1600
+ children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_10__.getType)(element)
1601
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
1602
+ children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_10__.getName)(element)
1513
1603
  })]
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",
1604
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {
1605
+ className: classnames__WEBPACK_IMPORTED_MODULE_3___default()({
1606
+ 'has-error': showTooltip
1607
+ }),
1608
+ label: tooltipLabel,
1520
1609
  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',
1610
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
1611
+ className: "btn-execute",
1612
+ kind: "primary",
1523
1613
  size: "sm",
1614
+ renderIcon: isTaskExecuting ? _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.StopFilledAlt : _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.PlayFilledAlt,
1524
1615
  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']
1616
+ children: isTaskExecuting ? 'Cancel' : 'Test task'
1528
1617
  })
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
- })
1618
+ })]
1619
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Input_Input__WEBPACK_IMPORTED_MODULE_7__["default"], {
1620
+ allOutputs: allOutputs,
1621
+ input: input,
1622
+ onErrorChange: setInputError,
1623
+ onResetInput: handleResetInput,
1624
+ onSetInput: handleSetInput,
1625
+ variablesForElement: variablesForElement
1553
1626
  })]
1627
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
1628
+ className: "task-testing__container--right",
1629
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Output_Output__WEBPACK_IMPORTED_MODULE_8__["default"], {
1630
+ isConnectionConfigured: isConnectionConfigured,
1631
+ configureConnectionBannerTitle: configureConnectionBannerTitle,
1632
+ configureConnectionBannerDescription: configureConnectionBannerDescription,
1633
+ configureConnectionLabel: configureConnectionLabel,
1634
+ onConfigureConnection: onConfigureConnection,
1635
+ isTaskExecuting: isTaskExecuting,
1636
+ output: output,
1637
+ onResetOutput: handleResetOutput,
1638
+ taskExecutionStatus: taskExecutionStatus || 'idle'
1639
+ })
1554
1640
  })]
1555
1641
  });
1556
1642
  }
1557
1643
 
1558
1644
  /***/ }),
1559
1645
 
1646
+ /***/ "./lib/components/shared/CodeMirrorTheme.js":
1647
+ /*!**************************************************!*\
1648
+ !*** ./lib/components/shared/CodeMirrorTheme.js ***!
1649
+ \**************************************************/
1650
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1651
+
1652
+ __webpack_require__.r(__webpack_exports__);
1653
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1654
+ /* harmony export */ baseTheme: () => (/* binding */ baseTheme),
1655
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1656
+ /* harmony export */ highlightTheme: () => (/* binding */ highlightTheme),
1657
+ /* harmony export */ syntaxClasses: () => (/* binding */ syntaxClasses)
1658
+ /* harmony export */ });
1659
+ /* harmony import */ var _codemirror_language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @codemirror/language */ "./node_modules/@codemirror/language/dist/index.js");
1660
+ /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @codemirror/view */ "./node_modules/@codemirror/view/dist/index.js");
1661
+ /* harmony import */ var _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lezer/highlight */ "./node_modules/@lezer/highlight/dist/index.js");
1662
+
1663
+
1664
+
1665
+ const baseTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.theme({
1666
+ '&': {
1667
+ height: '100%',
1668
+ width: '100%'
1669
+ },
1670
+ '.cm-scroller': {
1671
+ overflow: 'auto'
1672
+ },
1673
+ '& .cm-content': {
1674
+ padding: '0px'
1675
+ },
1676
+ '& .cm-line': {
1677
+ padding: '0px'
1678
+ },
1679
+ '&.cm-editor.cm-focused': {
1680
+ outline: 'none'
1681
+ },
1682
+ '& .cm-completionInfo': {
1683
+ whiteSpace: 'pre-wrap',
1684
+ overflow: 'hidden',
1685
+ textOverflow: 'ellipsis'
1686
+ },
1687
+ '&.cm-editor': {
1688
+ height: '100%'
1689
+ },
1690
+ // Don't wrap whitespace for custom HTML
1691
+ '& .cm-completionInfo > *': {
1692
+ whiteSpace: 'normal'
1693
+ },
1694
+ '& .cm-completionInfo ul': {
1695
+ margin: 0,
1696
+ paddingLeft: '15px'
1697
+ },
1698
+ '& .cm-completionInfo pre': {
1699
+ marginBottom: 0,
1700
+ whiteSpace: 'pre-wrap'
1701
+ },
1702
+ '& .cm-completionInfo p': {
1703
+ marginTop: 0
1704
+ },
1705
+ '& .cm-completionInfo p:not(:last-of-type)': {
1706
+ marginBottom: 0
1707
+ }
1708
+ });
1709
+ const highlightTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.baseTheme({
1710
+ '& .variableName': {
1711
+ color: '#10f'
1712
+ },
1713
+ '& .number': {
1714
+ color: '#164'
1715
+ },
1716
+ '& .string': {
1717
+ color: '#a11'
1718
+ },
1719
+ '& .bool': {
1720
+ color: '#219'
1721
+ },
1722
+ '& .function': {
1723
+ color: '#aa3731',
1724
+ fontWeight: 'bold'
1725
+ },
1726
+ '& .control': {
1727
+ color: '#708'
1728
+ }
1729
+ });
1730
+ const syntaxClasses = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.syntaxHighlighting)(_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.HighlightStyle.define([{
1731
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName,
1732
+ class: 'variableName'
1733
+ }, {
1734
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.name,
1735
+ class: 'variableName'
1736
+ }, {
1737
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.number,
1738
+ class: 'number'
1739
+ }, {
1740
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.string,
1741
+ class: 'string'
1742
+ }, {
1743
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.bool,
1744
+ class: 'bool'
1745
+ }, {
1746
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.function(_lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.variableName),
1747
+ class: 'function'
1748
+ }, {
1749
+ 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)),
1750
+ class: 'function'
1751
+ }, {
1752
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.controlKeyword,
1753
+ class: 'control'
1754
+ }, {
1755
+ tag: _lezer_highlight__WEBPACK_IMPORTED_MODULE_0__.tags.operatorKeyword,
1756
+ class: 'control'
1757
+ }]));
1758
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([baseTheme, highlightTheme, syntaxClasses]);
1759
+
1760
+ /***/ }),
1761
+
1560
1762
  /***/ "./lib/hooks/useSelectedElement.js":
1561
1763
  /*!*****************************************!*\
1562
1764
  !*** ./lib/hooks/useSelectedElement.js ***!
@@ -1840,7 +2042,8 @@ function hasPropertyAfter(state, pos) {
1840
2042
 
1841
2043
  __webpack_require__.r(__webpack_exports__);
1842
2044
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1843
- /* harmony export */ getName: () => (/* binding */ getName)
2045
+ /* harmony export */ getName: () => (/* binding */ getName),
2046
+ /* harmony export */ getType: () => (/* binding */ getType)
1844
2047
  /* harmony export */ });
1845
2048
  /* harmony import */ var bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bpmn-js/lib/util/ModelUtil */ "./node_modules/bpmn-js/lib/util/ModelUtil.js");
1846
2049
 
@@ -1861,6 +2064,40 @@ function getName(element) {
1861
2064
  return name;
1862
2065
  }
1863
2066
 
2067
+ /**
2068
+ * Get the name of a BPMN element.
2069
+ *
2070
+ * @param {import('../types').Element} element
2071
+ *
2072
+ * @returns {string}
2073
+ */
2074
+ function getType(element) {
2075
+ const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getBusinessObject)(element);
2076
+ const {
2077
+ $type: type
2078
+ } = businessObject;
2079
+ switch (type) {
2080
+ case 'bpmn:Task':
2081
+ return 'Task';
2082
+ case 'bpmn:UserTask':
2083
+ return 'User Task';
2084
+ case 'bpmn:ScriptTask':
2085
+ return 'Script Task';
2086
+ case 'bpmn:ServiceTask':
2087
+ return 'Service Task';
2088
+ case 'bpmn:BusinessRuleTask':
2089
+ return 'Business Rule Task';
2090
+ case 'bpmn:SendTask':
2091
+ return 'Send Task';
2092
+ case 'bpmn:ManualTask':
2093
+ return 'Manual Task';
2094
+ case 'bpmn:ReceiveTask':
2095
+ return 'Receive Task';
2096
+ default:
2097
+ return 'Task';
2098
+ }
2099
+ }
2100
+
1864
2101
  /***/ }),
1865
2102
 
1866
2103
  /***/ "./node_modules/@bpmn-io/extract-process-variables/zeebe/index.mjs":
@@ -32324,7 +32561,7 @@ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBP
32324
32561
  // Module
32325
32562
  ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32326
32563
  display: flex;
32327
- flex-direction: column;
32564
+ flex-direction: row;
32328
32565
  height: 100%;
32329
32566
  width: 100%;
32330
32567
  padding: 10px;
@@ -32342,47 +32579,47 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32342
32579
  inline-size: initial;
32343
32580
  min-block-size: initial;
32344
32581
  }
32345
- .task-testing__container .task-testing__container--header {
32582
+ .task-testing__container .task-testing__container--left {
32583
+ width: 50%;
32346
32584
  display: flex;
32347
- flex-direction: row;
32348
- gap: 12px;
32585
+ flex-direction: column;
32586
+ border-right: 1px solid #E0E0E0;
32587
+ padding-right: 6px;
32349
32588
  }
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;
32589
+ .task-testing__container .task-testing__container--right {
32354
32590
  width: 50%;
32591
+ display: flex;
32592
+ flex-direction: column;
32593
+ padding-left: 6px;
32355
32594
  }
32356
- .task-testing__container .task-testing__container--header .task-testing__container--header--left {
32595
+ .task-testing__container .task-testing__container--header {
32357
32596
  display: flex;
32597
+ flex-direction: row;
32358
32598
  align-items: center;
32359
- gap: 5px;
32599
+ justify-content: space-between;
32600
+ gap: 12px;
32601
+ width: 100%;
32602
+ }
32603
+ .task-testing__container .task-testing__container--header .task-header {
32604
+ display: flex;
32605
+ gap: 6px;
32360
32606
  }
32361
- .task-testing__container .task-testing__container--header .task-testing__container--header--left .task-testing__container--header-task-name {
32607
+ .task-testing__container .task-testing__container--header .task-header .task-type {
32362
32608
  font-weight: bold;
32363
32609
  }
32364
- .task-testing__container .task-testing__container--header .task-testing__container--header--right {
32365
- justify-content: flex-end;
32610
+ .task-testing__container .task-testing__container--header .btn-execute {
32611
+ width: 138px;
32366
32612
  }
32367
- .task-testing__container .task-testing__container--header .task-testing__container--header--right .cds--popover-container:not(.has-error) .cds--popover {
32613
+ .task-testing__container .task-testing__container--header .cds--popover-container:not(.has-error) .cds--popover {
32368
32614
  display: none;
32369
32615
  }
32370
- .task-testing__container .task-testing__container--header .task-testing__container--header--right .cds--btn .cds--inline-loading {
32616
+ .task-testing__container .task-testing__container--header .cds--tooltip-content {
32617
+ padding: 12px;
32618
+ }
32619
+ .task-testing__container .task-testing__container--header .cds--btn .cds--inline-loading {
32371
32620
  inline-size: initial;
32372
32621
  min-block-size: initial;
32373
32622
  }
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
32623
  .task-testing__container .input {
32387
32624
  flex-grow: 1;
32388
32625
  display: flex;
@@ -32394,6 +32631,9 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32394
32631
  align-items: center;
32395
32632
  gap: 5px;
32396
32633
  }
32634
+ .task-testing__container .input .input__header--title {
32635
+ color: #525252;
32636
+ }
32397
32637
  .task-testing__container .output {
32398
32638
  flex-grow: 1;
32399
32639
  display: flex;
@@ -32403,126 +32643,156 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
32403
32643
  .task-testing__container .output .output__header {
32404
32644
  display: flex;
32405
32645
  align-items: center;
32406
- gap: 5px;
32646
+ height: 32px;
32647
+ width: 100%;
32648
+ }
32649
+ .task-testing__container .output .output__header--title {
32650
+ color: #525252;
32651
+ display: flex;
32652
+ align-items: center;
32653
+ gap: 6px;
32654
+ }
32655
+ .task-testing__container .output .output__header--title svg.output__status-icon--ready {
32656
+ fill: #0043ce;
32657
+ }
32658
+ .task-testing__container .output .output__header--title svg.output__status-icon--success {
32659
+ fill: #24a148;
32660
+ }
32661
+ .task-testing__container .output .output__header--title svg.output__status-icon--error {
32662
+ fill: #da1e28;
32663
+ }
32664
+ .task-testing__container .output .output__header--title .cds--inline-loading {
32665
+ inline-size: 16px;
32666
+ min-block-size: initial;
32667
+ }
32668
+ .task-testing__container .output .output__header--button-operate {
32669
+ margin-left: auto;
32407
32670
  }
32408
32671
  .task-testing__container .output .output__body {
32672
+ display: flex;
32673
+ flex-direction: column;
32409
32674
  flex-grow: 1;
32410
32675
  position: relative;
32411
32676
  }
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;
32677
+ .task-testing__container .output .output__body .cds--tabs {
32678
+ --cds-layout-size-height-local: 32px;
32679
+ }
32680
+ .task-testing__container .output .output__body .cds--tab-content {
32681
+ padding: 0;
32682
+ height: calc(100% - 20px);
32683
+ }
32684
+ .task-testing__container .output .output__body .cds--tab-content:not([hidden]) {
32419
32685
  display: flex;
32420
- flex-direction: column;
32421
- gap: 12px;
32422
32686
  }
32423
- .task-testing__container .output .output__state {
32687
+ .task-testing__container .output .output__body .cds--popover {
32688
+ display: none;
32689
+ }
32690
+ .task-testing__container .output .output__error {
32424
32691
  display: flex;
32425
- flex-direction: row;
32692
+ flex-direction: column;
32426
32693
  gap: 12px;
32427
32694
  padding: 12px;
32428
- border: 1px solid transparent;
32695
+ margin-bottom: 12px;
32696
+ border: 1px solid #da1e28;
32429
32697
  border-left-width: 3px;
32698
+ background-color: #fff1f1;
32430
32699
  }
32431
- .task-testing__container .output .output__state .output__state-content {
32432
- display: flex;
32433
- flex-direction: column;
32434
- gap: 6px;
32435
- flex-grow: 1;
32436
- margin-top: 1px;
32437
- }
32438
- .task-testing__container .output .output__state .output__state-content .output__state-title {
32700
+ .task-testing__container .output .output__error .output__error--title {
32439
32701
  display: flex;
32440
- justify-content: space-between;
32702
+ flex-direction: row;
32703
+ align-items: center;
32441
32704
  font-weight: bold;
32442
32705
  }
32443
- .task-testing__container .output .output__state .output__state-content .output__state-title .cds--link {
32444
- cursor: pointer;
32445
- }
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 {
32706
+ .task-testing__container .output .output__error .output__error--title svg {
32451
32707
  fill: #da1e28;
32452
32708
  }
32453
- .task-testing__container .output .output__variables.output__variables--no-results .cds--snippet-container {
32454
- min-height: 0 !important;
32455
- outline: none;
32709
+ .task-testing__container .output .output__error .output__error--title .output__error--action {
32710
+ margin-left: auto;
32456
32711
  }
32457
- .task-testing__container .output .output__variables .output__variables--title {
32458
- margin-bottom: 12px;
32712
+ .task-testing__container .output .output__variables--empty {
32713
+ height: 32px;
32714
+ display: flex;
32715
+ align-items: center;
32716
+ color: #525252;
32717
+ }
32718
+ .task-testing__container .output .output__variables--empty-action {
32719
+ font-weight: bold;
32459
32720
  }
32460
- .task-testing__container .output .output__variables .cds--snippet-container {
32721
+ .task-testing__container .output .cds--snippet-container {
32461
32722
  width: 100%;
32462
32723
  }
32463
- .task-testing__container .output .output__variables .cds--snippet {
32724
+ .task-testing__container .output .cds--snippet {
32464
32725
  max-inline-size: 100%;
32726
+ height: 100%;
32465
32727
  }
32466
32728
  .task-testing__container .output code {
32467
32729
  font-size: 14px;
32468
32730
  }
32469
32731
 
32470
- .input__editor {
32732
+ .code__editor {
32471
32733
  position: relative;
32472
32734
  flex-grow: 1;
32473
32735
  display: flex;
32474
32736
  flex-direction: column;
32475
32737
  }
32476
- .input__editor.input__editor--error .input__editor-codemirror .input__editor-codemirror-inner .cm-editor {
32738
+ .code__editor.code__editor--error .code__editor-codemirror .code__editor-codemirror-inner .cm-editor {
32477
32739
  outline: 1px solid #da1e28;
32478
32740
  outline-offset: -1px;
32479
- background-color: #fff1f1;
32480
32741
  }
32481
- .input__editor .input__editor-codemirror {
32742
+ .code__editor .code__editor-codemirror {
32482
32743
  position: relative;
32483
32744
  flex-grow: 1;
32484
32745
  }
32485
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner {
32746
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner {
32486
32747
  position: absolute;
32487
32748
  top: 0;
32488
32749
  left: 0;
32489
32750
  right: 0;
32490
32751
  bottom: 0;
32491
32752
  }
32492
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-editor {
32753
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-editor {
32493
32754
  height: 100%;
32494
32755
  background-color: var(--cds-layer, #f4f4f4);
32495
32756
  }
32496
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-scroller {
32757
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-scroller {
32497
32758
  overflow-y: auto !important;
32498
32759
  }
32499
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-content {
32760
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-content {
32500
32761
  padding: 15px;
32501
32762
  }
32502
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-focused {
32763
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-focused {
32503
32764
  outline: none;
32504
32765
  }
32505
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .cm-tooltip {
32766
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .cm-tooltip {
32506
32767
  font-size: 14px;
32507
32768
  }
32508
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .info {
32769
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .info {
32509
32770
  padding: 5px;
32510
32771
  font-family: monospace;
32511
32772
  font-size: 12px;
32512
32773
  max-width: 300px;
32513
32774
  word-wrap: break-word;
32514
32775
  }
32515
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .info span {
32776
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .info span {
32516
32777
  font-style: italic;
32517
32778
  }
32518
- .input__editor .input__editor-codemirror .input__editor-codemirror-inner .info pre {
32779
+ .code__editor .code__editor-codemirror .code__editor-codemirror-inner .info pre {
32519
32780
  margin-top: 5px;
32520
32781
  }
32521
- .input__editor .input__editor-error {
32782
+ .code__editor .code__editor-error {
32522
32783
  color: #da1e28;
32523
32784
  font-size: 13px;
32524
32785
  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":""}]);
32786
+ }
32787
+ .code__editor .code__editor-copy-button {
32788
+ position: absolute;
32789
+ top: 10px;
32790
+ right: 10px;
32791
+ z-index: 10;
32792
+ }
32793
+ .code__editor .code__editor-copy-button svg {
32794
+ fill: #525252;
32795
+ }`, "",{"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,QAAA;AAJN;AAMM;EACE,iBAAA;AAJR;AAQI;EACE,YAAA;AANN;AASI;EACE,aAAA;AAPN;AAUI;EACE,aAAA;AARN;AAWI;EACE,oBAAA;EACA,uBAAA;AATN;AAaE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAXJ;AAaI;EACE,aAAA;EACA,mBAAA;EACA,QAAA;AAXN;AAcI;EACE,cAAA;AAZN;AAgBE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAdJ;AAgBI;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;AAdN;AAiBI;EACE,cAAA;EACA,aAAA;EACA,mBAAA;EACA,QAAA;AAfN;AAiBM;EACE,aAAA;AAfR;AAkBM;EACE,aAAA;AAhBR;AAmBM;EACE,aAAA;AAjBR;AAoBM;EACE,iBAAA;EACA,uBAAA;AAlBR;AAsBI;EACE,iBAAA;AApBN;AAuBI;EACE,aAAA;EACA,sBAAA;EACA,YAAA;EACA,kBAAA;AArBN;AAuBM;EACE,oCAAA;AArBR;AAwBM;EACE,UAAA;EACA,yBAAA;AAtBR;AAyBM;EACE,aAAA;AAvBR;AA2BM;EACE,aAAA;AAzBR;AA6BI;EACE,aAAA;EACA,sBAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,yBAAA;EACA,sBAAA;EACA,yBAAA;AA3BN;AA6BM;EACE,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,iBAAA;AA3BR;AA6BQ;EACE,aAAA;AA3BV;AA8BQ;EACE,iBAAA;AA5BV;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-header {\n display: flex;\n gap: 6px;\n \n .task-type {\n font-weight: bold;\n }\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: column;\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--title {\n display: flex;\n flex-direction: row;\n align-items: center;\n font-weight: bold;\n\n svg {\n fill: #da1e28;\n }\n\n .output__error--action {\n margin-left: auto;\n }\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
32796
  // Exports
32527
32797
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
32528
32798