@processmaker/modeler 1.43.7 → 1.43.9

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.
@@ -48329,10 +48329,10 @@ var ValidationStatus_component = normalizeComponent(
48329
48329
  )
48330
48330
 
48331
48331
  /* harmony default export */ var ValidationStatus = (ValidationStatus_component.exports);
48332
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/modeler/Modeler.vue?vue&type=template&id=27bb3680&
48332
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/modeler/Modeler.vue?vue&type=template&id=292ef746&
48333
48333
 
48334
48334
 
48335
- var Modelervue_type_template_id_27bb3680_render = function render() {
48335
+ var Modelervue_type_template_id_292ef746_render = function render() {
48336
48336
  var _vm = this,
48337
48337
  _c = _vm._self._c;
48338
48338
  return _c('span', {
@@ -48371,7 +48371,7 @@ var Modelervue_type_template_id_27bb3680_render = function render() {
48371
48371
  "clearSelection": _vm.clearSelection,
48372
48372
  "action": _vm.handleToolbarAction,
48373
48373
  "onGenerateAssets": function onGenerateAssets($event) {
48374
- return _vm.generateAssets();
48374
+ return _vm.onGenerateAssets();
48375
48375
  }
48376
48376
  }
48377
48377
  }) : _vm._e(), _c('b-row', {
@@ -48419,7 +48419,7 @@ var Modelervue_type_template_id_27bb3680_render = function render() {
48419
48419
  ref: "createAssetsCard",
48420
48420
  on: {
48421
48421
  "onGenerateAssets": function onGenerateAssets($event) {
48422
- return _vm.generateAssets();
48422
+ return _vm.onGenerateAssets();
48423
48423
  },
48424
48424
  "closeCreateAssets": function closeCreateAssets($event) {
48425
48425
  _vm.isAiGenerated = false;
@@ -48612,9 +48612,9 @@ var Modelervue_type_template_id_27bb3680_render = function render() {
48612
48612
  });
48613
48613
  })], 2)], 1);
48614
48614
  };
48615
- var Modelervue_type_template_id_27bb3680_staticRenderFns = [];
48615
+ var Modelervue_type_template_id_292ef746_staticRenderFns = [];
48616
48616
 
48617
- ;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=27bb3680&
48617
+ ;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=292ef746&
48618
48618
 
48619
48619
  ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/nodes/boundaryEvent/boundaryEvent.vue?vue&type=template&id=728530a2&
48620
48620
  var boundaryEventvue_type_template_id_728530a2_render = function render() {
@@ -78324,6 +78324,7 @@ var Multiplayer = /*#__PURE__*/function () {
78324
78324
 
78325
78325
 
78326
78326
 
78327
+
78327
78328
 
78328
78329
 
78329
78330
  /* harmony default export */ var Modelervue_type_script_lang_js_ = ({
@@ -78792,29 +78793,31 @@ var Multiplayer = /*#__PURE__*/function () {
78792
78793
  var _arguments2 = arguments,
78793
78794
  _this6 = this;
78794
78795
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
78795
- var redirectTo, id, svg, css, style, xml, svgString;
78796
+ var redirectTo, id, generatingAssets, svg, css, style, xml, svgString;
78796
78797
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
78797
78798
  while (1) switch (_context5.prev = _context5.next) {
78798
78799
  case 0:
78799
78800
  redirectTo = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : null;
78800
78801
  id = _arguments2.length > 1 && _arguments2[1] !== undefined ? _arguments2[1] : null;
78802
+ generatingAssets = _arguments2.length > 2 && _arguments2[2] !== undefined ? _arguments2[2] : false;
78801
78803
  svg = document.querySelector('.mini-paper svg');
78802
78804
  css = 'text { font-family: sans-serif; }';
78803
78805
  style = document.createElement('style');
78804
78806
  style.appendChild(document.createTextNode(css));
78805
78807
  svg.appendChild(style);
78806
- _context5.next = 9;
78808
+ _context5.next = 10;
78807
78809
  return _this6.getXmlFromDiagram();
78808
- case 9:
78810
+ case 10:
78809
78811
  xml = _context5.sent;
78810
78812
  svgString = new XMLSerializer().serializeToString(svg);
78811
78813
  _this6.$emit('saveBpmn', {
78812
78814
  xml: xml,
78813
78815
  svg: svgString,
78814
78816
  redirectUrl: redirectTo,
78815
- nodeId: id
78817
+ nodeId: id,
78818
+ generatingAssets: generatingAssets
78816
78819
  });
78817
- case 12:
78820
+ case 13:
78818
78821
  case "end":
78819
78822
  return _context5.stop();
78820
78823
  }
@@ -80502,10 +80505,16 @@ var Multiplayer = /*#__PURE__*/function () {
80502
80505
  }
80503
80506
  });
80504
80507
  },
80508
+ onGenerateAssets: function onGenerateAssets() {
80509
+ this.saveBpmn(null, null, true);
80510
+ },
80505
80511
  generateAssets: function generateAssets() {
80506
80512
  var _window$ProcessMaker7,
80507
80513
  _this46 = this;
80508
80514
  this.getNonce();
80515
+
80516
+ // Show Generating message
80517
+ this.loadingAI = true;
80509
80518
  this.fetchHistory();
80510
80519
  var params = {
80511
80520
  promptSessionId: this.promptSessionId,
@@ -80513,8 +80522,13 @@ var Multiplayer = /*#__PURE__*/function () {
80513
80522
  processId: (_window$ProcessMaker7 = window.ProcessMaker) === null || _window$ProcessMaker7 === void 0 || (_window$ProcessMaker7 = _window$ProcessMaker7.modeler) === null || _window$ProcessMaker7 === void 0 || (_window$ProcessMaker7 = _window$ProcessMaker7.process) === null || _window$ProcessMaker7 === void 0 ? void 0 : _window$ProcessMaker7.id
80514
80523
  };
80515
80524
  var url = '/package-ai/generateProcessArtifacts';
80516
- window.ProcessMaker.apiClient.post(url, params).then(function () {
80517
- // Response
80525
+ window.ProcessMaker.apiClient.post(url, params).then(function (response) {
80526
+ if (response.data) {
80527
+ var _response$data;
80528
+ if ((_response$data = response.data) !== null && _response$data !== void 0 && _response$data.error) {
80529
+ _this46.assetFail = true;
80530
+ }
80531
+ }
80518
80532
  }).catch(function (error) {
80519
80533
  var _error$response;
80520
80534
  var errorMsg = ((_error$response = error.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || error.message;
@@ -80588,6 +80602,28 @@ var Multiplayer = /*#__PURE__*/function () {
80588
80602
  }
80589
80603
  });
80590
80604
  },
80605
+ subscribeToGenerationCompleted: function subscribeToGenerationCompleted() {
80606
+ var _window$ProcessMaker9;
80607
+ var channel = "ProcessMaker.Models.User.".concat((_window$ProcessMaker9 = window.ProcessMaker) === null || _window$ProcessMaker9 === void 0 || (_window$ProcessMaker9 = _window$ProcessMaker9.modeler) === null || _window$ProcessMaker9 === void 0 || (_window$ProcessMaker9 = _window$ProcessMaker9.process) === null || _window$ProcessMaker9 === void 0 ? void 0 : _window$ProcessMaker9.user_id);
80608
+ var streamCompletedEvent = '.ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsCompletedEvent';
80609
+ window.Echo.private(channel).listen(streamCompletedEvent, function (response) {
80610
+ if (response.data) {
80611
+ setTimeout(function () {
80612
+ window.location.replace(window.location.href.split('?')[0]);
80613
+ }, 1500);
80614
+ }
80615
+ });
80616
+ },
80617
+ subscribeToErrors: function subscribeToErrors() {
80618
+ var _window$ProcessMaker10,
80619
+ _this48 = this;
80620
+ var channel = "ProcessMaker.Models.User.".concat((_window$ProcessMaker10 = window.ProcessMaker) === null || _window$ProcessMaker10 === void 0 || (_window$ProcessMaker10 = _window$ProcessMaker10.modeler) === null || _window$ProcessMaker10 === void 0 || (_window$ProcessMaker10 = _window$ProcessMaker10.process) === null || _window$ProcessMaker10 === void 0 ? void 0 : _window$ProcessMaker10.user_id);
80621
+ var streamProgressEvent = '.ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsErrorEvent';
80622
+ window.Echo.private(channel).listen(streamProgressEvent, function () {
80623
+ // Output error
80624
+ _this48.assetFail = true;
80625
+ });
80626
+ },
80591
80627
  onStopAssetGeneration: function onStopAssetGeneration() {
80592
80628
  if (this.currentNonce) {
80593
80629
  this.cancelledJobs.push(this.currentNonce);
@@ -80631,7 +80667,7 @@ var Multiplayer = /*#__PURE__*/function () {
80631
80667
  this.$emit('set-xml-manager', this.xmlManager);
80632
80668
  },
80633
80669
  mounted: function mounted() {
80634
- var _this48 = this;
80670
+ var _this49 = this;
80635
80671
  store.commit('setReadOnly', this.readOnly);
80636
80672
  this.graph = new external_jointjs_.dia.Graph();
80637
80673
  store.commit('setGraph', this.graph);
@@ -80650,47 +80686,47 @@ var Multiplayer = /*#__PURE__*/function () {
80650
80686
  store.commit('setPaper', this.paperManager.paper);
80651
80687
  this.paperManager.addEventHandler('element:pointerclick', this.blurFocusedScreenBuilderElement, this);
80652
80688
  this.paperManager.addEventHandler('blank:pointerdown', function (event, x, y) {
80653
- if (_this48.isGrabbing) return;
80689
+ if (_this49.isGrabbing) return;
80654
80690
  if (store.getters.isReadOnly) {
80655
- _this48.isGrabbing = true;
80691
+ _this49.isGrabbing = true;
80656
80692
  }
80657
- var scale = _this48.paperManager.scale;
80658
- _this48.canvasDragPosition = {
80693
+ var scale = _this49.paperManager.scale;
80694
+ _this49.canvasDragPosition = {
80659
80695
  x: x * scale.sx,
80660
80696
  y: y * scale.sy
80661
80697
  };
80662
- _this48.isOverShape = false;
80663
- _this48.pointerDownHandler(event);
80698
+ _this49.isOverShape = false;
80699
+ _this49.pointerDownHandler(event);
80664
80700
  }, this);
80665
80701
  this.paperManager.addEventHandler('cell:mouseover element:mouseover', function (_ref19) {
80666
80702
  var shape = _ref19.model;
80667
- if (_this48.isBpmnNode(shape) && shape.attr('body/cursor') !== 'default' && !_this48.isGrabbing) {
80703
+ if (_this49.isBpmnNode(shape) && shape.attr('body/cursor') !== 'default' && !_this49.isGrabbing) {
80668
80704
  shape.attr('body/cursor', 'move');
80669
80705
  }
80670
80706
  // If the user is panning the Paper while hovering an element, ignore the default move cursor
80671
- if (_this48.isGrabbing && _this48.isBpmnNode(shape)) {
80707
+ if (_this49.isGrabbing && _this49.isBpmnNode(shape)) {
80672
80708
  shape.attr('body/cursor', 'grabbing');
80673
80709
  }
80674
80710
  });
80675
80711
  this.paperManager.addEventHandler('blank:pointerup', function (event) {
80676
- _this48.isGrabbing = false;
80677
- _this48.canvasDragPosition = null;
80678
- _this48.activeNode = null;
80679
- _this48.pointerUpHandler(event);
80712
+ _this49.isGrabbing = false;
80713
+ _this49.canvasDragPosition = null;
80714
+ _this49.activeNode = null;
80715
+ _this49.pointerUpHandler(event);
80680
80716
  }, this);
80681
80717
  this.paperManager.addEventHandler('cell:pointerup', function (cellView, event) {
80682
- _this48.canvasDragPosition = null;
80683
- _this48.activeNode = null;
80684
- _this48.pointerUpHandler(event, cellView);
80718
+ _this49.canvasDragPosition = null;
80719
+ _this49.activeNode = null;
80720
+ _this49.pointerUpHandler(event, cellView);
80685
80721
  }, this);
80686
80722
  this.$refs['paper-container'].addEventListener('mouseenter', function () {
80687
80723
  store.commit('setClientLeftPaper', false);
80688
80724
  });
80689
80725
  this.$el.addEventListener('mousemove', function (event) {
80690
- _this48.pointerMoveHandler(event);
80726
+ _this49.pointerMoveHandler(event);
80691
80727
  });
80692
80728
  this.$refs['paper-container'].addEventListener('mouseleave', function () {
80693
- _this48.paperManager.removeEventHandler('blank:pointermove');
80729
+ _this49.paperManager.removeEventHandler('blank:pointermove');
80694
80730
  store.commit('setClientLeftPaper', true);
80695
80731
  });
80696
80732
  this.paperManager.addEventHandler('cell:pointerclick', function (cellView, evt, x, y) {
@@ -80701,44 +80737,44 @@ var Multiplayer = /*#__PURE__*/function () {
80701
80737
  });
80702
80738
  this.paperManager.addEventHandler('cell:pointerclick', function (_ref20, event) {
80703
80739
  var shape = _ref20.model;
80704
- if (!_this48.isBpmnNode(shape)) {
80740
+ if (!_this49.isBpmnNode(shape)) {
80705
80741
  return;
80706
80742
  }
80707
80743
 
80708
80744
  // ignore click event if the user is Grabbing the paper
80709
- if (_this48.isGrabbing) return;
80745
+ if (_this49.isGrabbing) return;
80710
80746
  shape.component.$emit('click', event);
80711
- _this48.$emit('click', {
80747
+ _this49.$emit('click', {
80712
80748
  event: event,
80713
- node: _this48.highlightedNode.definition
80749
+ node: _this49.highlightedNode.definition
80714
80750
  });
80715
80751
  });
80716
80752
  this.paperManager.addEventHandler('cell:pointerdown', function (_ref21, event) {
80717
80753
  var shape = _ref21.model;
80718
- if (!_this48.isBpmnNode(shape)) {
80754
+ if (!_this49.isBpmnNode(shape)) {
80719
80755
  return;
80720
80756
  }
80721
80757
  // If the user is pressing Space (grabbing) and clicking on a Cell, return
80722
- if (_this48.isGrabbing) {
80758
+ if (_this49.isGrabbing) {
80723
80759
  return;
80724
80760
  }
80725
- _this48.setShapeStacking(shape);
80726
- _this48.activeNode = shape.component.node;
80727
- _this48.isOverShape = true;
80728
- _this48.pointerDowInShape(event, shape);
80761
+ _this49.setShapeStacking(shape);
80762
+ _this49.activeNode = shape.component.node;
80763
+ _this49.isOverShape = true;
80764
+ _this49.pointerDowInShape(event, shape);
80729
80765
  });
80730
80766
  // If the user is grabbing the paper while he clicked in a cell, move the paper and not the cell
80731
80767
  this.paperManager.addEventHandler('cell:pointermove', function (_, event, x, y) {
80732
- if (_this48.isGrabbing) {
80733
- if (!_this48.canvasDragPosition) {
80734
- var scale = _this48.paperManager.scale;
80735
- _this48.canvasDragPosition = {
80768
+ if (_this49.isGrabbing) {
80769
+ if (!_this49.canvasDragPosition) {
80770
+ var scale = _this49.paperManager.scale;
80771
+ _this49.canvasDragPosition = {
80736
80772
  x: x * scale.sx,
80737
80773
  y: y * scale.sy
80738
80774
  };
80739
80775
  }
80740
- if (_this48.canvasDragPosition && !_this48.clientLeftPaper) {
80741
- _this48.paperManager.translate(event.offsetX - _this48.canvasDragPosition.x, event.offsetY - _this48.canvasDragPosition.y);
80776
+ if (_this49.canvasDragPosition && !_this49.clientLeftPaper) {
80777
+ _this49.paperManager.translate(event.offsetX - _this49.canvasDragPosition.x, event.offsetY - _this49.canvasDragPosition.y);
80742
80778
  }
80743
80779
  }
80744
80780
  });
@@ -80755,15 +80791,15 @@ var Multiplayer = /*#__PURE__*/function () {
80755
80791
  while (1) switch (_context33.prev = _context33.next) {
80756
80792
  case 0:
80757
80793
  _context33.next = 2;
80758
- return _this48.loadXML(xml);
80794
+ return _this49.loadXML(xml);
80759
80795
  case 2:
80760
80796
  _context33.next = 4;
80761
80797
  return undoRedoStore.dispatch('pushState', xml);
80762
80798
  case 4:
80763
80799
  try {
80764
- multiplayer = new Multiplayer(_this48);
80800
+ multiplayer = new Multiplayer(_this49);
80765
80801
  multiplayer.init();
80766
- _this48.multiplayer = multiplayer;
80802
+ _this49.multiplayer = multiplayer;
80767
80803
  } catch (error) {
80768
80804
  console.warn('Could not initialize multiplayer', error);
80769
80805
  }
@@ -80779,18 +80815,21 @@ var Multiplayer = /*#__PURE__*/function () {
80779
80815
  return loadXML;
80780
80816
  }(),
80781
80817
  addWarnings: function addWarnings(warnings) {
80782
- return _this48.$emit('warnings', warnings);
80818
+ return _this49.$emit('warnings', warnings);
80783
80819
  },
80784
80820
  addBreadcrumbs: function addBreadcrumbs(breadcrumbs) {
80785
- return _this48.breadcrumbData.push(breadcrumbs);
80821
+ return _this49.breadcrumbData.push(breadcrumbs);
80786
80822
  }
80787
80823
  });
80788
80824
  this.$root.$on('replace-ai-node', function (data) {
80789
- _this48.replaceAiNode(data);
80825
+ _this49.replaceAiNode(data);
80790
80826
  });
80791
- window.ProcessMaker.EventBus.$on('save-changes', function (redirectUrl) {
80827
+ window.ProcessMaker.EventBus.$on('save-changes', function (redirectUrl, nodeId, generatingAssets) {
80792
80828
  if (redirectUrl) {
80793
- _this48.redirect(redirectUrl);
80829
+ _this49.redirect(redirectUrl);
80830
+ }
80831
+ if (generatingAssets) {
80832
+ _this49.generateAssets();
80794
80833
  }
80795
80834
  });
80796
80835
 
@@ -80807,6 +80846,8 @@ var Multiplayer = /*#__PURE__*/function () {
80807
80846
  this.promptSessionId = this.getPromptSessionForUser();
80808
80847
  this.fetchHistory();
80809
80848
  this.subscribeToProgress();
80849
+ this.subscribeToGenerationCompleted();
80850
+ this.subscribeToErrors();
80810
80851
  }
80811
80852
  });
80812
80853
  ;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=script&lang=js&
@@ -80826,8 +80867,8 @@ var modelervue_type_style_index_0_prod_lang_scss_ = __webpack_require__(26695);
80826
80867
 
80827
80868
  var Modeler_component = normalizeComponent(
80828
80869
  modeler_Modelervue_type_script_lang_js_,
80829
- Modelervue_type_template_id_27bb3680_render,
80830
- Modelervue_type_template_id_27bb3680_staticRenderFns,
80870
+ Modelervue_type_template_id_292ef746_render,
80871
+ Modelervue_type_template_id_292ef746_staticRenderFns,
80831
80872
  false,
80832
80873
  null,
80833
80874
  null,