@processmaker/modeler 1.30.2 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/img/{boundary-event.5bf51421.svg → boundary-event.4e0fb9de.svg} +3 -3
  2. package/dist/img/clipboard.5fe6f79e.svg +3 -0
  3. package/dist/img/conditional-start-event.a56e4b5b.svg +4 -0
  4. package/dist/img/{connect-artifacts.5f8bed89.svg → connect-artifacts.496eb4b9.svg} +3 -3
  5. package/dist/img/{connect-elements.d4abedf2.svg → connect-elements.9ec5ca93.svg} +3 -3
  6. package/dist/img/copy-regular.2d678143.svg +3 -0
  7. package/dist/img/data-object.0d6d1585.svg +3 -0
  8. package/dist/img/data-store.32bed5ce.svg +3 -0
  9. package/dist/img/{default-flow.212147b4.svg → default-flow.156a793b.svg} +3 -3
  10. package/dist/img/end-event.9d1ff5c0.svg +3 -0
  11. package/dist/img/error-end-event.aab86eca.svg +11 -0
  12. package/dist/img/event-based-gateway.9960eee5.svg +6 -0
  13. package/dist/img/exclusive-gateway.26db4fae.svg +4 -0
  14. package/dist/img/generic-gateway.09ca6929.svg +3 -0
  15. package/dist/img/generic-intermediate-event.a711eb33.svg +4 -0
  16. package/dist/img/inclusive-gateway.754cb36f.svg +4 -0
  17. package/dist/img/intermediate-conditional-catch-event.e9ae6198.svg +5 -0
  18. package/dist/img/intermediate-message-catch-event.9d25208e.svg +5 -0
  19. package/dist/img/intermediate-message-throw-event.4309dc45.svg +5 -0
  20. package/dist/img/intermediate-signal-catch-event.74b65f17.svg +5 -0
  21. package/dist/img/intermediate-signal-throw-event.29cad018.svg +5 -0
  22. package/dist/img/intermediate-timer-event.1670a1c8.svg +5 -0
  23. package/dist/img/{lane-below.890c069b.svg → lane-below.e67f9823.svg} +12 -12
  24. package/dist/img/manual-task.374a73c3.svg +4 -0
  25. package/dist/img/message-end-event.f15b67f5.svg +4 -0
  26. package/dist/img/message-start-event.f2d4a5e6.svg +4 -0
  27. package/dist/img/mini-map.ae46890c.svg +3 -0
  28. package/dist/img/minus.ca21cc3b.svg +3 -0
  29. package/dist/img/parallel-gateway.877bb628.svg +4 -0
  30. package/dist/img/pin-angle-fill.0e4af645.svg +3 -0
  31. package/dist/img/pin-angle.3462c115.svg +3 -0
  32. package/dist/img/plus.afbb0b13.svg +3 -0
  33. package/dist/img/pool.98d4734c.svg +3 -0
  34. package/dist/img/redo.8425ce7e.svg +4 -0
  35. package/dist/img/script-task.3d8c664a.svg +4 -0
  36. package/dist/img/signal-end-event.a38a6616.svg +4 -0
  37. package/dist/img/signal-start-event.3d7b096c.svg +4 -0
  38. package/dist/img/start-event.7f1911cb.svg +3 -0
  39. package/dist/img/sub-task.52d09847.svg +4 -0
  40. package/dist/img/task.8a1c6c75.svg +3 -0
  41. package/dist/img/terminate-end-event.3aa5cd00.svg +4 -0
  42. package/dist/img/text-annotation.02df53cd.svg +3 -0
  43. package/dist/img/timer-start-event.55abac82.svg +4 -0
  44. package/dist/img/trash-alt-solid.58c408b8.svg +1 -0
  45. package/dist/img/undo.e0ffff93.svg +4 -0
  46. package/dist/modeler.common.js +19227 -12350
  47. package/dist/modeler.common.js.map +1 -1
  48. package/dist/modeler.umd.js +19227 -12350
  49. package/dist/modeler.umd.js.map +1 -1
  50. package/dist/modeler.umd.min.js +28 -3
  51. package/dist/modeler.umd.min.js.map +1 -1
  52. package/jsconfig.json +12 -0
  53. package/package.json +3 -1
  54. package/src/.DS_Store +0 -0
  55. package/src/ModelerApp.vue +21 -21
  56. package/src/assets/boundary-event.svg +3 -3
  57. package/src/assets/clipboard.svg +3 -1
  58. package/src/assets/cog-solid.svg +1 -0
  59. package/src/assets/connect-artifacts.svg +3 -3
  60. package/src/assets/connect-elements.svg +3 -3
  61. package/src/assets/copy-regular.svg +3 -1
  62. package/src/assets/default-flow.svg +3 -3
  63. package/src/assets/lane-below.svg +12 -12
  64. package/src/assets/palette.svg +1 -0
  65. package/src/assets/pin-angle-fill.svg +3 -0
  66. package/src/assets/pin-angle.svg +3 -0
  67. package/src/assets/railBottom/mini-map.svg +3 -0
  68. package/src/assets/railBottom/minus.svg +3 -0
  69. package/src/assets/railBottom/plus.svg +3 -0
  70. package/src/assets/railBottom/redo.svg +4 -0
  71. package/src/assets/railBottom/undo.svg +4 -0
  72. package/src/assets/scss/settings/_settings.variables.scss +5 -0
  73. package/src/assets/scss/tools/_tools.chevron.scss +1 -1
  74. package/src/assets/toolpanel/conditional-start-event.svg +4 -0
  75. package/src/assets/toolpanel/data-object.svg +2 -8
  76. package/src/assets/toolpanel/data-store.svg +2 -5
  77. package/src/assets/toolpanel/end-event.svg +3 -19
  78. package/src/assets/toolpanel/error-end-event.svg +11 -0
  79. package/src/assets/toolpanel/event-based-gateway.svg +6 -0
  80. package/src/assets/toolpanel/exclusive-gateway.svg +4 -0
  81. package/src/assets/toolpanel/generic-gateway.svg +2 -13
  82. package/src/assets/toolpanel/generic-intermediate-event.svg +3 -4
  83. package/src/assets/toolpanel/inclusive-gateway.svg +4 -0
  84. package/src/assets/toolpanel/intermediate-conditional-catch-event.svg +5 -0
  85. package/src/assets/toolpanel/intermediate-message-catch-event.svg +5 -0
  86. package/src/assets/toolpanel/intermediate-message-throw-event.svg +4 -5
  87. package/src/assets/toolpanel/intermediate-signal-catch-event.svg +5 -0
  88. package/src/assets/toolpanel/intermediate-signal-throw-event.svg +5 -0
  89. package/src/assets/toolpanel/intermediate-timer-event.svg +5 -0
  90. package/src/assets/toolpanel/manual-task.svg +4 -0
  91. package/src/assets/toolpanel/message-end-event.svg +4 -0
  92. package/src/assets/toolpanel/message-start-event.svg +3 -3
  93. package/src/assets/toolpanel/parallel-gateway.svg +4 -0
  94. package/src/assets/toolpanel/pool.svg +3 -11
  95. package/src/assets/toolpanel/script-task.svg +4 -0
  96. package/src/assets/toolpanel/signal-end-event.svg +4 -0
  97. package/src/assets/toolpanel/signal-start-event.svg +4 -0
  98. package/src/assets/toolpanel/start-event.svg +3 -19
  99. package/src/assets/toolpanel/sub-task.svg +4 -0
  100. package/src/assets/toolpanel/task.svg +3 -14
  101. package/src/assets/toolpanel/terminate-end-event.svg +4 -0
  102. package/src/assets/toolpanel/text-annotation.svg +3 -17
  103. package/src/assets/toolpanel/timer-start-event.svg +4 -0
  104. package/src/assets/trash-alt-solid.svg +1 -4
  105. package/src/components/crown/crownButtons/addLaneAboveButton.vue +6 -4
  106. package/src/components/crown/crownButtons/addLaneBelowButton.vue +6 -4
  107. package/src/components/crown/crownButtons/associationFlowButton.vue +1 -14
  108. package/src/components/crown/crownButtons/cloneButton.vue +1 -6
  109. package/src/components/crown/crownButtons/copyButton.vue +1 -4
  110. package/src/components/crown/crownButtons/crownBoundaryEventDropdown.vue +7 -2
  111. package/src/components/crown/crownButtons/crownButton.vue +36 -11
  112. package/src/components/crown/crownButtons/crownColorDropdown.vue +1 -1
  113. package/src/components/crown/crownButtons/crownDropdown.scss +4 -9
  114. package/src/components/crown/crownButtons/crownTaskDropdown.vue +1 -1
  115. package/src/components/crown/crownButtons/deleteButton.vue +1 -7
  116. package/src/components/crown/crownButtons/genericFlowButton.vue +4 -4
  117. package/src/components/crown/crownButtons/icons/faAlignBottom.js +11 -0
  118. package/src/components/crown/crownButtons/icons/faAlignLeft.js +11 -0
  119. package/src/components/crown/crownButtons/icons/faAlignRight.js +11 -0
  120. package/src/components/crown/crownButtons/icons/faAlignTop.js +11 -0
  121. package/src/components/crown/crownButtons/icons/faBoundaryEvent.js +11 -0
  122. package/src/components/crown/crownButtons/icons/faCenterHorizontally.js +11 -0
  123. package/src/components/crown/crownButtons/icons/faCenterVertically.js +11 -0
  124. package/src/components/crown/crownButtons/icons/faConnectElements.js +11 -0
  125. package/src/components/crown/crownButtons/icons/faDistributeHorizontally.js +11 -0
  126. package/src/components/crown/crownButtons/icons/faDistributeVertically.js +11 -0
  127. package/src/components/crown/crownButtons/icons/faLaneAbove.js +11 -0
  128. package/src/components/crown/crownButtons/icons/faLaneBelow.js +11 -0
  129. package/src/components/crown/crownButtons/icons/index.js +12 -0
  130. package/src/components/crown/crownConfig/crownConfig.scss +5 -4
  131. package/src/components/crown/crownConfig/crownConfig.vue +5 -4
  132. package/src/components/crown/crownMultiselect/crownAlign.scss +20 -0
  133. package/src/components/crown/crownMultiselect/crownAlign.vue +302 -0
  134. package/src/components/crown/crownMultiselect/crownMultiselect.vue +60 -14
  135. package/src/components/miniPaper/MiniPaper.vue +16 -2
  136. package/src/components/miniPaper/miniPaper.scss +6 -12
  137. package/src/components/modeler/Modeler.vue +29 -23
  138. package/src/components/modeler/ModelerReadonly.vue +996 -0
  139. package/src/components/modeler/Selection.vue +206 -18
  140. package/src/components/nodes/boundaryEvent/boundaryEvent.vue +0 -5
  141. package/src/components/nodes/endEvent/index.js +37 -0
  142. package/src/components/nodes/exclusiveGateway/index.js +30 -0
  143. package/src/components/nodes/genericFlow/SequenceFlow.js +2 -1
  144. package/src/components/nodes/index.js +1 -0
  145. package/src/components/nodes/intermediateTimerEvent/index.js +44 -0
  146. package/src/components/nodes/pool/pool.vue +0 -8
  147. package/src/components/nodes/startEvent/index.js +43 -0
  148. package/src/components/nodes/task/index.js +30 -0
  149. package/src/components/railBottom/RailBottom.vue +120 -0
  150. package/src/components/railBottom/controls/Controls.vue +148 -0
  151. package/src/components/railBottom/controls/SubmenuPopper/SubmenuPopper.vue +188 -0
  152. package/src/components/railBottom/controls/controls.scss +98 -0
  153. package/src/components/railBottom/icons/MinusIcon.vue +5 -0
  154. package/src/components/railBottom/icons/PlusIcon.vue +5 -0
  155. package/src/components/railBottom/icons/index.js +2 -0
  156. package/src/components/railBottom/miniPaperControl/MiniPaperControl.vue +46 -0
  157. package/src/components/railBottom/miniPaperControl/miniPaperControl.scss +45 -0
  158. package/src/components/railBottom/railBottom.scss +28 -0
  159. package/src/components/railBottom/undoRedoControl/UndoRedoControl.vue +89 -0
  160. package/src/components/railBottom/undoRedoControl/undoRedoControl.scss +51 -0
  161. package/src/components/railBottom/zoomControl/ZoomControl.vue +80 -0
  162. package/src/components/railBottom/zoomControl/zoomControl.scss +66 -0
  163. package/src/components/rails/explorer-rail/explorer-rail.scss +55 -0
  164. package/src/components/rails/explorer-rail/explorer.vue +93 -0
  165. package/src/components/rails/explorer-rail/filterNodeTypes/filterNodeTypes.vue +54 -0
  166. package/src/components/rails/explorer-rail/nodeTypesLoop/nodeTypesLoop.vue +234 -0
  167. package/src/components/rails/explorer-rail/rankConstants.js +1 -0
  168. package/src/components/toolbar/ToolBar.vue +0 -66
  169. package/src/main.js +6 -0
  170. package/src/mixins/linkConfig.js +16 -5
  171. package/src/mixins/resizeConfig.js +3 -1
  172. package/src/nodeTypesStore.js +118 -0
  173. package/src/store.js +5 -0
  174. package/dist/img/clipboard.bcc7796a.svg +0 -1
  175. package/dist/img/copy-regular.3eb4c04a.svg +0 -1
  176. package/dist/img/data-object.e931f8e7.svg +0 -9
  177. package/dist/img/data-store.7ca4c899.svg +0 -6
  178. package/dist/img/end-event.1ad31396.svg +0 -19
  179. package/dist/img/generic-gateway.3a76fc75.svg +0 -14
  180. package/dist/img/generic-intermediate-event.ba2e1d71.svg +0 -5
  181. package/dist/img/intermediate-message-throw-event.ac432d96.svg +0 -6
  182. package/dist/img/pool.ac62ddae.svg +0 -11
  183. package/dist/img/start-event.e895cee2.svg +0 -19
  184. package/dist/img/task.e7419065.svg +0 -14
  185. package/dist/img/text-annotation.926416f4.svg +0 -17
  186. package/dist/img/trash-alt-solid.f2f64c1f.svg +0 -4
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="crown-config" :style="style" v-if="showCrown && !isMultiselect" role="menu">
2
+ <div class="crown-config" :style="style" v-if="showCrownConfig" role="menu">
3
3
  <slot />
4
4
 
5
5
  <association-flow-button
@@ -174,6 +174,9 @@ export default {
174
174
  this.$t = this.$t.bind(this);
175
175
  },
176
176
  computed: {
177
+ showCrownConfig() {
178
+ return this.showCrown && !this.isMultiselect && store.getters.isReadOnly === false;
179
+ },
177
180
  isMultiselect() {
178
181
  const countSelected = store.getters.highlightedShapes.length;
179
182
  return countSelected > 1;
@@ -222,8 +225,6 @@ export default {
222
225
  if (!store.getters.allowSavingElementPosition) {
223
226
  return;
224
227
  }
225
-
226
- this.$emit('save-state');
227
228
  },
228
229
  repositionCrown() {
229
230
  const shapeView = this.shape.findView(this.paper);
@@ -235,7 +236,7 @@ export default {
235
236
  const { x, y, width } = shapeView.getBBox({ useModelGeometry: !this.isTextAnnotation && !this.isFlow });
236
237
 
237
238
  this.style = {
238
- top: `${y - 45}px`,
239
+ top: `${y - 52}px`,
239
240
  left: `${x + width - 20}px`,
240
241
  cursor: 'pointer',
241
242
  };
@@ -0,0 +1,20 @@
1
+ $crown-top-chevron: 1.8rem;
2
+ $crown-right-chevron: 8.1rem;
3
+
4
+ .crown-align {
5
+ background-color: $primary-white;
6
+ position: absolute;
7
+ z-index: 1;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ width: auto;
12
+ padding: 0 3px 0 3px;
13
+ height: 2.5rem;
14
+ border-radius: 5px;
15
+ box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
16
+
17
+ &::after {
18
+ @include chevron($crown-top-chevron, $crown-right-chevron);
19
+ }
20
+ }
@@ -0,0 +1,302 @@
1
+ <template>
2
+ <div
3
+ class="crown-config crown-align"
4
+ :style="style"
5
+ v-if="isMultiSelect" role="menu"
6
+ >
7
+ <slot />
8
+
9
+ <button
10
+ v-for="button in availableButtons"
11
+ :key="button.label"
12
+ :aria-label="button.label"
13
+ class="crown-button"
14
+ :title="button.label"
15
+ :data-test="button.testId"
16
+ :role="button.role"
17
+ :disabled="button.disabled"
18
+ @mousedown.stop.prevent
19
+ @click.stop.prevent="button.action"
20
+ >
21
+ <font-awesome-icon :icon="['fpm', `fa-${button.icon}`]"/>
22
+ </button>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import store from '@/store';
28
+ import runningInCypressTest from '@/runningInCypressTest';
29
+ import { getShapesOptions } from '@/components/nodes/utilities/shapeGroup';
30
+ import { library } from '@fortawesome/fontawesome-svg-core';
31
+ import {
32
+ faAlignBottom,
33
+ faAlignTop,
34
+ faAlignRight,
35
+ faAlignLeft,
36
+ faCenterHorizontally,
37
+ faCenterVertically,
38
+ faDistributeVertically,
39
+ faDistributeHorizontally,
40
+ } from '../crownButtons/icons';
41
+ import { get } from 'lodash';
42
+
43
+ export default {
44
+ props: {
45
+ paper: Object,
46
+ hasPools: Boolean,
47
+ },
48
+ data() {
49
+ return {
50
+ runningInCypressTest: runningInCypressTest(),
51
+ showCrown: false,
52
+ savePositionOnPointerupEventSet: false,
53
+ style: null,
54
+ taskDropdownInitiallyOpen: this.paperNotRendered(),
55
+ showReplaceModal: false,
56
+ nodeToReplace: null,
57
+ buttons: [
58
+ {
59
+ label: this.$t('Align Left'),
60
+ icon: 'align-left',
61
+ testId: 'align-left',
62
+ role: 'menuitem',
63
+ action: this.alignLeft,
64
+ condition: 'align.left',
65
+ disabled: false,
66
+ },
67
+ {
68
+ label: this.$t('Center Horizontally'),
69
+ icon: 'center-horizontally',
70
+ testId: 'align-horizontally',
71
+ role: 'menuitem',
72
+ action: this.centerHorizontally,
73
+ condition: 'align.horizontalCenter',
74
+ disabled: false,
75
+ },
76
+ {
77
+ label: this.$t('Align Right'),
78
+ icon: 'align-right',
79
+ testId: 'align-right',
80
+ role: 'menuitem',
81
+ action: this.alignRight,
82
+ condition: 'align.right',
83
+ disabled: false,
84
+ },
85
+ {
86
+ label: this.$t('Align Bottom'),
87
+ icon: 'align-bottom',
88
+ testId: 'align-bottom',
89
+ role: 'menuitem',
90
+ action: this.alignBottom,
91
+ condition: 'align.bottom',
92
+ disabled: false,
93
+ },
94
+ {
95
+ label: this.$t('Center Vertically'),
96
+ icon: 'center-vertically',
97
+ testId: 'center-vertically',
98
+ role: 'menuitem',
99
+ action: this.centerVertically,
100
+ condition: 'align.verticalCenter',
101
+ disabled: false,
102
+ },
103
+ {
104
+ label: this.$t('Align Top'),
105
+ icon: 'align-top',
106
+ testId: 'align-top',
107
+ role: 'menuitem',
108
+ action: this.alignTop,
109
+ condition: 'align.top',
110
+ disabled: false,
111
+ },
112
+ {
113
+ label: this.$t('Distribute Horizontally'),
114
+ icon: 'distribute-horizontally',
115
+ testId: 'distribute-horizontally',
116
+ role: 'menuitem',
117
+ action: this.distributeHorizontally,
118
+ condition: 'distribute.horizontally',
119
+ disabled: false,
120
+ },
121
+ {
122
+ label: this.$t('Distribute Vertically'),
123
+ icon: 'distribute-vertically',
124
+ testId: 'distribute-vertically',
125
+ role: 'menuitem',
126
+ action: this.distributeVertically,
127
+ condition: 'distribute.vertically',
128
+ disabled: false,
129
+ },
130
+ // add more buttons as necessary
131
+ ],
132
+ };
133
+ },
134
+ created() {
135
+ this.$t = this.$t.bind(this);
136
+ library.add(faAlignRight);
137
+ library.add(faAlignLeft);
138
+ library.add(faAlignBottom);
139
+ library.add(faAlignTop);
140
+ library.add(faCenterVertically);
141
+ library.add(faCenterHorizontally);
142
+ library.add(faDistributeVertically);
143
+ library.add(faDistributeHorizontally);
144
+ },
145
+ watch: {
146
+ selectedShapes() {
147
+ this.$root.$emit('bv::hide::tooltip');
148
+ },
149
+ },
150
+ computed: {
151
+ selectedShapes() {
152
+ this.disableButtons();
153
+ return getShapesOptions(store.getters.highlightedShapes);
154
+ },
155
+ isMultiSelect() {
156
+ const countSelected = store.getters.highlightedShapes.length;
157
+ return countSelected > 1;
158
+ },
159
+ highlightedShapes: () => store.getters.highlightedShapes,
160
+ availableButtons() {
161
+ const hasPoolsSelected = this.hasPools;
162
+ return this.buttons.filter(button => {
163
+ if (button.testId === 'copy-button') {
164
+ return !hasPoolsSelected;
165
+ }
166
+ if (button.testId === 'clone-button') {
167
+ return !hasPoolsSelected;
168
+ }
169
+ return true;
170
+ });
171
+ },
172
+ },
173
+ methods: {
174
+ disableButtons() {
175
+ let shapes = getShapesOptions(store.getters.highlightedShapes);
176
+ this.buttons.forEach(button => {
177
+ button.disabled = !get(shapes.can, button.condition, true);
178
+ });
179
+ },
180
+ alignLeft() {
181
+ this.undoableAction(this.selectedShapes.align.left);
182
+ },
183
+ centerHorizontally() {
184
+ this.undoableAction(this.selectedShapes.align.horizontalCenter);
185
+ },
186
+ alignRight() {
187
+ this.undoableAction(this.selectedShapes.align.right);
188
+ },
189
+ alignBottom() {
190
+ this.undoableAction(this.selectedShapes.align.bottom);
191
+ },
192
+ centerVertically() {
193
+ this.undoableAction(this.selectedShapes.align.verticalCenter);
194
+ },
195
+ alignTop() {
196
+ this.undoableAction(this.selectedShapes.align.top);
197
+ },
198
+ distributeHorizontally() {
199
+ this.undoableAction(this.selectedShapes.distribute.horizontally);
200
+ },
201
+ distributeVertically() {
202
+ this.undoableAction(this.selectedShapes.distribute.vertically);
203
+ },
204
+
205
+ undoableAction(actionFn) {
206
+ actionFn();
207
+ this.$emit('save-state');
208
+ this.disableButtons();
209
+ },
210
+
211
+ paperNotRendered() {
212
+ return !this.isRendering;
213
+ },
214
+ setNodePosition() {
215
+ this.shape.stopListening(
216
+ this.paper,
217
+ 'element:pointerup',
218
+ this.setNodePosition
219
+ );
220
+ this.savePositionOnPointerupEventSet = false;
221
+
222
+ if (!store.getters.allowSavingElementPosition) {
223
+ return;
224
+ }
225
+
226
+ this.$emit('save-state');
227
+ },
228
+ paperDoneRendering() {
229
+ if (!this.isRendering) {
230
+ return;
231
+ }
232
+
233
+ return new Promise((resolve) => this.paper.once('render:done', resolve));
234
+ },
235
+ setUpCrownConfig() {
236
+ this.paper.on(
237
+ 'render:done scale:changed translate:changed',
238
+ this.repositionCrown
239
+ );
240
+ },
241
+ setUpPositionHandling() {},
242
+ },
243
+ async mounted() {
244
+ await this.$nextTick();
245
+ await this.paperDoneRendering();
246
+ this.setUpCrownConfig();
247
+ },
248
+ };
249
+ </script>
250
+
251
+ <style lang="scss" scoped>
252
+ .crown-align {
253
+ top: -58px;
254
+ left: -35%;
255
+ pointer-events: auto;
256
+ }
257
+ .crown-button {
258
+ border:none;
259
+ display: flex;
260
+ background-color: $primary-white;
261
+ border-radius: 4px;
262
+ color: $crown-icon-neutral;
263
+ width: 35px;
264
+ height: 35px;
265
+ font-size: 20px;
266
+ padding: 4px;
267
+ }
268
+ .crown-button:hover {
269
+ background-color: $crown-icon-hover-bg;
270
+ color: $crown-icon-neutral;
271
+ }
272
+ .crown-button:active {
273
+ background-color: $cronw-icon-active-bg;
274
+ color: $crown-icon-active;
275
+ }
276
+
277
+ .crown-button:disabled {
278
+ background-color: #eaeaea;
279
+ color: $crown-icon-active;
280
+ }
281
+
282
+ .crown-button:focus {
283
+ background-color: #DEEBFF;
284
+ color: $crown-icon-active;
285
+ }
286
+
287
+ img {
288
+ margin: 0px 5px;
289
+ height: 20px;
290
+ width: 20px;
291
+ padding:2px;
292
+ fill: #5faaee;
293
+ }
294
+ .crown-button svg {
295
+ margin:auto;
296
+ }
297
+ .crown-button i {
298
+ margin:auto;
299
+ }
300
+ </style>
301
+
302
+ <style lang="scss" src="./crownAlign.scss" />
@@ -11,29 +11,35 @@
11
11
  v-for="button in availableButtons"
12
12
  :key="button.label"
13
13
  :aria-label="button.label"
14
- class="btn"
14
+ class="crown-button"
15
15
  :title="button.label"
16
16
  :data-test="button.testId"
17
17
  :role="button.role"
18
- @mousedown.stop.prevent
19
- @click.stop.prevent="button.action"
18
+ @click="button.action"
20
19
  >
21
- <i :class="`fa fa-${button.icon} text-white`" />
20
+ <font-awesome-icon v-if="button.iconPrefix === 'fpm'" :icon="[button.iconPrefix, `fa-${button.icon}`]"/>
21
+ <i v-else :class="`${button.iconPrefix} fa-${button.icon} text-dark`" />
22
22
  </button>
23
+ <crown-align v-show="showAlignmentButtons" :paper="paper"/>
23
24
  </div>
24
25
  </template>
25
26
 
26
27
  <script>
27
28
  import store from '@/store';
28
29
  import runningInCypressTest from '@/runningInCypressTest';
30
+ import crownAlign from './crownAlign';
31
+ import { library } from '@fortawesome/fontawesome-svg-core';
32
+ import { faCenterVertically } from '../crownButtons/icons';
29
33
 
30
34
  export default {
31
35
  props: {
32
36
  paper: Object,
33
37
  hasPools: Boolean,
34
38
  },
39
+ components:{ crownAlign },
35
40
  data() {
36
41
  return {
42
+ showAlignmentButtons: false,
37
43
  runningInCypressTest: runningInCypressTest(),
38
44
  showCrown: false,
39
45
  savePositionOnPointerupEventSet: false,
@@ -44,6 +50,7 @@ export default {
44
50
  buttons: [
45
51
  {
46
52
  label: 'Copy Selection',
53
+ iconPrefix: 'fa',
47
54
  icon: 'clipboard',
48
55
  testId: 'copy-button',
49
56
  role: 'menuitem',
@@ -51,13 +58,23 @@ export default {
51
58
  },
52
59
  {
53
60
  label: 'Clone Selection',
61
+ iconPrefix: 'fa',
54
62
  icon: 'copy',
55
63
  testId: 'clone-button',
56
64
  role: 'menuitem',
57
65
  action: this.cloneSelection,
58
66
  },
67
+ {
68
+ label: 'Align',
69
+ iconPrefix: 'fpm',
70
+ icon: 'center-vertically',
71
+ testId: 'align',
72
+ role: 'menuitem',
73
+ action: this.showAlign,
74
+ },
59
75
  {
60
76
  label: 'Delete Element',
77
+ iconPrefix: 'fa',
61
78
  icon: 'trash-alt',
62
79
  testId: 'delete-button',
63
80
  role: 'menuitem',
@@ -69,6 +86,7 @@ export default {
69
86
  },
70
87
  created() {
71
88
  this.$t = this.$t.bind(this);
89
+ library.add(faCenterVertically);
72
90
  },
73
91
  computed: {
74
92
  isMultiSelect() {
@@ -90,6 +108,9 @@ export default {
90
108
  },
91
109
  },
92
110
  methods: {
111
+ showAlign() {
112
+ this.showAlignmentButtons = !this.showAlignmentButtons;
113
+ },
93
114
  copySelection() {
94
115
  this.$emit('copy-selection');
95
116
  },
@@ -139,24 +160,49 @@ export default {
139
160
  };
140
161
  </script>
141
162
 
142
- <style scoped>
163
+
164
+ <style lang="scss" scoped>
143
165
  .crown-multiselect {
144
166
  top: -38px;
145
167
  left: 50%;
146
168
  pointer-events: auto;
147
169
  }
148
- .btn {
149
- border: none;
150
- padding: 0;
151
- margin-top: 0;
170
+ .crown-button {
171
+ border:none;
152
172
  display: flex;
173
+ background-color: $primary-white;
174
+ border-radius: 4px;
175
+ color: $crown-icon-neutral;
176
+ width: 35px;
177
+ height: 35px;
178
+ font-size: 20px;
179
+ padding: 4px;
180
+ }
181
+ .crown-button:hover {
182
+ background-color: $crown-icon-hover-bg;
183
+ color: $crown-icon-neutral;
153
184
  }
185
+ .crown-button:active {
186
+ background-color: $cronw-icon-active-bg;
187
+ color: $crown-icon-active;
188
+ }
189
+
190
+ .crown-button:focus {
191
+ background-color: #DEEBFF;
192
+ color: $crown-icon-active;
193
+ }
194
+
154
195
  img {
155
- margin: 0px 10px;
156
- height: 15px;
196
+ margin: 0px 5px;
197
+ height: 20px;
198
+ width: 20px;
199
+ padding:2px;
200
+ fill: #5faaee;
201
+ }
202
+ .crown-button svg {
203
+ margin:auto;
157
204
  }
158
- i {
159
- margin: 0px 10px;
160
- font-size: 15px;
205
+ .crown-button i {
206
+ margin:auto;
161
207
  }
162
208
  </style>
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <div class="mini-paper-container position-absolute" @click="movePaper" :class="isOpen ? 'opened' : 'closed'">
2
+ <div
3
+ class="mini-paper-container"
4
+ @click="movePaper"
5
+ :class="isOpen ? 'opened' : 'closed'"
6
+ data-cy="mini-map-box"
7
+ >
3
8
  <div ref="miniPaper" class="mini-paper" />
4
9
  </div>
5
10
  </template>
@@ -11,6 +16,8 @@ export default {
11
16
  data() {
12
17
  return {
13
18
  miniMapManager: null,
19
+ newX: 0,
20
+ newY: 0,
14
21
  };
15
22
  },
16
23
  props: {
@@ -35,10 +42,17 @@ export default {
35
42
  const { sx: scaleX, sy: scaleY } = this.paperManager.scale;
36
43
  const { clientWidth, clientHeight } = this.paperManager.paper.el;
37
44
  const { newX, newY } = this.miniMapManager.calculateNewPaperPosition(offsetX, offsetY, scaleX, scaleY, clientWidth, clientHeight);
38
- this.paperManager.translate(newX, newY);
45
+ this.newX = newX;
46
+ this.newY = newY;
47
+
48
+ this.paperManager.translate(this.newX, this.newY);
39
49
  },
40
50
  },
41
51
  async mounted() {
52
+ if (window.Cypress) {
53
+ window.MiniPaper = this;
54
+ }
55
+
42
56
  await this.$nextTick();
43
57
 
44
58
  this.miniMapManager = MiniMapManager.factory(this.graph, this.$refs.miniPaper);
@@ -1,13 +1,11 @@
1
- $mini-paper-container-top-position: 4.75rem;
2
- $mini-paper-container-right-position: 17.5rem;
3
- $mini-paper-container-right-expanded-position: 2rem;
4
- $transition: 0.3s;
1
+ $transition: 0.1s;
5
2
 
6
3
  .mini-paper-container {
7
- top: $mini-paper-container-top-position;
8
- right: $mini-paper-container-right-position;
9
- z-index: 2;
10
- box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
4
+ position: absolute;
5
+ bottom: 60px;
6
+ left: 0;
7
+ display: flex;
8
+ box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
11
9
  border: 1px solid $border-color;
12
10
  cursor: pointer;
13
11
 
@@ -15,10 +13,6 @@ $transition: 0.3s;
15
13
  pointer-events: none;
16
14
  }
17
15
 
18
- &.expanded {
19
- right: $mini-paper-container-right-expanded-position;
20
- }
21
-
22
16
  &.closed {
23
17
  opacity: 0;
24
18
  visibility: hidden;
@@ -23,16 +23,10 @@
23
23
  :target="getTooltipTarget"
24
24
  :title="tooltipTitle"
25
25
  />
26
-
27
- <controls
28
- :nodeTypes="nodeTypes"
29
- :compressed="panelsCompressed"
30
- :parent-height="parentHeight"
31
- :allowDrop="allowDrop"
32
- @drag="validateDropTarget"
33
- @handleDrop="handleDrop"
34
- class="controls h-100 rounded-0 border-top-0 border-bottom-0 border-left-0"
35
- :canvas-drag-position="canvasDragPosition"
26
+ <explorer-rail
27
+ :node-types="nodeTypes"
28
+ @set-cursor="cursor = $event"
29
+ @onCreateElement="onCreateElementHandler"
36
30
  />
37
31
  <b-col
38
32
  class="paper-container h-100 pr-4"
@@ -44,13 +38,6 @@
44
38
  <div ref="paper" data-test="paper" class="main-paper" />
45
39
  </b-col>
46
40
 
47
- <mini-paper
48
- :isOpen="miniMapOpen"
49
- :paperManager="paperManager"
50
- :graph="graph"
51
- :class="{ 'expanded' : panelsCompressed }"
52
- />
53
-
54
41
  <InspectorPanel
55
42
  ref="inspector-panel"
56
43
  v-show="!(highlightedNodes.length > 1)"
@@ -111,6 +98,18 @@
111
98
  @default-flow="toggleDefaultFlow"
112
99
  @shape-resize="shapeResize"
113
100
  />
101
+
102
+ <RailBottom
103
+ :nodeTypes="nodeTypes"
104
+ :paper-manager="paperManager"
105
+ :graph="graph"
106
+ :is-rendering="isRendering"
107
+ @load-xml="loadXML"
108
+ @clearSelection="clearSelection"
109
+ @set-cursor="cursor = $event"
110
+ @onCreateElement="onCreateElementHandler"
111
+ />
112
+
114
113
  <selection
115
114
  v-if="paper"
116
115
  ref="selector"
@@ -132,7 +131,7 @@ import _ from 'lodash';
132
131
  import { dia } from 'jointjs';
133
132
  import boundaryEventConfig from '../nodes/boundaryEvent';
134
133
  import BpmnModdle from 'bpmn-moddle';
135
- import controls from '../controls/controls';
134
+ import ExplorerRail from '../rails/explorer-rail/explorer';
136
135
  import pull from 'lodash/pull';
137
136
  import remove from 'lodash/remove';
138
137
  import store from '@/store';
@@ -144,7 +143,6 @@ import { getNodeIdGenerator } from '../../NodeIdGenerator';
144
143
  import Process from '../inspectors/process';
145
144
  import runningInCypressTest from '@/runningInCypressTest';
146
145
  import getValidationProperties from '@/targetValidationUtils';
147
- import MiniPaper from '@/components/miniPaper/MiniPaper';
148
146
  import { id as laneId } from '@/components/nodes/poolLane/config';
149
147
  import { id as processId } from '@/components/inspectors/process';
150
148
  import { id as sequenceFlowId } from '../nodes/sequenceFlow';
@@ -176,19 +174,21 @@ import { getInvalidNodes } from '@/components/modeler/modelerUtils';
176
174
  import { NodeMigrator } from '@/components/modeler/NodeMigrator';
177
175
  import addLoopCharacteristics from '@/setup/addLoopCharacteristics';
178
176
  import cloneSelection from '../../mixins/cloneSelection';
177
+ import RailBottom from '@/components/railBottom/RailBottom.vue';
179
178
 
180
179
  import ProcessmakerModelerGenericFlow from '@/components/nodes/genericFlow/genericFlow';
181
180
 
182
181
  import Selection from './Selection';
183
182
 
183
+
184
184
  export default {
185
185
  components: {
186
186
  ToolBar,
187
- controls,
187
+ ExplorerRail,
188
188
  InspectorPanel,
189
- MiniPaper,
190
189
  ProcessmakerModelerGenericFlow,
191
190
  Selection,
191
+ RailBottom,
192
192
  },
193
193
  props: {
194
194
  owner: Object,
@@ -872,9 +872,15 @@ export default {
872
872
  toXML(cb) {
873
873
  this.moddle.toXML(this.definitions, { format: true }, cb);
874
874
  },
875
+ onCreateElementHandler({ event, control }) {
876
+ this.handleDrop({
877
+ clientX: event.clientX,
878
+ clientY: event.clientY,
879
+ control,
880
+ });
881
+ },
875
882
  async handleDrop({ clientX, clientY, control, nodeThatWillBeReplaced }) {
876
883
  this.validateDropTarget({ clientX, clientY, control });
877
-
878
884
  if (!this.allowDrop) {
879
885
  return;
880
886
  }
@@ -1190,7 +1196,6 @@ export default {
1190
1196
  if (!this.isDragging && this.dragStart) {
1191
1197
  // is clicked over the shape
1192
1198
  if (cellView) {
1193
- this.$refs.selector.stopDrag(event);
1194
1199
  this.$refs.selector.selectElement(cellView, event.shiftKey);
1195
1200
  } else {
1196
1201
  this.clearSelection();
@@ -1202,6 +1207,7 @@ export default {
1202
1207
  this.$refs.selector.stopDrag(event);
1203
1208
  }
1204
1209
  }
1210
+ window.ProcessMaker.EventBus.$emit('custom-pointerclick', event);
1205
1211
  this.isDragging = false;
1206
1212
  this.dragStart = null;
1207
1213
  this.isSelecting = false;