@processmaker/modeler 1.30.3 → 1.32.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 (207) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/img/{boundary-event.5bf51421.svg → boundary-event.4e0fb9de.svg} +3 -3
  3. package/dist/img/clipboard.5fe6f79e.svg +3 -0
  4. package/dist/img/conditional-start-event.a56e4b5b.svg +4 -0
  5. package/dist/img/{connect-artifacts.5f8bed89.svg → connect-artifacts.496eb4b9.svg} +3 -3
  6. package/dist/img/{connect-elements.d4abedf2.svg → connect-elements.9ec5ca93.svg} +3 -3
  7. package/dist/img/copy-regular.2d678143.svg +3 -0
  8. package/dist/img/data-object.0d6d1585.svg +3 -0
  9. package/dist/img/data-store.32bed5ce.svg +3 -0
  10. package/dist/img/{default-flow.212147b4.svg → default-flow.156a793b.svg} +3 -3
  11. package/dist/img/end-event.9d1ff5c0.svg +3 -0
  12. package/dist/img/error-end-event.aab86eca.svg +11 -0
  13. package/dist/img/event-based-gateway.9960eee5.svg +6 -0
  14. package/dist/img/exclusive-gateway.26db4fae.svg +4 -0
  15. package/dist/img/generic-gateway.09ca6929.svg +3 -0
  16. package/dist/img/generic-intermediate-event.a711eb33.svg +4 -0
  17. package/dist/img/inclusive-gateway.754cb36f.svg +4 -0
  18. package/dist/img/intermediate-conditional-catch-event.e9ae6198.svg +5 -0
  19. package/dist/img/intermediate-message-catch-event.9d25208e.svg +5 -0
  20. package/dist/img/intermediate-message-throw-event.4309dc45.svg +5 -0
  21. package/dist/img/intermediate-signal-catch-event.74b65f17.svg +5 -0
  22. package/dist/img/intermediate-signal-throw-event.29cad018.svg +5 -0
  23. package/dist/img/intermediate-timer-event.1670a1c8.svg +5 -0
  24. package/dist/img/issue-close.5d1630e6.svg +3 -0
  25. package/dist/img/issue-item.3187f291.svg +3 -0
  26. package/dist/img/issue-open.707390b4.svg +4 -0
  27. package/dist/img/{lane-below.890c069b.svg → lane-below.e67f9823.svg} +12 -12
  28. package/dist/img/manual-task.374a73c3.svg +4 -0
  29. package/dist/img/message-end-event.f15b67f5.svg +4 -0
  30. package/dist/img/message-start-event.f2d4a5e6.svg +4 -0
  31. package/dist/img/mini-map.ae46890c.svg +3 -0
  32. package/dist/img/minus.ca21cc3b.svg +3 -0
  33. package/dist/img/parallel-gateway.877bb628.svg +4 -0
  34. package/dist/img/pin-angle-fill.0e4af645.svg +3 -0
  35. package/dist/img/pin-angle.3462c115.svg +3 -0
  36. package/dist/img/plus.afbb0b13.svg +3 -0
  37. package/dist/img/pool.98d4734c.svg +3 -0
  38. package/dist/img/redo.8425ce7e.svg +4 -0
  39. package/dist/img/script-task.3d8c664a.svg +4 -0
  40. package/dist/img/signal-end-event.a38a6616.svg +4 -0
  41. package/dist/img/signal-start-event.3d7b096c.svg +4 -0
  42. package/dist/img/start-event.7f1911cb.svg +3 -0
  43. package/dist/img/sub-task.52d09847.svg +4 -0
  44. package/dist/img/task.8a1c6c75.svg +3 -0
  45. package/dist/img/terminate-end-event.3aa5cd00.svg +4 -0
  46. package/dist/img/text-annotation.02df53cd.svg +3 -0
  47. package/dist/img/timer-start-event.55abac82.svg +4 -0
  48. package/dist/img/trash-alt-solid.58c408b8.svg +1 -0
  49. package/dist/img/undo.e0ffff93.svg +4 -0
  50. package/dist/img/validate-close.09ace97a.svg +4 -0
  51. package/dist/img/validate-open.b0ecf74e.svg +4 -0
  52. package/dist/modeler.common.js +27454 -19961
  53. package/dist/modeler.common.js.map +1 -1
  54. package/dist/modeler.umd.js +27454 -19961
  55. package/dist/modeler.umd.js.map +1 -1
  56. package/dist/modeler.umd.min.js +28 -3
  57. package/dist/modeler.umd.min.js.map +1 -1
  58. package/jsconfig.json +12 -0
  59. package/package.json +4 -2
  60. package/src/.DS_Store +0 -0
  61. package/src/ModelerApp.vue +13 -22
  62. package/src/assets/boundary-event.svg +3 -3
  63. package/src/assets/clipboard.svg +3 -1
  64. package/src/assets/cog-solid.svg +1 -0
  65. package/src/assets/connect-artifacts.svg +3 -3
  66. package/src/assets/connect-elements.svg +3 -3
  67. package/src/assets/copy-regular.svg +3 -1
  68. package/src/assets/default-flow.svg +3 -3
  69. package/src/assets/lane-below.svg +12 -12
  70. package/src/assets/palette.svg +1 -0
  71. package/src/assets/pin-angle-fill.svg +3 -0
  72. package/src/assets/pin-angle.svg +3 -0
  73. package/src/assets/railBottom/mini-map.svg +3 -0
  74. package/src/assets/railBottom/minus.svg +3 -0
  75. package/src/assets/railBottom/plus.svg +3 -0
  76. package/src/assets/railBottom/redo.svg +4 -0
  77. package/src/assets/railBottom/undo.svg +4 -0
  78. package/src/assets/scss/settings/_settings.variables.scss +5 -0
  79. package/src/assets/scss/tools/_tools.chevron.scss +1 -1
  80. package/src/assets/toolpanel/conditional-start-event.svg +4 -0
  81. package/src/assets/toolpanel/data-object.svg +2 -8
  82. package/src/assets/toolpanel/data-store.svg +2 -5
  83. package/src/assets/toolpanel/end-event.svg +3 -19
  84. package/src/assets/toolpanel/error-end-event.svg +11 -0
  85. package/src/assets/toolpanel/event-based-gateway.svg +6 -0
  86. package/src/assets/toolpanel/exclusive-gateway.svg +4 -0
  87. package/src/assets/toolpanel/generic-gateway.svg +2 -13
  88. package/src/assets/toolpanel/generic-intermediate-event.svg +3 -4
  89. package/src/assets/toolpanel/inclusive-gateway.svg +4 -0
  90. package/src/assets/toolpanel/intermediate-conditional-catch-event.svg +5 -0
  91. package/src/assets/toolpanel/intermediate-message-catch-event.svg +5 -0
  92. package/src/assets/toolpanel/intermediate-message-throw-event.svg +4 -5
  93. package/src/assets/toolpanel/intermediate-signal-catch-event.svg +5 -0
  94. package/src/assets/toolpanel/intermediate-signal-throw-event.svg +5 -0
  95. package/src/assets/toolpanel/intermediate-timer-event.svg +5 -0
  96. package/src/assets/toolpanel/manual-task.svg +4 -0
  97. package/src/assets/toolpanel/message-end-event.svg +4 -0
  98. package/src/assets/toolpanel/message-start-event.svg +3 -3
  99. package/src/assets/toolpanel/parallel-gateway.svg +4 -0
  100. package/src/assets/toolpanel/pool.svg +3 -11
  101. package/src/assets/toolpanel/script-task.svg +4 -0
  102. package/src/assets/toolpanel/signal-end-event.svg +4 -0
  103. package/src/assets/toolpanel/signal-start-event.svg +4 -0
  104. package/src/assets/toolpanel/start-event.svg +3 -19
  105. package/src/assets/toolpanel/sub-task.svg +4 -0
  106. package/src/assets/toolpanel/task.svg +3 -14
  107. package/src/assets/toolpanel/terminate-end-event.svg +4 -0
  108. package/src/assets/toolpanel/text-annotation.svg +3 -17
  109. package/src/assets/toolpanel/timer-start-event.svg +4 -0
  110. package/src/assets/topRail/issue-close.svg +3 -0
  111. package/src/assets/topRail/issue-item.svg +3 -0
  112. package/src/assets/topRail/issue-open.svg +4 -0
  113. package/src/assets/topRail/validate-close.svg +4 -0
  114. package/src/assets/topRail/validate-open.svg +4 -0
  115. package/src/assets/trash-alt-solid.svg +1 -4
  116. package/src/components/crown/crownButtons/addLaneAboveButton.vue +6 -4
  117. package/src/components/crown/crownButtons/addLaneBelowButton.vue +6 -4
  118. package/src/components/crown/crownButtons/associationFlowButton.vue +1 -14
  119. package/src/components/crown/crownButtons/cloneButton.vue +1 -6
  120. package/src/components/crown/crownButtons/copyButton.vue +1 -4
  121. package/src/components/crown/crownButtons/crownBoundaryEventDropdown.vue +7 -2
  122. package/src/components/crown/crownButtons/crownButton.vue +36 -11
  123. package/src/components/crown/crownButtons/crownColorDropdown.vue +1 -1
  124. package/src/components/crown/crownButtons/crownDropdown.scss +4 -9
  125. package/src/components/crown/crownButtons/crownTaskDropdown.vue +1 -1
  126. package/src/components/crown/crownButtons/deleteButton.vue +1 -7
  127. package/src/components/crown/crownButtons/genericFlowButton.vue +4 -4
  128. package/src/components/crown/crownButtons/icons/faAlignBottom.js +11 -0
  129. package/src/components/crown/crownButtons/icons/faAlignLeft.js +11 -0
  130. package/src/components/crown/crownButtons/icons/faAlignRight.js +11 -0
  131. package/src/components/crown/crownButtons/icons/faAlignTop.js +11 -0
  132. package/src/components/crown/crownButtons/icons/faBoundaryEvent.js +11 -0
  133. package/src/components/crown/crownButtons/icons/faCenterHorizontally.js +11 -0
  134. package/src/components/crown/crownButtons/icons/faCenterVertically.js +11 -0
  135. package/src/components/crown/crownButtons/icons/faConnectElements.js +11 -0
  136. package/src/components/crown/crownButtons/icons/faDistributeHorizontally.js +11 -0
  137. package/src/components/crown/crownButtons/icons/faDistributeVertically.js +11 -0
  138. package/src/components/crown/crownButtons/icons/faLaneAbove.js +11 -0
  139. package/src/components/crown/crownButtons/icons/faLaneBelow.js +11 -0
  140. package/src/components/crown/crownButtons/icons/index.js +12 -0
  141. package/src/components/crown/crownConfig/crownConfig.scss +5 -4
  142. package/src/components/crown/crownConfig/crownConfig.vue +5 -2
  143. package/src/components/crown/crownMultiselect/crownAlign.scss +20 -0
  144. package/src/components/crown/crownMultiselect/crownAlign.vue +302 -0
  145. package/src/components/crown/crownMultiselect/crownMultiselect.vue +60 -14
  146. package/src/components/hotkeys/escKey.js +20 -0
  147. package/src/components/hotkeys/main.js +4 -2
  148. package/src/components/miniPaper/MiniPaper.vue +16 -2
  149. package/src/components/miniPaper/miniPaper.scss +6 -12
  150. package/src/components/modeler/Modeler.vue +32 -22
  151. package/src/components/modeler/ModelerReadonly.vue +1011 -0
  152. package/src/components/modeler/Selection.vue +11 -9
  153. package/src/components/nodes/endEvent/index.js +37 -0
  154. package/src/components/nodes/exclusiveGateway/index.js +30 -0
  155. package/src/components/nodes/index.js +1 -0
  156. package/src/components/nodes/intermediateTimerEvent/index.js +44 -0
  157. package/src/components/nodes/startEvent/index.js +43 -0
  158. package/src/components/nodes/task/index.js +30 -0
  159. package/src/components/railBottom/RailBottom.vue +120 -0
  160. package/src/components/railBottom/controls/Controls.vue +80 -0
  161. package/src/components/railBottom/controls/SubmenuPopper/SubmenuPopper.vue +188 -0
  162. package/src/components/railBottom/controls/controls.scss +98 -0
  163. package/src/components/railBottom/icons/MinusIcon.vue +5 -0
  164. package/src/components/railBottom/icons/PlusIcon.vue +5 -0
  165. package/src/components/railBottom/icons/index.js +2 -0
  166. package/src/components/railBottom/miniPaperControl/MiniPaperControl.vue +46 -0
  167. package/src/components/railBottom/miniPaperControl/miniPaperControl.scss +45 -0
  168. package/src/components/railBottom/railBottom.scss +28 -0
  169. package/src/components/railBottom/undoRedoControl/UndoRedoControl.vue +89 -0
  170. package/src/components/railBottom/undoRedoControl/undoRedoControl.scss +51 -0
  171. package/src/components/railBottom/zoomControl/ZoomControl.vue +80 -0
  172. package/src/components/railBottom/zoomControl/zoomControl.scss +66 -0
  173. package/src/components/rails/explorer-rail/explorer-rail.scss +55 -0
  174. package/src/components/rails/explorer-rail/explorer.vue +93 -0
  175. package/src/components/rails/explorer-rail/filterNodeTypes/filterNodeTypes.vue +54 -0
  176. package/src/components/rails/explorer-rail/nodeTypesLoop/nodeTypesLoop.vue +164 -0
  177. package/src/components/rails/explorer-rail/rankConstants.js +1 -0
  178. package/src/components/toolbar/ToolBar.vue +23 -80
  179. package/src/components/topRail/TopRail.vue +91 -0
  180. package/src/components/topRail/topRail.scss +6 -0
  181. package/src/components/topRail/validateControl/index.js +3 -0
  182. package/src/components/topRail/validateControl/validateButton/ValidateButton.vue +38 -0
  183. package/src/components/topRail/validateControl/validateButton/validateButton.scss +25 -0
  184. package/src/components/topRail/validateControl/validateIssue/ValidateIssue.vue +59 -0
  185. package/src/components/topRail/validateControl/validateIssue/validateIssue.scss +54 -0
  186. package/src/components/topRail/validateControl/validatePanel/ValidatePanel.vue +51 -0
  187. package/src/components/topRail/validateControl/validatePanel/validatePanel.scss +67 -0
  188. package/src/main.js +6 -0
  189. package/src/mixins/clickAndDrop.js +100 -0
  190. package/src/mixins/highlightConfig.js +52 -8
  191. package/src/mixins/linkConfig.js +7 -0
  192. package/src/mixins/resizeConfig.js +3 -1
  193. package/src/nodeTypesStore.js +133 -0
  194. package/src/store.js +5 -0
  195. package/dist/img/clipboard.bcc7796a.svg +0 -1
  196. package/dist/img/copy-regular.3eb4c04a.svg +0 -1
  197. package/dist/img/data-object.e931f8e7.svg +0 -9
  198. package/dist/img/data-store.7ca4c899.svg +0 -6
  199. package/dist/img/end-event.1ad31396.svg +0 -19
  200. package/dist/img/generic-gateway.3a76fc75.svg +0 -14
  201. package/dist/img/generic-intermediate-event.ba2e1d71.svg +0 -5
  202. package/dist/img/intermediate-message-throw-event.ac432d96.svg +0 -6
  203. package/dist/img/pool.ac62ddae.svg +0 -11
  204. package/dist/img/start-event.e895cee2.svg +0 -19
  205. package/dist/img/task.e7419065.svg +0 -14
  206. package/dist/img/text-annotation.926416f4.svg +0 -17
  207. package/dist/img/trash-alt-solid.f2f64c1f.svg +0 -4
@@ -0,0 +1,12 @@
1
+ export { faBoundaryEvent } from './faBoundaryEvent.js';
2
+ export { faConnectElements } from './faConnectElements';
3
+ export { faLaneAbove } from './faLaneAbove';
4
+ export { faLaneBelow } from './faLaneBelow';
5
+ export { faCenterHorizontally } from './faCenterHorizontally';
6
+ export { faCenterVertically } from './faCenterVertically';
7
+ export { faAlignLeft } from './faAlignLeft';
8
+ export { faAlignRight } from './faAlignRight';
9
+ export { faAlignBottom } from './faAlignBottom';
10
+ export { faAlignTop } from './faAlignTop';
11
+ export { faDistributeHorizontally } from './faDistributeHorizontally';
12
+ export { faDistributeVertically } from './faDistributeVertically';
@@ -2,18 +2,19 @@ $crown-top-chevron: 0.8rem;
2
2
  $crown-left-chevron: 0.3rem;
3
3
 
4
4
  .crown-config {
5
- background-color: $primary-color;
5
+ background-color: $primary-white;
6
6
  position: absolute;
7
7
  z-index: 1;
8
8
  display: flex;
9
9
  align-items: center;
10
10
  justify-content: center;
11
11
  width: auto;
12
- height: 1.85rem;
12
+ padding: 0 3px 0 3px;
13
+ height: 2.5rem;
13
14
  border-radius: 5px;
15
+ box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
14
16
 
15
17
  &::after {
16
18
  @include chevron($crown-top-chevron, $crown-left-chevron);
17
19
  }
18
- }
19
-
20
+ }
@@ -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;
@@ -233,7 +236,7 @@ export default {
233
236
  const { x, y, width } = shapeView.getBBox({ useModelGeometry: !this.isTextAnnotation && !this.isFlow });
234
237
 
235
238
  this.style = {
236
- top: `${y - 45}px`,
239
+ top: `${y - 52}px`,
237
240
  left: `${x + width - 20}px`,
238
241
  cursor: 'pointer',
239
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>
@@ -0,0 +1,20 @@
1
+ import nodeTypesStore from '@/nodeTypesStore';
2
+
3
+ export default {
4
+ methods: {
5
+ escapeKeyHandler(event) {
6
+ if (this.selectedNode) {
7
+ event.preventDefault();
8
+ window.ProcessMaker.EventBus.$emit('custom-pointerclick', event);
9
+ }
10
+ },
11
+ },
12
+ computed: {
13
+ selectedNode() {
14
+ return nodeTypesStore.getters.getSelectedNode;
15
+ },
16
+ movedElement() {
17
+ return nodeTypesStore.getters.getGhostNode;
18
+ },
19
+ },
20
+ };
@@ -1,10 +1,11 @@
1
1
  import ZoomInOut from './zoomInOut';
2
2
  import CopyPaste from './copyPaste.js';
3
- import store from '@/store';
4
3
  import moveShapeByKeypress from './moveWithArrowKeys';
4
+ import EscKey from './escKey';
5
+ import store from '@/store';
5
6
 
6
7
  export default {
7
- mixins: [ZoomInOut, CopyPaste],
8
+ mixins: [ZoomInOut, CopyPaste, EscKey],
8
9
  computed: {
9
10
  clientLeftPaper() {
10
11
  return store.getters.clientLeftPaper;
@@ -19,6 +20,7 @@ export default {
19
20
  // Pass event to all handlers
20
21
  this.zoomInOutHandler(event, options);
21
22
  this.copyPasteHandler(event, options);
23
+ this.escapeKeyHandler(event);
22
24
  },
23
25
  keyupListener(event) {
24
26
  if (event.code === 'Space') {
@@ -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;