@processmaker/modeler 1.43.12 → 1.43.13

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.
Files changed (31) hide show
  1. package/cypress.config.js +1 -0
  2. package/dist/img/pan-icon.4a4b74b7.svg +3 -0
  3. package/dist/modeler.common.js +2667 -1922
  4. package/dist/modeler.common.js.map +1 -1
  5. package/dist/modeler.umd.js +2671 -1926
  6. package/dist/modeler.umd.js.map +1 -1
  7. package/dist/modeler.umd.min.js +4 -4
  8. package/dist/modeler.umd.min.js.map +1 -1
  9. package/package.json +2 -2
  10. package/src/ModelerApp.vue +5 -1
  11. package/src/assets/railBottom/pan-icon.svg +3 -0
  12. package/src/components/crown/crownConfig/crownConfig.vue +1 -6
  13. package/src/components/hotkeys/main.js +41 -16
  14. package/src/components/hotkeys/undoRedo.js +24 -0
  15. package/src/components/modeler/Modeler.vue +216 -186
  16. package/src/components/modeler/modeler.scss +17 -5
  17. package/src/components/railBottom/PanControl.vue +38 -0
  18. package/src/components/railBottom/RailBottom.vue +8 -0
  19. package/src/components/railBottom/{miniPaperControl/miniPaperControl.scss → bottomLeftControl.scss} +5 -1
  20. package/src/components/railBottom/controls/Controls.vue +18 -6
  21. package/src/components/railBottom/controls/SubmenuPopper/SubmenuPopper.vue +2 -7
  22. package/src/components/railBottom/miniPaperControl/MiniPaperControl.vue +1 -1
  23. package/src/components/railBottom/undoRedoControl/UndoRedoControl.vue +4 -0
  24. package/src/components/rails/explorer-rail/nodeTypesLoop/nodeTypesLoop.vue +10 -3
  25. package/src/components/rails/explorer-rail/pmBlocksLoop/pmBlocksLoop.vue +6 -3
  26. package/src/components/topRail/TopRail.vue +5 -0
  27. package/src/mixins/clickAndDrop.js +20 -0
  28. package/src/mixins/linkEditing.js +393 -0
  29. package/src/mixins/transparentDragging.js +45 -0
  30. package/src/setup/initialLoad.js +2 -1
  31. package/src/undoRedoStore.js +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/modeler",
3
- "version": "1.43.12",
3
+ "version": "1.43.13",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve --mode development",
6
6
  "test:unit": "vue-cli-service test:unit",
@@ -91,7 +91,7 @@
91
91
  "@vue/cli-service": "~5.0.8",
92
92
  "@vue/test-utils": "^1.3.6",
93
93
  "@vue/vue2-jest": "^27.0.0-alpha.2",
94
- "axios": "^0.21.0",
94
+ "axios": "1.6.0",
95
95
  "axios-mock-adapter": "^1.19.0",
96
96
  "babel-core": "7.0.0-bridge.0",
97
97
  "babel-eslint": "^10.1.0",
@@ -3,7 +3,7 @@
3
3
 
4
4
  <b-card no-body class="h-100 rounded-0">
5
5
  <b-card-body class="overflow-hidden position-relative p-0 vh-100">
6
- <modeler ref="modeler" @set-xml-manager="xmlManager = $event" @validate="validationErrors = $event" @warnings="warnings = $event" :decorations="decorations" />
6
+ <modeler ref="modeler" @saveBpmn="saveBpmn" @set-xml-manager="xmlManager = $event" @validate="validationErrors = $event" @warnings="warnings = $event" :decorations="decorations" />
7
7
  </b-card-body>
8
8
  </b-card>
9
9
 
@@ -72,6 +72,10 @@ export default {
72
72
  setUploadedXml(event) {
73
73
  this.uploadedXml = event.target.result;
74
74
  },
75
+ saveBpmn(payload) {
76
+ // save into browser storage
77
+ localStorage.setItem('bpmn', payload.xml);
78
+ },
75
79
  },
76
80
  created() {
77
81
  reader.onload = this.setUploadedXml;
@@ -0,0 +1,3 @@
1
+ <svg width="21" height="25" viewBox="0 0 21 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M17.9382 3.53434C17.4842 3.5337 17.0358 3.63595 16.6261 3.83356V3.0927C16.6263 2.35587 16.366 1.64317 15.8919 1.08302C15.4178 0.522879 14.7611 0.152131 14.0403 0.0375892C13.3194 -0.0769526 12.5817 0.0722438 11.9602 0.458293C11.3386 0.844342 10.874 1.44186 10.6502 2.14316C10.1839 1.8878 9.65994 1.75913 9.12962 1.76976C8.59929 1.78038 8.0808 1.92994 7.62494 2.20378C7.16908 2.47761 6.7915 2.86633 6.52919 3.33185C6.26688 3.79736 6.12884 4.3237 6.12861 4.85928V11.9256L5.71089 11.2488C5.30517 10.5418 4.63876 10.0258 3.85733 9.81346C3.0759 9.60115 2.24301 9.70983 1.54071 10.1158C0.838404 10.5217 0.323815 11.1918 0.109419 11.9797C-0.104977 12.7676 -0.00174257 13.6092 0.396557 14.3204C2.14613 18.049 3.56001 20.6934 5.17727 22.3462C6.81094 24.0201 8.66549 24.7333 11.3773 24.7333C13.9285 24.7304 16.3744 23.7058 18.1784 21.8843C19.9824 20.0628 20.9971 17.5931 21 15.0171V6.62586C21 5.80594 20.6774 5.0196 20.1032 4.43983C19.529 3.86006 18.7503 3.53434 17.9382 3.53434ZM19.2504 15.0171C19.2481 17.1248 18.4179 19.1454 16.9419 20.6358C15.4659 22.1261 13.4647 22.9644 11.3773 22.9668C9.14881 22.9668 7.71306 22.4279 6.42057 21.1063C4.97389 19.6257 3.64202 17.1149 1.96243 13.5354C1.95259 13.5135 1.94164 13.4921 1.92962 13.4714C1.75562 13.167 1.70849 12.8053 1.79862 12.4658C1.88875 12.1263 2.10874 11.8369 2.41021 11.6612C2.71168 11.4855 3.06992 11.4379 3.40613 11.5289C3.74234 11.6199 4.02897 11.842 4.20298 12.1464C4.20743 12.1553 4.21255 12.1638 4.21829 12.1718L6.25982 15.4842C6.36011 15.6476 6.51046 15.7735 6.68804 15.8428C6.86562 15.9121 7.06074 15.921 7.24379 15.8682C7.42685 15.8153 7.58783 15.7036 7.70232 15.5501C7.81681 15.3965 7.87856 15.2094 7.87818 15.0171V4.85928C7.87818 4.50789 8.01643 4.17088 8.26251 3.92241C8.50859 3.67394 8.84235 3.53434 9.19036 3.53434C9.53838 3.53434 9.87213 3.67394 10.1182 3.92241C10.3643 4.17088 10.5025 4.50789 10.5025 4.85928V11.484C10.5025 11.7182 10.5947 11.9429 10.7588 12.1085C10.9228 12.2742 11.1453 12.3673 11.3773 12.3673C11.6093 12.3673 11.8318 12.2742 11.9959 12.1085C12.16 11.9429 12.2521 11.7182 12.2521 11.484V3.0927C12.2521 2.7413 12.3904 2.4043 12.6365 2.15583C12.8825 1.90735 13.2163 1.76776 13.5643 1.76776C13.9123 1.76776 14.2461 1.90735 14.4922 2.15583C14.7382 2.4043 14.8765 2.7413 14.8765 3.0927V11.484C14.8765 11.7182 14.9686 11.9429 15.1327 12.1085C15.2968 12.2742 15.5193 12.3673 15.7513 12.3673C15.9833 12.3673 16.2058 12.2742 16.3698 12.1085C16.5339 11.9429 16.6261 11.7182 16.6261 11.484V6.62586C16.6261 6.27447 16.7643 5.93747 17.0104 5.68899C17.2565 5.44052 17.5902 5.30093 17.9382 5.30093C18.2863 5.30093 18.62 5.44052 18.8661 5.68899C19.1122 5.93747 19.2504 6.27447 19.2504 6.62586V15.0171Z" fill="#44494E"/>
3
+ </svg>
@@ -162,11 +162,6 @@ export default {
162
162
 
163
163
  this.showCrown = this.highlightedShapes[0] === this.shape;
164
164
  },
165
- highlighted(highlighted) {
166
- if (!highlighted) {
167
- this.taskDropdownInitiallyOpen = false;
168
- }
169
- },
170
165
  shape() {
171
166
  if (this.highlighted) {
172
167
  this.showCrown = true;
@@ -179,7 +174,7 @@ export default {
179
174
  showCrown: false,
180
175
  savePositionOnPointerupEventSet: false,
181
176
  style: null,
182
- taskDropdownInitiallyOpen: this.paperNotRendered(),
177
+ taskDropdownInitiallyOpen: false,
183
178
  showReplaceModal: false,
184
179
  nodeToReplace: null,
185
180
  };
@@ -1,11 +1,12 @@
1
1
  import ZoomInOut from './zoomInOut';
2
+ import UndoRedo from './undoRedo';
2
3
  import CopyPaste from './copyPaste.js';
3
4
  import moveShapeByKeypress from './moveWithArrowKeys';
4
5
  import EscKey from './escKey';
5
6
  import store from '@/store';
6
7
 
7
8
  export default {
8
- mixins: [ZoomInOut, CopyPaste, EscKey],
9
+ mixins: [ZoomInOut, CopyPaste, EscKey, UndoRedo],
9
10
  computed: {
10
11
  clientLeftPaper() {
11
12
  return store.getters.clientLeftPaper;
@@ -19,13 +20,13 @@ export default {
19
20
  handleHotkeys(event, options) {
20
21
  // Pass event to all handlers
21
22
  this.zoomInOutHandler(event, options);
23
+ this.undoRedoHandler(event, options);
22
24
  this.copyPasteHandler(event, options);
23
25
  this.escapeKeyHandler(event);
24
26
  },
25
27
  keyupListener(event) {
26
28
  if (event.code === 'Space') {
27
- this.isGrabbing = false;
28
- this.paperManager.removeEventHandler('blank:pointermove');
29
+ this.panMode = false;
29
30
  }
30
31
  },
31
32
  keydownListener(event) {
@@ -46,19 +47,10 @@ export default {
46
47
  }
47
48
 
48
49
  if (event.code === 'Space') {
49
- this.isGrabbing = true;
50
- this.paperManager.addEventHandler('blank:pointermove', (event, x, y) => {
51
- if (!this.canvasDragPosition) {
52
- const scale = this.paperManager.scale;
53
- this.canvasDragPosition = { x: x * scale.sx, y: y * scale.sy };
54
- }
55
- if (this.canvasDragPosition && !this.clientLeftPaper) {
56
- this.paperManager.translate(
57
- event.offsetX - this.canvasDragPosition.x,
58
- event.offsetY - this.canvasDragPosition.y,
59
- );
60
- }
61
- });
50
+ if (this.panMode) {
51
+ return;
52
+ }
53
+ this.panMode = true;
62
54
  }
63
55
 
64
56
  moveShapeByKeypress(
@@ -67,5 +59,38 @@ export default {
67
59
  this.pushToUndoStack,
68
60
  );
69
61
  },
62
+ startPanning() {
63
+ this.panning = true;
64
+ this.paperManager.addEventHandler('blank:pointermove', this.blankMoveHandler);
65
+ this.paperManager.addEventHandler('cell:pointermove', this.cellMoveHandler);
66
+ },
67
+ blankMoveHandler(event, x, y) {
68
+ this.checkCanvasDragPosition(x, y);
69
+ this.translatePaper(event);
70
+ },
71
+ cellMoveHandler(shape, event, x, y) {
72
+ this.checkCanvasDragPosition(x, y);
73
+ this.translatePaper(event);
74
+ },
75
+ checkCanvasDragPosition(x, y) {
76
+ if (!this.canvasDragPosition) {
77
+ const scale = this.paperManager.scale;
78
+ this.canvasDragPosition = { x: x * scale.sx, y: y * scale.sy };
79
+ }
80
+ },
81
+ translatePaper(event) {
82
+ if (this.clientLeftPaper) {
83
+ return;
84
+ }
85
+ this.paperManager.translate(
86
+ event.offsetX - this.canvasDragPosition.x,
87
+ event.offsetY - this.canvasDragPosition.y,
88
+ );
89
+ },
90
+ stopPanning() {
91
+ this.paperManager.removeEventHandler('blank:pointermove', this.blankMoveHandler);
92
+ this.paperManager.removeEventHandler('cell:pointermove', this.cellMoveHandler);
93
+ this.panning = false;
94
+ },
70
95
  },
71
96
  };
@@ -0,0 +1,24 @@
1
+ export default {
2
+ methods: {
3
+ undoRedoHandler(event, options) {
4
+ const key = event.key.toLowerCase();
5
+ const isRedo = key === 'y';
6
+ const isUndo= key === 'z';
7
+
8
+ if (isUndo && options.mod) {
9
+ this.undo(event);
10
+ }
11
+ if (isRedo && options.mod) {
12
+ this.redo(event);
13
+ }
14
+ },
15
+ undo(event) {
16
+ event.preventDefault();
17
+ this.$root.$emit('undo-keyboard-shortcut');
18
+ },
19
+ redo(event) {
20
+ event.preventDefault();
21
+ this.$root.$emit('redo-keyboard-shortcut');
22
+ },
23
+ },
24
+ };